diff --git a/.github/actions/verify-debug-artifact-scan-completed/action.yml b/.github/actions/verify-debug-artifact-scan-completed/action.yml new file mode 100644 index 0000000000..90fecdd52a --- /dev/null +++ b/.github/actions/verify-debug-artifact-scan-completed/action.yml @@ -0,0 +1,6 @@ +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 new file mode 100644 index 0000000000..9cb49e3e18 --- /dev/null +++ b/.github/actions/verify-debug-artifact-scan-completed/index.js @@ -0,0 +1,2 @@ +// 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 new file mode 100644 index 0000000000..996b1e9236 --- /dev/null +++ b/.github/actions/verify-debug-artifact-scan-completed/post.js @@ -0,0 +1,11 @@ +// 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/pull_request_template.md b/.github/pull_request_template.md index 3b632d8f37..2e552907f1 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -18,14 +18,25 @@ For internal use only. Please select the risk level of this change: #### 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, CCR, ...). + +Products: + +- **Code Scanning** - The changes impact analyses when `analysis-kinds: code-scanning`. +- **Code Quality** - The changes impact analyses when `analysis-kinds: code-quality`. +- **CCR** - The changes impact analyses for Copilot Code Reviews. +- **Third-party analyses** - The changes affect the `upload-sarif` action. + +Environments: -- **Advanced setup** - Impacts users who have custom workflows. -- **Default setup** - Impacts users who use default setup. -- **Code Scanning** - Impacts Code Scanning (i.e. `analysis-kinds: code-scanning`). -- **Code Quality** - Impacts Code Quality (i.e. `analysis-kinds: code-quality`). -- **Third-party analyses** - Impacts third-party analyses (i.e. `upload-sarif`). -- **GHES** - Impacts GitHub Enterprise Server. +- **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? @@ -54,6 +65,15 @@ For internal use only. Please select the risk level of this change: - **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. diff --git a/.github/workflows/__all-platform-bundle.yml b/.github/workflows/__all-platform-bundle.yml index 89138c523c..2340be49c7 100644 --- a/.github/workflows/__all-platform-bundle.yml +++ b/.github/workflows/__all-platform-bundle.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -61,7 +71,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -74,6 +84,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - id: init uses: ./../action/init with: diff --git a/.github/workflows/__analyze-ref-input.yml b/.github/workflows/__analyze-ref-input.yml index 9cf85b0c59..161942723a 100644 --- a/.github/workflows/__analyze-ref-input.yml +++ b/.github/workflows/__analyze-ref-input.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -67,7 +77,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -85,6 +95,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/__autobuild-action.yml b/.github/workflows/__autobuild-action.yml index c315763391..08470bcff9 100644 --- a/.github/workflows/__autobuild-action.yml +++ b/.github/workflows/__autobuild-action.yml @@ -21,9 +21,19 @@ on: schedule: - cron: '0 5 * * *' workflow_dispatch: - inputs: {} + inputs: + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: - inputs: {} + inputs: + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -51,7 +61,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -59,6 +69,10 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: languages: csharp diff --git a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml index c1de5c19de..9607fce187 100644 --- a/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml +++ b/.github/workflows/__autobuild-direct-tracing-with-working-dir.yml @@ -63,7 +63,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__autobuild-working-dir.yml b/.github/workflows/__autobuild-working-dir.yml index 3a3ca9e5f0..e9d1d7d5db 100644 --- a/.github/workflows/__autobuild-working-dir.yml +++ b/.github/workflows/__autobuild-working-dir.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__build-mode-autobuild.yml b/.github/workflows/__build-mode-autobuild.yml index 878c941a47..87ed95e1ea 100644 --- a/.github/workflows/__build-mode-autobuild.yml +++ b/.github/workflows/__build-mode-autobuild.yml @@ -63,7 +63,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__build-mode-manual.yml b/.github/workflows/__build-mode-manual.yml index e0dc25f889..c164a1a7b5 100644 --- a/.github/workflows/__build-mode-manual.yml +++ b/.github/workflows/__build-mode-manual.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -57,7 +67,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -70,6 +80,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init id: init with: diff --git a/.github/workflows/__build-mode-none.yml b/.github/workflows/__build-mode-none.yml index 7584f90650..7bb121810f 100644 --- a/.github/workflows/__build-mode-none.yml +++ b/.github/workflows/__build-mode-none.yml @@ -49,7 +49,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__build-mode-rollback.yml b/.github/workflows/__build-mode-rollback.yml index c1f3ccd0c2..e9d85968c4 100644 --- a/.github/workflows/__build-mode-rollback.yml +++ b/.github/workflows/__build-mode-rollback.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__bundle-from-toolcache.yml b/.github/workflows/__bundle-from-toolcache.yml index 639595af5d..96858acd1d 100644 --- a/.github/workflows/__bundle-from-toolcache.yml +++ b/.github/workflows/__bundle-from-toolcache.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__bundle-toolcache.yml b/.github/workflows/__bundle-toolcache.yml index de3826b656..59d06b49bf 100644 --- a/.github/workflows/__bundle-toolcache.yml +++ b/.github/workflows/__bundle-toolcache.yml @@ -51,7 +51,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__bundle-zstd.yml b/.github/workflows/__bundle-zstd.yml index f5b1ab3aad..1d0d9b47ee 100644 --- a/.github/workflows/__bundle-zstd.yml +++ b/.github/workflows/__bundle-zstd.yml @@ -51,7 +51,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -79,7 +79,7 @@ jobs: output: ${{ runner.temp }}/results upload-database: false - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.os }}-zstd-bundle.sarif path: ${{ runner.temp }}/results/javascript.sarif diff --git a/.github/workflows/__cleanup-db-cluster-dir.yml b/.github/workflows/__cleanup-db-cluster-dir.yml index dfe53c67ce..8bf4659ae5 100644 --- a/.github/workflows/__cleanup-db-cluster-dir.yml +++ b/.github/workflows/__cleanup-db-cluster-dir.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__config-export.yml b/.github/workflows/__config-export.yml index f01c4ae3d3..1a2df7875d 100644 --- a/.github/workflows/__config-export.yml +++ b/.github/workflows/__config-export.yml @@ -49,7 +49,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -67,7 +67,7 @@ jobs: output: ${{ runner.temp }}/results upload-database: false - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json path: ${{ runner.temp }}/results/javascript.sarif diff --git a/.github/workflows/__config-input.yml b/.github/workflows/__config-input.yml index 59db10d4d6..2a006be21d 100644 --- a/.github/workflows/__config-input.yml +++ b/.github/workflows/__config-input.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js uses: actions/setup-node@v6 with: diff --git a/.github/workflows/__cpp-deptrace-disabled.yml b/.github/workflows/__cpp-deptrace-disabled.yml index 1221592366..2116e5c4fa 100644 --- a/.github/workflows/__cpp-deptrace-disabled.yml +++ b/.github/workflows/__cpp-deptrace-disabled.yml @@ -51,7 +51,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml index b9669b8703..1039cc3213 100644 --- a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml +++ b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml @@ -49,7 +49,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__cpp-deptrace-enabled.yml b/.github/workflows/__cpp-deptrace-enabled.yml index bf155a64d2..9a57d0041a 100644 --- a/.github/workflows/__cpp-deptrace-enabled.yml +++ b/.github/workflows/__cpp-deptrace-enabled.yml @@ -51,7 +51,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__diagnostics-export.yml b/.github/workflows/__diagnostics-export.yml index 9251e04a8b..b0265ca3fc 100644 --- a/.github/workflows/__diagnostics-export.yml +++ b/.github/workflows/__diagnostics-export.yml @@ -49,7 +49,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -78,7 +78,7 @@ jobs: output: ${{ runner.temp }}/results upload-database: false - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json path: ${{ runner.temp }}/results/javascript.sarif diff --git a/.github/workflows/__export-file-baseline-information.yml b/.github/workflows/__export-file-baseline-information.yml index 66274f26b6..2a4556ddf0 100644 --- a/.github/workflows/__export-file-baseline-information.yml +++ b/.github/workflows/__export-file-baseline-information.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -61,7 +71,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -74,6 +84,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init id: init with: @@ -85,7 +99,7 @@ jobs: with: output: ${{ runner.temp }}/results - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json path: ${{ runner.temp }}/results/javascript.sarif diff --git a/.github/workflows/__extractor-ram-threads.yml b/.github/workflows/__extractor-ram-threads.yml index 2d8316f52a..09c1cbbf43 100644 --- a/.github/workflows/__extractor-ram-threads.yml +++ b/.github/workflows/__extractor-ram-threads.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__global-proxy.yml b/.github/workflows/__global-proxy.yml index bd5d64b5f4..3987966496 100644 --- a/.github/workflows/__global-proxy.yml +++ b/.github/workflows/__global-proxy.yml @@ -61,7 +61,7 @@ jobs: apt install -y gh env: {} - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -76,6 +76,7 @@ jobs: - uses: ./../action/analyze env: https_proxy: http://squid-proxy:3128 + CODEQL_ACTION_TOLERATE_MISSING_GIT_VERSION: true CODEQL_ACTION_TEST_MODE: true container: image: ubuntu:22.04 diff --git a/.github/workflows/__go-custom-queries.yml b/.github/workflows/__go-custom-queries.yml index 1b5b7b9150..32912ee078 100644 --- a/.github/workflows/__go-custom-queries.yml +++ b/.github/workflows/__go-custom-queries.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -59,7 +69,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -72,6 +82,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: languages: go diff --git a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml index 061ad42549..b140b13c4a 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-diagnostic.yml @@ -57,7 +57,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml index 0a347c65c7..d6cf269d71 100644 --- a/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml +++ b/.github/workflows/__go-indirect-tracing-workaround-no-file-program.yml @@ -57,7 +57,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__go-indirect-tracing-workaround.yml b/.github/workflows/__go-indirect-tracing-workaround.yml index bb811d4d51..8b0c3d13da 100644 --- a/.github/workflows/__go-indirect-tracing-workaround.yml +++ b/.github/workflows/__go-indirect-tracing-workaround.yml @@ -57,7 +57,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__go-tracing-autobuilder.yml b/.github/workflows/__go-tracing-autobuilder.yml index 6d4cc91cc9..0d2db37343 100644 --- a/.github/workflows/__go-tracing-autobuilder.yml +++ b/.github/workflows/__go-tracing-autobuilder.yml @@ -91,7 +91,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__go-tracing-custom-build-steps.yml b/.github/workflows/__go-tracing-custom-build-steps.yml index 634b074c08..bbd461c891 100644 --- a/.github/workflows/__go-tracing-custom-build-steps.yml +++ b/.github/workflows/__go-tracing-custom-build-steps.yml @@ -91,7 +91,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__go-tracing-legacy-workflow.yml b/.github/workflows/__go-tracing-legacy-workflow.yml index 8168e3b108..feedfdff5d 100644 --- a/.github/workflows/__go-tracing-legacy-workflow.yml +++ b/.github/workflows/__go-tracing-legacy-workflow.yml @@ -91,7 +91,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__go.yml b/.github/workflows/__go.yml index e8bf8837e4..76d178b723 100644 --- a/.github/workflows/__go.yml +++ b/.github/workflows/__go.yml @@ -8,9 +8,6 @@ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GO111MODULE: auto on: - push: - paths: - - .github/workflows/__go.yml workflow_dispatch: inputs: go-version: @@ -18,6 +15,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x jobs: go-custom-queries: name: 'Go: Custom queries' @@ -27,6 +29,7 @@ jobs: uses: ./.github/workflows/__go-custom-queries.yml with: go-version: ${{ inputs.go-version }} + dotnet-version: ${{ inputs.dotnet-version }} go-indirect-tracing-workaround-diagnostic: name: 'Go: diagnostic when Go is changed after init step' permissions: diff --git a/.github/workflows/__init-with-registries.yml b/.github/workflows/__init-with-registries.yml index bbbc55bf12..8403d63e4e 100644 --- a/.github/workflows/__init-with-registries.yml +++ b/.github/workflows/__init-with-registries.yml @@ -52,7 +52,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__javascript-source-root.yml b/.github/workflows/__javascript-source-root.yml index e6c883966e..97caa3a69e 100644 --- a/.github/workflows/__javascript-source-root.yml +++ b/.github/workflows/__javascript-source-root.yml @@ -51,7 +51,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__job-run-uuid-sarif.yml b/.github/workflows/__job-run-uuid-sarif.yml index b9f3eed911..6fc0052680 100644 --- a/.github/workflows/__job-run-uuid-sarif.yml +++ b/.github/workflows/__job-run-uuid-sarif.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -64,7 +64,7 @@ jobs: with: output: ${{ runner.temp }}/results - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json path: ${{ runner.temp }}/results/javascript.sarif diff --git a/.github/workflows/__language-aliases.yml b/.github/workflows/__language-aliases.yml index 5f95caa131..b8976bb5da 100644 --- a/.github/workflows/__language-aliases.yml +++ b/.github/workflows/__language-aliases.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__local-bundle.yml b/.github/workflows/__local-bundle.yml index 159d8c4556..094f22ebc0 100644 --- a/.github/workflows/__local-bundle.yml +++ b/.github/workflows/__local-bundle.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -67,7 +77,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -85,6 +95,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Fetch latest CodeQL bundle run: | wget https://github.com/github/codeql-action/releases/latest/download/codeql-bundle-linux64.tar.zst diff --git a/.github/workflows/__multi-language-autodetect.yml b/.github/workflows/__multi-language-autodetect.yml index e9272f8939..8e0b44dbf6 100644 --- a/.github/workflows/__multi-language-autodetect.yml +++ b/.github/workflows/__multi-language-autodetect.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -101,7 +111,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -119,6 +129,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Use Xcode 16 if: runner.os == 'macOS' && matrix.version != 'nightly-latest' run: sudo xcode-select -s "/Applications/Xcode_16.app" diff --git a/.github/workflows/__overlay-init-fallback.yml b/.github/workflows/__overlay-init-fallback.yml index d85e58aa17..b843b8aac5 100644 --- a/.github/workflows/__overlay-init-fallback.yml +++ b/.github/workflows/__overlay-init-fallback.yml @@ -49,7 +49,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index a5038cefc4..63875502f2 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -71,7 +81,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js uses: actions/setup-node@v6 with: @@ -96,6 +106,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: .github/codeql/codeql-config-packaging3.yml diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index 9c8483c746..7a79729718 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -61,7 +71,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js uses: actions/setup-node@v6 with: @@ -81,6 +91,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: .github/codeql/codeql-config-packaging3.yml diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index b7608793a5..00a6fc9dae 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -61,7 +71,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js uses: actions/setup-node@v6 with: @@ -81,6 +91,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: .github/codeql/codeql-config-packaging.yml diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index 0a814a0502..ec3ef3d5bf 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -61,7 +71,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Install Node.js uses: actions/setup-node@v6 with: @@ -81,6 +91,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: .github/codeql/codeql-config-packaging2.yml diff --git a/.github/workflows/__quality-queries.yml b/.github/workflows/__quality-queries.yml index 2a30bfcebe..66184f9c27 100644 --- a/.github/workflows/__quality-queries.yml +++ b/.github/workflows/__quality-queries.yml @@ -63,7 +63,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -83,7 +83,7 @@ jobs: post-processed-sarif-path: ${{ runner.temp }}/post-processed - name: Upload security SARIF if: contains(matrix.analysis-kinds, 'code-scanning') - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: | quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json @@ -91,14 +91,14 @@ jobs: retention-days: 7 - name: Upload quality SARIF if: contains(matrix.analysis-kinds, 'code-quality') - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: | quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.quality.sarif.json path: ${{ runner.temp }}/results/javascript.quality.sarif retention-days: 7 - name: Upload post-processed SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: | post-processed-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json diff --git a/.github/workflows/__remote-config.yml b/.github/workflows/__remote-config.yml index b59da417e4..f39b6f6f93 100644 --- a/.github/workflows/__remote-config.yml +++ b/.github/workflows/__remote-config.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -69,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -87,6 +97,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/__resolve-environment-action.yml b/.github/workflows/__resolve-environment-action.yml index 2203f3316c..01e242ebb9 100644 --- a/.github/workflows/__resolve-environment-action.yml +++ b/.github/workflows/__resolve-environment-action.yml @@ -51,7 +51,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__rubocop-multi-language.yml b/.github/workflows/__rubocop-multi-language.yml index 5442459ff7..9b814f8d3a 100644 --- a/.github/workflows/__rubocop-multi-language.yml +++ b/.github/workflows/__rubocop-multi-language.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -56,7 +56,7 @@ jobs: use-all-platform-bundle: 'false' setup-kotlin: 'true' - name: Set up Ruby - uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0 + uses: ruby/setup-ruby@ac793fdd38cc468a4dd57246fa9d0e868aba9085 # v1.270.0 with: ruby-version: 2.6 - name: Install Code Scanning integration diff --git a/.github/workflows/__ruby.yml b/.github/workflows/__ruby.yml index 769a119253..3050bf7353 100644 --- a/.github/workflows/__ruby.yml +++ b/.github/workflows/__ruby.yml @@ -57,7 +57,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__rust.yml b/.github/workflows/__rust.yml index d788e5226d..352ffdee7d 100644 --- a/.github/workflows/__rust.yml +++ b/.github/workflows/__rust.yml @@ -55,7 +55,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__split-workflow.yml b/.github/workflows/__split-workflow.yml index e916b36ccc..c02385a728 100644 --- a/.github/workflows/__split-workflow.yml +++ b/.github/workflows/__split-workflow.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -67,7 +77,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -80,6 +90,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: config-file: .github/codeql/codeql-config-packaging3.yml diff --git a/.github/workflows/__start-proxy.yml b/.github/workflows/__start-proxy.yml index 26f1184608..40a2993cac 100644 --- a/.github/workflows/__start-proxy.yml +++ b/.github/workflows/__start-proxy.yml @@ -51,7 +51,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__submit-sarif-failure.yml b/.github/workflows/__submit-sarif-failure.yml index 7383b52a8d..60c3510204 100644 --- a/.github/workflows/__submit-sarif-failure.yml +++ b/.github/workflows/__submit-sarif-failure.yml @@ -52,7 +52,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -60,7 +60,7 @@ jobs: version: ${{ matrix.version }} use-all-platform-bundle: 'false' setup-kotlin: 'true' - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: ./init with: languages: javascript diff --git a/.github/workflows/__swift-autobuild.yml b/.github/workflows/__swift-autobuild.yml index 9d18d0c978..447f4ea9a2 100644 --- a/.github/workflows/__swift-autobuild.yml +++ b/.github/workflows/__swift-autobuild.yml @@ -47,7 +47,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/__swift-custom-build.yml b/.github/workflows/__swift-custom-build.yml index 32ce33a7f0..49f6558803 100644 --- a/.github/workflows/__swift-custom-build.yml +++ b/.github/workflows/__swift-custom-build.yml @@ -27,6 +27,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -34,6 +39,11 @@ on: description: The version of Go to install required: false default: '>=1.21.0' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -61,7 +71,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -74,6 +84,10 @@ jobs: with: go-version: ${{ inputs.go-version || '>=1.21.0' }} cache: false + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Use Xcode 16 if: runner.os == 'macOS' && matrix.version != 'nightly-latest' run: sudo xcode-select -s "/Applications/Xcode_16.app" diff --git a/.github/workflows/__unset-environment.yml b/.github/workflows/__unset-environment.yml index ced3b33fcc..2d52f3a800 100644 --- a/.github/workflows/__unset-environment.yml +++ b/.github/workflows/__unset-environment.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -69,7 +79,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -87,6 +97,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init id: init with: diff --git a/.github/workflows/__upload-ref-sha-input.yml b/.github/workflows/__upload-ref-sha-input.yml index 8f1fd49173..8de95e42ac 100644 --- a/.github/workflows/__upload-ref-sha-input.yml +++ b/.github/workflows/__upload-ref-sha-input.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -67,7 +77,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -85,6 +95,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/__upload-sarif.yml b/.github/workflows/__upload-sarif.yml index 77cd057f9c..c4c31e4e47 100644 --- a/.github/workflows/__upload-sarif.yml +++ b/.github/workflows/__upload-sarif.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -74,7 +84,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -92,6 +102,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - uses: ./../action/init with: tools: ${{ steps.prepare-test.outputs.tools-url }} diff --git a/.github/workflows/__with-checkout-path.yml b/.github/workflows/__with-checkout-path.yml index 1b4002ffbc..0ebb46432f 100644 --- a/.github/workflows/__with-checkout-path.yml +++ b/.github/workflows/__with-checkout-path.yml @@ -32,6 +32,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x workflow_call: inputs: go-version: @@ -44,6 +49,11 @@ on: description: The version of Python to install required: false default: '3.13' + dotnet-version: + type: string + description: The version of .NET to install + required: false + default: 9.x defaults: run: shell: bash @@ -67,7 +77,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -85,6 +95,10 @@ jobs: uses: actions/setup-python@v6 with: python-version: ${{ inputs.python-version || '3.13' }} + - name: Install .NET + uses: actions/setup-dotnet@v5 + with: + dotnet-version: ${{ inputs.dotnet-version || '9.x' }} - name: Delete original checkout run: | # delete the original checkout so we don't accidentally use it. @@ -93,7 +107,7 @@ jobs: 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@v5 + - uses: actions/checkout@v6 with: ref: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6 path: x/y/z/some-path diff --git a/.github/workflows/check-expected-release-files.yml b/.github/workflows/check-expected-release-files.yml index a066cbde55..c0dd21af64 100644 --- a/.github/workflows/check-expected-release-files.yml +++ b/.github/workflows/check-expected-release-files.yml @@ -22,7 +22,7 @@ jobs: steps: - name: Checkout CodeQL Action - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Check Expected Release Files run: | bundle_version="$(cat "./src/defaults.json" | jq -r ".bundleVersion")" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 24dace33cf..999aa6dfd0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,7 +4,6 @@ on: push: branches: [main, releases/v*] pull_request: - branches: [main, releases/v*] # Run checks on reopened draft PRs to support triggering PR checks on draft PRs that were opened # by other workflows. types: [opened, synchronize, reopened, ready_for_review] @@ -32,7 +31,7 @@ jobs: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Init with default CodeQL bundle from the VM image id: init-default uses: ./init @@ -91,7 +90,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Initialize CodeQL uses: ./init id: init @@ -128,7 +127,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Initialize CodeQL uses: ./init with: diff --git a/.github/workflows/codescanning-config-cli.yml b/.github/workflows/codescanning-config-cli.yml index 5ae95f68af..cbac3a8a91 100644 --- a/.github/workflows/codescanning-config-cli.yml +++ b/.github/workflows/codescanning-config-cli.yml @@ -6,6 +6,11 @@ env: # Diff informed queries add an additional query filter which is not yet # taken into account by these tests. CODEQL_ACTION_DIFF_INFORMED_QUERIES: false + # Specify overlay enablement manually to ensure stability around the exclude-from-incremental + # query filter. Here we only enable for the default code scanning suite. + CODEQL_ACTION_OVERLAY_ANALYSIS: true + CODEQL_ACTION_OVERLAY_ANALYSIS_JAVASCRIPT: false + CODEQL_ACTION_OVERLAY_ANALYSIS_CODE_SCANNING_JAVASCRIPT: true on: push: @@ -53,7 +58,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Set up Node.js uses: actions/setup-node@v6 @@ -70,13 +75,33 @@ jobs: with: version: ${{ matrix.version }} - - name: Empty file + # On PRs, overlay analysis may change the config that is passed to the CLI. + # Therefore, we have two variants of the following test, one for PRs and one for other events. + - name: Empty file (non-PR) + if: github.event_name != 'pull_request' uses: ./../action/.github/actions/check-codescanning-config with: expected-config-file-contents: "{}" languages: javascript tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Empty file (PR) + if: github.event_name == 'pull_request' + uses: ./../action/.github/actions/check-codescanning-config + with: + expected-config-file-contents: | + { + "query-filters": [ + { + "exclude": { + "tags": "exclude-from-incremental" + } + } + ] + } + languages: javascript + tools: ${{ steps.prepare-test.outputs.tools-url }} + - name: Packs from input if: success() || failure() uses: ./../action/.github/actions/check-codescanning-config diff --git a/.github/workflows/debug-artifacts-failure-safe.yml b/.github/workflows/debug-artifacts-failure-safe.yml index 1a09b3d9ee..1c1343b19a 100644 --- a/.github/workflows/debug-artifacts-failure-safe.yml +++ b/.github/workflows/debug-artifacts-failure-safe.yml @@ -45,7 +45,7 @@ jobs: - name: Dump GitHub event run: cat "${GITHUB_EVENT_PATH}" - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -54,6 +54,12 @@ jobs: - uses: actions/setup-go@v6 with: go-version: ^1.13.1 + - name: Install .NET + uses: actions/setup-dotnet@v5 + 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: tools: ${{ steps.prepare-test.outputs.tools-url }} @@ -79,7 +85,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download all artifacts - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 - name: Check expected artifacts exist run: | LANGUAGES="cpp csharp go java javascript python" diff --git a/.github/workflows/debug-artifacts-safe.yml b/.github/workflows/debug-artifacts-safe.yml index ea513521f1..5314cc753a 100644 --- a/.github/workflows/debug-artifacts-safe.yml +++ b/.github/workflows/debug-artifacts-safe.yml @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Prepare test id: prepare-test uses: ./.github/actions/prepare-test @@ -50,6 +50,12 @@ jobs: - uses: actions/setup-go@v6 with: go-version: ^1.13.1 + - name: Install .NET + uses: actions/setup-dotnet@v5 + 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: @@ -73,7 +79,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Download all artifacts - uses: actions/download-artifact@v6 + uses: actions/download-artifact@v7 - name: Check expected artifacts exist run: | VERSIONS="stable-v2.20.3 default linked nightly-latest" diff --git a/.github/workflows/post-release-mergeback.yml b/.github/workflows/post-release-mergeback.yml index 1731a78ff9..8340632aec 100644 --- a/.github/workflows/post-release-mergeback.yml +++ b/.github/workflows/post-release-mergeback.yml @@ -44,7 +44,7 @@ jobs: GITHUB_CONTEXT: '${{ toJson(github) }}' run: echo "${GITHUB_CONTEXT}" - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # ensure we have all tags and can push commits - uses: actions/setup-node@v6 @@ -142,7 +142,7 @@ jobs: token: "${{ secrets.GITHUB_TOKEN }}" - name: Generate token - uses: actions/create-github-app-token@v2.1.4 + uses: actions/create-github-app-token@v2.2.1 id: app-token with: app-id: ${{ vars.AUTOMATION_APP_ID }} diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 9aa0355c13..5badaab815 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -32,7 +32,7 @@ jobs: if: runner.os == 'Windows' run: git config --global core.autocrlf false - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Set up Node.js uses: actions/setup-node@v6 @@ -91,7 +91,7 @@ jobs: contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - id: head-version name: Verify all Actions use the same Node version run: | @@ -106,7 +106,7 @@ jobs: - id: checkout-base name: 'Backport: Check out base ref' if: ${{ startsWith(github.head_ref, 'backport-') }} - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: ref: ${{ env.BASE_REF }} diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index dad6fce39a..7e9486bb49 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -44,7 +44,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 # Need full history for calculation of diffs diff --git a/.github/workflows/publish-immutable-action.yml b/.github/workflows/publish-immutable-action.yml index c6084573c0..e14bc30bc4 100644 --- a/.github/workflows/publish-immutable-action.yml +++ b/.github/workflows/publish-immutable-action.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Publish immutable release id: publish diff --git a/.github/workflows/python312-windows.yml b/.github/workflows/python312-windows.yml index aa2a034200..8ef1be8667 100644 --- a/.github/workflows/python312-windows.yml +++ b/.github/workflows/python312-windows.yml @@ -31,7 +31,7 @@ jobs: with: python-version: 3.12 - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - name: Prepare test uses: ./.github/actions/prepare-test diff --git a/.github/workflows/query-filters.yml b/.github/workflows/query-filters.yml index 3e17d989e4..90e702c934 100644 --- a/.github/workflows/query-filters.yml +++ b/.github/workflows/query-filters.yml @@ -29,7 +29,7 @@ jobs: 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@v5 + uses: actions/checkout@v6 - name: Install Node.js uses: actions/setup-node@v6 diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml index e7b9022be9..9740a0d163 100644 --- a/.github/workflows/rebuild.yml +++ b/.github/workflows/rebuild.yml @@ -24,7 +24,7 @@ jobs: pull-requests: write # needed to comment on the PR steps: - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 ref: ${{ env.HEAD_REF }} diff --git a/.github/workflows/rollback-release.yml b/.github/workflows/rollback-release.yml index 8d8e872fa7..5c3b7efdd1 100644 --- a/.github/workflows/rollback-release.yml +++ b/.github/workflows/rollback-release.yml @@ -52,7 +52,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 # Need full history for calculation of diffs @@ -137,7 +137,7 @@ jobs: - name: Generate token if: github.event_name == 'workflow_dispatch' - uses: actions/create-github-app-token@v2.1.4 + uses: actions/create-github-app-token@v2.2.1 id: app-token with: app-id: ${{ vars.AUTOMATION_APP_ID }} diff --git a/.github/workflows/script/bundle_changelog.py b/.github/workflows/script/bundle_changelog.py new file mode 100644 index 0000000000..8a7135f1e4 --- /dev/null +++ b/.github/workflows/script/bundle_changelog.py @@ -0,0 +1,18 @@ +import os +import re + +# Get the PR number from the PR URL. +pr_number = os.environ['PR_URL'].split('/')[-1] +changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})" + +# If the "[UNRELEASED]" section starts with "no user facing changes", remove that line. +with open('CHANGELOG.md', 'r') as f: + changelog = f.read() + +changelog = changelog.replace('## [UNRELEASED]\n\nNo user facing changes.', '## [UNRELEASED]\n') + +# Add the changelog note to the bottom of the "[UNRELEASED]" section. +changelog = re.sub(r'\n## (\d+\.\d+\.\d+)', f'{changelog_note}\n\n## \\1', changelog, count=1) + +with open('CHANGELOG.md', 'w') as f: + f.write(changelog) diff --git a/.github/workflows/test-codeql-bundle-all.yml b/.github/workflows/test-codeql-bundle-all.yml index 4b7fdca817..3952882758 100644 --- a/.github/workflows/test-codeql-bundle-all.yml +++ b/.github/workflows/test-codeql-bundle-all.yml @@ -36,13 +36,17 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Check out repository - uses: actions/checkout@v5 + uses: actions/checkout@v6 - 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@v5 + with: + dotnet-version: '9.x' - id: init uses: ./../action/init with: diff --git a/.github/workflows/update-bundle.yml b/.github/workflows/update-bundle.yml index f2c3cd40cb..951b89066d 100644 --- a/.github/workflows/update-bundle.yml +++ b/.github/workflows/update-bundle.yml @@ -33,13 +33,18 @@ jobs: GITHUB_CONTEXT: '${{ toJson(github) }}' run: echo "$GITHUB_CONTEXT" - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - 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 Python + uses: actions/setup-python@v6 + with: + python-version: '3.12' + - name: Set up Node.js uses: actions/setup-node@v6 with: @@ -78,28 +83,8 @@ jobs: echo "PR_URL=$pr_url" | tee -a "$GITHUB_ENV" - name: Create changelog note - shell: python run: | - import os - import re - - # Get the PR number from the PR URL. - pr_number = os.environ['PR_URL'].split('/')[-1] - changelog_note = f"- Update default CodeQL bundle version to {os.environ['CLI_VERSION']}. [#{pr_number}]({os.environ['PR_URL']})" - - # If the "[UNRELEASED]" section starts with "no user facing changes", remove that line. - # Use perl to avoid having to escape the newline character. - - with open('CHANGELOG.md', 'r') as f: - changelog = f.read() - - changelog = changelog.replace('## [UNRELEASED]\n\nNo user facing changes.', '## [UNRELEASED]\n') - - # Add the changelog note to the bottom of the "[UNRELEASED]" section. - changelog = re.sub(r'\n## (\d+\.\d+\.\d+)', f'{changelog_note}\n\n## \\1', changelog, count=1) - - with open('CHANGELOG.md', 'w') as f: - f.write(changelog) + python .github/workflows/script/bundle_changelog.py - name: Push changelog note run: | diff --git a/.github/workflows/update-release-branch.yml b/.github/workflows/update-release-branch.yml index 830ed7c2a5..bd38d922e4 100644 --- a/.github/workflows/update-release-branch.yml +++ b/.github/workflows/update-release-branch.yml @@ -38,7 +38,7 @@ jobs: contents: write # needed to push commits pull-requests: write # needed to create pull request steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 with: fetch-depth: 0 # Need full history for calculation of diffs - uses: ./.github/actions/release-initialise @@ -93,14 +93,14 @@ jobs: pull-requests: write # needed to create pull request steps: - name: Generate token - uses: actions/create-github-app-token@v2.1.4 + uses: actions/create-github-app-token@v2.2.1 id: app-token with: app-id: ${{ vars.AUTOMATION_APP_ID }} private-key: ${{ secrets.AUTOMATION_PRIVATE_KEY }} - name: Checkout - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: fetch-depth: 0 # Need full history for calculation of diffs token: ${{ steps.app-token.outputs.token }} diff --git a/.github/workflows/update-supported-enterprise-server-versions.yml b/.github/workflows/update-supported-enterprise-server-versions.yml index b6cbe01510..4cead58f4f 100644 --- a/.github/workflows/update-supported-enterprise-server-versions.yml +++ b/.github/workflows/update-supported-enterprise-server-versions.yml @@ -4,6 +4,12 @@ on: schedule: - cron: "0 0 * * *" workflow_dispatch: + pull_request: + branches: + - main + paths: + - .github/workflows/update-supported-enterprise-server-versions.yml + - .github/workflows/update-supported-enterprise-server-versions/update.py jobs: update-supported-enterprise-server-versions: @@ -21,13 +27,14 @@ jobs: with: python-version: "3.13" - name: Checkout CodeQL Action - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Checkout Enterprise Releases - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: github/enterprise-releases token: ${{ secrets.ENTERPRISE_RELEASE_TOKEN }} path: ${{ github.workspace }}/enterprise-releases/ + sparse-checkout: releases.json - name: Update Supported Enterprise Server Versions run: | cd ./.github/workflows/update-supported-enterprise-server-versions/ @@ -35,6 +42,7 @@ jobs: pipenv install pipenv run ./update.py rm --recursive "$ENTERPRISE_RELEASES_PATH" + npm ci npm run build env: ENTERPRISE_RELEASES_PATH: ${{ github.workspace }}/enterprise-releases/ @@ -44,25 +52,33 @@ jobs: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - - name: Commit changes and open PR - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - 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" - 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" + 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/CHANGELOG.md b/CHANGELOG.md index bb4d0129e5..e9ece6114e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,35 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th No user facing changes. +## 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. diff --git a/eslint.config.mjs b/eslint.config.mjs index ae9cf27460..96de67dbea 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -12,6 +12,7 @@ import filenames from "eslint-plugin-filenames"; import github from "eslint-plugin-github"; import _import from "eslint-plugin-import"; import noAsyncForeach from "eslint-plugin-no-async-foreach"; +import jsdoc from "eslint-plugin-jsdoc"; import globals from "globals"; const __filename = fileURLToPath(import.meta.url); @@ -52,6 +53,7 @@ export default [ github: fixupPluginRules(github), import: fixupPluginRules(_import), "no-async-foreach": noAsyncForeach, + "jsdoc": jsdoc, }, languageOptions: { @@ -133,6 +135,16 @@ export default [ "@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, + } + ], }, }, { diff --git a/lib/analyze-action-post.js b/lib/analyze-action-post.js index cca06fede2..e060fee4c0 100644 --- a/lib/analyze-action-post.js +++ b/lib/analyze-action-post.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os2 = __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() + os.EOL); + process.stdout.write(cmd.toString() + os2.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,41 +176,51 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs7 = __importStar4(require("fs")); - var os = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs8 = __importStar2(require("fs")); + var os2 = __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 (!fs7.existsSync(filePath)) { + if (!fs8.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs7.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + fs8.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -210,18 +228,18 @@ var require_file_command = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug4("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -999,14 +1015,14 @@ var require_util = __commonJS({ } const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}`; - let path6 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path7 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path6 && !path6.startsWith("/")) { - path6 = `/${path6}`; + if (path7 && !path7.startsWith("/")) { + path7 = `/${path7}`; } - url = new URL(origin + path6); + url = new URL(origin + path7); } return url; } @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -2620,20 +2636,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) { "use strict"; - module2.exports = function basename(path6) { - if (typeof path6 !== "string") { + module2.exports = function basename2(path7) { + if (typeof path7 !== "string") { return ""; } - for (var i = path6.length - 1; i >= 0; --i) { - switch (path6.charCodeAt(i)) { + for (var i = path7.length - 1; i >= 0; --i) { + switch (path7.charCodeAt(i)) { case 47: // '/' case 92: - path6 = path6.slice(i + 1); - return path6 === ".." || path6 === "." ? "" : path6; + path7 = path7.slice(i + 1); + return path7 === ".." || path7 === "." ? "" : path7; } } - return path6 === ".." || path6 === "." ? "" : path6; + return path7 === ".." || path7 === "." ? "" : path7; }; } }); @@ -2647,7 +2663,7 @@ var require_multipart = __commonJS({ var Dicer = require_Dicer(); var parseParams = require_parseParams(); var decodeText = require_decodeText(); - var basename = require_basename(); + var basename2 = require_basename(); var getLimit = require_getLimit(); var RE_BOUNDARY = /^boundary$/i; var RE_FIELD = /^form-data$/i; @@ -2764,7 +2780,7 @@ var require_multipart = __commonJS({ } else if (RE_FILENAME.test(parsed[i][0])) { filename = parsed[i][1]; if (!preservePath) { - filename = basename(filename); + filename = basename2(filename); } } } @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5663,7 +5679,7 @@ var require_request = __commonJS({ } var Request = class _Request { constructor(origin, { - path: path6, + path: path7, method, body, headers, @@ -5677,11 +5693,11 @@ var require_request = __commonJS({ throwOnError, expectContinue }, handler) { - if (typeof path6 !== "string") { + if (typeof path7 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path6[0] !== "/" && !(path6.startsWith("http://") || path6.startsWith("https://")) && method !== "CONNECT") { + } else if (path7[0] !== "/" && !(path7.startsWith("http://") || path7.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path6) !== null) { + } else if (invalidPathRegex.exec(path7) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -5744,7 +5760,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util.buildURL(path6, query) : path6; + this.path = query ? util.buildURL(path7, query) : path7; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6752,9 +6768,9 @@ var require_RedirectHandler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path6 = search ? `${pathname}${search}` : pathname; + const path7 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path6; + this.opts.path = path7; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -7994,7 +8010,7 @@ var require_client = __commonJS({ writeH2(client, client[kHTTP2Session], request); return; } - const { body, method, path: path6, host, upgrade, headers, blocking, reset } = request; + const { body, method, path: path7, host, upgrade, headers, blocking, reset } = request; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); @@ -8044,7 +8060,7 @@ var require_client = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path6} HTTP/1.1\r + let header = `${method} ${path7} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -8107,7 +8123,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request) { - const { body, method, path: path6, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + const { body, method, path: path7, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; let headers; if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -8150,7 +8166,7 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path6; + headers[HTTP2_HEADER_PATH] = path7; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10390,20 +10406,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path6) { - if (typeof path6 !== "string") { - return path6; + function safeUrl(path7) { + if (typeof path7 !== "string") { + return path7; } - const pathSegments = path6.split("?"); + const pathSegments = path7.split("?"); if (pathSegments.length !== 2) { - return path6; + return path7; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path6, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path6); + function matchKey(mockDispatch2, { path: path7, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path7); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10421,7 +10437,7 @@ var require_mock_utils = __commonJS({ 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: path6 }) => matchValue(safeUrl(path6), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path7 }) => matchValue(safeUrl(path7), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10458,9 +10474,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path6, method, body, headers, query } = opts; + const { path: path7, method, body, headers, query } = opts; return { - path: path6, + path: path7, method, body, headers, @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay, persist } = mockDispatch2; + const { data: { statusCode, data, headers, trailers, error: error3 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay === "number" && delay > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -10909,10 +10925,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path6, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path7, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path6, + Path: path7, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve5({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15532,8 +15548,8 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path6) { - for (const char of path6) { + function validateCookiePath(path7) { + for (const char of path7) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17213,11 +17229,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path6 = opts.path; + let path7 = opts.path; if (!opts.path.startsWith("/")) { - path6 = `/${path6}`; + path7 = `/${path7}`; } - url = new URL(util.parseOrigin(url).origin + path6); + url = new URL(util.parseOrigin(url).origin + path7); } else { if (!opts) { opts = typeof url === "object" ? url : {}; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve5, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path6 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path7 = __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, path6.sep); + return pth.replace(/[/\\]/g, path7.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs7 = __importStar4(require("fs")); - var path6 = __importStar4(require("path")); - _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs8 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); + _a = fs8.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs8.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs7.constants.O_RDONLY; + exports2.READONLY = fs8.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18563,7 +18677,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path6.extname(filePath).toUpperCase(); + const upperExt = path7.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18587,11 +18701,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path6.dirname(filePath); - const upperName = path6.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + const directory = path7.dirname(filePath); + const upperName = path7.basename(filePath).toUpperCase(); + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path6.join(directory, actualName); + filePath = path7.join(directory, actualName); break; } } @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -18684,18 +18810,23 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which6; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path6 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path7 = __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 ? path6.join(dest, path6.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path7.join(dest, path7.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -18707,20 +18838,19 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path6.relative(source, newDest) === "") { + if (path7.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = path6.join(dest, path6.basename(source)); + dest = path7.join(dest, path7.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -18731,13 +18861,12 @@ var require_io = __commonJS({ } } } - yield mkdirP(path6.dirname(dest)); + yield mkdirP(path7.dirname(dest)); yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,15 +18913,14 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + 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(path6.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path7.delimiter)) { if (extension) { extensions.push(extension); } @@ -18807,12 +18933,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path6.sep)) { + if (tool.includes(path7.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path6.delimiter)) { + for (const p of process.env.PATH.split(path7.delimiter)) { if (p) { directories.push(p); } @@ -18820,7 +18946,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path6.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path7.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path6 = __importStar4(require("path")); - var io6 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path7 = __importStar2(require("path")); + var io6 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner5 = class extends events.EventEmitter { @@ -18988,12 +19128,12 @@ var require_toolrunner = __commonJS({ _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); - let n = s.indexOf(os.EOL); + let n = s.indexOf(os2.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); } return s; } catch (err) { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path6.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path7.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io6.which(this.toolPath, true); - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19162,7 +19302,7 @@ var require_toolrunner = __commonJS({ } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os2.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on("debug", (message) => { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve5(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + 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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 = exportVariable6; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug4; + exports2.error = error3; + exports2.warning = warning9; + exports2.notice = notice; + exports2.info = info7; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os = __importStar4(require("os")); - var path6 = __importStar4(require("path")); + var os2 = __importStar2(require("os")); + var path7 = __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 exportVariable5(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable6(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable5; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19679,20 +19870,18 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path6.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path7.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,71 +19889,58 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput(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(os.EOL); + process.stdout.write(os2.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug4(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug4; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning8(message, properties = {}) { + function warning9(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning8; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info7(message) { - process.stdout.write(message + os.EOL); + process.stdout.write(message + os2.EOL); } - exports2.info = info7; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19835,8 +20007,8 @@ var require_context = __commonJS({ 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 path6 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path6} does not exist${os_1.EOL}`); + const path7 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path7} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve5, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter4(this, void 0, void 0, function* () { + const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,501 +25406,43 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs7 = __importStar4(require("fs")); - var path6 = __importStar4(require("path")); - _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs7.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs7.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path6.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 = path6.dirname(filePath); - const upperName = path6.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path6.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 = which6; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path6 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path6.join(dest, path6.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 (path6.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path6.join(dest, path6.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(path6.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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 __awaiter4(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(path6.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(path6.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path6.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path6.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + var debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; module2.exports = debug4; } @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare2 = require_compare(); - var gte5 = (a, b, loose) => compare2(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare2(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises3)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } } doExpire(clearGlobalState, run, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve5, returned, task; + var args, cb, error3, reject, resolve5, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve5, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve5(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info7) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info7) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29256,14 +28970,14 @@ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path6, name, argument) { - if (Array.isArray(path6)) { - this.path = path6; - this.property = path6.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path7, name, argument) { + if (Array.isArray(path7)) { + this.path = path7; + this.property = path7.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path6 !== void 0) { - this.property = path6; + } else if (path7 !== void 0) { + this.property = path7; } if (message) { this.message = message; @@ -29354,16 +29068,16 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path6, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path7, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path6)) { - this.path = path6; - this.propertyPath = path6.reduce(function(sum, item) { + if (Array.isArray(path7)) { + this.path = path7; + this.propertyPath = path7.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path6; + this.propertyPath = path7; } this.base = base; this.schemas = schemas; @@ -29372,10 +29086,10 @@ var require_helpers = __commonJS({ return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path6 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path7 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path6, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path7, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -29565,8 +29279,8 @@ var require_helpers = __commonJS({ } return decimalPlaces; }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; }; } }); @@ -30548,1424 +30262,895 @@ var require_lib3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path6 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname2(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs8 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path6.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs8.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs8.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname2; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path6.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path6.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path6.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; - }; - var isArray = 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 = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; - } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length) { - result = [left, right]; - } + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __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", () => { + resolve5(output.toString()); + }); + })); + }); } - parts.push.apply(parts, p); - return parts; - } - function expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve5(Buffer.concat(chunks)); + }); + })); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; + }; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; - } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; } - } - } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } + 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; } - N.push(c); } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + } + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path6 = (function() { - try { - return require("path"); - } catch (e) { + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path6.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path6.sep !== "/") { - pattern = pattern.split(path6.sep).join("/"); + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.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 set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug4() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = 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++) { - negate = !negate; - negateOffset++; - } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; - } - } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * 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); + }); } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + 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); + }); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); + }); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; - } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; - } + 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); + }); } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; - } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + /** + * 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."); } - 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; - } - 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; + const parsedUrl = new URL(requestUrl); + let info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, data); + } else { + return response; + } } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, data); + redirectsRemaining--; } - 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; + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); } - re += c; + } 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; } - if (inClass) { - cs = pattern.substr(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve5(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); } - 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 = "\\"; + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; } - return $1 + $1 + $2 + "|"; + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(void 0, res); }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; - } - clearStateChar(); - if (escaping) { - re += "\\\\"; - } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = 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(/\)[+*?]?/, ""); + let socket; + req.on("socket", (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info7.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); } - nlAfter = cleanAfter; - var dollar = ""; - if (nlAfter === "" && isSub !== SUBPARSE) { - dollar = "$"; + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + /** + * 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); } - if (addPatternStart) { - re = patternStart + re; + 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); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + _prepareRequest(method, requestUrl, headers) { + const info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); + } + } + return info7; } - if (!hasMagic) { - return globUnescape(pattern); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path6.sep !== "/") { - f = f.split(path6.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - } - if (options.flipNegate) return false; - return this.negate; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - return false; + if (!useProxy) { + agent = this._agent; } - 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 (agent) { + return agent; } - 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 regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path6 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path6.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path6.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path6.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } - } + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path6.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; + 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 { - result += path6.sep; + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } - result += this.segments[i]; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os = __importStar4(require("os")); - var path6 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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}`; - } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); + this._agent = agent; } - while (pattern.startsWith("!")) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); } - pattern = _Pattern.fixupPattern(pattern, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path6.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); + return agent; } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path6.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path6.sep}`; - } - } else { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; } - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + if (proxyAgent) { + return proxyAgent; } - 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); + 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 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, "[*]"); + return proxyAgent; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path6.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path6.sep}`)) { - homedir = homedir || os.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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); + _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((resolve5) => setTimeout(() => resolve5(), ms)); + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve5(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } } + return value; } - if (closed >= 0) { - if (set2.length > 1) { - return ""; + 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; } - if (set2) { - literal += set2; - i = closed; - continue; + 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 { + resolve5(response); } - } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path6, level) { - this.path = path6; - this.level = level; + })); + }); } }; - exports2.SearchState = SearchState; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -31992,286 +31177,84 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); - } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + 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; } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - function step(r) { - r.value instanceof __await4 ? 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); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core14 = __importStar4(require_core()); - var fs7 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path6 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - getSearchPaths() { - return this.searchPaths.slice(); + // 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}`; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs7.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs7.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path6.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter4(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; - }); + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs7.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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 fs7.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs7.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; - } - traversalChain.push(realPath); - } - return stats; - }); + // 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")}`; } - }; - exports2.DefaultGlobber = DefaultGlobber; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create3(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); - } - exports2.create = create3; + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -32298,153 +31281,78 @@ var require_io_util3 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var _a; 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 fs7 = __importStar4(require("fs")); - var path6 = __importStar4(require("path")); - _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs7.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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'); + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + 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); } - if (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); + 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; } - return p.startsWith("/"); - } - exports2.isRooted = isRooted; - function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(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}`); - } + 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"); } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path6.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - } - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = void 0; + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter2(this, void 0, void 0, function* () { 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 = path6.dirname(filePath); - const upperName = path6.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path6.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; - } + 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}`); } - } - 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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } - exports2.getCmdPath = getCmdPath; + }; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -32472,60 +31380,599 @@ var require_io3 = __commonJS({ }); }; 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 path6 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); - function cp(source, dest, options = {}) { - return __awaiter4(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 ? path6.join(dest, path6.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 (path6.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); + 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; } - yield copyFile(source, newDest, force); - } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path6.join(dest, path6.basename(source)); - destExists = yield ioUtil.exists(dest); + 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.`); } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } else { - throw new Error("Destination already exists"); - } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + 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}>`; } - yield mkdirP(path6.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } + 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/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/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 path7 = __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, path7.sep); + } + exports2.toPlatformPath = toPlatformPath; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + 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 fs8 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); + _a = fs8.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs8.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 = path7.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 = path7.dirname(filePath); + const upperName = path7.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path7.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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 path7 = __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 ? path7.join(dest, path7.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 (path7.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(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 = path7.join(dest, path7.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(path7.dirname(dest)); + yield ioUtil.rename(source, dest); + }); + } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -32545,14 +31992,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32576,13 +32023,13 @@ var require_io3 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + 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(path6.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path7.delimiter)) { if (extension) { extensions.push(extension); } @@ -32595,12 +32042,12 @@ var require_io3 = __commonJS({ } return []; } - if (tool.includes(path6.sep)) { + if (tool.includes(path7.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path6.delimiter)) { + for (const p of process.env.PATH.split(path7.delimiter)) { if (p) { directories.push(p); } @@ -32608,7 +32055,7 @@ var require_io3 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path6.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path7.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -32624,7 +32071,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -32644,7 +32091,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -32665,1200 +32112,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug4; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug4 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug4 = 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++) { - debug4(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + __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(resolve5) { + resolve5(value); + }); } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; - } else { - version = version.version; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } 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); - } - debug4("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; - } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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) { - debug4("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]; - debug4("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); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - SemVer.prototype.compareBuild = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path7 = __importStar2(require("path")); + var io6 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - var i2 = 0; - do { - var a = this.build[i2]; - var b = other.build[i2]; - debug4("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); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); } - } while (++i2); - }; - SemVer.prototype.inc = function(release, identifier) { - switch (release) { - 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; - } + } + _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}`; } - if (i2 === -1) { - this.prerelease.push(0); + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - } - if (identifier) { - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } } - break; - default: - throw new Error("invalid increment argument: " + release); - } - this.format(); - this.raw = this.version; - return this; - }; - exports2.inc = inc; - function inc(version, release, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; } - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; + 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 defaultResult; + return this.args; } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; + _endsWith(str2, end) { + return str2.endsWith(end); } - 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 = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(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 = rcompare; - function rcompare(a, b, loose) { - return compare2(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 compare2(a, b, loose) > 0; - } - exports2.lt = lt; - function lt(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports2.gte = gte5; - function gte5(a, b, loose) { - return compare2(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(a, b, loose) { - return compare2(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(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 - }; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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(""); } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug4("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; + _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(""); } - debug4("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); + _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; } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; + _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; } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); + /** + * 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 = path7.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve5, 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) + os2.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 { + resolve5(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug4("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; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug4("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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); } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); + __setModuleDefault2(result, mod); + return result; }; - 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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); - testComparator = remainingComparators.pop(); } - return result; - } - exports2.toComparators = toComparators; - function toComparators(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug4("comp", comp, options); - comp = replaceCarets(comp, options); - debug4("caret", comp); - comp = replaceTildes(comp, options); - debug4("tildes", comp); - comp = replaceXRanges(comp, options); - debug4("xrange", comp); - comp = replaceStars(comp, options); - debug4("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) { - debug4("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) { - debug4("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } - debug4("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) { - debug4("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_2, M, m, p, pr) { - debug4("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) { - debug4("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"; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } else { - debug4("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"; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - debug4("caret return", ret); - return ret; + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - function replaceXRanges(comp, options) { - debug4("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) { - debug4("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 = ""; + }; + 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.`); } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m = 0; + 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 _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - 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; - } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - 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; - } - debug4("xRange return", ret); - return ret; + }; + 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 + }; }); } - function replaceStars(comp, options) { - debug4("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - 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; + 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); } - return (from + " " + to).trim(); - } - Range2.prototype.test = function(version) { - if (!version) { - return false; + __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(resolve5) { + resolve5(value); + }); } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve5(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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - return false; + 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; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug4(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve5(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_utils5(); + var os2 = __importStar2(require("os")); + var path7 = __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 exportVariable6(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path7.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } + 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 setOutput(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(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } + return result; }); - return min; } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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/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]; + } }; } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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); - } - }); + 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); } - if (minver && range.test(minver)) { - return minver; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core14 = __importStar2(require_core2()); + 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; + core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + } + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core14.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + } } - return null; + return result; } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - } - exports2.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); - } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); - } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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); } - if (satisfies2(version, range, options)) { - return false; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path7 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname3(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + let result = path7.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname3; + 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)}`; } - }); - 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; + } 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)}`; } } - return true; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path7.sep; + } + return root + itemPath; } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(version, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); } - exports2.intersects = intersects; - function intersects(r1, r2, options) { - r1 = new Range2(r1, options); - r2 = new Range2(r2, options); - return r1.intersects(r2); + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.hasRoot = hasRoot; + function normalizeSeparators(p) { + p = p || ""; + if (IS_WINDOWS) { + p = p.replace(/\//g, "\\"); + const isUnc = /^\\\\+[^\\]/.test(p); + return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); } - if (typeof version === "number") { - version = String(version); + return p.replace(/\/\/+/g, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; } - if (typeof version !== "string") { - return null; + p = normalizeSeparators(p); + if (!p.endsWith(path7.sep)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } - safeRe[t.COERCERTL].lastIndex = -1; + if (p === path7.sep) { + return p; } - if (match === null) { - return null; + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -33871,932 +33289,1220 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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; + } + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + } + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); } + return res; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob2 = __importStar4(require_glob()); - var io6 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs7 = __importStar4(require("fs")); - var path6 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path6.join(baseLocation, "actions", "temp"); - } - const dest = path6.join(tempDirectory, crypto.randomUUID()); - yield io6.mkdirP(dest); - return dest; - }); + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs7.statSync(filePath).size; + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - 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 = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path6.relative(workspace, file).replace(new RegExp(`\\${path6.sep}`, "g"), "/"); - core14.debug(`Matched: ${relativeFile}`); - if (relativeFile === "") { - paths.push("."); - } else { - paths.push(`${relativeFile}`); + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.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 = str2.indexOf(b, i + 1); } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } + i = ai < bi && ai >= 0 ? ai : bi; } - return paths; - }); - } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs7.unlink)(filePath); - }); - } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() - } - }); - } catch (err) { - core14.debug(err.message); + if (begs.length) { + result = [left, right]; } - versionOutput = versionOutput.trim(); - core14.debug(versionOutput); - return versionOutput; - }); + } + return result; } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core14.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; - } - }); + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs7.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; - }); + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - return value; + parts.push.apply(parts, p); + return parts; } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getCacheVersion = getCacheVersion; - 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; + function embrace(str2) { + return "{" + str2 + "}"; } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } 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}`); + N = concatMap(n, function(el) { + return expand(el, false); + }); } - 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; + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); } } - 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]"); + return expansions; } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path7 = (function() { + try { + return require("path"); + } catch (e) { } - __setModuleDefault4(result, mod); - return result; + })() || { + sep: "/" }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + minimatch.sep = path7.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } }; - 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); } - 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); + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(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", () => { - resolve5(output.toString()); - }); - })); - }); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve5(Buffer.concat(chunks)); - }); - })); - }); + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path7.sep !== "/") { + pattern = pattern.split(path7.sep).join("/"); } + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + Minimatch.prototype.debug = function() { }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + Minimatch.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 set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug4() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; - } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = 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++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern = "*"; } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; + } + self2.debug("clearStateChar %j %j", stateChar, re); + stateChar = false; + } } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + 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 && reSpecials[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; + } + 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 (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; + } } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); + 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 === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - /** - * 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 __awaiter4(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); - }); + clearStateChar(); + if (escaping) { + re += "\\\\"; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + if (re !== "" && hasMagic) { + re = "(?=.)" + re; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, data); - } else { - return response; - } + if (addPatternStart) { + 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; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path7.sep !== "/") { + f = f.split(path7.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; } - 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) { + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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); + this.debug("globstar swallow a segment, and continue"); + fr++; } - } 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(); + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + return false; } - this._disposed = true; + 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 regExpEscape(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 || 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.Path = void 0; + var path7 = __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 { /** - * Raw request. - * @param info - * @param data + * Constructs a Path + * @param itemPath Path or array of segments */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve5(res); - } + 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(path7.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename2 = path7.basename(remaining); + this.segments.unshift(basename2); + remaining = dir; + dir = pathHelper.dirname(remaining); } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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(path7.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } } /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * Converts the path to it's string representation */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path7.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path7.sep; } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + result += this.segments[i]; } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + 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 || 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.Pattern = void 0; + var os2 = __importStar2(require("os")); + var path7 = __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, homedir) { + 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}`; } } - const req = info7.httpModule.request(info7.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: ${info7.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path7.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(path7.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path7.sep}`; + } } else { - req.end(); + 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; } /** - * 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 + * Indicates whether the pattern may match descendants of the specified path */ - 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; + partialMatch(itemPath) { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + if (pathHelper.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); + /** + * 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, homedir) { + (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(`.${path7.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path7.sep}`)) { + homedir = homedir || os2.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 info7; + return pathHelper.normalizeSeparators(pattern); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; - } - _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 https2.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 __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve5(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + /** + * 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; + } else { + set2 += c2; } - 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; + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - 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})`; + if (set2) { + literal += set2; + i = closed; + continue; } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve5(response); } - })); - }); + } + literal += c; + } + return literal; + } + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.Pattern = Pattern; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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(path7, level) { + this.path = path7; + 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -34823,3172 +34529,2309 @@ var require_auth2 = __commonJS({ 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; + 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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ value: v2, done: d }); + }, reject); } }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - // 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"); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - // 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")}`; + function fulfill(value) { + resume("next", value); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + function reject(value) { + resume("throw", value); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + exports2.DefaultGlobber = void 0; + var core14 = __importStar2(require_core2()); + var fs8 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path7 = __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); } - 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; + getSearchPaths() { + return this.searchPaths.slice(); } - 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; + glob() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } } + return result; }); - this._orderedPolicies = void 0; - return removedPolicies; - } - sendRequest(httpClient, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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); - } + 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("**"))); } } - if (options.beforePolicies) { - for (const beforePolicyName of options.beforePolicies) { - const beforeNode = policyMap.get(beforePolicyName); - if (beforeNode) { - beforeNode.dependsOn.add(node); - node.dependants.add(beforeNode); + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core14.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs8.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } + throw err; } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - } - function walkPhase(phase) { - phase.hasRun = true; - for (const node of phase.policies) { - if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) { + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { 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); + const stats = yield __await2( + _DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + if (!stats) { + continue; } - } - } - function walkPhases() { - for (const phase of orderedPhases) { - walkPhase(phase); - if (phase.policies.size > 0 && phase !== noPhase) { - if (!noPhase.hasRun) { - walkPhase(noPhase); + if (options.excludeHiddenFiles && path7.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await2(item.path); + } else if (!partialMatch) { + continue; } - return; + const childLevel = item.level + 1; + const childItems = (yield __await2(fs8.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path7.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); } - if (phase.hasAfterPolicies) { - walkPhase(noPhase); + } + }); + } + /** + * 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)); } } - } - 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."); + 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 fs8.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core14.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 fs8.promises.lstat(item.path); } - } - return result; + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs8.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + if (traversalChain.some((x) => x === realPath)) { + core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; + }); } }; - function createEmptyPipeline() { - return HttpPipeline.create(); - } + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os.EOL}`); - } - 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 - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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]; + } }; } - } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + 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); } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + __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(resolve5) { + resolve5(value); + }); } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } - return false; - } - function disable() { - const result = enabledString || ""; - enable(""); - return result; - } - function createDebugger(namespace) { - const newDebugger = Object.assign(debug5, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend: extend3 - }); - function debug5(...args) { - if (!newDebugger.enabled) { - return; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; - } - return false; - } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; - } - var debug4 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug4("azure"); - AzureLogger.log = (...args) => { - debug4.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } - } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + 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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); + }); + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); - } + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ value: v2, done: d }); + }, reject); } - debug4.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; - } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core14 = __importStar2(require_core2()); + var fs8 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path7 = __importStar2(require("path")); + function hashFiles2(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core14.info : core14.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path7.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs8.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs8.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_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 ""; + } }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug4.disable(); - debug4.enable(enabledNamespaces2 + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); + exports2.hashFiles = hashFiles2; } }); -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve5, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - try { - buildPromise((x) => { - removeListeners(); - resolve5(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/delay.js -var require_delay = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/delay.js"(exports2) { - "use strict"; + }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.calculateRetryDelay = calculateRetryDelay; - var createAbortablePromise_js_1 = require_createAbortablePromise(); - var random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve5) => { - token = setTimeout(resolve5, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage + exports2.hashFiles = exports2.create = void 0; + 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 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/@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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } + exports2.create = create3; + function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + 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); + }); } + exports2.hashFiles = hashFiles2; } }); -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@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 debug4; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug4 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug4 = function() { + }; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + 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++; } - function getErrorMessage2(e) { - if (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}`; + 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; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); - } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + 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++) { + debug4(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); + } } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return 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; } - return true; - } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID() { - return uuidFunction(); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; + 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); + } + debug4("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; } - seen.add(value); } - return value; - }, 2); + return id; + }); } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url = new URL(value); - if (!url.search) { - return value; - } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); - } - } - return url.toString(); + 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("."); } - 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; + return this.version; + }; + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug4("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - 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; + 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); }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); - } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; - } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - 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(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var i2 = 0; + do { + var a = this.prerelease[i2]; + var b = other.prerelease[i2]; + debug4("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); } - } - function step(result) { - result.done ? resolve5(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]); + var i2 = 0; + do { + var a = this.build[i2]; + var b = other.build[i2]; + debug4("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); }; - } - 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; + SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier); 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; + 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); } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _2.label = op[1]; - break; + this.inc("pre", identifier); + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; } - if (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; } - if (t[2]) _2.ops.pop(); - _2.trys.pop(); - continue; + 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: " + release); + } + this.format(); + this.raw = this.version; + return this; + }; + exports2.inc = inc; + function inc(version, release, loose, identifier) { + if (typeof loose === "string") { + identifier = loose; + loose = void 0; + } + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; } - 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 }; + exports2.diff = diff; + function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(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; + } } - }; - 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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } - 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]; + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - } - 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]); + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } - 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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]; + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + exports2.compare = compare2; + function compare2(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - 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); - } + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare2(a, b, true); } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + 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); } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os.arch()}-${os.type()}-${os.release()})`); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare2(b, a, loose); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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(" "); + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - 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; + exports2.gt = gt; + function gt(a, b, loose) { + return compare2(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); - } - }; + exports2.lt = lt; + function lt(a, b, loose) { + return compare2(a, b, loose) < 0; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - exports2.isReadableStream = isReadableStream; - exports2.isBlob = isBlob; - function isNodeReadableStream(x) { - return Boolean(x && typeof x["pipe"] === "function"); + exports2.eq = eq; + function eq(a, b, loose) { + return compare2(a, b, loose) === 0; } - function isWebReadableStream(x) { - return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); + exports2.neq = neq; + function neq(a, b, loose) { + return compare2(a, b, loose) !== 0; } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare2(a, b, loose) >= 0; } - function isBlob(x) { - return typeof x.stream === "function"; + exports2.lte = lte; + function lte(a, b, loose) { + return compare2(a, b, loose) <= 0; } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); + 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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function createFileFromStream(stream, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - return s; - }, [rawContent]: stream }); - } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); + } + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); + } + comp = comp.trim().split(/\s+/).join(" "); + debug4("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; } else { - return new File([content], name, options); + this.value = this.operator + this.semver.version; } + debug4("comp", this); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); - } - yield yield tslib_1.__await(value); - } - } finally { - reader.releaseLock(); - } - }); - } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); + 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); } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; } - } - function ensureNodeStream(stream) { - if (stream instanceof ReadableStream) { - makeAsyncIterable(stream); - return node_stream_1.Readable.fromWeb(stream); + if (!m[2]) { + this.semver = ANY; } else { - return stream; + this.semver = new SemVer(m[2], this.options.loose); } - } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); - } else { - return ensureNodeStream(source); + }; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug4("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; } - } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } - } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; - } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } } - 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; + 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"); } - } - function getTotalLength(sources) { - let total = 0; - for (const source of sources) { - const partLength = getLength(source); - if (partLength === void 0) { - return void 0; + 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(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; } else { - total += partLength; + return new Range2(range.raw, options); } } - return total; - } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + if (range instanceof Comparator) { + return new Range2(range.value, options); } - request.body = await (0, concat_js_1.concat)(sources); + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - 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`); + 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(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug4("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); + }); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; + }; + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); + } + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.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; } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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}`); + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); + } + function parseComparator(comp, options) { + debug4("comp", comp, options); + comp = replaceCarets(comp, options); + debug4("caret", comp); + comp = replaceTildes(comp, options); + debug4("tildes", comp); + comp = replaceXRanges(comp, options); + debug4("xrange", comp); + comp = replaceStars(comp, options); + debug4("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) { + debug4("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) { + debug4("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + } + debug4("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) { + debug4("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_2, M, m, p, pr) { + debug4("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"; } - 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`); + } else if (pr) { + debug4("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"; } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); + } else { + debug4("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 { - boundary = generateBoundary(); + ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); } - }; + debug4("caret return", ret); + return ret; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __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; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; + function replaceXRanges(comp, options) { + debug4("replaceXRanges", comp, options); + return comp.split(/\s+/).map(function(comp2) { + return replaceXRange(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay(delayInMs, value, options) { - return new Promise((resolve5, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); - }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); + 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) { + debug4("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 = "*"; } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); + } else if (gtlt && anyX) { + if (xm) { + m = 0; } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve5(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + 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; } + debug4("xRange return", ret); + return ret; }); } - function parseHeaderValueAsNumber(response, headerName) { - const value = response.headers.get(headerName); - if (!value) - return; - const valueAsNum = Number(value); - if (Number.isNaN(valueAsNum)) - return; - return valueAsNum; + function replaceStars(comp, options) { + debug4("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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; + 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(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug4(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } } } - 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 (_a) { - return void 0; + return false; } + return true; } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; + } + return range.test(version); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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 { - retryAfterInMs - }; } - }; + }); + return max; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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); } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + }); + return min; } - function isSystemError(err) { - if (!err) { - return false; + exports2.minVersion = minVersion; + function minVersion(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 { - 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; + compver.prerelease.push(0); } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.url = redirectTo; - continue retryRequest; + compver.raw = compver.format(); + /* fallthrough */ + case "": + case ">=": + if (!minver || gt(minver, compver)) { + minver = compver; } - } - 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; - } + break; + case "<": + case "<=": + break; + /* istanbul ignore next */ + default: + throw new Error("Unexpected operation: " + comparator.operator); } - } - }; + }); + } + if (minver && range.test(minver)) { + return minver; + } + return null; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; + } } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies2(version, range, options)) { + return false; + } + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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; } } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + return true; + } + exports2.prerelease = prerelease; + function prerelease(version, options) { + var parsed = parse(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; } - /** - * 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)); + if (typeof version === "number") { + version = String(version); } - /** - * Remove the header with the provided headerName. - * @param name - The name of the header to remove. - */ - delete(name) { - this._headersMap.delete(normalizeName(name)); + if (typeof version !== "string") { + return null; } - /** - * 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; + options = options || {}; + var match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } - return result; - } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJSON({ preserveCase: true })); + safeRe[t.COERCERTL].lastIndex = -1; } - /** - * Iterate over tuples of header [name, value] pairs. - */ - [Symbol.iterator]() { - return headerIterator(this._headersMap); + if (match === null) { + return null; } - }; - function createHttpHeaders(rawHeaders) { - return new HttpHeadersImpl(rawHeaders); + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js"(exports2) { +// 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.formDataPolicyName = void 0; - exports2.formDataPolicy = formDataPolicy; - var core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); - } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); - } - }; - } - 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, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); - } - } - } - request.multipartBody = { parts }; - } + 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); } }); -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); - }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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"); +// 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]; + } }; } - 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 hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; + 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]); } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + __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(resolve5) { + resolve5(value); + }); } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug4(...args) { - if (!debug4.enabled) { - return; - } - const self2 = debug4; - 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"); + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); } - debug4.namespace = namespace; - debug4.useColors = createDebug.useColors(); - debug4.color = createDebug.selectColor(namespace); - debug4.extend = extend3; - debug4.destroy = createDebug.destroy; - Object.defineProperty(debug4, "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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug4); } - return debug4; + function step(result) { + result.done ? resolve5(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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); + }); + }; } - function extend3(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ value: v2, done: d }); + }, reject); } - 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)); + }; + 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 core14 = __importStar2(require_core()); + var exec3 = __importStar2(require_exec()); + var glob2 = __importStar2(require_glob()); + var io6 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs8 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 { - createDebug.names.push(ns); + if (process.platform === "darwin") { + baseLocation = "/Users"; + } else { + baseLocation = "/home"; + } } + tempDirectory = path7.join(baseLocation, "actions", "temp"); } - } - 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++; + const dest = path7.join(tempDirectory, crypto2.randomUUID()); + yield io6.mkdirP(dest); + return dest; + }); + } + function getArchiveFileSizeInBytes(filePath) { + return fs8.statSync(filePath).size; + } + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path7.relative(workspace, file).replace(new RegExp(`\\${path7.sep}`, "g"), "/"); + core14.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); } else { - searchIndex++; - templateIndex++; + paths.push(`${relativeFile}`); } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; + return paths; + }); + } + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs8.unlink)(filePath); + }); + } + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core14.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) { + core14.debug(err.message); } - 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; - } + versionOutput = versionOutput.trim(); + core14.debug(versionOutput); + return versionOutput; + }); + } + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core14.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } + }); + } + 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 (fs8.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } - return false; + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - function coerce3(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - 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`."); + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - createDebug.enable(createDebug.load()); - return createDebug; + components.push(versionSalt); + return crypto2.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; } - 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+)/); +// 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]]; } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); + 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 context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.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], context2); + 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; } - exports2.log = console.debug || console.log || (() => { + } + 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(resolve5) { + resolve5(value); }); - function save(namespaces) { + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { + step(generator.next(value)); + } catch (e) { + reject(e); } } - function load2() { - let r; + function rejected(value) { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return r; } - function localstorage() { - try { - return localStorage; - } catch (error4) { - } + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.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); + 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]); }; } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os = 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 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; } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; + 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 }; } - 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 = os.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; + }; + 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; } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); + } + 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]; } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) + } + 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); }; } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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]; + 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 { - 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 (error4) { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - 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(); + } + 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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); - } - obj[prop] = val2; - 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(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } + }; + } + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ 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]; } - function load2() { - return process.env.DEBUG; + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function init(debug4) { - debug4.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug4.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { + try { + inner.call(this); + } catch (e) { + return Promise.reject(e); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + env.stack.push({ value, dispose, async }); + } else if (async) { + env.stack.push({ async: true }); } -}); - -// 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(); + 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; } -}); - -// node_modules/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + return next(); +} +function __rewriteRelativeImportExtension(path7, preserveJsx) { + if (typeof path7 === "string" && /^\.\.?\//.test(path7)) { + return path7.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path7; +} +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)) { @@ -38000,980 +36843,760 @@ var require_helpers3 = __commonJS({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + }); + __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; }; + 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.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - async function toBuffer(stream) { - let length = 0; - const chunks = []; - for await (const chunk of stream) { - length += chunk.length; - chunks.push(chunk); - } - return Buffer.concat(chunks, length); - } - exports2.toBuffer = toBuffer; - async function json2(stream) { - const buf = await toBuffer(stream); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; + 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}`); } - exports2.json = json2; - function req(url, opts = {}) { - const href = typeof url === "string" ? url : url.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); - const promise = new Promise((resolve5, reject) => { - req2.once("response", resolve5).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) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + 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 }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); + } } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = Symbol("AgentBaseInternalState"); - var Agent = class extends http.Agent { - constructor(opts) { - super(opts); - this[INTERNAL] = {}; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - /** - * 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); + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - // 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] = []; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; } - 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 index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; } } - // 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); + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - 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); + 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; } } - 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"); + 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; } - return socket; } - get defaultPort() { - return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); - } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + 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(debug4, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug4(...args) { + if (!newDebugger.enabled) { + return; } - } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); - } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; } + newDebugger.log(...args); } - }; - exports2.Agent = Agent; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; + } + function extend3(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; + } + exports2.default = debugObj; } }); -// 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) { +// 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"; - var __importDefault4 = 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 = __importDefault4(require_src()); - var debug4 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve5, 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); + 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(",")}`); } - function onend() { - cleanup(); - debug4("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + logLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } } - function onerror(err) { - cleanup(); - debug4("onerror %o", err); - reject(err); + 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 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) { - debug4("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; - } - } - debug4("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve5({ - connect: { - statusCode, - statusText, - headers - }, - buffered - }); + } + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); + } + function createLogger(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); } - socket.on("error", onerror); - socket.on("end", onend); - read(); - }); + registeredLoggers.add(logger); + return logger; + } + function contextGetLogLevel() { + return logLevel; + } + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; + } + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/https-proxy-agent/dist/index.js -var require_dist3 = __commonJS({ - "node_modules/https-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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(exports2, "__esModule", { value: true }); + exports2.createHttpHeaders = createHttpHeaders; + function normalizeName(name) { + return name.toLowerCase(); + } + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + } + 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]); + } + } } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug4 = (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 - }; + /** + * 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() }); } - return options; - }; - var HttpsProxyAgent = 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 ?? {}; - debug4("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 ? omit(opts, "headers") : null, - host, - port - }; + /** + * 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; } /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. + * 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. */ - async connect(req, opts) { - const { proxy } = this; - if (!opts.host) { - throw new TypeError('No "host" provided'); - } - let socket; - if (proxy.protocol === "https:") { - debug4("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + 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 { - debug4("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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) { - debug4("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + for (const [normalizedName, entry] of this._headersMap) { + result[normalizedName] = entry.value; } - return socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug4("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + 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); } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); } - function omit(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/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/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; }; + 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.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug4 = (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 ?? {}; - debug4("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 ? omit(opts, "headers") : null, - host, - port - }; - } - addRequest(req, opts) { - req._header = null; - this.setRequestProps(req, opts); - super.addRequest(req, opts); + 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; } - setRequestProps(req, opts) { - const { proxy } = this; - const protocol = opts.secureEndpoint ? "https:" : "http:"; - const hostname = req.getHeader("host") || "localhost"; - const base = `${protocol}//${hostname}`; - const url = new url_1.URL(req.path, base); - if (opts.port !== 80) { - url.port = String(opts.port); + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - req.path = String(url); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - for (const name of Object.keys(headers)) { - const value = headers[name]; - if (value) { - req.setHeader(name, value); + 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; } - async connect(req, opts) { - req._header = null; - if (!req.path.includes("://")) { - this.setRequestProps(req, opts); - } - let first; - let endOfHeaders; - debug4("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug4("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); - debug4("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug4("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug4("Creating `net.Socket`: %o", this.connectOpts); - socket = net.connect(this.connectOpts); - } - await (0, events_1.once)(socket, "connect"); - return socket; + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); } - }; - HttpProxyAgent.protocols = ["http", "https"]; - exports2.HttpProxyAgent = HttpProxyAgent; - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - return ret; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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_log(); - 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; + clone() { + return new _HttpPipeline(this._policies); } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + static create() { + return new _HttpPipeline(); } - let isBypassedFlag = false; - for (const pattern of noProxyList) { - if (pattern[0] === ".") { - if (host.endsWith(pattern)) { - isBypassedFlag = true; + 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 { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } else { - if (host === pattern) { - isBypassedFlag = true; + return noPhase; } } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + 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); } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + 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); + } + } + } } - request.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(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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); + } } - return next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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); + } } - return next(request); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __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; - exports2.tlsPolicyName = "tlsPolicy"; - function tlsPolicy(tlsSettings) { - return { - name: exports2.tlsPolicyName, - sendRequest: async (req, next) => { - if (!req.tlsSettings) { - req.tlsSettings = tlsSettings; + 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 next(req); } - }; - } - } -}); - -// 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.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; - } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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; + return result; } }; - 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 - }; + function createEmptyPipeline() { + return HttpPipeline.create(); + } } }); -// node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js -var require_instrumenter = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js"(exports2) { +// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } - exports2.getInstrumenter = getInstrumenter; } }); -// node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js -var require_tracingClient = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js"(exports2) { +// 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.createTracingClient = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); - } - function parseTraceparentHeader(traceparentHeader) { - return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); - } - function createRequestHeaders(tracingContext) { - return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + 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 { - startSpan, - withSpan, - withContext, - parseTraceparentHeader, - createRequestHeaders - }; + return false; } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/inspect.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.custom = void 0; @@ -38982,18 +37605,196 @@ var require_inspect = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { +// 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.RestError = void 0; - exports2.isRestError = isRestError; - var core_util_1 = require_commonjs2(); + 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 url = new URL(value); + if (!url.search) { + return value; + } + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } + } + return url.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"; @@ -39001,212 +37802,86 @@ var require_restError = __commonJS({ 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); } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } }; exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; function isRestError(e) { if (e instanceof RestError) { return true; } - return (0, core_util_1.isError)(e) && e.name === "RestError"; + return (0, error_js_1.isError)(e) && e.name === "RestError"; } } }); -// 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) { +// 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.tracingPolicyName = void 0; - exports2.tracingPolicy = tracingPolicy; - var core_tracing_1 = require_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.statusCode); - } - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + exports2.uint8ArrayToString = uint8ArrayToString; + exports2.stringToUint8Array = stringToUint8Array; + function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); } - 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); - } - span.setStatus({ - status: "success" - }); - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + function stringToUint8Array(value, format) { + return Buffer.from(value, format); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { +// 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.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 multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { + "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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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(stream) { + if (stream.readable === false) { + return Promise.resolve(); + } return new Promise((resolve5) => { const handler = () => { resolve5(); @@ -39223,6 +37898,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -39236,25 +37913,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -39263,13 +37937,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -39293,8 +37970,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -39316,7 +37996,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -39334,9 +38014,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -39345,29 +38024,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url = new URL(request.url); const isInsecure = url.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url.hostname, path: `${url.pathname}${url.search}`, port: url.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve5, reject) => { - const req = isInsecure ? http.request(options, resolve5) : https2.request(options, resolve5); + const req = isInsecure ? node_http_1.default.request(options, resolve5) : node_https_1.default.request(options, resolve5); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -39388,30 +38066,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -39434,11 +38113,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream.pipe(inflate); return inflate; } @@ -39458,7 +38137,7 @@ var require_nodeHttpClient = __commonJS({ resolve5(Buffer.concat(buffer).toString("utf8")); }); stream.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -39489,9 +38168,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -39502,10075 +38181,18305 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.systemErrorRetryPolicyName = void 0; - exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; - function systemErrorRetryPolicy(options = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; + 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.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest + name: exports2.userAgentPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } }; } } }); -// 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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + exports2.decompressResponsePolicyName = void 0; + exports2.decompressResponsePolicy = decompressResponsePolicy; + exports2.decompressResponsePolicyName = "decompressResponsePolicy"; + function decompressResponsePolicy() { + return { + name: exports2.decompressResponsePolicyName, + async sendRequest(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; + } +}); + +// 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 = delay; + exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; + var AbortError_js_1 = require_AbortError(); + var StandardAbortMessage = "The operation was aborted."; + function delay(delayInMs, value, options) { + return new Promise((resolve5, 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); } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + }; + onAborted = () => { + if (timer) { + clearTimeout(timer); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + removeListeners(); + return rejectOnAbort(); + }; + if (options?.abortSignal && options.abortSignal.aborted) { + return rejectOnAbort(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve5(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - 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; + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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; + } } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(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; +}); + +// 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 hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug4(...args) { + if (!debug4.enabled) { + return; } - if (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + const self2 = debug4; + 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"); } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + debug4.namespace = namespace; + debug4.useColors = createDebug.useColors(); + debug4.color = createDebug.selectColor(namespace); + debug4.extend = extend3; + debug4.destroy = createDebug.destroy; + Object.defineProperty(debug4, "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 (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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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 __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); + if (typeof createDebug.init === "function") { + createDebug.init(debug4); + } + return debug4; + } + function extend3(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; } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); +}); + +// 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 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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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]; + args.splice(lastC, 0, c); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { + function load2() { + let r; try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error3) { } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + function localstorage() { 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); + return localStorage; + } catch (error3) { } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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 __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - } }; + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 }; } }); -// node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js -var require_azureKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js"(exports2) { +// node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "node_modules/has-flag/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureKeyCredential = void 0; - var AzureKeyCredential = class { - /** - * 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; - } + 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); }; - 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) { +// node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs2(); - function isKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; + var os2 = 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; } - } -}); - -// 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + 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); } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + } + function translateLevel(level) { + if (level === 0) { + return false; } - /** - * 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"); + 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 = os2.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } - this._name = name; - this._key = key; + return 1; } - /** - * 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"); + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; } - this._name = newName; - this._key = newKey; + return min; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } - /** - * 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; + if (env.COLORTERM === "truecolor") { + return 3; } - /** - * 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"); + 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; } - this._signature = newSignature; } - }; - exports2.AzureSASCredential = AzureSASCredential; - function isSASCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; + 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(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); } + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) + }; } }); -// 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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(util.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 init(debug4) { + debug4.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug4.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; } }); -// node_modules/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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/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/@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) { +// 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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); - } - }; + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + async function toBuffer(stream) { + let length = 0; + const chunks = []; + for await (const chunk of stream) { + length += chunk.length; + chunks.push(chunk); + } + return Buffer.concat(chunks, length); } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); + exports2.toBuffer = toBuffer; + async function json2(stream) { + const buf = await toBuffer(stream); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; + exports2.json = json2; + function req(url, opts = {}) { + const href = typeof url === "string" ? url : url.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); + const promise = new Promise((resolve5, reject) => { + req2.once("response", resolve5).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; + } + exports2.req = req; } }); -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// node_modules/agent-base/dist/index.js +var require_dist = __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 result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - 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 __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(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]); + 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); }; - } - 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; + 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 (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + if (typeof options.protocol === "string") { + return options.protocol === "https:"; } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + } + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } - 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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 __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + // 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); }); - }; - 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 __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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 __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + 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; } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); - }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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]; + 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; } - return t; - }; - return __assign3.apply(this, arguments); - }; - __createBinding3 = 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]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 }; + exports2.Agent = Agent; } }); -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); - } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); - } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); - } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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) { +// 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.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; - } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); - } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, 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 = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; - } - } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + exports2.parseProxyResponse = void 0; + var debug_1 = __importDefault2(require_src()); + var debug4 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve5, 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(); + debug4("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); + } + function onerror(err) { + cleanup(); + debug4("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) { + debug4("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; + } } + debug4("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve5({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - 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) + socket.on("error", onerror); + socket.on("end", onend); + read(); }); } - exports2.flattenResponse = flattenResponse; + exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/@azure/core-client/dist/commonjs/serializer.js -var require_serializer = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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.MapperTypeNames = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + 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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug4 = (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 + }; } - /** - * @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}.`); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug4("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 ? omit(opts, "headers") : null, + host, + port }; - 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 + * Called when the node-core HTTP client library is creating a + * new HTTP request. */ - serialize(mapper, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : 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) { - object = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + async connect(req, opts) { + const { proxy } = this; + if (!opts.host) { + throw new TypeError('No "host" provided'); } - if (object === void 0 || object === null) { - payload = object; + let socket; + if (proxy.protocol === "https:") { + debug4("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + debug4("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - let payload; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - 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); - } + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r +`; } - if (mapper.isConstant) { - payload = mapper.defaultValue; + 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) { + debug4("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; } - return payload; + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug4("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } } - return str2.substr(0, len); + return ret; } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var debug4 = (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 ?? {}; + debug4("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 ? omit(opts, "headers") : null, + host, + port + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + addRequest(req, opts) { + req._header = null; + this.setRequestProps(req, opts); + super.addRequest(req, opts); } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; + setRequestProps(req, opts) { + const { proxy } = this; + const protocol = opts.secureEndpoint ? "https:" : "http:"; + const hostname = req.getHeader("host") || "localhost"; + const base = `${protocol}//${hostname}`; + const url = new url_1.URL(req.path, base); + if (opts.port !== 80) { + url.port = String(opts.port); + } + req.path = String(url); + const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - 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.`); - } + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); } - } - 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(); + let first; + let endOfHeaders; + debug4("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug4("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); + debug4("Output buffer: %o", req.outputData[0].data); } - 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.`); + let socket; + if (this.proxy.protocol === "https:") { + debug4("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug4("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - value = base64.encodeByteArray(value); + await (0, events_1.once)(socket, "connect"); + return socket; } - 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.`); + }; + HttpProxyAgent.protocols = ["http", "https"]; + exports2.HttpProxyAgent = HttpProxyAgent; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); - } - } + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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 value; + return void 0; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - 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}.`); + 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; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + const host = new URL(uri).hostname; + if (bypassedMap?.has(host)) { + return bypassedMap.get(host); } - const tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + let isBypassedFlag = false; + for (const pattern of noProxyList) { + if (pattern[0] === ".") { + if (host.endsWith(pattern)) { + isBypassedFlag = true; } else { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); + } else { + return stream; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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 stream of streams) { + for await (const chunk of stream) { + yield chunk; } } - } 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]; - } - } + })()); + }; + } + } +}); + +// 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 instance; + return result; } - 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}`); + 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; } - if (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); + } + 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 tempDictionary; } - return responseBody; + return total; } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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 = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; - } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); - } - return tempArray; + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); } - return responseBody; + request.body = await (0, concat_js_1.concat)(sources); } - 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); - } - } - } + 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`); } - return void 0; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } } }); -// node_modules/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; + exports2.apiVersionPolicyName = void 0; + exports2.apiVersionPolicy = apiVersionPolicy; + exports2.apiVersionPolicyName = "ApiVersionPolicy"; + function apiVersionPolicy(options) { + return { + name: exports2.apiVersionPolicyName, + sendRequest: (req, next) => { + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; } + return next(req); } - } 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; - } + }; + } + } +}); + +// 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(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url = new URL(request.url); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; } } - return value; + return false; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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]; + function emitInsecureConnectionWarning() { + const warning9 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning9); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning9); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } else { - break; + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info7 = state_js_1.state.operationRequestMap.get(request); - if (!info7) { - info7 = {}; - state_js_1.state.operationRequestMap.set(request, info7); - } - return info7; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; + } + } +}); + +// 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.deserializationPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } } - return result; + return pipeline; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); } - return result; + return cachedHttpClient; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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]; + } } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if (descriptor.contentType === null) { + return void 0; } - 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 }); - } + if (descriptor.contentType) { + return descriptor.contentType; } - return parsedResponse; + 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 isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escapeDispositionField(value) { + return JSON.stringify(value); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; + 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; } } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; - } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; } - return { error: error4, shouldReturnResponse: false }; + return disposition; } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; - } + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); } - 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + if ((0, typeGuards_js_1.isBinaryBody)(body)) { + return body; } - return result; + 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}`); } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + 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); } - return result; + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } + 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_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + const headers = response.headers.toJSON(); + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; + if (options?.onResponse) { + options.onResponse({ ...response, request, rawHeaders: headers, parsedBody }); } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + return { + request, + 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, rawHeaders }, e); } + throw e; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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; + 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 { - if (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; } } + return "application/json"; } - exports2.serializeRequestBody = serializeRequestBody; - 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 buildPipelineRequest(method, url, 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, + 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 prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - 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_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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) }; } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; } - exports2.createClientPipeline = createClientPipeline; - } -}); - -// 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 = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; + 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 + }); } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path6 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path6.startsWith("/")) { - path6 = path6.substring(1); - } - if (isAbsoluteUrl(path6)) { - requestUrl = path6; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path6); - } + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.toString().replace(/([^:]\/)\/+/g, "$1"); + } + function getQueryParamValue(key, allowReserved, style, param) { + let separator; + if (style === "pipeDelimited") { + separator = "|"; + } else if (style === "spaceDelimited") { + separator = "%20"; + } else { + separator = ","; } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + 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]; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; } - } - return result; - } - function isAbsoluteUrl(url) { - return url.includes("://"); + 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 appendPath(url, pathToAppend) { - if (!pathToAppend) { + function appendQueryParams(url, options = {}) { + if (!options.queryParameters) { return url; } const parsedUrl = new URL(url); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path6 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path6; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } + 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)); } - if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "CSV" || queryParameter.collectionFormat === "Pipes")) { - queryParameterValue = queryParameterValue.join(delimiter); + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); } - result.set(queryParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter), queryParameterValue); + } 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)); } } - return { - queryParams: result, - sequenceParams - }; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return result; + return endpoint; } - function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url; + 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)); } - const parsedUrl = new URL(url); - 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); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - 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}`); + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path7, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path7, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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."); } - } else { - searchPieces.push(`${name}=${value}`); } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); + }; } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, options), { credentialOptions })); + 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 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; + 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/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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)(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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 getLogLevel() { + return context2.getLogLevel(); } - 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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + } +}); + +// 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 + }); } - 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) => Object.assign(Object.assign({}, a), b), {}); + } +}); + +// 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 + }; } - function requestToOptions(request) { + } +}); + +// 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 { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions + 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/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } + 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 + }); } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); + } +}); + +// 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); } - var HttpHeaders = class _HttpHeaders { - 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } + 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"; } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - exports2.toPipelineResponse = toPipelineResponse; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.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) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + 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-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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.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); } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); + 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.requestPolicyFactoryPolicyName, + name: exports2.userAgentPolicyName, async sendRequest(request, 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); + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; + 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); } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + 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/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); +// 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(); } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } + 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); } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + } + } +}); + +// 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.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; + exports2.AbortError = AbortError; } }); -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { +// 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"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } - return i; - } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } + 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((resolve5, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - return true; - } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; - } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; - } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - }; - } - function validateAttrName(attrName) { - return util.isName(attrName); - } - function validateTagName(tagname) { - return util.isName(tagname); - } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; - } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } + if (abortSignal?.aborted) { + return rejectOnAbort(); } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); + try { + buildPromise((x) => { + removeListeners(); + resolve5(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); - } - return { entities, i }; - } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; - } - return [entityName2, val2, i]; - } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; - } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; - } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; - } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; - } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; - } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); + abortSignal?.addEventListener("abort", onAbort); + }); } - module2.exports = readDocType; } }); -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; +// 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 = delay; + exports2.calculateRetryDelay = calculateRetryDelay; + var createAbortablePromise_js_1 = require_createAbortablePromise(); + var util_1 = require_internal3(); + var StandardAbortMessage = "The delay was aborted."; + function delay(timeInMs, options) { + let token; + const { abortSignal, abortErrorMsg } = options ?? {}; + return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve5) => { + token = setTimeout(resolve5, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage + }); } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; + 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 }; } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); + } +}); + +// 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 { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; + let stringified; + try { + if (typeof e === "object" && e) { + stringified = JSON.stringify(e); + } else { + stringified = String(e); } - } else { - return str2; + } catch (err) { + stringified = "[unable to stringify input]"; } + return `Unknown error ${stringified}`; } } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; - } - module2.exports = toNumber; } }); -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } } - return () => false; + return true; + } + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_2, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_2, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } + 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 parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - var replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); - } - return val2; - }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; + function isError(e) { + return tspRuntime.isError(e); } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; + function isObject2(input) { + return tspRuntime.isObject(input); } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; + 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 findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); } else { - return closingIndex + str2.length - 1; + return blob; } } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + function createFileFromStream(stream, name, options = {}) { return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName + ...unimplementedMethods, + type: options.type ?? "", + lastModified: options.lastModified ?? (/* @__PURE__ */ new Date()).getTime(), + webkitRelativePath: options.webkitRelativePath ?? "", + size: options.size ?? -1, + name, + stream: () => { + const s = stream(); + if (isNodeReadableStream(s)) { + throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + } + return s; + }, + [rawContent]: stream }; } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } - } - } + 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 parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } + return source.map((x) => x); } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; + 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } + return tspPolicy.sendRequest(request, next); } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + }; } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; +// 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/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; +// 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); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; + } +}); + +// 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)(); } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + } +}); + +// 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 replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; + 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); + } + return next(request); + } + }; + } + } +}); + +// 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); } + return context2; } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; + var TracingContextImpl = class _TracingContextImpl { + _contextMap; + constructor(initialContext) { + this._contextMap = initialContext instanceof _TracingContextImpl ? new Map(initialContext._contextMap) : /* @__PURE__ */ new Map(); } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); - } - } + 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; } - return { attrStr, val: val2 }; }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; + 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 }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } - } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; + } +}); + +// 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: () => { } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; + }; + } + 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(); } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); + 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(); } } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); - } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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 + }; } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder - }; + 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-xml/dist/commonjs/xml.common.js -var require_xml_common = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.common.js"(exports2) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + 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-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false + name: exports2.tracingPolicyName, + async sendRequest(request, next) { + if (!tracingClient) { + return next(request); + } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; + } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); + } + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; + } + } }; } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + 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 getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { + request.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 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, ""); + 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)}`); + } } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); + 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)}`); } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; + } + } +}); + +// 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 }; } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; } } - return parsedXml; + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); + } + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; - } }); + exports2.wrapAbortSignalLikePolicyName = void 0; + exports2.wrapAbortSignalLikePolicy = wrapAbortSignalLikePolicy; + var wrapAbortSignal_js_1 = require_wrapAbortSignal(); + exports2.wrapAbortSignalLikePolicyName = "wrapAbortSignalLikePolicy"; + function wrapAbortSignalLikePolicy() { + return { + name: exports2.wrapAbortSignalLikePolicyName, + sendRequest: async (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); + } + } + }; + } } }); -// 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) { +// 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.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - }; - exports2.AbortError = AbortError; + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } } }); -// node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); + } + } + }; + } } }); -// node_modules/@azure/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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 index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 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); + exports2.createHttpHeaders = createHttpHeaders; + var ts_http_runtime_1 = require_commonjs(); + function createHttpHeaders(rawHeaders) { + return (0, ts_http_runtime_1.createHttpHeaders)(rawHeaders); } - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } + } +}); + +// 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 }; - 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(); - }); + 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; } } - /** - * 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); + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } - /** - * 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 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(); } - return signal; + }; + 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; } - }; - exports2.AbortController = AbortController2; - exports2.AbortError = AbortError; - exports2.AbortSignal = AbortSignal2; + 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-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { + 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(request, next) { try { - return JSON.parse(serializedState).state; + return [await next(request), void 0]; } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); - } - throw error4; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - 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 isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - 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.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 - })); + 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 buildResult(inputs) { - const { processResult, response, state } = inputs; - return processResult ? processResult(response, state) : response; - } - async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation + 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) }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; - } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; + 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(request, next) { + if (!request.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, + getAccessToken, + logger + }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } } - } - return { response, status }; + }; } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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; } - 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) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; + } +}); + +// 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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); } } + return next(request); } - } + }; } - 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; - } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions + }; + return (await getAccessToken(scopes, getTokenOptions))?.token ?? ""; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - } - } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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; + } +}); + +// 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; } - return void 0; - } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; + /** + * 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; } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; + /** + * 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; } - return error4; + }; + 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"; } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + } +}); + +// 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; } - return void 0; - } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case void 0: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; } - const status = helper(); - return status === "running" && operationLocation === void 0 ? "succeeded" : status; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return 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 - }); - } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + /** + * 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"); } - case "Body": - default: { - return void 0; + 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); - } - case "Body": { - return getProvisioningState(rawResponse); + } +}); + +// 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + this._signature = signature; } - } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + /** + * 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; } - return state.config.resourceLocation; + }; + exports2.AzureSASCredential = AzureSASCredential; + function isSASCredential(credential) { + return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; } - function isOperationError(e) { - return e.name === "RestError"; + } +}); + +// 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"; } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); + function isPopToken(accessToken) { + return accessToken.tokenType === "pop"; } - var createStateProxy$1 = () => ({ - /** - * 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, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } }; } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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; + } +}); + +// 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_utils6 = __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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + } + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + 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]; + } } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (parsedHeaders) { + for (const key of Object.keys(parsedHeaders)) { + arrayResponse[key] = parsedHeaders[key]; + } } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + 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_utils6(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Serializes the Poller operation. + * @deprecated Removing the constraints validation on client side. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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); + } + } } - }; - 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); + * Serialize the given object based on its metadata defined in the mapper * - * // You can assign more local properties here. - * } - * } - * ``` + * @param mapper - The mapper which defines the metadata of the serializable object * - * 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. + * @param object - A valid Javascript object to be serialized * - * 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: + * @param objectName - Name of the serialized object * - * ```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 options - additional options to serialization * - * @param operation - Must contain the basic properties of `PollOperation`. + * @returns A valid serialized Javascript object */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve5, reject) => { - this.resolve = resolve5; - 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; + serialize(mapper, object, 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; } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - } - /** - * 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) - }); + if (mapper.isConstant) { + object = mapper.defaultValue; } - this.processUpdatedState(); + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. + * Deserialize the given object based on its metadata defined in the mapper * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * @param mapper - The mapper which defines the metadata of the serializable object * - * @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. + * @param responseBody - A valid Javascript entity to be deserialized * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @param objectName - Name of the deserialized object * - * @param options - Optional properties passed to the operation's update method. + * @param options - Controls behavior of XML parser and builder. + * + * @returns A valid deserialized Javascript object */ - 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; + 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; } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + 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 (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + if (mapper.isConstant) { + payload = mapper.defaultValue; } + return payload; } - /** - * 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; + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; } - /** - * 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); - }; + return str2.substr(0, len); + } + function bufferToBase64Url(buffer) { + if (!buffer) { + return void 0; } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + if (!(buffer instanceof Uint8Array)) { + throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); } - /** - * 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")); + const str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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 = ""; } } } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + return classes; + } + function dateToUnixTime(d) { + if (!d) { + return void 0; } - /** - * 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; + if (typeof d.valueOf() === "string") { + d = new Date(d); } - /** - * 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; + return Math.floor(d.getTime() / 1e3); + } + function unixTimeToDate(n) { + if (!n) { + return void 0; } - /** - * 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; + 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.`); + } + } } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); + 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.`); } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + 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)}.`); } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve5) => setTimeout(() => resolve5(), this.config.intervalInMs)); + 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); } - }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs7 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); + 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}".`); + } + } } - n.default = e; - return Object.freeze(n); + return value; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs7); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - /** - * 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); + 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}.`); } - /** - * 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); + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" - } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path6 = urlParsed.pathname; - path6 = path6 || "/"; - path6 = escape(path6); - urlParsed.pathname = path6; - 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 = 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"); + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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 }; } - 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); + } else { + tempArray[i] = serializedValue; } - return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas }; } + return tempArray; } - function escape(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 path6 = urlParsed.pathname; - path6 = path6 ? path6.endsWith("/") ? `${path6}${name}` : `${path6}/${name}` : name; - urlParsed.pathname = path6; - 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); - } - } + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); + 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}.`); } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : 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; + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - } - 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; + 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 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}`; + 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 `${pathString}${queryString}`; + return additionalProperties; } - 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; + 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 queries; + return serializer.modelMappers[className]; } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + 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}".`); + } } - 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 !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + return modelProps; } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - const res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay(timeInMs, aborter, abortError) { - return new Promise((resolve5, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); + if (object !== void 0 && object !== null) { + const payload = {}; + const modelProps = resolveModelProperties(serializer, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); + 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) && (object[key] !== void 0 && object[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 = object[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; + } + } } - resolve5(); - }; - 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); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + } } - return padString.slice(0, targetLength) + currentString; + return payload; } + return object; } - 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]; + 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 { - accountName = ""; + const result2 = { ...serializedValue }; + result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result2; } - return accountName; - } catch (error4) { - throw new Error("Unable to extract accountName with provided information."); } + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + 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 tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + 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; + } } } - return tagPairs.join("&"); + 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 toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); } + return tempDictionary; } - return res; + return responseBody; } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + 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 res; + return responseBody; } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + 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); + } + } + } } - 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 - } + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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; } - }; - case "json": - return { - format: { - type: "json", - jsonTextConfiguration: { - recordSeparator: textConfiguration.recordSeparator - } + } + } + } + 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); } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - }; - case "parquet": - return { - format: { - type: "parquet" + 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 = {}; } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + value[propertyName] = propertyValue; + } + } } + return value; } - 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); + 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 { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); + break; } } - return orProperties; + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } + let info7 = state_js_1.state.operationRequestMap.get(request); + if (!info7) { + info7 = {}; + state_js_1.state.operationRequestMap.set(request, info7); + } + return info7; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; } - 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; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } - 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 - }; - } + return result; } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return split.join("/"); + return result; } - function assertResponse(response) { - if (`_response` in response) { - return response; + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; } - throw new TypeError(`Unexpected response object ${response}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); + const operationSpec = operationInfo?.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + const responseSpec = getOperationResponseMap(parsedResponse); + const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); + if (error3) { + throw error3; + } else if (shouldReturnResponse) { + return parsedResponse; } - /** - * 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); + 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 (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); } - let response; + } + 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 parse(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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; + 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; } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw 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; } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; + 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)); } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; + } + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } 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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + } + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path7 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path7.startsWith("/")) { + path7 = path7.substring(1); + } + if (isAbsoluteUrl(path7)) { + requestUrl = path7; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path7); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + 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); } - } else { - delayTimeInMs = Math.random() * 1e3; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } - }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + return result; + } + function isAbsoluteUrl(url) { + return url.includes("://"); + } + function appendPath(url, pathToAppend) { + if (!pathToAppend) { + return url; } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + const parsedUrl = new URL(url); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path7 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path7; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + } + } else { + newPath = newPath + pathToAppend; } - }; - 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; + parsedUrl.pathname = newPath; + return parsedUrl.toString(); } - 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; + 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); + } } - 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; + } + return { + queryParams: result, + sequenceParams + }; + } + function simpleParseQueryParams(queryString) { + const result = /* @__PURE__ */ new Map(); + if (!queryString || queryString[0] !== "?") { + return result; + } + queryString = queryString.slice(1); + const pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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 { - return weight1 < weight2; + result.set(name, value); } } - return false; + return result; + } + function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url; + } + const parsedUrl = new URL(url); + 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(); } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { + } +}); + +// 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_utils6(); + 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 { /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - + * 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. */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; - } + _endpoint; /** - * Signs request. - * - * @param request - + * The default request content type for the service. + * Used if no requestContentType is present on an OperationSpec. */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; - } + _requestContentType; /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - + * Set to true if the request is sent over HTTP instead of HTTPS */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { - const path6 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path6}`; - const queries = getURLQueries(request.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; - } - }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); - } - }; - var StorageSharedKeyCredential = class extends Credential { + _allowInsecureConnection; /** - * Creates an instance of StorageSharedKeyCredential. - * @param accountName - - * @param accountKey - + * The HTTP client that will be used to send requests. */ - constructor(accountName, accountKey) { - super(); - this.accountName = accountName; - this.accountKey = Buffer.from(accountKey, "base64"); - } + _httpClient; /** - * Creates a StorageSharedKeyCredentialPolicy object. - * - * @param nextPolicy - - * @param options - + * The pipeline used by this client to make requests */ - create(nextPolicy, options) { - return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this); - } + pipeline; /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - + * The ServiceClient constructor + * @param options - The service client options that govern the behavior of the client. */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + 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 + }); + } + } } - }; - var AnonymousCredentialPolicy = class extends CredentialPolicy { /** - * Creates an instance of AnonymousCredentialPolicy. - * @param nextPolicy - - * @param options - + * Send the provided httpRequest. */ - // 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); + async sendRequest(request) { + return this.pipeline.sendRequest(this._httpClient, request); } - }; - var AnonymousCredential = class extends Credential { /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - + * 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. */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); - } - }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); + async sendOperationRequest(operationArguments, operationSpec) { + const endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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."); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; + const url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; } - } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - return false; - } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; - } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; - } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; } - attempt++; } - if (response) { - return response; + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; } - return value; - } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); - } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + try { + const rawResponse = await this.sendRequest(request); + const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); + if (options?.onResponse) { + options.onResponse(rawResponse, flatResponse); } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; - } - function getCanonicalizedResourceString(request) { - const path6 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path6}`; - const queries = getURLQueries(request.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); + 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); } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } + throw error3; } - return canonicalizedResourceString; } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; + }; + 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 + }); } - var StorageBrowserPolicy = class extends 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); + function getCredentialScopes(options) { + if (options.credentialScopes) { + return options.credentialScopes; } - /** - * Sends out request. - * - * @param request - - */ - async sendRequest(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); - } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); + if (options.endpoint) { + return `${options.endpoint}/.default`; } - }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); + if (options.baseUri) { + return `${options.baseUri}/.default`; } - }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } + 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 { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); - } - }; + return void 0; } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { + } +}); + +// 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 castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. - * - * @param factories - - * @param options - - */ - constructor(factories, options = {}) { - this.factories = factories; - this.options = options; + 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", /** - * Transfer Pipeline object to ServiceClientOptions object which is required by - * ServiceClient constructor. - * - * @returns The ServiceClientOptions object from this Pipeline. + * Defines constants for use with HTTP headers. */ - toServiceClientOptions() { - return { - httpClient: this.options.httpClient, - requestPolicyFactories: this.factories - }; + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization" } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); - } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; + 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); } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); + 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 (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; + if (!accessToken) { + return false; } + challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); + return true; } - return void 0; - } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } - } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } - } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); - } - pipeline._corePipeline = corePipeline; + 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 Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); + return void 0; } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; - } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; - } + function buildScopes(challengeOptions, challengeInfo) { + if (!challengeInfo.resource_id) { + return challengeOptions.scopes; } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; + 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 factory.constructor.name === "StorageSharedKeyCredential"; + return [scope]; } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; + function getChallenge(response) { + const challenge = response.headers.get("WWW-Authenticate"); + if (response.status === 401 && challenge) { + return challenge; } - return factory.constructor.name === "AnonymousCredential"; + return; } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); + 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 isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; + function requestToOptions(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.tracingOptions + }; } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof StorageRetryPolicyFactory) { - return true; + } +}); + +// 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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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; } - 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 (request) => { - return { - request, - headers: request.headers.clone(), - status: 500 - }; - } - }; - const mockRequestPolicyOptions = { - log(_logLevel, _message) { + function toWebResourceLike(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.requestOverrides, + clone() { + throw new Error("Cannot clone a non-proxied WebResourceLike"); }, - shouldLog(_logLevel) { - return false; + prepare() { + throw new Error("WebResourceLike.prepare() is not supported by @azure/core-http-compat"); + }, + validateRequestProperties() { } }; - const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions); - const policyName = policyInstance.constructor.name; - return knownPolicies.some((knownPolicyName) => { - return policyName.startsWith(knownPolicyName); - }); - } - var 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" + if (options?.createProxy) { + return new Proxy(webResource, { + get(target, prop, receiver) { + if (prop === originalRequestSymbol) { + return request; + } else if (prop === "clone") { + return () => { + return toWebResourceLike(toPipelineRequest(webResource, { originalRequest }), { + createProxy: true, + originalRequest + }); + }; } + return Reflect.get(target, prop, receiver); }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" + set(target, prop, value, receiver) { + if (prop === "keepAlive") { + request.disableKeepAlive = !value; } - }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", - type: { - name: "Composite", - className: "StaticWebsite" + const passThroughProps = [ + "url", + "method", + "withCredentials", + "timeout", + "requestId", + "abortSignal", + "body", + "formData", + "onDownloadProgress", + "onUploadProgress", + "proxySettings", + "streamResponseStatusCodes", + "agent", + "requestOverrides" + ]; + if (typeof prop === "string" && passThroughProps.includes(prop)) { + request[prop] = value; } + return Reflect.set(target, prop, value, receiver); } - } + }); + } else { + return webResource; } - }; - var 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" - } + } + 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]); } } } - }; - var 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" - } - } - } + /** + * 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() + }; } - }; - var 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" - } - } + /** + * 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; } - }; - var 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" - } + /** + * 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); } }; - var 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" + 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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } else if (prop === originalResponse) { + return response; } + return Reflect.get(target, prop, receiver); }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", - type: { - name: "String" + set(target, prop, value, receiver) { + if (prop === "headers") { + headers = value; + } else if (prop === "request") { + request = value; } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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; } }; - var StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", - type: { - name: "String" + 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_util8(); + 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(request, 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 }); } - }, - code: { - serializedName: "Code", - xmlName: "Code", - type: { - name: "String" + }; + for (const factory of orderedFactories) { + httpPipeline = factory.create(httpPipeline, mockRequestPolicyOptions); + } + const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; } - }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", - type: { - name: "String" + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; } } } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); } - }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", - type: { - name: "Composite", - className: "BlobServiceStatistics", - modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", - type: { - name: "Composite", - className: "GeoReplication" - } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; } } + return e2; } - }; - var 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" - } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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; } - }; - var 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" + const d = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _2), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; } - }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; } } + return t3; } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } + var n2; + })(t2, i2); } + return void 0 !== t2 ? t2 : ""; } - }; - var 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" } } - } - } - } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); } - }; - var 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" - } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; } - } - } - }; - var 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" - } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; } - } - } - }; - var 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" - } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; } - } - } - }; - var 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" - } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; } + return s2; } - }; - var 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" - } - } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; } } - }; - var 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" - } - } - } - } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } + return i2; } - }; - var 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" - } - } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); } + return t2; } - }; - var 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" - } - } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); } - }; - var 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" - } - } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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; } } - }; - var 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: { + 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 = delay; + 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(url) { + const urlParsed = new URL(url); + let path7 = urlParsed.pathname; + path7 = path7 || "/"; + path7 = escape(path7); + urlParsed.pathname = path7; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path7 = urlParsed.pathname; + path7 = path7 ? path7.endsWith("/") ? `${path7}${name}` : `${path7}/${name}` : name; + urlParsed.pathname = path7; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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 delay(timeInMs, aborter, abortError) { + return new Promise((resolve5, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve5(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path7 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path7}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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((resolve5, 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(resolve5).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve5(); + } + } + }); + }); + } + /** + * 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 = delay; + 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(url) { + const urlParsed = new URL(url); + let path7 = urlParsed.pathname; + path7 = path7 || "/"; + path7 = escape(path7); + urlParsed.pathname = path7; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path7 = urlParsed.pathname; + path7 = path7 ? path7.endsWith("/") ? `${path7}${name}` : `${path7}/${name}` : name; + urlParsed.pathname = path7; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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 delay(timeInMs, aborter, abortError) { + return new Promise((resolve5, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve5(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path7 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path7}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path7 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path7}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path7 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path7}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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", + 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" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + 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" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + expiresOn: { + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + 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" } @@ -49578,1035 +56487,1265 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", + exports2.BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "BlobFlatListSegment", + className: "BlobGetPropertiesExceptionHeaders", modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", + exports2.BlobDeleteHeaders = { + serializedName: "Blob_deleteHeaders", type: { name: "Composite", - className: "BlobItemInternal", + className: "BlobDeleteHeaders", modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "BlobName" + name: "String" } }, - deleted: { - serializedName: "Deleted", - required: true, - xmlName: "Deleted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - snapshot: { - serializedName: "Snapshot", - required: true, - xmlName: "Snapshot", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - isCurrentVersion: { - serializedName: "IsCurrentVersion", - xmlName: "IsCurrentVersion", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + } + } + } + }; + exports2.BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", + type: { + name: "Composite", + className: "BlobDeleteExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "BlobPropertiesInternal" + 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" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobTags" + name: "String" } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTimeRfc1123" } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "BlobUndeleteExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" + } + } + } + } + }; + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", + type: { + name: "Composite", + className: "BlobSetExpiryHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + 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" + } } } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + 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", - required: true, - xmlName: "Last-Modified", + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + 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" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + 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" } }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "ByteArray" + name: "String" } }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + 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" } - }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + } + } + } + }; + 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" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "String" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "DateTimeRfc1123" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "Boolean" } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + } + } + } + }; + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetLegalHoldExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + } + } + } + }; + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "DateTimeRfc1123" } }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "DateTimeRfc1123" + name: "String" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + } + } + } + }; + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "String" } - }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + } + } + } + }; + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Boolean" + name: "String" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "DateTimeRfc1123" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", + } + } + } + }; + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", + } + } + } + }; + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", + type: { + name: "Composite", + className: "BlobReleaseLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ListBlobsHierarchySegmentResponse", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", + type: { + name: "Composite", + className: "BlobRenewLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobHierarchyListSegment", + className: "BlobRenewLeaseExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobPrefix = { - serializedName: "BlobPrefix", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "BlobPrefix", + className: "BlobChangeLeaseHeaders", modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Composite", - className: "BlobName" + name: "String" } - } - } - } - }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + 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" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTimeRfc1123" } } } } }; - var BlockList = { - serializedName: "BlockList", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "BlockList", + className: "BlobChangeLeaseExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } } } } }; - var Block = { - serializedName: "Block", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "Block", + className: "BlobBreakLeaseHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { name: "Number" } - } - } - } - }; - var PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "String" } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } } } } }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "PageRange", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "ClearRange", + className: "BlobCreateSnapshotHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", type: { - name: "Number" + name: "String" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Number" + name: "String" } - } - } - } - }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + }, + 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" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "Composite", - className: "QuerySerialization" + 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" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "BlobStartCopyFromURLHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "String" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "String" } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Dictionary", - value: { type: { name: "any" } } + name: "String" } - } - } - } - }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "String" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "JsonTextConfiguration", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + 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" + } } } } }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "ArrowConfiguration", + className: "BlobCopyFromURLHeaders", modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + 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" } } } } }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ArrowField", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", - type: { - name: "String" - } - }, - name: { - serializedName: "Name", - xmlName: "Name", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { - name: "Number" + name: "String" } }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { name: "Number" } @@ -50614,11 +57753,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50641,6 +57780,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -50651,11 +57797,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50667,11 +57813,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesHeaders", + className: "BlobSetTierHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50704,11 +57850,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50720,11 +57866,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50754,21 +57900,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { - name: "String" + 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" } } } } }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50780,12 +57954,179 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentHeaders", + 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", @@ -50807,21 +58148,77 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", + className: "BlobQueryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50833,11 +58230,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", + exports2.BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", + className: "BlobGetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50877,11 +58274,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50893,11 +58290,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoHeaders", + className: "BlobSetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50927,41 +58324,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -50972,11 +58334,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50988,15 +58350,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "PageBlobCreateHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + 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" } @@ -51015,9 +58398,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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" } @@ -51032,11 +58443,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51048,12 +58459,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + 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", @@ -51082,6 +58528,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51092,11 +58559,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51108,24 +58575,45 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "PageBlobClearPagesHeaders", modelProperties: { etag: { serializedName: "etag", xmlName: "etag", type: { - name: "String" + 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" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -51166,11 +58654,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51182,21 +58670,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "PageBlobUploadPagesFromURLHeaders", 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", @@ -51211,41 +58690,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "ByteArray" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } }, requestId: { @@ -51269,47 +58732,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Boolean" + name: "String" } }, errorCode: { @@ -51322,11 +58763,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51334,16 +58775,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + 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", @@ -51382,11 +58858,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51398,12 +58874,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -51411,11 +58894,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -51456,11 +58939,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51472,20 +58955,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "PageBlobResizeHeaders", 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", @@ -51500,6 +58975,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51538,11 +59020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51554,11 +59036,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "PageBlobUpdateSequenceNumberHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51574,6 +59056,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51612,11 +59101,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51628,12 +59117,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + 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", @@ -51662,6 +59165,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51672,11 +59190,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51688,12 +59206,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -51715,6 +59254,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51722,6 +59268,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51732,11 +59299,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51748,58 +59315,40 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -51827,15 +59376,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51847,11 +59438,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51867,18 +59458,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, requestId: { @@ -51901,82 +59492,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", - type: { - name: "Composite", - className: "ContainerReleaseLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + }, + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - date: { - serializedName: "date", - xmlName: "date", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } } } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51984,15 +59550,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52008,13 +59588,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52042,15 +59615,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52062,11 +59642,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52082,11 +59662,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Number" + name: "ByteArray" } }, clientRequestId: { @@ -52110,21 +59690,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52136,11 +59751,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52156,11 +59771,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -52184,73 +59799,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var 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", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52261,11 +59844,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52273,21 +59856,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlockBlobStageBlockHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -52318,6 +59915,34 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52328,11 +59953,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52344,12 +59969,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + 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", @@ -52378,50 +60017,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "Boolean" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + name: "String" } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Boolean" + name: "String" } - } - } - } - }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", - modelProperties: { + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52432,72 +60048,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", 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", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { name: "String" } }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { - name: "String" + name: "Number" } - }, + } + } + } + }; + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobCommitBlockListHeaders", + modelProperties: { etag: { serializedName: "etag", xmlName: "etag", @@ -52505,127 +60091,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", 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", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "ByteArray" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, clientRequestId: { @@ -52656,20 +60140,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52677,16 +60147,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -52698,10263 +60161,7886 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + 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" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "ByteArray" + name: "String" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + 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" } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + } + } + } + }; + } +}); + +// 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: "ByteArray" + 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" } } } } }; - var 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.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" } } }; - var 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", + 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: [ - "available", - "leased", - "expired", - "breaking", - "broken" + "copy", + "deleted", + "metadata", + "snapshots", + "uncommittedblobs", + "versions", + "tags", + "immutabilitypolicy", + "legalhold", + "deletedwithversions" ] } - }, - 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" - } } } + }, + collectionFormat: "CSV" + }; + exports2.delimiter = { + parameterPath: "delimiter", + mapper: { + serializedName: "delimiter", + required: true, + xmlName: "delimiter", + type: { + name: "String" + } } }; - var 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.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var 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.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], + mapper: { + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", + type: { + name: "Boolean" } } }; - var 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.rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], + mapper: { + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", + type: { + name: "Boolean" } } }; - var 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.encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], + mapper: { + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", + type: { + name: "String" } } }; - var 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.encryptionKeySha256 = { + parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], + mapper: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" } } }; - var 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.encryptionAlgorithm = { + parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], + mapper: { + serializedName: "x-ms-encryption-algorithm", + xmlName: "x-ms-encryption-algorithm", + type: { + name: "String" } } }; - var 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.ifMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], + mapper: { + serializedName: "If-Match", + xmlName: "If-Match", + type: { + name: "String" } } }; - var 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.ifNoneMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], + mapper: { + serializedName: "If-None-Match", + xmlName: "If-None-Match", + type: { + name: "String" } } }; - var 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.ifTags = { + parameterPath: ["options", "modifiedAccessConditions", "ifTags"], + mapper: { + serializedName: "x-ms-if-tags", + xmlName: "x-ms-if-tags", + type: { + name: "String" } } }; - var 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.deleteSnapshots = { + parameterPath: ["options", "deleteSnapshots"], + mapper: { + serializedName: "x-ms-delete-snapshots", + xmlName: "x-ms-delete-snapshots", + type: { + name: "Enum", + allowedValues: ["include", "only"] } } }; - var 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.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" } } }; - var 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.comp12 = { + parameterPath: "comp", + mapper: { + defaultValue: "immutabilityPolicies", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.immutabilityPolicyExpiry = { + parameterPath: ["options", "immutabilityPolicyExpiry"], + mapper: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", + type: { + name: "DateTimeRfc1123" } } }; - var 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.immutabilityPolicyMode = { + parameterPath: ["options", "immutabilityPolicyMode"], + mapper: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } }; - var 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.comp13 = { + parameterPath: "comp", + mapper: { + defaultValue: "legalhold", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.legalHold = { + parameterPath: "legalHold", + mapper: { + serializedName: "x-ms-legal-hold", + required: true, + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var 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.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] } } }; - var 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.sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.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" } } }; - var 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.sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], + mapper: { + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", + type: { + name: "String" } } }; - var 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.copySource = { + parameterPath: "copySource", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.blobTagsString = { + parameterPath: ["options", "blobTagsString"], + mapper: { + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", + type: { + name: "String" } } }; - var 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.sealBlob = { + parameterPath: ["options", "sealBlob"], + mapper: { + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", + type: { + name: "Boolean" } } }; - var 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.legalHold1 = { + parameterPath: ["options", "legalHold"], + mapper: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.xMsRequiresSync = { + parameterPath: "xMsRequiresSync", + mapper: { + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", + type: { + name: "String" } } }; - var 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.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], + mapper: { + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", + type: { + name: "ByteArray" } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var 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.comp15 = { + parameterPath: "comp", + mapper: { + defaultValue: "copy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", + mapper: { + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", + type: { + name: "String" } } }; - var 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.copyId = { + parameterPath: "copyId", + mapper: { + serializedName: "copyid", + required: true, + xmlName: "copyid", + type: { + name: "String" } } }; - var 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.comp16 = { + parameterPath: "comp", + mapper: { + defaultValue: "tier", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", + mapper: { + defaultValue: "query", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.comp18 = { + parameterPath: "comp", + mapper: { + defaultValue: "tags", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], + mapper: { + defaultValue: 0, + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" } } }; - var 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.contentType1 = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/octet-stream", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" } } }; - var 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.body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" } } }; - var 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.accept2 = { + parameterPath: "accept", + mapper: { + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" } } }; - var 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.comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "page", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.pageWrite = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" } } }; - var 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.ifSequenceNumberLessThanOrEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", + type: { + name: "Number" } } }; - var 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.ifSequenceNumberLessThan = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThan" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-lt", + xmlName: "x-ms-if-sequence-number-lt", + type: { + name: "Number" } } }; - var 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.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" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.sourceUrl = { + parameterPath: "sourceUrl", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.sourceRange = { + parameterPath: "sourceRange", + mapper: { + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", + type: { + name: "String" } } }; - var 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.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], + mapper: { + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", + type: { + name: "ByteArray" } } }; - var 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.range1 = { + parameterPath: "range", + mapper: { + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.comp20 = { + parameterPath: "comp", + mapper: { + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], + mapper: { + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", + type: { + name: "String" } } }; - var 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.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], + mapper: { + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.comp21 = { + parameterPath: "comp", + mapper: { + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blobType1 = { + parameterPath: "blobType", + mapper: { + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], + mapper: { + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", + type: { + name: "Boolean" } } }; - var 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.comp24 = { + parameterPath: "comp", + mapper: { + defaultValue: "block", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blockId = { + parameterPath: "blockId", + mapper: { + serializedName: "blockid", + required: true, + xmlName: "blockid", + type: { + name: "String" } } }; - var 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.blocks = { + parameterPath: "blocks", + mapper: mappers_js_1.BlockLookupList + }; + exports2.comp25 = { + parameterPath: "comp", + mapper: { + defaultValue: "blocklist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.listType = { + parameterPath: "listType", + mapper: { + defaultValue: "committed", + serializedName: "blocklisttype", + required: true, + xmlName: "blocklisttype", + type: { + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + } +}); + +// 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); } }; - var 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.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 AppendBlobSealExceptionHeaders = { - serializedName: "AppendBlob_sealExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobSealExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } - } + 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 BlockBlobUploadExceptionHeaders = { - serializedName: "BlockBlob_uploadExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobUploadExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } - } + 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 BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } + var submitBatchOperationSpec = { + path: "/", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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); } - }; - var BlockBlobStageBlockExceptionHeaders = { - serializedName: "BlockBlob_stageBlockExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * [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); } - }; - var 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" - } - } - } + /** + * [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); } - }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * [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); } - }; - var 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" - } - } - } + /** + * [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); } - }; - var BlockBlobCommitBlockListExceptionHeaders = { - serializedName: "BlockBlob_commitBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobCommitBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var 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.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 BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + 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 blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + 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 accept = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 url = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" + var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerSetAccessPolicyHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerSetAccessPolicyExceptionHeaders } }, - skipEncoding: true + 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 restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 + var submitBatchOperationSpec = { + path: "/{containerName}", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: Mappers.ContainerSubmitBatchHeaders }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" + 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 version = { - parameterPath: "version", - mapper: { - defaultValue: "2024-11-04", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" + 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 requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" + 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 accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" + 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 marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" + 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 maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 + var listBlobHierarchySegmentOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListBlobsHierarchySegmentResponse, + headersMapper: Mappers.ContainerListBlobHierarchySegmentHeaders }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" + 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 include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + var getAccountInfoOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: Mappers.ContainerGetAccountInfoHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerGetAccountInfoExceptionHeaders } }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + queryParameters: [ + Parameters.comp, + Parameters.timeoutInSeconds, + Parameters.restype1 + ], + urlParameters: [Parameters.url], + headerParameters: [ + Parameters.version, + Parameters.requestId, + Parameters.accept1 + ], + isXML: true, + serializer: xmlSerializer }; - var comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } + /** + * 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); } - }; - var comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } + /** + * 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); } - }; - var comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } + /** + * 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); } - }; - var restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + /** + * 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); } - }; - var access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } + /** + * 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); } - }; - var defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } + /** + * [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); } - }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } + /** + * 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); } }; - var comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" + 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 sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" + 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 comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" + 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 proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" + 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 action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 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" - ] - } - } + var breakLeaseOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.BlobBreakLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobBreakLeaseExceptionHeaders } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 }; - var ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" - } + /** + * 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); } - }; - var ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } + /** + * 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); } - }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * 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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * 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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * 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); } }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" + 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 blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" + 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 blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" + 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 blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" + 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 comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" + 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 immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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 comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 }; - var encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } + } +}); + +// 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); } - }; - var comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var 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" - ] - } + /** + * 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); } }; - var rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + 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 } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" + 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 sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" + var appendBlockFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.AppendBlobAppendBlockFromUrlHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.AppendBlobAppendBlockFromUrlExceptionHeaders } - } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" + 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 }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } + /** + * 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); } }; - var 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.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 comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" + 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 copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" + 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 comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 }; - var comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + } +}); + +// 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(url, options) { + if (url === void 0) { + throw new Error("'url' cannot be null"); } - } - }; - var comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (!options) { + options = {}; } + const defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; + super(optionsWithDefaults); + this.url = url; + 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; }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags - }; - var transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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); } }; - var transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } + 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(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + const storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = void 0; } }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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; } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + /** + * 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; } - } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + if (permissionLike.add) { + blobSASPermissions.add = true; } - } - }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + if (permissionLike.create) { + blobSASPermissions.create = true; } - } - }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + if (permissionLike.write) { + blobSASPermissions.write = true; } - } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + if (permissionLike.delete) { + blobSASPermissions.delete = true; } - } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.deleteVersion) { + blobSASPermissions.deleteVersion = true; } - } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.tag) { + blobSASPermissions.tag = true; } - } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + if (permissionLike.move) { + blobSASPermissions.move = true; } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" + if (permissionLike.execute) { + blobSASPermissions.execute = true; } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" + if (permissionLike.setImmutabilityPolicy) { + blobSASPermissions.setImmutabilityPolicy = true; } - } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.permanentDelete) { + blobSASPermissions.permanentDelete = true; } + return blobSASPermissions; } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + /** + * 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"); } - } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + if (this.add) { + permissions.push("a"); } - } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + if (this.create) { + permissions.push("c"); } - } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + if (this.write) { + permissions.push("w"); } - } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.delete) { + permissions.push("d"); } - } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + if (this.deleteVersion) { + permissions.push("x"); } - } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + if (this.tag) { + permissions.push("t"); } - } - }; - var 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"] + if (this.move) { + permissions.push("m"); } - } - }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.execute) { + permissions.push("e"); } - } - }; - var blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - } - }; - var comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.permanentDelete) { + permissions.push("y"); } + return permissions.join(""); } }; - var maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + 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; } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + /** + * 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; } - } - }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.add) { + containerSASPermissions.add = true; } - } - }; - var comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.create) { + containerSASPermissions.create = true; } - } - }; - var blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.write) { + containerSASPermissions.write = true; } - } - }; - var copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + if (permissionLike.delete) { + containerSASPermissions.delete = true; } - } - }; - var comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.list) { + containerSASPermissions.list = true; } - } - }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + if (permissionLike.deleteVersion) { + containerSASPermissions.deleteVersion = true; } - } - }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList - }; - var comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.tag) { + containerSASPermissions.tag = true; } - } - }; - var listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + 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; } - }; - var ServiceImpl = class { /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client + * Specifies Read access granted. */ - constructor(client) { - this.client = client; - } + read = false; /** - * 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. + * Specifies Add access granted. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); - } + add = false; /** - * 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. + * Specifies Create access granted. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); - } + create = false; /** - * 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. + * Specifies Write access granted. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); - } + write = false; /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. + * Specifies Delete access granted. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); - } + deleteVersion = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Specifies List access granted. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); - } + list = false; /** - * 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. + * Specfies Tag access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); - } + tag = false; /** - * 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. + * Specifies Move access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); - } - }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + 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"); } - }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + 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(""); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * Azure Storage account name; readonly. */ - constructor(client) { - this.client = client; - } + accountName; /** - * 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. + * Azure Storage user delegation key; readonly. */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); + 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 { /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * The storage API version. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + version; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + protocol; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); + 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; + } + } } /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Encodes all SAS query parameters into a string that can be appended to a URL. + * */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); + 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("&"); } /** - * 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. + * A private helper method used to filter and append query key/value pairs into an array. + * + * @param queries - + * @param key - + * @param value - */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); + tryAppendQueryParameter(queries, key, value) { + if (!value) { + return; + } + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); + } } - /** - * 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); + }; + 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); } - /** - * [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$1); + if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { + throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); + 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); + } + } } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); + 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); + } + } } - /** - * [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$1); + 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."); + } } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); + 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."); } - /** - * [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); + let resource = "c"; + if (blobSASSignatureValues.blobName) { + resource = "b"; } - /** - * [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(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); + 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(); + } } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); + 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."); } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders - } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + } + 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(); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var BlobImpl = class { - /** - * 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); + 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * 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); + 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(); + } } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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, + timestamp2, + 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}`); } - /** - * 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(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + 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'."); } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - /** - * 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); + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - /** - * 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); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - /** - * 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(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - /** - * 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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - /** - * [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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + 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."); } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - /** - * [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); + 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; /** - * The Create Snapshot operation creates a read-only snapshot of a blob - * @param options The options parameters. + * Gets the lease Id. + * + * @readonly */ - createSnapshot(options) { - return this.client.sendOperationRequest({ options }, createSnapshotOperationSpec); + get leaseId() { + return this._leaseId; } /** - * 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. + * Gets the url. + * + * @readonly */ - startCopyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + get url() { + return this._url; } /** - * 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. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - copyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + 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; } /** - * 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. + * 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. */ - abortCopyFromURL(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + 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 + })); + }); } /** - * 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. + * 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. */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + 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; + }); } /** - * Returns the sku name and account kind - * @param options The options parameters. + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + 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 + })); + }); } /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * 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. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); + 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 + }); + }); } /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * 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. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); + 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; /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. + * 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 - */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); + 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(); } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + _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; } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + if (!this.push(data)) { + this.source.pause(); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + }; + 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; } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 + 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); + } }; - var PageBlobImpl = class { + 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 { /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - constructor(client) { - this.client = client; + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * 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. + * Returns if it was previously specified + * for the file. + * + * @readonly */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * 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. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * 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. + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } /** - * 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. + * 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 */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * 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. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - constructor(client) { - this.client = client; + get contentType() { + return this.originalResponse.contentType; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * 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 */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get copyId() { + return this.originalResponse.copyId; } /** - * 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. + * 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 */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyProgress() { + return this.originalResponse.copyProgress; } /** - * 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. + * 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 */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + get copySource() { + return this.originalResponse.copySource; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - constructor(client) { - this.client = client; + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * 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 */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * 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. + * 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 */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } /** - * 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. + * 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 */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get lastModified() { + return this.originalResponse.lastModified; } /** - * 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. + * 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 */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get lastAccessed() { + return this.originalResponse.lastAccessed; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * Returns the date and time the blob was created. + * + * @readonly */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); - } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + get createdOn() { + return this.originalResponse.createdOn; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * A name-value pair + * to associate with a file storage object. + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; - } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + get metadata() { + return this.originalResponse.metadata; } /** - * 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. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * - * @param permissions - + * @readonly */ - 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; + get requestId() { + return this.originalResponse.requestId; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. * - * @param permissionLike - + * @readonly */ - 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; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Indicates the version of the Blob service used + * to execute the request. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); - } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + get version() { + return this.originalResponse.version; } /** - * 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. + * Indicates the versionId of the downloaded blob version. * - * @param permissions - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates whether version of this blob is a current version. * - * @param permissionLike - + * @readonly */ - 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; + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * 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 */ - 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(""); + 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; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * Object Replication Policy Id of the destination blob. + * + * @readonly */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * If this blob has been sealed. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + get isSealed() { + return this.originalResponse.isSealed; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * Indicates immutability policy mode. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } - } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version2 >= "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.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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."); + /** + * Indicates if a legal hold is present on the blob. + * + * @readonly + */ + get legalHold() { + return this.originalResponse.legalHold; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get contentAsBlob() { + return this.originalResponse.blobBody; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + 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); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); + if (bytes.length !== length) { + throw new Error("Hit stream end."); } + return bytes; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * Reads a single byte from the stream. + * + * @param stream - + * @param options - + */ + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 1, options); + return buf[0]; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + // 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(stream, options = {}) { + let zigZagEncoded = 0; + let significanceInBit = 0; + let byte, haveMoreByte, significanceInFloat; + do { + byte = await _AvroParser.readByte(stream, 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(stream, 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); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); + } + static async readNull() { + return null; + } + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); + if (b === 1) { + return true; + } else if (b === 0) { + return false; } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat32(0, true); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat64(0, true); + } + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); + if (size < 0) { + throw new Error("Bytes size was negative."); } + return stream.read(size, { abortSignal: options.abortSignal }); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); + } + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); + return { key, value }; + } + static async readMap(stream, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; + } + return dict; + } + static async readArray(stream, readItemMethod, options = {}) { + const items = []; + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { + if (count < 0) { + await _AvroParser.readLong(stream, options); + count = -count; + } + while (count--) { + const item = await readItemMethod(stream, 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + return _AvroType.fromObjectSchema(schema2); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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}`); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); + } } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { + } + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + } } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + switch (this._primitive) { + case AvroPrimitive.NULL: + return AvroParser.readNull(); + case AvroPrimitive.BOOLEAN: + return AvroParser.readBoolean(stream, options); + case AvroPrimitive.INT: + return AvroParser.readInt(stream, options); + case AvroPrimitive.LONG: + return AvroParser.readLong(stream, options); + case AvroPrimitive.FLOAT: + return AvroParser.readFloat(stream, options); + case AvroPrimitive.DOUBLE: + return AvroParser.readDouble(stream, options); + case AvroPrimitive.BYTES: + return AvroParser.readBytes(stream, options); + case AvroPrimitive.STRING: + return AvroParser.readString(stream, options); + default: + throw new Error("Unknown Avro Primitive"); + } } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); + return this._symbols[value]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } - if (version2 < "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."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + const readItemMethod = (s, opts) => { + return this._itemType.read(s, opts); + }; + return AvroParser.readMap(stream, readItemMethod, options); } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, 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(stream, options); + } + } + return record; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + }; + } +}); + +// 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; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + _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; } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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."); } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + this._metadata = await AvroParser_js_1.AvroParser.readMap(this._headerStream, AvroParser_js_1.AvroParser.readString, { + abortSignal: options.abortSignal }); - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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"); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal }); - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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; + } } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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((resolve5, 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(); + resolve5(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); + } + }); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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. @@ -63070,7 +68156,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -63177,14 +68263,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -63227,23 +68305,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63272,7 +68333,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.originalResponse.clientRequestId; } /** - * Indicates the version of the Blob service used + * Indicates the version of the File service used * to execute the request. * * @readonly @@ -63280,1140 +68341,1333 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 coreUtil.isNode ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - /** - * 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(this.originalResponse.readableStreamBody, getter, offset, count, options); - } - }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - 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 pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - 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; - } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); - } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); - } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { - } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); - } - } - }; - var AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; + /** + * 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; } - // 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"); - } + /** + * 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; } - }; - var AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get blobBody() { + return void 0; } - // 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]; + /** + * 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; } - }; - var AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); + 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); } }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + 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; } - // 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); + return tier; + } + function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25; } - // 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); + } + 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 } } - return record; + }; + } + } +}); + +// 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}`); } - }; - 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; + } + 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 true; + return message + " " + innerMessage; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; + 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); } - get objectIndex() { - return this._objectIndex; + 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; + } } - 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; + 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 + })); } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); + } + function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; + } + async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 + }; } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal + } + 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 }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + processOperationStatus({ + status, + response, + state, + stateProxy, + isDone, + processResult, + getError, + setErrorAsResult }); - await 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--; - } + 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); } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return void 0; + } + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); + } } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } - } - yield yield tslib.__await(result); + case "original-uri": { + return requestPath; } - }); + case "location": + default: { + return location; + } + } } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); + } + 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; } - return data; } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - get position() { - return this._position; + } + 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; } - async read(size, options = {}) { + 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 _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - throw ABORT_ERROR; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); + case "Body": + default: { + return void 0; } - if (size === 0) { - return new Uint8Array(); + } + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve5, 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(); - resolve5(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); - } - }); + case "Body": { + return getProvisioningState(rawResponse); } + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); } - }; - var BlobQuickQueryStream = class extends stream.Readable { + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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 = () => ({ /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * 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. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new 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 schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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; + 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, 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, + 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 }); } } - 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 }); - } + } 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`); } - 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 }); + } + })().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; } - 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 - }); + } + 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; } - break; - default: - throw Error(`Unknown schema ${schema2} in avro progress record.`); + } } - } while (!avroNext.done && !this.avroPaused); + }; + 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; } - }; - var BlobQueryResponse = class { - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * Returns if it was previously specified - * for the file. - * - * @readonly - */ - get cacheControl() { - return this.originalResponse.cacheControl; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * 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; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly + * Serializes the Poller operation. */ - get contentEncoding() { - return this.originalResponse.contentEncoding; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + }; + 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); } - /** - * 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; + }; + 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 { /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. + * 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); * - * @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. + * // You can assign more local properties here. + * } + * } + * ``` * - * @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. + * 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. * - * @readonly - */ - get contentRange() { - return this.originalResponse.contentRange; - } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * 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: * - * @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. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get copyCompletedOn() { - return void 0; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve5, reject) => { + this.resolve = resolve5; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get copyId() { - return this.originalResponse.copyId; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * 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. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get copySource() { - return this.originalResponse.copySource; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @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. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly + * Invokes the underlying operation's cancel method. */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * 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. * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; - } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + 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; } - /** - * 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; + 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()); + } } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get etag() { - return this.originalResponse.etag; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * The error code. - * - * @readonly + * Returns true if the poller has finished polling. */ - get errorCode() { - return this.originalResponse.errorCode; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * 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 + * Stops the poller from continuing to poll. */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * 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 + * Returns true if the poller is stopped. */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; + isStopped() { + return this.stopped; } /** - * Returns the date and time the file was last - * modified. Any operation that modifies the file or its properties updates - * the last modified time. + * Attempts to cancel the underlying operation. * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * A name-value pair - * to associate with a file storage object. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * If it's called again before it finishes, it will throw an error. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get requestId() { - return this.originalResponse.requestId; + 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; } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * Returns the state of the operation. * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the File service used - * to execute the request. + * 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. * - * @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. + * Example: * - * @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. + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } * - * @readonly - */ - get blobBody() { - return void 0; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * // 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; + * } * - * It will parse avor data returned by blob query. + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... * - * @readonly + * 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. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve5) => setTimeout(() => resolve5(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -64421,20 +69675,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -64442,10 +69697,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -64485,12 +69740,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + 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.`); @@ -64500,27 +69764,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -64535,8 +69833,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -64551,9 +69849,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve5, reject) => { this.emitter.on("finish", resolve5); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -64590,333 +69888,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve5, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve5).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve5(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream2, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve5, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream2.on("readable", () => { + const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); resolve5(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -64924,28 +69925,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve5(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream2, buffer2, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve5, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -64956,18 +69957,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream.on("end", () => { resolve5(pos); }); - stream2.on("error", reject); + stream.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve5, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve5(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve5, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -64978,9 +69991,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_utils7(); + 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. */ @@ -64996,49 +70048,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -65047,8 +70099,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -65057,8 +70109,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -65088,7 +70140,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -65097,76 +70149,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -65174,8 +70256,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -65183,9 +70264,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -65194,7 +70275,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -65211,9 +70295,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -65224,7 +70308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -65234,7 +70318,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -65245,17 +70329,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -65263,19 +70355,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -65285,19 +70379,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65307,13 +70409,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -65324,7 +70426,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -65336,14 +70438,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -65354,22 +70458,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65385,15 +70491,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -65403,15 +70511,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -65422,24 +70537,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65460,57 +70577,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using a changing polling interval (default 15 seconds): + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -65518,15 +70636,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -65538,14 +70656,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -65555,36 +70673,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -65595,31 +70716,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -65627,12 +70749,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -65643,26 +70765,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -65676,8 +70801,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await streamToBuffer(stream2, buffer2, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -65685,7 +70810,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -65705,10 +70830,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -65723,7 +70851,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -65739,7 +70867,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -65751,21 +70879,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -65773,12 +70903,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -65790,18 +70920,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve5) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve5(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve5((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -65810,17 +70946,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve5) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve5((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. @@ -65828,8 +71014,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -65840,8 +71026,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -65854,8 +71040,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -65865,60 +71051,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -65929,40 +71120,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -65970,20 +71176,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65996,20 +71213,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -66018,29 +71237,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -66055,7 +71289,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -66069,74 +71303,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -66148,8 +71397,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -66158,15 +71407,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -66182,26 +71448,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -66219,7 +71487,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -66230,32 +71498,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66280,22 +71564,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -66303,10 +71602,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -66324,7 +71623,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -66341,18 +71640,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -66363,30 +71663,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66394,20 +71696,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -66436,18 +71740,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -66474,7 +71778,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -66495,23 +71799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -66521,32 +71824,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -66572,15 +71875,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -66599,27 +71905,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream2, + const scheduler = new storage_common_1.BufferScheduler( + stream, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -66637,50 +71943,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -66691,13 +72005,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -66705,23 +72019,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66730,21 +72046,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -66752,7 +72080,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -66760,19 +72088,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -66785,7 +72115,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -66796,32 +72126,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -66830,13 +72163,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -66846,7 +72181,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -66855,16 +72190,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -66872,22 +72209,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -66907,17 +72246,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -66926,94 +72263,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * 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()`: - * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67039,13 +72361,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67055,17 +72380,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -67074,7 +72401,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67082,20 +72409,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67116,17 +72445,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -67136,94 +72463,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67232,7 +72553,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -67250,13 +72573,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67264,24 +72590,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -67289,12 +72617,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -67302,22 +72632,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67327,38 +72659,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_utils7(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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."); @@ -67369,15 +72735,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -67389,18 +72755,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -67420,7 +72786,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -67435,7 +72801,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -67450,6 +72816,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -67489,6 +72865,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve5(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -67505,11 +72883,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -67533,13 +72936,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -67551,13 +72954,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; + let url; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -67566,28 +72969,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; + let url; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -67595,24 +72998,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + await new Clients_js_1.BlobClient(url, 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -67625,9 +73036,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -67636,19 +73047,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -67657,24 +73068,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path6 = getURLPath(subRequest.url); - if (!path6 || path6 === "") { + const path7 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path7 || path7 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -67684,7 +73095,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -67701,7 +73112,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -67712,7 +73123,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -67723,19 +73134,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url2, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path6 = getURLPath(url2); - if (path6 && path6 !== "/") { + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path7 = (0, utils_common_js_1.getURLPath)(url); + if (path7 && path7 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -67746,10 +73175,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -67760,7 +73189,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -67778,11 +73207,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -67790,17 +73233,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -67809,10 +73267,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -67829,7 +73289,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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. */ @@ -67838,48 +73326,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -67887,34 +73375,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -67931,7 +73437,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -67953,7 +73459,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67961,7 +73467,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67971,15 +73477,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * 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 BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67987,12 +73505,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -68005,14 +73523,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -68020,8 +73542,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -68032,19 +73554,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68056,24 +73585,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -68086,7 +73615,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -68094,8 +73623,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -68144,29 +73673,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -68181,7 +73710,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -68195,7 +73724,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -68205,10 +73734,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -68220,14 +73749,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -68240,18 +73769,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -68260,23 +73809,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -68292,44 +73864,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -68337,64 +73891,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -68402,41 +73955,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -68455,7 +74011,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68472,17 +74031,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -68490,35 +74047,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -68526,118 +74070,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -68655,7 +74219,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68676,23 +74243,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -68712,18 +74283,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -68734,27 +74303,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -68764,53 +74317,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: - * - * ```js - * let i = 1; + * // 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 @@ -68818,11 +74372,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -68834,7 +74387,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -68853,7 +74408,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -68862,14 +74420,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -68881,7 +74439,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -68891,7 +74449,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -68901,18 +74459,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve5) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve5(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve5((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -68921,45 +74482,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve5) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve5((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -69063,6 +74657,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -69070,7 +74716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69117,12 +74763,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -69148,10 +74799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69168,13 +74831,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -69203,6 +74870,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -69224,44 +74907,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -69272,22 +74973,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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. @@ -69302,35 +75031,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url2, credentialOrPipeline, options) { + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url2, pipeline); + super(url, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -69341,22 +75070,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -69373,7 +75111,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -69387,47 +75125,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -69436,15 +75156,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -69454,14 +75174,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -69472,14 +75192,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -69487,7 +75207,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -69499,9 +75219,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -69522,23 +75248,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -69558,18 +75288,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -69580,27 +75308,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -69608,57 +75320,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // 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 @@ -69670,7 +75378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -69682,7 +75390,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -69701,7 +75411,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69717,45 +75430,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -69763,45 +75458,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js + * // Use for await to iterate the containers * let i = 1; * for await (const container of blobServiceClient.listContainers()) { * console.log(`Container ${i++}: ${container.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -69823,7 +75514,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -69835,17 +75526,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -69864,7 +75558,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69874,16 +75571,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -69897,19 +75594,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -69917,7 +75622,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69925,21 +75630,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -69947,7 +75653,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69955,66 +75661,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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; + } }); } }); @@ -70099,7 +75863,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70112,21 +75876,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -70154,9 +75928,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core14 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core14 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { constructor(contentLength) { @@ -70239,15 +76014,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -70258,15 +76035,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -70274,7 +76050,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70287,21 +76063,31 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -70329,9 +76115,14 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -70339,14 +76130,12 @@ var require_requestUtils = __commonJS({ } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -70358,14 +76147,13 @@ var require_requestUtils = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve5) => setTimeout(resolve5, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(name_1, method_1, getStatusCode_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { let errorMessage = ""; let attempt = 1; while (attempt <= maxAttempts) { @@ -70374,12 +76162,12 @@ var require_requestUtils = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -70402,9 +76190,8 @@ var require_requestUtils = __commonJS({ throw Error(`${name} failed: ${errorMessage}`); }); } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + function retryTypedResponse(name_1, method_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return yield retry3( name, method, @@ -70413,13 +76200,13 @@ var require_requestUtils = __commonJS({ delay, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { + (error3) => { + if (error3 instanceof http_client_1.HttpClientError) { return { - statusCode: error4.statusCode, + statusCode: error3.statusCode, result: null, headers: {}, - error: error4 + error: error3 }; } else { return void 0; @@ -70428,13 +76215,155 @@ var require_requestUtils = __commonJS({ ); }); } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + function retryHttpClientResponse(name_1, method_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return yield retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay); }); } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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; } }); @@ -70442,7 +76371,7 @@ var require_requestUtils = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70455,21 +76384,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -70497,20 +76436,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs7 = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs8 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream.pipeline); yield pipeline(response.message, output); }); @@ -70612,10 +76554,10 @@ var require_downloadUtils = __commonJS({ }; exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { - const writeStream = fs7.createWriteStream(archivePath); + return __awaiter2(this, void 0, void 0, function* () { + const writeStream = fs8.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { + 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, () => { @@ -70635,17 +76577,16 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs7.promises.open(archivePath, "w"); + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const archiveDescriptor = yield fs8.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", () => __awaiter4(this, void 0, void 0, function* () { + 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"]; @@ -70662,7 +76603,7 @@ var require_downloadUtils = __commonJS({ const count = Math.min(blockSize, length - offset); downloads.push({ offset, - promiseGetter: () => __awaiter4(this, void 0, void 0, function* () { + promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); }) }); @@ -70675,7 +76616,7 @@ var require_downloadUtils = __commonJS({ const progressFn = progress.onProgress(); const activeDownloads = []; let nextDownload; - const waitAndWrite = () => __awaiter4(this, void 0, void 0, function* () { + 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--; @@ -70699,9 +76640,8 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const retries = 5; let failures = 0; while (true) { @@ -70722,8 +76662,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { + 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}` }); @@ -70739,8 +76679,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { retryOptions: { // Override the timeout used when downloading each 4 MB chunk @@ -70756,7 +76696,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs7.openSync(archivePath, "w"); + const fd = fs8.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -70774,18 +76714,17 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs7.writeFileSync(fd, result); + fs8.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs7.closeSync(fd); + fs8.closeSync(fd); } } }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; const timeoutPromise = new Promise((resolve5) => { timeoutHandle = setTimeout(() => resolve5("timeout"), timeoutMs); @@ -70802,7 +76741,7 @@ var require_downloadUtils = __commonJS({ var require_options = __commonJS({ "node_modules/@actions/cache/lib/options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70815,23 +76754,34 @@ var require_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core14 = __importStar4(require_core()); + exports2.getUploadOptions = getUploadOptions; + exports2.getDownloadOptions = getDownloadOptions; + var core14 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -70856,7 +76806,6 @@ var require_options = __commonJS({ core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } - exports2.getUploadOptions = getUploadOptions; function getDownloadOptions(copy) { const result = { useAzureSdk: false, @@ -70898,7 +76847,6 @@ var require_options = __commonJS({ core14.debug(`Lookup only: ${result.lookupOnly}`); return result; } - exports2.getDownloadOptions = getDownloadOptions; } }); @@ -70907,7 +76855,9 @@ var require_config = __commonJS({ "node_modules/@actions/cache/lib/internal/config.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; + exports2.isGhes = isGhes; + exports2.getCacheServiceVersion = getCacheServiceVersion; + exports2.getCacheServiceURL = getCacheServiceURL; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); @@ -70916,13 +76866,11 @@ var require_config = __commonJS({ const isLocalHost = hostname.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } - exports2.isGhes = isGhes; function getCacheServiceVersion() { if (isGhes()) return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } - exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { const version = getCacheServiceVersion(); switch (version) { @@ -70934,7 +76882,6 @@ var require_config = __commonJS({ throw new Error(`Unsupported cache service version: ${version}`); } } - exports2.getCacheServiceURL = getCacheServiceURL; } }); @@ -70943,7 +76890,7 @@ var require_package2 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", - version: "4.1.0", + version: "5.0.1", preview: true, description: "Actions cache lib", keywords: [ @@ -70980,22 +76927,26 @@ var require_package2 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", + "@azure/core-rest-pipeline": "^1.22.0", + "@azure/storage-blob": "^12.29.1", semver: "^6.3.1" }, devDependencies: { - "@types/node": "^22.13.9", + "@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" } }; } @@ -71006,12 +76957,11 @@ 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 = void 0; + exports2.getUserAgentString = getUserAgentString; var packageJson = require_package2(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } - exports2.getUserAgentString = getUserAgentString; } }); @@ -71019,7 +76969,7 @@ var require_user_agent = __commonJS({ var require_cacheHttpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -71032,21 +76982,31 @@ var require_cacheHttpClient = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -71074,13 +77034,16 @@ var require_cacheHttpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var auth_1 = require_auth2(); - var fs7 = __importStar4(require("fs")); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache4; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs8 = __importStar2(require("fs")); var url_1 = require("url"); - var utils = __importStar4(require_cacheUtils()); + var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); var downloadUtils_1 = require_downloadUtils(); var options_1 = require_options(); @@ -71113,11 +77076,11 @@ var require_cacheHttpClient = __commonJS({ return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); } function getCacheEntry(keys, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { @@ -71140,11 +77103,10 @@ var require_cacheHttpClient = __commonJS({ return cacheResult; }); } - exports2.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { @@ -71161,7 +77123,7 @@ Other caches with similar key:`); }); } function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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")) { @@ -71177,9 +77139,8 @@ Other caches with similar key:`); } }); } - exports2.downloadCache = downloadCache; function reserveCache(key, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -71187,24 +77148,23 @@ Other caches with similar key:`); version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); })); return response; }); } - exports2.reserveCache = reserveCache; function getContentRange(start, end) { return `bytes ${start}-${end}/*`; } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { core14.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})`, () => __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -71213,10 +77173,10 @@ Other caches with similar key:`); }); } function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs7.openSync(archivePath, "r"); + const fd = fs8.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -71224,38 +77184,38 @@ Other caches with similar key:`); core14.debug("Awaiting all uploads"); let offset = 0; try { - yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () { + 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, () => fs7.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs8.createReadStream(archivePath, { fd, start, end, autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); + }).on("error", (error3) => { + throw new Error(`Cache upload failed because file read failed with ${error3.message}`); }), start, end); } }))); } finally { - fs7.closeSync(fd); + fs8.closeSync(fd); } return; }); } function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); } function saveCache4(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { if (!signedUploadURL) { @@ -71277,7 +77237,6 @@ Other caches with similar key:`); } }); } - exports2.saveCache = saveCache4; } }); @@ -71449,7 +77408,7 @@ var require_binary_format_contract = __commonJS({ exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; var UnknownFieldHandler; (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = Symbol.for("protobuf-ts/unknown"); + 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 }); @@ -72374,7 +78333,7 @@ var require_message_type_contract = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); } }); @@ -72872,26 +78831,26 @@ var require_reflection_json_reader = __commonJS({ const fieldObj = target[localName]; for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { this.assert(jsonObjValue !== null, field.name + " map value", null); - let val2; + let val; switch (field.V.kind) { case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); + val = field.V.T().internalJsonRead(jsonObjValue, options); break; case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); break; } - this.assert(val2 !== void 0, field.name + " map value", jsonObjValue); + 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] = val2; + fieldObj[key] = val; } } else if (field.repeat) { if (jsonValue === null) @@ -72900,22 +78859,22 @@ var require_reflection_json_reader = __commonJS({ const fieldArr = target[localName]; for (const jsonItem of jsonValue) { this.assert(jsonItem !== null, field.name, null); - let val2; + let val; switch (field.kind) { case "message": - val2 = field.T().internalJsonRead(jsonItem, options); + val = field.T().internalJsonRead(jsonItem, options); break; case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); + val = this.scalar(jsonItem, field.T, field.L, field.name); break; } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); + this.assert(val !== void 0, field.name, jsonValue); + fieldArr.push(val); } } else { switch (field.kind) { @@ -72929,10 +78888,10 @@ var require_reflection_json_reader = __commonJS({ case "enum": if (jsonValue === null) continue; - let val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; - target[localName] = val2; + target[localName] = val; break; case "scalar": if (jsonValue === null) @@ -73082,8 +79041,8 @@ var require_reflection_json_reader = __commonJS({ break; return base64_1.base64decode(json2); } - } catch (error4) { - e = error4.message; + } catch (error3) { + e = error3.message; } this.assert(false, fieldName + (e ? " - " + e : ""), json2); } @@ -73137,26 +79096,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== void 0); + jsonObj[entryKey.toString()] = val; } break; } @@ -73168,26 +79127,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { - const val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== void 0); + jsonArr.push(val); } break; } @@ -73437,7 +79396,7 @@ var require_reflection_binary_reader = __commonJS({ let length = reader.uint32(); let end = reader.pos + length; let key = void 0; - let val2 = void 0; + let val = void 0; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -73450,13 +79409,13 @@ var require_reflection_binary_reader = __commonJS({ case 2: switch (field.V.kind) { case "scalar": - val2 = this.scalar(reader, field.V.T, field.V.L); + val = this.scalar(reader, field.V.T, field.V.L); break; case "enum": - val2 = reader.int32(); + val = reader.int32(); break; case "message": - val2 = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); break; } break; @@ -73468,19 +79427,19 @@ var require_reflection_binary_reader = __commonJS({ let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; } - if (val2 === void 0) + if (val === void 0) switch (field.V.kind) { case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); break; case "enum": - val2 = 0; + val = 0; break; case "message": - val2 = field.V.T().create(); + val = field.V.T().create(); break; } - return [key, val2]; + return [key, val]; } scalar(reader, type2, longType) { switch (type2) { @@ -73585,8 +79544,8 @@ var require_reflection_binary_writer = __commonJS({ break; case "map": assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); break; } } @@ -74156,18 +80115,18 @@ var require_enum_object = __commonJS({ } exports2.listEnumValues = listEnumValues; function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + return listEnumValues(enumObject).map((val) => val.name); } exports2.listEnumNames = listEnumNames; function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } exports2.listEnumNumbers = listEnumNumbers; } }); // node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ +var require_commonjs16 = __commonJS({ "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -74358,7 +80317,7 @@ var require_reflection_info2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function normalizeMethodInfo(method, service) { var _a, _b, _c; let m = method; @@ -74446,1810 +80405,2967 @@ var require_rpc_error = __commonJS({ 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}`); + 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(defaults, options) { + if (!options) + return defaults; + let o = {}; + copy(defaults, o); + copy(options, o); + for (let key of Object.keys(options)) { + let val = options[key]; + switch (key) { + case "jsonOptions": + o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); + break; + case "binaryOptions": + o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); + break; + case "meta": + o.meta = {}; + copy(defaults.meta, o.meta); + copy(options.meta, o.meta); + break; + case "interceptors": + o.interceptors = defaults.interceptors ? defaults.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((resolve5, reject) => { + this._resolve = resolve5; + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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); } } - return l.join("\n"); - } + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - 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_commonjs11(); - function mergeRpcOptions(defaults, options) { - if (!options) - return defaults; - let o = {}; - copy(defaults, o); - copy(options, o); - for (let key of Object.keys(options)) { - let val2 = options[key]; - switch (key) { - case "jsonOptions": - o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); - break; - case "binaryOptions": - o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); - break; - case "meta": - o.meta = {}; - copy(defaults.meta, o.meta); - copy(options.meta, o.meta); - break; - case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); - break; - } + exports2.DuplexStreamingCall = void 0; + var DuplexStreamingCall = class { + constructor(method, requestHeaders, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - 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; + /** + * 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/deferred.js -var require_deferred = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/deferred.js"(exports2) { +// 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"; - 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((resolve5, reject) => { - this._resolve = resolve5; - this._reject = reject; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); - if (preventUnhandledRejectionWarning) { - this._promise.catch((_2) => { - }); - } } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 { /** - * Get the current state of the promise. + * Initialize with mock data. Omitted fields have default value. */ - get state() { - return this._state; + 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 : {}; } /** - * Get the deferred promise. + * Sent message(s) during the last operation. */ - get promise() { - return this._promise; + get sentMessages() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.sent; + } else if (typeof this.lastInput == "object") { + return [this.lastInput.single]; + } + return []; } /** - * Resolve the promise. Throws if the promise is already resolved or rejected. + * Sending message(s) completed? */ - resolve(value) { - if (this.state !== DeferredState.PENDING) - throw new Error(`cannot resolve ${DeferredState[this.state].toLowerCase()}`); - this._resolve(value); - this._state = DeferredState.RESOLVED; + get sendComplete() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.completed; + } else if (typeof this.lastInput == "object") { + return true; + } + return false; } - /** - * 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; + // Creates a promise for response headers from the mock data. + promiseHeaders() { + var _a; + const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; + return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); } - /** - * Resolve the promise. Ignore if not pending. - */ - resolvePending(val2) { - if (this._state === DeferredState.PENDING) - this.resolve(val2); + // 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); } /** - * Reject the promise. Ignore if not pending. + * 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. */ - 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_commonjs11(); - var RpcOutputStreamController = class { - constructor() { - this._lis = { - nxt: [], - msg: [], - err: [], - cmp: [] - }; - this._closed = false; - this._itState = { q: [] }; + streamResponses(method, stream, 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 delay(this.responseDelay, abort)(void 0); + } catch (error3) { + stream.notifyError(error3); + return; + } + if (this.data.response instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.response); + return; + } + for (let msg of messages) { + stream.notifyMessage(msg); + try { + yield delay(this.betweenResponseDelay, abort)(void 0); + } catch (error3) { + stream.notifyError(error3); + return; + } + } + if (this.data.status instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.status); + return; + } + if (this.data.trailers instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.trailers); + return; + } + stream.notifyComplete(); + }); } - // --- RpcOutputStream callback API - onNext(callback) { - return this.addLis(callback, this._lis.nxt); + // Creates a promise for response status from the mock data. + promiseStatus() { + var _a; + const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; + return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); } - onMessage(callback) { - return this.addLis(callback, this._lis.msg); + // Creates a promise for response trailers from the mock data. + promiseTrailers() { + var _a; + const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; + return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); } - onError(callback) { - return this.addLis(callback, this._lis.err); + maybeSuppressUncaught(...promise) { + if (this.suppressUncaughtRejections) { + for (let p of promise) { + p.catch(() => { + }); + } + } } - onComplete(callback) { - return this.addLis(callback, this._lis.cmp); + mergeOptions(options) { + return rpc_options_1.mergeRpcOptions({}, options); } - addLis(callback, list) { - list.push(callback); - return () => { - let i = list.indexOf(callback); - if (i >= 0) - list.splice(i, 1); - }; + unary(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_2) => { + }).then(delay(this.responseDelay, options.abort)).then((_2) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_2) => { + }).then(delay(this.afterResponseDelay, options.abort)).then((_2) => this.promiseStatus()), trailersPromise = responsePromise.catch((_2) => { + }).then(delay(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); } - // remove all listeners - clearLis() { - for (let l of Object.values(this._lis)) - l.splice(0, l.length); + serverStreaming(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay(this.responseDelay, options.abort)).catch(() => { + }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay(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); } - // --- Controller API - /** - * Is this stream already closed by a completion or error? - */ - get closed() { - return this._closed !== false; + clientStreaming(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_2) => { + }).then(delay(this.responseDelay, options.abort)).then((_2) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_2) => { + }).then(delay(this.afterResponseDelay, options.abort)).then((_2) => this.promiseStatus()), trailersPromise = responsePromise.catch((_2) => { + }).then(delay(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); } - /** - * 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, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); - if (message) - this.notifyMessage(message); - if (error4) - this.notifyError(error4); - if (complete) - this.notifyComplete(); + duplex(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay(this.responseDelay, options.abort)).catch(() => { + }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay(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); } - /** - * 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)); + }; + exports2.TestTransport = TestTransport; + TestTransport.defaultHeaders = { + responseHeader: "test" + }; + TestTransport.defaultStatus = { + code: "OK", + detail: "all good" + }; + TestTransport.defaultTrailers = { + responseTrailer: "test" + }; + function delay(ms, abort) { + return (v) => new Promise((resolve5, reject) => { + if (abort === null || abort === void 0 ? void 0 : abort.aborted) { + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + } else { + const id = setTimeout(() => resolve5(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; } - /** - * Closes the stream with an error. Throws if stream is closed. - * - * Triggers onNext and onError callbacks. - */ - notifyError(error4) { - runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); - this.clearLis(); + get sent() { + return this._sent; } - /** - * 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(); + get completed() { + return this._completed; } - /** - * 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; - } - }; + 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(delay(delayMs, this.abort)); } - // "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); + 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(delay(delayMs, this.abort)); } }; - 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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); - } + 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 _a, _b, _c, _d; + if (kind == "unary") { + let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); + for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { + const next = tail; + tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + 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); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UnaryCall = void 0; - var UnaryCall = class { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + return tail(method, input, options); } - /** - * 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)); + 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); } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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); } - }; - exports2.UnaryCall = UnaryCall; + 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-streaming-call.js -var require_server_streaming_call = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js"(exports2) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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, request, headers, response, status, trailers) { + 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.requestHeaders = requestHeaders; - this.request = request; this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; + this.deadline = deadline; + this.trailers = {}; + this._sendRH = sendResponseHeadersFn; + this.status = defaultStatus; } /** - * 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. + * Set the call cancelled. + * + * Invokes all callbacks registered with onCancel() and + * sets `cancelled = true`. */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); + notifyCancelled() { + if (!this._cancelled) { + this._cancelled = true; + for (let l of this._listeners) { + l(); + } + } } - promiseFinished() { - return __awaiter4(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 - }; - }); + /** + * 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.ServerStreamingCall = ServerStreamingCall; + exports2.ServerCallContextController = ServerCallContextController; } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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*/ } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + ]); + } + 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); } } - function step(result) { - result.done ? resolve5(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - 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)); + return message; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.ClientStreamingCall = ClientStreamingCall; + exports2.CacheScope = new CacheScope$Type(); } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; + 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 } + ]); } - /** - * 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)); + 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; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.DuplexStreamingCall = DuplexStreamingCall; + exports2.CacheMetadata = new CacheMetadata$Type(); } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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*/ } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + ]); + } + 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); } } - function step(result) { - result.done ? resolve5(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_commonjs11(); - 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 : {}; + return message; } - /** - * 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 []; + 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; } - /** - * 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; + }; + 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*/ + } + ]); } - // Creates a promise for response headers from the mock data. - promiseHeaders() { - var _a; - const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; - return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); + 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; } - // 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(); + 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); + } } - runtime_1.assert(method.O.is(r)); - return Promise.resolve(r); + return message; } - /** - * 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, stream, abort) { - return __awaiter4(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 delay(this.responseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); - return; - } - if (this.data.response instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.response); - return; + 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*/ } - for (let msg of messages) { - stream.notifyMessage(msg); - try { - yield delay(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); - return; - } + ]); + } + 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); } - if (this.data.status instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.status); - return; + } + 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*/ } - if (this.data.trailers instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.trailers); - return; + ]); + } + 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); } - stream.notifyComplete(); - }); + } + return message; } - // Creates a promise for response status from the mock data. - promiseStatus() { - var _a; - const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; - return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); + 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; } - // Creates a promise for response trailers from the mock data. - promiseTrailers() { - var _a; - const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; - return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); + }; + 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*/ + } + ]); } - maybeSuppressUncaught(...promise) { - if (this.suppressUncaughtRejections) { - for (let p of promise) { - p.catch(() => { - }); + 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; } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); - } - unary(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_2) => { - }).then(delay(this.responseDelay, options.abort)).then((_2) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_2) => { - }).then(delay(this.afterResponseDelay, options.abort)).then((_2) => this.promiseStatus()), trailersPromise = responsePromise.catch((_2) => { - }).then(delay(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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay(this.responseDelay, options.abort)).catch(() => { - }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay(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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_2) => { - }).then(delay(this.responseDelay, options.abort)).then((_2) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_2) => { - }).then(delay(this.afterResponseDelay, options.abort)).then((_2) => this.promiseStatus()), trailersPromise = responsePromise.catch((_2) => { - }).then(delay(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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay(this.responseDelay, options.abort)).catch(() => { - }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay(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); + 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.TestTransport = TestTransport; - TestTransport.defaultHeaders = { - responseHeader: "test" - }; - TestTransport.defaultStatus = { - code: "OK", - detail: "all good" - }; - TestTransport.defaultTrailers = { - responseTrailer: "test" - }; - function delay(ms, abort) { - return (v) => new Promise((resolve5, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - } else { - const id = setTimeout(() => resolve5(v), ms); - if (abort) { - abort.addEventListener("abort", (ev) => { - clearTimeout(id); - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - }); + 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*/ } - } - }); - } - 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; + 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; } - send(message) { - if (this.data.inputMessage instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.inputMessage); + 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); + } } - const delayMs = this.data.inputMessage === void 0 ? 10 : this.data.inputMessage; - return Promise.resolve(void 0).then(() => { - this._sent.push(message); - }).then(delay(delayMs, this.abort)); + return message; } - 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(delay(delayMs, this.abort)); + 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/@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) { +// 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.stackDuplexStreamingInterceptors = exports2.stackClientStreamingInterceptors = exports2.stackServerStreamingInterceptors = exports2.stackUnaryInterceptors = exports2.stackIntercept = void 0; - var runtime_1 = require_commonjs11(); - function stackIntercept(kind, transport, method, options, input) { - var _a, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).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); + 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); } - 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); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toJson(request, { + 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 + })); } - 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); + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { + 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 + })); } - 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; + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { + 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 + })); } - /** - * 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(); - } - } + }; + exports2.CacheServiceClientJSON = CacheServiceClientJSON; + var CacheServiceClientProtobuf = class { + constructor(rpc) { + this.rpc = rpc; + this.CreateCacheEntry.bind(this); + this.FinalizeCacheEntryUpload.bind(this); + this.GetCacheEntryDownloadURL.bind(this); } - /** - * Send response headers. - */ - sendResponseHeaders(data) { - this._sendRH(data); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); + return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); } - /** - * 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; + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); + return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); } - /** - * 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); - }; + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); + 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.ServerCallContextController = ServerCallContextController; + exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; } }); -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs12 = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js"(exports2) { +// node_modules/@actions/cache/lib/internal/shared/util.js +var require_util9 = __commonJS({ + "node_modules/@actions/cache/lib/internal/shared/util.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; - } }); + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; + var core_1 = require_core(); + function maskSigUrl(url) { + if (!url) + return; + try { + const parsedUrl = new URL(url); + 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: ${url} ${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/generated/results/entities/v1/cachescope.js -var require_cachescope = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/entities/v1/cachescope.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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_util9(); + var CacheServiceClient = class { + constructor(userAgent, 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(userAgent, [ + new auth_1.BearerCredentialHandler(token) ]); } - 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; + // 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 url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; + (0, core_1.debug)(`[Request] ${method} ${url}`); + const headers = { + "Content-Type": contentType + }; + try { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { + return this.httpClient.post(url, JSON.stringify(data), headers); + })); + return body; + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.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); + 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++; } - } - return message; + throw new Error(`Request failed`); + }); } - 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; + 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((resolve5) => setTimeout(resolve5, 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); } }; - exports2.CacheScope = new CacheScope$Type(); + 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/generated/results/entities/v1/cachemetadata.js -var require_cachemetadata = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/entities/v1/cachemetadata.js"(exports2) { +// node_modules/@actions/cache/lib/internal/tar.js +var require_tar = __commonJS({ + "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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 } - ]); + 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]; + } }; } - 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; + 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(resolve5) { + resolve5(value); + }); } - 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(); + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 = extractTar2; + exports2.createTar = createTar; + var exec_1 = require_exec(); + var io6 = __importStar2(require_io()); + var fs_1 = require("fs"); + var path7 = __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 io6.which("gtar", false); + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else { + return { + path: yield io6.which("tar", true), + type: constants_1.ArchiveToolType.BSD + }; + } + } + default: + break; + } + return { + path: yield io6.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, type2, 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 (type2) { + case "create": + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + break; + case "extract": + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path7.sep}`, "g"), "/")); + break; + case "list": + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P"); + break; + } + if (tarPath.type === constants_1.ArchiveToolType.GNU) { + switch (process.platform) { + case "win32": + args.push("--force-local"); break; - case /* repeated github.actions.results.entities.v1.CacheScope scope */ - 2: - message.scope.push(cachescope_1.CacheScope.internalBinaryRead(reader, reader.uint32(), options)); + case "darwin": + args.push("--delay-directory-restore"); 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(); + return args; + }); + } + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { + let args; + const tarPath = yield getTarPath(); + const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); + const compressionArgs = type2 !== "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 && type2 !== "create") { + args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + } else { + args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + } + if (BSD_TAR_ZSTD) { + return args; + } + return [args.join(" ")]; + }); + } + function getWorkingDirectory() { + var _a; + return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : 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(`\\${path7.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(`\\${path7.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(`\\${path7.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(`\\${path7.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 extractTar2(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const workingDirectory = getWorkingDirectory(); + yield io6.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)(path7.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + const commands = yield getCommands(compressionMethod, "create"); + yield execCommands(commands, archiveFolder); + }); + } } }); -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/api/v1/cache.js"(exports2) { +// node_modules/@actions/cache/lib/cache.js +var require_cache4 = __commonJS({ + "node_modules/@actions/cache/lib/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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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; + 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]; + } }; } - 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); + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; + var core14 = __importStar2(require_core()); + var path7 = __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 ValidationError = class _ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + Object.setPrototypeOf(this, _ValidationError.prototype); } }; - 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*/ - } - ]); + exports2.ValidationError = ValidationError; + var ReserveCacheError2 = class _ReserveCacheError extends Error { + constructor(message) { + super(message); + this.name = "ReserveCacheError"; + Object.setPrototypeOf(this, _ReserveCacheError.prototype); } - 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; + }; + exports2.ReserveCacheError = ReserveCacheError2; + var FinalizeCacheError = class _FinalizeCacheError extends Error { + constructor(message) { + super(message); + this.name = "FinalizeCacheError"; + Object.setPrototypeOf(this, _FinalizeCacheError.prototype); } - 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; + }; + 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`); } - 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; + } + function checkKey(key) { + if (key.length > 512) { + throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); } - }; - 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*/ - } - ]); + const regex = /^[^,]*$/; + if (!regex.test(key)) { + throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); } - 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; + } + 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"]; } - 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); + } + function restoreCache4(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)(); + core14.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + 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) { + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core14.debug("Resolved Keys:"); + core14.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 { + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + return void 0; + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core14.info("Lookup only - skipping download"); + return cacheEntry.cacheKey; + } + archivePath = path7.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core14.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) { + core14.error(`Failed to restore: ${error3.message}`); + } else { + core14.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } - 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*/ + 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) { + options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core14.debug("Resolved Keys:"); + core14.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 request = { + key: primaryKey, + restoreKeys, + version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) + }; + const response = yield twirpClient.GetCacheEntryDownloadURL(request); + if (!response.ok) { + core14.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); + return void 0; + } + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core14.info(`Cache hit for restore-key: ${response.matchedKey}`); + } else { + core14.info(`Cache hit for: ${response.matchedKey}`); + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core14.info("Lookup only - skipping download"); + return response.matchedKey; + } + archivePath = path7.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive path: ${archivePath}`); + core14.debug(`Starting download of archive to: ${archivePath}`); + yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core14.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) { + core14.error(`Failed to restore: ${error3.message}`); + } else { + core14.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + if (archivePath) { + yield utils.unlinkFile(archivePath); + } + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); + } + } + return void 0; + }); + } + function saveCache4(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + core14.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + checkKey(key); + 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 _a, _b, _c, _d, _e; + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core14.debug("Cache Paths:"); + core14.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 = path7.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.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.`); + } + core14.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { + throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + } + core14.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 === ReserveCacheError2.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); + } else { + core14.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.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) { + 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); + core14.debug("Cache Paths:"); + core14.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 = path7.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core14.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core14.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); + } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core14.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + } + core14.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); + core14.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 === ReserveCacheError2.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core14.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); + } else { + core14.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } - ]); + } + return cacheId; + }); + } + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/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; } - 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; + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - 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; + 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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - 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; + 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; }; - 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; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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; } - 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); + 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)}`; + } + } } } - return message; + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - 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; + }; + 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/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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; }; - 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*/ - } - ]); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs8 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - 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; + if (!fs8.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - 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; + fs8.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - 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; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - }; - 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 } - ]); + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// 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) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); - var CacheServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + exports2.checkBypass = exports2.getProxyUrl = void 0; + function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === "https:"; + if (checkBypass(reqUrl)) { + return void 0; } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toJson(request, { - 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 - })); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { - 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 - })); + } + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { - 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 - })); + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - }; - exports2.CacheServiceClientJSON = CacheServiceClientJSON; - var CacheServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/protobuf", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromBinary(data2)); + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; } }; - 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) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; - var core_1 = require_core(); - function maskSigUrl(url) { - if (!url) - return; - try { - const parsedUrl = new URL(url); - const signature = parsedUrl.searchParams.get("sig"); - if (signature) { - (0, core_1.setSecret)(signature); - (0, core_1.setSecret)(encodeURIComponent(signature)); - } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); - } - } - 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); + 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]; + } }; } - if ("signed_download_url" in body && typeof body.signed_download_url === "string") { - maskSigUrl(body.signed_download_url); + 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); } - } - exports2.maskSecretUrls = maskSecretUrls; - } -}); - -// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + __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(resolve5) { resolve5(value); @@ -76277,183 +83393,571 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; - 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_auth2(); - var http_client_1 = require_lib4(); - var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util10(); - var CacheServiceClient = class { - constructor(userAgent, 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; + exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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((resolve5) => __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", () => { + resolve5(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve5(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(userAgent, 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 = userAgent; + 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; + } } - if (baseRetryIntervalMilliseconds) { - this.baseRetryIntervalMilliseconds = baseRetryIntervalMilliseconds; + } + 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, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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 info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, 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(); } - if (retryMultiplier) { - this.retryMultiplier = retryMultiplier; + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve5(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; + } + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.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: ${info7.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(); } - this.httpClient = new http_client_1.HttpClient(userAgent, [ - 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 __awaiter4(this, void 0, void 0, function* () { - const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; - (0, core_1.debug)(`[Request] ${method} ${url}`); - const headers = { - "Content-Type": contentType + /** + * 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 info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); + } + } + return info7; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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 }) }; - try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { - return this.httpClient.post(url, JSON.stringify(data), headers); - })); - return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + 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 https2.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((resolve5) => setTimeout(() => resolve5(), ms)); }); } - retryableRequest(operation) { - return __awaiter4(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(); + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve5(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; } - errorMessage = `${errorMessage}: ${body.msg}`; - } - } catch (error4) { - if (error4 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); - } - if (error4 instanceof errors_1.UsageError) { - throw error4; - } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); } - isRetryable = true; - errorMessage = error4.message; + return value; } - if (!isRetryable) { - throw new Error(`Received non-retryable error: ${errorMessage}`); + 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 (attempt + 1 === this.maxAttempts) { - throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); + 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 { + resolve5(response); } - 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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => setTimeout(resolve5, 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); - } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -76481,623 +83985,524 @@ var require_tar = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; - var exec_1 = require_exec(); - var io6 = __importStar4(require_io3()); - var fs_1 = require("fs"); - var path6 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { - return __awaiter4(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 io6.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io6.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; - } - } - default: - break; - } - return { - path: yield io6.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); - } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - 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 (type2) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path6.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path6.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path6.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path6.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path6.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path6.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, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); - const compressionArgs = type2 !== "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 && type2 !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; - } else { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; - } - if (BSD_TAR_ZSTD) { - return args; - } - return [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a; - return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(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(`\\${path6.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(`\\${path6.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; - } - }); - } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(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(`\\${path6.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(`\\${path6.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; - } - }); - } - function execCommands(commands, cwd) { - return __awaiter4(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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); - } + 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"); } - }); - } - function listTar(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - exports2.listTar = listTar; - function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io6.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - exports2.extractTar = extractTar2; - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path6.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - exports2.createTar = createTar; - } -}); - -// node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core14 = __importStar4(require_core()); - var path6 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); - var config_1 = require_config(); - var tar_1 = require_tar(); - var http_client_1 = require_lib4(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - }; - exports2.ValidationError = ValidationError; - var ReserveCacheError2 = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); + // 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}`; } - }; - exports2.ReserveCacheError = ReserveCacheError2; - var FinalizeCacheError = class _FinalizeCacheError extends Error { - constructor(message) { - super(message); - this.name = "FinalizeCacheError"; - Object.setPrototypeOf(this, _FinalizeCacheError.prototype); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } }; - 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`); + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - } - function checkKey(key) { - if (key.length > 512) { - throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); + // 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")}`; } - const regex = /^[^,]*$/; - if (!regex.test(key)) { - throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - } - 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"]; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache4(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - switch (cacheServiceVersion) { - case "v2": - return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - case "v1": - default: - return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - } - }); - } - exports2.restoreCache = restoreCache4; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.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 { - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path6.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); - } else { - core14.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + }; + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.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 request = { - key: primaryKey, - restoreKeys, - version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) - }; - const response = yield twirpClient.GetCacheEntryDownloadURL(request); - if (!response.ok) { - core14.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); - return void 0; - } - const isRestoreKeyMatch = request.key !== response.matchedKey; - if (isRestoreKeyMatch) { - core14.info(`Cache hit for restore-key: ${response.matchedKey}`); - } else { - core14.info(`Cache hit for: ${response.matchedKey}`); - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); - return response.matchedKey; - } - archivePath = path6.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive path: ${archivePath}`); - core14.debug(`Starting download of archive to: ${archivePath}`); - yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); - return response.matchedKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); - } else { - core14.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + function rejected(value) { try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function saveCache4(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - exports2.saveCache = saveCache4; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core14.debug("Cache Paths:"); - core14.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.`); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OidcClient = void 0; + var http_client_1 = require_lib5(); + var auth_1 = require_auth3(); + 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"); } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path6.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.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.`); - } - core14.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize + 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 _a; + 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}`); }); - if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - core14.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError2.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); + 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}`); } - } finally { + }); + } + }; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core14.debug("Cache Paths:"); - core14.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 = path6.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core14.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; + function rejected(value) { try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core14.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core14.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } - core14.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); - core14.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.`); + } + function step(result) { + result.done ? resolve5(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; } - cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError2.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core14.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); - } + 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.`); } - } finally { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + 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 cacheId; - }); + 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/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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 path7 = __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, path7.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ +var require_io_util3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77106,21 +84511,21 @@ var require_io_util4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -77150,14 +84555,14 @@ var require_io_util4 = __commonJS({ var _a; 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 fs7 = __importStar4(require("fs")); - var path6 = __importStar4(require("path")); - _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + var fs8 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); + _a = fs8.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs7.constants.O_RDONLY; + exports2.READONLY = fs8.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -77171,7 +84576,7 @@ var require_io_util4 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -77189,7 +84594,7 @@ var require_io_util4 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -77200,7 +84605,7 @@ var require_io_util4 = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path6.extname(filePath).toUpperCase(); + const upperExt = path7.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -77224,11 +84629,11 @@ var require_io_util4 = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path6.dirname(filePath); - const upperName = path6.basename(filePath).toUpperCase(); + const directory = path7.dirname(filePath); + const upperName = path7.basename(filePath).toUpperCase(); for (const actualName of yield exports2.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path6.join(directory, actualName); + filePath = path7.join(directory, actualName); break; } } @@ -77267,10 +84672,10 @@ var require_io_util4 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ +var require_io3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77279,21 +84684,21 @@ var require_io4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -77323,16 +84728,16 @@ var require_io4 = __commonJS({ 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 path6 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); + var path7 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 ? path6.join(dest, path6.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path7.join(dest, path7.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -77344,7 +84749,7 @@ var require_io4 = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path6.relative(source, newDest) === "") { + if (path7.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); @@ -77353,11 +84758,11 @@ var require_io4 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path6.join(dest, path6.basename(source)); + dest = path7.join(dest, path7.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -77368,13 +84773,13 @@ var require_io4 = __commonJS({ } } } - yield mkdirP(path6.dirname(dest)); + yield mkdirP(path7.dirname(dest)); yield ioUtil.rename(source, dest); }); } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -77394,14 +84799,14 @@ var require_io4 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77425,13 +84830,13 @@ var require_io4 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + 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(path6.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path7.delimiter)) { if (extension) { extensions.push(extension); } @@ -77444,12 +84849,12 @@ var require_io4 = __commonJS({ } return []; } - if (tool.includes(path6.sep)) { + if (tool.includes(path7.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path6.delimiter)) { + for (const p of process.env.PATH.split(path7.delimiter)) { if (p) { directories.push(p); } @@ -77457,7 +84862,7 @@ var require_io4 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path6.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path7.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -77473,7 +84878,7 @@ var require_io4 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -77493,7 +84898,7 @@ var require_io4 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -77514,38 +84919,34 @@ var require_io4 = __commonJS({ } }); -// node_modules/@actions/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -77573,819 +84974,463 @@ var require_manifest = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os = require("os"); - var cp = require("child_process"); - var fs7 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path7 = __importStar2(require("path")); + var io6 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = class extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os.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; + } + _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)}`; } } - } - } - return version; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs7.existsSync(lsbReleaseFile)) { - contents = fs7.readFileSync(lsbReleaseFile).toString(); - } else if (fs7.existsSync(osReleaseFile)) { - contents = fs7.readFileSync(osReleaseFile).toString(); - } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/tool-cache/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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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}`); + return cmd; } - 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; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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]; } } - function step(result) { - result.done ? resolve5(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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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; + return this.args; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(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", () => { - resolve5(output.toString()); - }); - })); - }); + _endsWith(str2, end) { + return str2.endsWith(end); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve5(Buffer.concat(chunks)); - }); - })); - }); + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + _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 (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + 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(""); } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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); - }); + _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(""); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + _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; } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + _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; } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * 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 */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + exec() { + return __awaiter2(this, void 0, void 0, function* () { + if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { + this.toolPath = path7.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve5, 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) + os2.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 (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, data); - } else { - return response; - } + 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 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; + 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); } - 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."); + if (errbuffer.length > 0) { + this.emit("errline", errbuffer); } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + cp.removeAllListeners(); + if (error3) { + reject(error3); + } else { + resolve5(exitCode); } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } - } 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(); + }; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve5(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + arg += c; + escaped = false; } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + continue; } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } + if (c === "\\" && escaped) { + append(c); + continue; } - const req = info7.httpModule.request(info7.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: ${info7.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + if (c === "\\" && inQuotes) { + escaped = true; + continue; } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; } + append(c); } - /** - * 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); + if (arg.length > 0) { + args.push(arg.trim()); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; + 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"); } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - return info7; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + CheckComplete() { + if (this.done) { + return; } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } - return additionalHeaders[header] || clientHeader || _default2; } - _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; + _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`); } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.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 (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; } - if (proxyAgent) { - return proxyAgent; + this.done = true; + this.emit("done", error3, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; } - 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 - }); + 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); } - return proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve5(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 { - resolve5(response); - } - })); - }); + state._setResult(); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -78413,58 +85458,63 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core14 = __importStar4(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"); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + 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.`); } - } - execute(action, isRetryable) { - return __awaiter4(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; - } - core14.info(err.message); - } - const seconds = this.getSleepAmount(); - core14.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + 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 _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => setTimeout(resolve5, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + }; + 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/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78477,21 +85527,21 @@ var require_tool_cache = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -78518,613 +85568,546 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core14 = __importStar4(require_core()); - var io6 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs7 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os = __importStar4(require("os")); - var path6 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver8 = __importStar4(require_semver2()); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var assert_1 = require("assert"); - var exec_1 = require_exec(); - var retry_helper_1 = require_retry_helper(); - var HTTPError = class extends Error { - constructor(httpStatusCode) { - super(`Unexpected HTTP response: ${httpStatusCode}`); - this.httpStatusCode = httpStatusCode; - Object.setPrototypeOf(this, new.target.prototype); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.HTTPError = HTTPError; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path6.join(_getTempDirectory(), crypto.randomUUID()); - yield io6.mkdirP(path6.dirname(dest)); - core14.debug(`Downloading ${url}`); - core14.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); + 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_exec3()); + 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 }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs7.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false + 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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 }); - if (auth) { - core14.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError(response.message.statusCode); - core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs7.createWriteStream(dest)); - core14.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core14.debug("download failed"); - try { - yield io6.rmRF(dest); - } catch (err) { - core14.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } }); } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core14.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path6.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 - }; + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { try { - const powershellPath = yield io6.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core14.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() + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - }); - core14.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core14.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core14.isDebug()) { - args.push("-v"); - } - const xarPath = yield io6.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io6.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 - ]; - core14.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 io6.which("powershell", true); - core14.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io6.which("unzip", true); - const args = [file]; - if (!core14.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch}`); - core14.debug(`source dir: ${sourceDir}`); - if (!fs7.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); } - const destPath = yield _createToolPath(tool, version, arch); - for (const itemName of fs7.readdirSync(sourceDir)) { - const s = path6.join(sourceDir, itemName); - yield io6.cp(s, destPath, { recursive: true }); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - _completeToolPath(tool, version, arch); - return destPath; + 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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os2 = __importStar2(require("os")); + var path7 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch}`); - core14.debug(`source file: ${sourceFile}`); - if (!fs7.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch); - const destPath = path6.join(destFolder, targetFile); - core14.debug(`destination file ${destPath}`); - yield io6.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch); - return destFolder; - }); + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch) { - if (!toolName) { - throw new Error("toolName parameter is required"); + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); + process.env["PATH"] = `${inputPath}${path7.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - arch = arch || os.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; + if (options && options.trimWhitespace === false) { + return val; } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path6.join(_getCacheDirectory(), toolName, versionSpec, arch); - core14.debug(`checking cache: ${cachePath}`); - if (fs7.existsSync(cachePath) && fs7.existsSync(`${cachePath}.complete`)) { - core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); - toolPath = cachePath; - } else { - core14.debug("not found"); - } + 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 toolPath; + return inputs.map((input) => input.trim()); } - exports2.find = find2; - function findAllVersions2(toolName, arch) { - const versions = []; - arch = arch || os.arch(); - const toolPath = path6.join(_getCacheDirectory(), toolName); - if (fs7.existsSync(toolPath)) { - const children = fs7.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path6.join(toolPath, child, arch || ""); - if (fs7.existsSync(fullPath) && fs7.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return versions; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core14.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core14.debug("Invalid json"); - } - } - return releases; - }); + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path6.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io6.mkdirP(dest); - return dest; - }); + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; } - function _createToolPath(tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path6.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - core14.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io6.rmRF(folderPath); - yield io6.rmRF(markerPath); - yield io6.mkdirP(folderPath); - return folderPath; - }); + exports2.isDebug = isDebug2; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); } - function _completeToolPath(tool, version, arch) { - const folderPath = path6.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - const markerPath = `${folderPath}.complete`; - fs7.writeFileSync(markerPath, ""); - core14.debug("finished caching tool"); + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core14.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core14.debug(`explicit? ${valid3}`); - return valid3; + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core14.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } - return -1; + return result; }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core14.debug(`matched: ${version}`); - } else { - core14.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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; + exports2.group = group; + function saveState2(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 _getGlobal(key, defaultValue) { - const value = global[key]; - return value !== void 0 ? value : defaultValue; + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - function _unique(values) { - return Array.from(new Set(values)); + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/fast-deep-equal/index.js -var require_fast_deep_equal = __commonJS({ - "node_modules/fast-deep-equal/index.js"(exports2, module2) { +// node_modules/@actions/tool-cache/lib/manifest.js +var require_manifest = __commonJS({ + "node_modules/@actions/tool-cache/lib/manifest.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; + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - return true; - } - return a !== a && b !== b; + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - } -}); - -// node_modules/@actions/http-client/lib/proxy.js -var require_proxy5 = __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"]; + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os2 = require("os"); + var cp = require("child_process"); + var fs8 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os2.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; } - } else { - return void 0; - } + return result; + }); } - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os2.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; + } + } + } } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs8.existsSync(lsbReleaseFile)) { + contents = fs8.readFileSync(lsbReleaseFile).toString(); + } else if (fs8.existsSync(osReleaseFile)) { + contents = fs8.readFileSync(osReleaseFile).toString(); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + return contents; + } + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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]; + } }; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + __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(resolve5) { + resolve5(value); + }); } - 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 new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 core14 = __importStar2(require_core3()); + 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"); } } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; + 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; + } + core14.info(err.message); + } + const seconds = this.getSleepAmount(); + core14.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); + }); } - get password() { - return this._decodedPassword; + 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((resolve5) => setTimeout(resolve5, seconds * 1e3)); + }); } }; + exports2.RetryHelper = RetryHelper; } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -79137,31 +86120,21 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -79189,628 +86162,535 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core14 = __importStar2(require_core3()); + var io6 = __importStar2(require_io3()); + var crypto2 = __importStar2(require("crypto")); + var fs8 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os2 = __importStar2(require("os")); + var path7 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver9 = __importStar2(require_semver2()); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + var retry_helper_1 = require_retry_helper(); + var HTTPError = class extends Error { + constructor(httpStatusCode) { + super(`Unexpected HTTP response: ${httpStatusCode}`); + this.httpStatusCode = httpStatusCode; + Object.setPrototypeOf(this, new.target.prototype); } }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(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", () => { - resolve5(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve5(Buffer.concat(chunks)); - }); - })); + exports2.HTTPError = HTTPError; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path7.join(_getTempDirectory(), crypto2.randomUUID()); + yield io6.mkdirP(path7.dirname(dest)); + core14.debug(`Downloading ${url}`); + core14.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(url, dest || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + }); } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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); + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs8.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false + }); + if (auth) { + core14.debug("set auth"); + if (headers === void 0) { + headers = {}; } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; + headers.authorization = auth; + } + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError(response.message.statusCode); + core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs8.createWriteStream(dest)); + core14.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core14.debug("download failed"); + try { + yield io6.rmRF(dest); + } catch (err) { + core14.debug(`Failed to delete '${dest}'. ${err.message}`); + } } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + } + }); + } + 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 = core14.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } else { + const escapedScript = path7.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 io6.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core14.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() } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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(); + core14.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve5(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + if (core14.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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]; } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } + args.push("-x", "-C", dest, "-f", file); + if (core14.isDebug()) { + args.push("-v"); } - const req = info7.httpModule.request(info7.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: ${info7.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + const xarPath = yield io6.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + function extractZip(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); + dest = yield _createExtractFolder(dest); + if (IS_WINDOWS) { + yield extractZipWin(file, dest); } 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; + yield extractZipNix(file, dest); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; + return dest; + }); + } + exports2.extractZip = extractZip; + 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 io6.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 + ]; + core14.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 io6.which("powershell", true); + core14.debug(`Using powershell at path: ${powershellPath}`); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } + }); + } + function extractZipNix(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + const unzipPath = yield io6.which("unzip", true); + const args = [file]; + if (!core14.isDebug()) { + args.unshift("-q"); } - return info7; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os2.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch}`); + core14.debug(`source dir: ${sourceDir}`); + if (!fs8.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); } - return lowercaseKeys(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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; - if (headerValue) { - clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; - } + const destPath = yield _createToolPath(tool, version, arch); + for (const itemName of fs8.readdirSync(sourceDir)) { + const s = path7.join(sourceDir, itemName); + yield io6.cp(s, destPath, { recursive: true }); } - const additionalValue = additionalHeaders[header]; - if (additionalValue !== void 0) { - return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + _completeToolPath(tool, version, arch); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os2.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch}`); + core14.debug(`source file: ${sourceFile}`); + if (!fs8.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); } - if (clientHeader !== void 0) { - return clientHeader; + const destFolder = yield _createToolPath(tool, version, arch); + const destPath = path7.join(destFolder, targetFile); + core14.debug(`destination file ${destPath}`); + yield io6.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch) { + if (!toolName) { + throw new Error("toolName parameter is required"); + } + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); + } + arch = arch || os2.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path7.join(_getCacheDirectory(), toolName, versionSpec, arch); + core14.debug(`checking cache: ${cachePath}`); + if (fs8.existsSync(cachePath) && fs8.existsSync(`${cachePath}.complete`)) { + core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; + } else { + core14.debug("not found"); } - return _default2; } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch) { + const versions = []; + arch = arch || os2.arch(); + const toolPath = path7.join(_getCacheDirectory(), toolName); + if (fs8.existsSync(toolPath)) { + const children = fs8.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path7.join(toolPath, child, arch || ""); + if (fs8.existsSync(fullPath) && fs8.existsSync(`${fullPath}.complete`)) { + versions.push(child); } } } - 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 _default2; } - _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; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core14.debug("set auth"); + headers.authorization = auth; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; } - 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; + let manifestUrl = ""; + for (const item of response.result.tree) { + if (item.path === "versions-manifest.json") { + manifestUrl = item.url; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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 (_a) { + core14.debug("Invalid json"); + } } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path7.join(_getTempDirectory(), crypto2.randomUUID()); } - if (proxyAgent) { - return proxyAgent; + yield io6.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path7.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + core14.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io6.rmRF(folderPath); + yield io6.rmRF(markerPath); + yield io6.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch) { + const folderPath = path7.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + const markerPath = `${folderPath}.complete`; + fs8.writeFileSync(markerPath, ""); + core14.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core14.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core14.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core14.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); - }); + if (version) { + core14.debug(`matched: ${version}`); + } else { + core14.debug("match not found"); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve5(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 { - resolve5(response); - } - })); - }); + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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; }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ +var require_debug3 = __commonJS({ "node_modules/follow-redirects/debug.js"(exports2, module2) { var debug4; module2.exports = function() { if (!debug4) { try { debug4 = require_src()("follow-redirects"); - } catch (error4) { + } catch (error3) { } if (typeof debug4 !== "function") { debug4 = function() { @@ -79831,7 +86711,7 @@ var require_follow_redirects = __commonJS({ var https2 = require("https"); var Writable = require("stream").Writable; var assert = require("assert"); - var debug4 = require_debug2(); + var debug4 = require_debug3(); (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; @@ -79843,8 +86723,8 @@ var require_follow_redirects = __commonJS({ var useNativeURL = false; try { assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; } var preservedUrlFields = [ "auth", @@ -79918,9 +86798,9 @@ var require_follow_redirects = __commonJS({ this._currentRequest.abort(); this.emit("abort"); }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); + RedirectableRequest.prototype.destroy = function(error3) { + destroyRequest(this._currentRequest, error3); + destroy.call(this, error3); return this; }; RedirectableRequest.prototype.write = function(data, encoding, callback) { @@ -80087,10 +86967,10 @@ var require_follow_redirects = __commonJS({ var i = 0; var self2 = this; var buffers = this._requestBodyBuffers; - (function writeNext(error4) { + (function writeNext(error3) { if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); + if (error3) { + self2.emit("error", error3); } else if (i < buffers.length) { var buffer = buffers[i++]; if (!request.finished) { @@ -80289,12 +87169,12 @@ var require_follow_redirects = __commonJS({ }); return CustomError; } - function destroyRequest(request, error4) { + function destroyRequest(request, error3) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); - request.destroy(error4); + request.destroy(error3); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); @@ -80322,7 +87202,7 @@ var require_follow_redirects = __commonJS({ var require_config2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/config.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -80334,7 +87214,7 @@ var require_config2 = __commonJS({ exports2.getConcurrency = getConcurrency; exports2.getUploadChunkTimeout = getUploadChunkTimeout; exports2.getMaxArtifactListCount = getMaxArtifactListCount; - var os_1 = __importDefault4(require("os")); + var os_1 = __importDefault2(require("os")); var core_1 = require_core(); function getUploadChunkSize() { return 8 * 1024 * 1024; @@ -80418,13 +87298,13 @@ var require_timestamp = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Timestamp = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - var runtime_6 = require_commonjs11(); - var runtime_7 = require_commonjs11(); + 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", [ @@ -80567,13 +87447,13 @@ var require_wrappers = __commonJS({ "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_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - var runtime_6 = require_commonjs11(); - var runtime_7 = require_commonjs11(); + 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", [ @@ -80834,433 +87714,34 @@ var require_wrappers = __commonJS({ 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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", + no: 1, + name: "value", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 5, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, signedUploadUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: 0 }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81268,13 +87749,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* int32 value */ 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); + message.value = reader.int32(); break; default: let u = options.readUnknownField; @@ -81282,54 +87759,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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.value !== 0) + writer.tag(1, runtime_3.WireType.Varint).int32(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.MigrateArtifactResponse = new MigrateArtifactResponse$Type(); - var FinalizeMigratedArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.Int32Value = new Int32Value$Type(); + var UInt32Value$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [ + super("google.protobuf.UInt32Value", [ { 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", + name: "value", kind: "scalar", - T: 3 - /*ScalarType.INT64*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 13, void 0, "value"); + return target; + } create(value) { - const message = { workflowRunBackendId: "", name: "", size: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: 0 }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81337,17 +87813,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* uint32 value */ 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string name */ - 2: - message.name = reader.string(); - break; - case /* int64 size */ - 3: - message.size = reader.int64().toString(); + message.value = reader.uint32(); break; default: let u = options.readUnknownField; @@ -81355,49 +87823,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== 0) + writer.tag(1, runtime_3.WireType.Varint).uint32(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type(); - var FinalizeMigratedArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.UInt32Value = new UInt32Value$Type(); + var BoolValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [ + super("google.protobuf.BoolValue", [ { no: 1, - name: "ok", + name: "value", kind: "scalar", T: 8 /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "artifact_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ } ]); } + /** + * Encode `BoolValue` to JSON bool. + */ + internalJsonWrite(message, options) { + return message.value; + } + /** + * Decode `BoolValue` from JSON bool. + */ + internalJsonRead(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 8, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, artifactId: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: false }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81405,13 +87877,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* bool value */ 1: - message.ok = reader.bool(); - break; - case /* int64 artifact_id */ - 2: - message.artifactId = reader.int64().toString(); + message.value = reader.bool(); break; default: let u = options.readUnknownField; @@ -81419,62 +87887,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== false) + writer.tag(1, runtime_3.WireType.Varint).bool(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type(); - var CreateArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.BoolValue = new BoolValue$Type(); + var StringValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.CreateArtifactRequest", [ + super("google.protobuf.StringValue", [ { 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", + name: "value", 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*/ } ]); } + /** + * Encode `StringValue` to JSON string. + */ + internalJsonWrite(message, options) { + return message.value; + } + /** + * Decode `StringValue` from JSON string. + */ + internalJsonRead(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 9, void 0, "value"); + return target; + } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", version: 0 }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: "" }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81482,25 +87941,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* string value */ 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(); + message.value = reader.string(); break; default: let u = options.readUnknownField; @@ -81508,53 +87951,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== "") + writer.tag(1, runtime_3.WireType.LengthDelimited).string(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.CreateArtifactRequest = new CreateArtifactRequest$Type(); - var CreateArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.StringValue = new StringValue$Type(); + var BytesValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.CreateArtifactResponse", [ + super("google.protobuf.BytesValue", [ { no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "signed_upload_url", + name: "value", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 12, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, signedUploadUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81562,13 +88005,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* bytes value */ 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); + message.value = reader.bytes(); break; default: let u = options.readUnknownField; @@ -81576,26 +88015,42 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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.value.length) + writer.tag(1, runtime_3.WireType.LengthDelimited).bytes(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.CreateArtifactResponse = new CreateArtifactResponse$Type(); - var FinalizeArtifactRequest$Type = class extends runtime_5.MessageType { + 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.FinalizeArtifactRequest", [ + super("github.actions.results.api.v1.MigrateArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -81605,30 +88060,16 @@ var require_artifact = __commonJS({ }, { 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 } + { no: 3, name: "expires_at", kind: "message", T: () => timestamp_1.Timestamp } ]); } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", size: "0" }; + 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); @@ -81643,21 +88084,13 @@ var require_artifact = __commonJS({ 1: message.workflowRunBackendId = reader.string(); break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; case /* string name */ - 3: + 2: 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); + 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; @@ -81673,24 +88106,20 @@ var require_artifact = __commonJS({ 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(); + 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.FinalizeArtifactRequest = new FinalizeArtifactRequest$Type(); - var FinalizeArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.MigrateArtifactRequest = new MigrateArtifactRequest$Type(); + var MigrateArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeArtifactResponse", [ + super("github.actions.results.api.v1.MigrateArtifactResponse", [ { no: 1, name: "ok", @@ -81700,15 +88129,15 @@ var require_artifact = __commonJS({ }, { no: 2, - name: "artifact_id", + name: "signed_upload_url", kind: "scalar", - T: 3 - /*ScalarType.INT64*/ + T: 9 + /*ScalarType.STRING*/ } ]); } create(value) { - const message = { ok: false, artifactId: "0" }; + 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); @@ -81723,9 +88152,9 @@ var require_artifact = __commonJS({ 1: message.ok = reader.bool(); break; - case /* int64 artifact_id */ + case /* string signed_upload_url */ 2: - message.artifactId = reader.int64().toString(); + message.signedUploadUrl = reader.string(); break; default: let u = options.readUnknownField; @@ -81741,18 +88170,18 @@ var require_artifact = __commonJS({ 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); + 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.FinalizeArtifactResponse = new FinalizeArtifactResponse$Type(); - var ListArtifactsRequest$Type = class extends runtime_5.MessageType { + exports2.MigrateArtifactResponse = new MigrateArtifactResponse$Type(); + var FinalizeMigratedArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.ListArtifactsRequest", [ + super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -81762,17 +88191,22 @@ var require_artifact = __commonJS({ }, { no: 2, - name: "workflow_job_run_backend_id", + name: "name", 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 } + { + no: 3, + name: "size", + kind: "scalar", + T: 3 + /*ScalarType.INT64*/ + } ]); } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "" }; + 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); @@ -81787,17 +88221,13 @@ var require_artifact = __commonJS({ 1: message.workflowRunBackendId = reader.string(); break; - case /* string workflow_job_run_backend_id */ + case /* string name */ 2: - message.workflowJobRunBackendId = reader.string(); + message.name = reader.string(); break; - case /* google.protobuf.StringValue name_filter */ + case /* int64 size */ 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); + message.size = reader.int64().toString(); break; default: let u = options.readUnknownField; @@ -81813,106 +88243,38 @@ var require_artifact = __commonJS({ 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(); + 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.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*/ - }, + } + }; + exports2.FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type(); + var FinalizeMigratedArtifactResponse$Type = class extends runtime_5.MessageType { + constructor() { + super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [ { - no: 4, - name: "name", + no: 1, + name: "ok", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + T: 8 + /*ScalarType.BOOL*/ }, { - no: 5, - name: "size", + no: 2, + name: "artifact_id", 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" }; + 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); @@ -81923,33 +88285,13 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* bool ok */ 1: - message.workflowRunBackendId = reader.string(); + message.ok = reader.bool(); break; - case /* string workflow_job_run_backend_id */ + case /* int64 artifact_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); + message.artifactId = reader.int64().toString(); break; default: let u = options.readUnknownField; @@ -81963,30 +88305,20 @@ var require_artifact = __commonJS({ 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(); + 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.ListArtifactsResponse_MonolithArtifact = new ListArtifactsResponse_MonolithArtifact$Type(); - var GetSignedArtifactURLRequest$Type = class extends runtime_5.MessageType { + exports2.FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type(); + var CreateArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.GetSignedArtifactURLRequest", [ + super("github.actions.results.api.v1.CreateArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -82007,11 +88339,19 @@ var require_artifact = __commonJS({ 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: "" }; + 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); @@ -82034,6 +88374,14 @@ var require_artifact = __commonJS({ 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") @@ -82052,19 +88400,30 @@ var require_artifact = __commonJS({ 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.GetSignedArtifactURLRequest = new GetSignedArtifactURLRequest$Type(); - var GetSignedArtifactURLResponse$Type = class extends runtime_5.MessageType { + exports2.CreateArtifactRequest = new CreateArtifactRequest$Type(); + var CreateArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.GetSignedArtifactURLResponse", [ + super("github.actions.results.api.v1.CreateArtifactResponse", [ { no: 1, - name: "signed_url", + name: "ok", + kind: "scalar", + T: 8 + /*ScalarType.BOOL*/ + }, + { + no: 2, + name: "signed_upload_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ @@ -82072,7 +88431,7 @@ var require_artifact = __commonJS({ ]); } create(value) { - const message = { signedUrl: "" }; + 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); @@ -82083,9 +88442,13 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string signed_url */ + case /* bool ok */ 1: - message.signedUrl = reader.string(); + message.ok = reader.bool(); + break; + case /* string signed_upload_url */ + 2: + message.signedUploadUrl = reader.string(); break; default: let u = options.readUnknownField; @@ -82099,18 +88462,20 @@ var require_artifact = __commonJS({ return message; } internalBinaryWrite(message, writer, options) { - if (message.signedUrl !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.signedUrl); + 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.GetSignedArtifactURLResponse = new GetSignedArtifactURLResponse$Type(); - var DeleteArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.CreateArtifactResponse = new CreateArtifactResponse$Type(); + var FinalizeArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.DeleteArtifactRequest", [ + super("github.actions.results.api.v1.FinalizeArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -82131,11 +88496,19 @@ var require_artifact = __commonJS({ 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: "" }; + 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); @@ -82158,6 +88531,14 @@ var require_artifact = __commonJS({ 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") @@ -82176,16 +88557,20 @@ var require_artifact = __commonJS({ 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.DeleteArtifactRequest = new DeleteArtifactRequest$Type(); - var DeleteArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.FinalizeArtifactRequest = new FinalizeArtifactRequest$Type(); + var FinalizeArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.DeleteArtifactResponse", [ + super("github.actions.results.api.v1.FinalizeArtifactResponse", [ { no: 1, name: "ok", @@ -82198,1129 +88583,819 @@ var require_artifact = __commonJS({ 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(request) { - const data = artifact_1.CreateArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.FinalizeArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.ListArtifactsRequest.toJson(request, { - 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(request) { - const data = artifact_1.GetSignedArtifactURLRequest.toJson(request, { - 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(request) { - const data = artifact_1.DeleteArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.CreateArtifactRequest.toBinary(request); - 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(request) { - const data = artifact_1.FinalizeArtifactRequest.toBinary(request); - 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(request) { - const data = artifact_1.ListArtifactsRequest.toBinary(request); - 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(request) { - const data = artifact_1.GetSignedArtifactURLRequest.toBinary(request); - 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(request) { - const data = artifact_1.DeleteArtifactRequest.toBinary(request); - 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 __createBinding4 = 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 __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar4(require_timestamp(), exports2); - __exportStar4(require_wrappers(), exports2); - __exportStar4(require_artifact(), exports2); - __exportStar4(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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getExpiration = getExpiration; - var generated_1 = require_generated(); - var core14 = __importStar4(require_core()); - function getExpiration(retentionDays) { - if (!retentionDays) { - return void 0; - } - const maxRetentionDays = getRetentionDays(); - if (maxRetentionDays && maxRetentionDays < retentionDays) { - core14.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); - } - 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.validateArtifactName = validateArtifactName; - exports2.validateFilePath = validateFilePath; - 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!`); - } - function validateFilePath(path6) { - if (!path6) { - throw new Error(`Provided file path input during validation is empty`); - } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path6.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path6}. 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. - `); - } - } - } - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/http-client/lib/proxy.js -var require_proxy6 = __commonJS({ - "node_modules/@actions/artifact/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 (_a) { - 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; + /*ScalarType.INT64*/ + } + ]); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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; } - 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; + 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; } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + 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; } - get username() { - return this._decodedUsername; + }; + 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 } + ]); } - get password() { - return this._decodedPassword; + 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; } - }; - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/http-client/lib/index.js -var require_lib7 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + 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; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); + 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 } + ]); } - return new (P || (P = Promise))(function(resolve5, 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); + 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); } } - function step(result) { - result.done ? resolve5(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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy6()); - var tunnel = __importStar4(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); + 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.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + 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 } + ]); } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(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", () => { - resolve5(output.toString()); - }); - })); - }); + 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; } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve5(Buffer.concat(chunks)); - }); - })); - }); + 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.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + 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*/ } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + ]); + } + 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; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + 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; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + 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*/ + } + ]); } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + 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; } - /** - * 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 __awaiter4(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); - }); + 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; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + }; + 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*/ + } + ]); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + 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); } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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; + return message; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve5(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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; } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info7.httpModule.request(info7.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(); + }; + 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*/ } - handleResult(new Error(`Request timeout: ${info7.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); + 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; } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); + 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 info7; + return message; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + 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; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + }; + 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); } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + CreateArtifact(request) { + const data = artifact_1.CreateArtifactRequest.toJson(request, { + 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 + })); } - _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")}` + FinalizeArtifact(request) { + const data = artifact_1.FinalizeArtifactRequest.toJson(request, { + 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 })); - this._proxyAgentDispatcher = proxyAgent; - if (usingSsl && this._ignoreSslError) { - proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { - rejectUnauthorized: false - }); - } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); + ListArtifacts(request) { + const data = artifact_1.ListArtifactsRequest.toJson(request, { + 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 })); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve5(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 { - resolve5(response); - } - })); + GetSignedArtifactURL(request) { + const data = artifact_1.GetSignedArtifactURLRequest.toJson(request, { + 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(request) { + const data = artifact_1.DeleteArtifactRequest.toJson(request, { + 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.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + 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(request) { + const data = artifact_1.CreateArtifactRequest.toBinary(request); + 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(request) { + const data = artifact_1.FinalizeArtifactRequest.toBinary(request); + 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(request) { + const data = artifact_1.ListArtifactsRequest.toBinary(request); + 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(request) { + const data = artifact_1.GetSignedArtifactURLRequest.toBinary(request); + 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(request) { + const data = artifact_1.DeleteArtifactRequest.toBinary(request); + 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/node_modules/@actions/http-client/lib/auth.js -var require_auth3 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// node_modules/@actions/artifact/lib/generated/index.js +var require_generated = __commonJS({ + "node_modules/@actions/artifact/lib/generated/index.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }); - exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; + __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]; + } }; } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + 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]); } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + __setModuleDefault2(result, mod); + return result; + }; + })(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getExpiration = getExpiration; + var generated_1 = require_generated(); + var core14 = __importStar2(require_core()); + function getExpiration(retentionDays) { + if (!retentionDays) { + return void 0; } - // 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}`; + const maxRetentionDays = getRetentionDays(); + if (maxRetentionDays && maxRetentionDays < retentionDays) { + core14.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`); + retentionDays = maxRetentionDays; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + const expirationDate = /* @__PURE__ */ new Date(); + expirationDate.setDate(expirationDate.getDate() + retentionDays); + return generated_1.Timestamp.fromDate(expirationDate); + } + function getRetentionDays() { + const retentionDays = process.env["GITHUB_RETENTION_DAYS"]; + if (!retentionDays) { + return void 0; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + const days = parseInt(retentionDays); + if (isNaN(days)) { + return void 0; } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + 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.validateArtifactName = validateArtifactName; + exports2.validateFilePath = validateFilePath; + 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`); } - // 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"); + 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.`); } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + (0, core_1.info)(`Artifact name is valid!`); + } + function validateFilePath(path7) { + if (!path7) { + throw new Error(`Provided file path input during validation is empty`); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { + if (path7.includes(invalidCharacterKey)) { + throw new Error(`The path for one of the files in artifact is not valid: ${path7}. 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.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + } } }); @@ -83329,7 +89404,7 @@ var require_package3 = __commonJS({ "node_modules/@actions/artifact/package.json"(exports2, module2) { module2.exports = { name: "@actions/artifact", - version: "4.0.0", + version: "5.0.1", preview: true, description: "Actions artifact lib", keywords: [ @@ -83369,11 +89444,10 @@ var require_package3 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.10.0", + "@actions/core": "^2.0.0", "@actions/github": "^6.0.1", - "@actions/http-client": "^2.1.0", - "@azure/core-http": "^3.0.5", - "@azure/storage-blob": "^12.15.0", + "@actions/http-client": "^3.0.0", + "@azure/storage-blob": "^12.29.1", "@octokit/core": "^5.2.1", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-retry": "^3.0.9", @@ -83547,10 +89621,10 @@ var require_jwt_decode_cjs = __commonJS({ }); // node_modules/@actions/artifact/lib/internal/shared/util.js -var require_util11 = __commonJS({ +var require_util10 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -83563,40 +89637,40 @@ var require_util11 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getBackendIdsFromToken = getBackendIdsFromToken; exports2.maskSigUrl = maskSigUrl; exports2.maskSecretUrls = maskSecretUrls; - var core14 = __importStar4(require_core()); + var core14 = __importStar2(require_core()); var config_1 = require_config2(); - var jwt_decode_1 = __importDefault4(require_jwt_decode_cjs()); + 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() { @@ -83637,8 +89711,8 @@ var require_util11 = __commonJS({ (0, core_1.setSecret)(signature); (0, core_1.setSecret)(encodeURIComponent(signature)); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${error3 instanceof Error ? error3.message : String(error3)}`); } } function maskSecretUrls(body) { @@ -83660,7 +89734,7 @@ var require_util11 = __commonJS({ var require_artifact_twirp_client2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -83689,14 +89763,14 @@ var require_artifact_twirp_client2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.internalArtifactTwirpClient = internalArtifactTwirpClient; - var http_client_1 = require_lib7(); - var auth_1 = require_auth3(); + 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 util_1 = require_util10(); var ArtifactHttpClient = class { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -83720,24 +89794,24 @@ var require_artifact_twirp_client2 = __commonJS({ // This function satisfies the Rpc interface. It is compatible with the JSON // JSON generated client. request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; (0, core_1.debug)(`[Request] ${method} ${url}`); const headers = { "Content-Type": contentType }; try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { return this.httpClient.post(url, JSON.stringify(data), headers); })); return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); } }); } retryableRequest(operation) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let attempt = 0; let errorMessage = ""; let rawBody = ""; @@ -83763,18 +89837,18 @@ var require_artifact_twirp_client2 = __commonJS({ } errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { + } catch (error3) { + if (error3 instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); } - if (error4 instanceof errors_1.UsageError) { - throw error4; + if (error3 instanceof errors_1.UsageError) { + throw error3; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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 = error4.message; + errorMessage = error3.message; } if (!isRetryable) { throw new Error(`Received non-retryable error: ${errorMessage}`); @@ -83808,7 +89882,7 @@ var require_artifact_twirp_client2 = __commonJS({ return retryableStatusCodes.includes(statusCode); } sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve5) => setTimeout(resolve5, milliseconds)); }); } @@ -83835,7 +89909,7 @@ var require_artifact_twirp_client2 = __commonJS({ var require_upload_zip_specification = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/upload-zip-specification.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -83848,42 +89922,42 @@ var require_upload_zip_specification = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateRootDirectory = validateRootDirectory; exports2.getUploadZipSpecification = getUploadZipSpecification; - var fs7 = __importStar4(require("fs")); + var fs8 = __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 (!fs7.existsSync(rootDirectory)) { + if (!fs8.existsSync(rootDirectory)) { throw new Error(`The provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs7.statSync(rootDirectory).isDirectory()) { + if (!fs8.statSync(rootDirectory).isDirectory()) { throw new Error(`The provided rootDirectory ${rootDirectory} is not a valid directory`); } (0, core_1.info)(`Root directory input is valid!`); @@ -83893,7 +89967,7 @@ var require_upload_zip_specification = __commonJS({ rootDirectory = (0, path_1.normalize)(rootDirectory); rootDirectory = (0, path_1.resolve)(rootDirectory); for (let file of filesToZip) { - const stats = fs7.lstatSync(file, { throwIfNoEntry: false }); + const stats = fs8.lstatSync(file, { throwIfNoEntry: false }); if (!stats) { throw new Error(`File ${file} does not exist`); } @@ -83929,7 +90003,7 @@ var require_upload_zip_specification = __commonJS({ var require_blob_upload = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/blob-upload.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -83942,31 +90016,31 @@ var require_blob_upload = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -83995,18 +90069,18 @@ var require_blob_upload = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadZipToBlobStorage = uploadZipToBlobStorage; - var storage_blob_1 = require_dist7(); + var storage_blob_1 = require_commonjs15(); var config_1 = require_config2(); - var core14 = __importStar4(require_core()); - var crypto = __importStar4(require("crypto")); - var stream = __importStar4(require("stream")); + var core14 = __importStar2(require_core()); + var crypto2 = __importStar2(require("crypto")); + var stream = __importStar2(require("stream")); var errors_1 = require_errors3(); function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let uploadByteCount = 0; let lastProgressTime = Date.now(); const abortController = new AbortController(); - const chunkTimer = (interval) => __awaiter4(this, void 0, void 0, function* () { + const chunkTimer = (interval) => __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve5, reject) => { const timer = setInterval(() => { if (Date.now() - lastProgressTime > interval) { @@ -84036,7 +90110,7 @@ var require_blob_upload = __commonJS({ }; let sha256Hash = void 0; const uploadStream = new stream.PassThrough(); - const hashStream = crypto.createHash("sha256"); + const hashStream = crypto2.createHash("sha256"); zipUploadStream.pipe(uploadStream); zipUploadStream.pipe(hashStream).setEncoding("hex"); core14.info("Beginning upload of artifact content to blob storage"); @@ -84045,11 +90119,11 @@ var require_blob_upload = __commonJS({ blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options), chunkTimer((0, config_1.getUploadChunkTimeout)()) ]); - } catch (error4) { - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + } 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 error4; + throw error3; } finally { abortController.abort(); } @@ -84133,7 +90207,7 @@ var require_brace_expansion2 = __commonJS({ function lte(i, y) { return i <= y; } - function gte5(i, y) { + function gte6(i, y) { return i >= y; } function expand(str2, isTop) { @@ -84183,7 +90257,7 @@ var require_brace_expansion2 = __commonJS({ var reverse = y < x; if (reverse) { incr *= -1; - test = gte5; + test = gte6; } var pad = n.some(isPadded); N = []; @@ -84238,9 +90312,9 @@ var require_minimatch2 = __commonJS({ return new Minimatch(pattern, options).match(p); }; module2.exports = minimatch; - var path6 = require_path(); - minimatch.sep = path6.sep; - var GLOBSTAR = Symbol("globstar **"); + var path7 = require_path(); + minimatch.sep = path7.sep; + var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; var expand = require_brace_expansion2(); var plTypes = { @@ -84304,7 +90378,7 @@ var require_minimatch2 = __commonJS({ throw new TypeError("pattern is too long"); } }; - var SUBPARSE = Symbol("subparse"); + var SUBPARSE = /* @__PURE__ */ Symbol("subparse"); minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe(); minimatch.match = (list, pattern, options = {}) => { const mm = new Minimatch(pattern, options); @@ -84748,8 +90822,8 @@ var require_minimatch2 = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; const options = this.options; - if (path6.sep !== "/") { - f = f.split(path6.sep).join("/"); + if (path7.sep !== "/") { + f = f.split(path7.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -84787,13 +90861,13 @@ var require_minimatch2 = __commonJS({ var require_readdir_glob = __commonJS({ "node_modules/readdir-glob/index.js"(exports2, module2) { module2.exports = readdirGlob; - var fs7 = require("fs"); + var fs8 = require("fs"); var { EventEmitter } = require("events"); var { Minimatch } = require_minimatch2(); var { resolve: resolve5 } = require("path"); function readdir(dir, strict) { return new Promise((resolve6, reject) => { - fs7.readdir(dir, { withFileTypes: true }, (err, files) => { + fs8.readdir(dir, { withFileTypes: true }, (err, files) => { if (err) { switch (err.code) { case "ENOTDIR": @@ -84826,7 +90900,7 @@ var require_readdir_glob = __commonJS({ } function stat(file, followSymlinks) { return new Promise((resolve6, reject) => { - const statFunc = followSymlinks ? fs7.stat : fs7.lstat; + const statFunc = followSymlinks ? fs8.stat : fs8.lstat; statFunc(file, (err, stats) => { if (err) { switch (err.code) { @@ -84847,8 +90921,8 @@ var require_readdir_glob = __commonJS({ }); }); } - async function* exploreWalkAsync(dir, path6, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir(path6 + dir, strict); + async function* exploreWalkAsync(dir, path7, followSymlinks, useStat, shouldSkip, strict) { + let files = await readdir(path7 + dir, strict); for (const file of files) { let name = file.name; if (name === void 0) { @@ -84857,7 +90931,7 @@ var require_readdir_glob = __commonJS({ } const filename = dir + "/" + name; const relative = filename.slice(1); - const absolute = path6 + "/" + relative; + const absolute = path7 + "/" + relative; let stats = null; if (useStat || followSymlinks) { stats = await stat(absolute, followSymlinks); @@ -84871,15 +90945,15 @@ var require_readdir_glob = __commonJS({ if (stats.isDirectory()) { if (!shouldSkip(relative)) { yield { relative, absolute, stats }; - yield* exploreWalkAsync(filename, path6, followSymlinks, useStat, shouldSkip, false); + yield* exploreWalkAsync(filename, path7, followSymlinks, useStat, shouldSkip, false); } } else { yield { relative, absolute, stats }; } } } - async function* explore(path6, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync("", path6, followSymlinks, useStat, shouldSkip, true); + async function* explore(path7, followSymlinks, useStat, shouldSkip) { + yield* exploreWalkAsync("", path7, followSymlinks, useStat, shouldSkip, true); } function readOptions(options) { return { @@ -85070,9 +91144,9 @@ var require_async = __commonJS({ invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); }); } - function invokeCallback(callback, error4, value) { + function invokeCallback(callback, error3, value) { try { - callback(error4, value); + callback(error3, value); } catch (err) { setImmediate$1((e) => { throw e; @@ -85346,7 +91420,7 @@ var require_async = __commonJS({ } var mapSeries$1 = awaitify(mapSeries, 3); var applyEachSeries = applyEach$1(mapSeries$1); - const PROMISE_SYMBOL = Symbol("promiseCallback"); + const PROMISE_SYMBOL = /* @__PURE__ */ Symbol("promiseCallback"); function promiseCallback() { let resolve5, reject2; function callback(err, ...args) { @@ -85926,8 +92000,8 @@ var require_async = __commonJS({ var mapLimit$1 = awaitify(mapLimit, 4); function concatLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val2, iterCb) => { - _iteratee(val2, (err, ...args) => { + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { if (err) return iterCb(err); return iterCb(err, args); }); @@ -86133,10 +92207,10 @@ var require_async = __commonJS({ var forever$1 = awaitify(forever, 2); function groupByLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val2, iterCb) => { - _iteratee(val2, (err, key) => { + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { if (err) return iterCb(err); - return iterCb(err, { key, val: val2 }); + return iterCb(err, { key, val }); }); }, (err, mapResults) => { var result = {}; @@ -86144,11 +92218,11 @@ var require_async = __commonJS({ for (var i = 0; i < mapResults.length; i++) { if (mapResults[i]) { var { key } = mapResults[i]; - var { val: val2 } = mapResults[i]; + var { val } = mapResults[i]; if (hasOwnProperty.call(result, key)) { - result[key].push(val2); + result[key].push(val); } else { - result[key] = [val2]; + result[key] = [val]; } } } @@ -86167,8 +92241,8 @@ var require_async = __commonJS({ callback = once(callback); var newObj = {}; var _iteratee = wrapAsync(iteratee); - return eachOfLimit$2(limit)(obj, (val2, key, next) => { - _iteratee(val2, key, (err, result) => { + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { if (err) return next(err); newObj[key] = result; next(err); @@ -86378,10 +92452,10 @@ var require_async = __commonJS({ function reflect(fn) { var _fn = wrapAsync(fn); return initialParams(function reflectOn(args, reflectCallback) { - args.push((error4, ...cbArgs) => { + args.push((error3, ...cbArgs) => { let retVal = {}; - if (error4) { - retVal.error = error4; + if (error3) { + retVal.error = error3; } if (cbArgs.length > 0) { var value = cbArgs; @@ -86537,13 +92611,13 @@ var require_async = __commonJS({ var timer; function timeoutCallback() { var name = asyncFn.name || "anonymous"; - var error4 = new Error('Callback function "' + name + '" timed out.'); - error4.code = "ETIMEDOUT"; + var error3 = new Error('Callback function "' + name + '" timed out.'); + error3.code = "ETIMEDOUT"; if (info7) { - error4.info = info7; + error3.info = info7; } timedOut = true; - callback(error4); + callback(error3); } args.push((...cbArgs) => { if (!timedOut) { @@ -86586,7 +92660,7 @@ var require_async = __commonJS({ return callback[PROMISE_SYMBOL]; } function tryEach(tasks, callback) { - var error4 = null; + var error3 = null; var result; return eachSeries$1(tasks, (task, taskCb) => { wrapAsync(task)((err, ...args) => { @@ -86596,10 +92670,10 @@ var require_async = __commonJS({ } else { result = args; } - error4 = err; + error3 = err; taskCb(err ? null : {}); }); - }, () => callback(error4, result)); + }, () => callback(error3, result)); } var tryEach$1 = awaitify(tryEach); function unmemoize(fn) { @@ -86891,54 +92965,54 @@ var require_polyfills = __commonJS({ } var chdir; module2.exports = patch; - function patch(fs7) { + function patch(fs8) { if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs7); - } - if (!fs7.lutimes) { - patchLutimes(fs7); - } - fs7.chown = chownFix(fs7.chown); - fs7.fchown = chownFix(fs7.fchown); - fs7.lchown = chownFix(fs7.lchown); - fs7.chmod = chmodFix(fs7.chmod); - fs7.fchmod = chmodFix(fs7.fchmod); - fs7.lchmod = chmodFix(fs7.lchmod); - fs7.chownSync = chownFixSync(fs7.chownSync); - fs7.fchownSync = chownFixSync(fs7.fchownSync); - fs7.lchownSync = chownFixSync(fs7.lchownSync); - fs7.chmodSync = chmodFixSync(fs7.chmodSync); - fs7.fchmodSync = chmodFixSync(fs7.fchmodSync); - fs7.lchmodSync = chmodFixSync(fs7.lchmodSync); - fs7.stat = statFix(fs7.stat); - fs7.fstat = statFix(fs7.fstat); - fs7.lstat = statFix(fs7.lstat); - fs7.statSync = statFixSync(fs7.statSync); - fs7.fstatSync = statFixSync(fs7.fstatSync); - fs7.lstatSync = statFixSync(fs7.lstatSync); - if (fs7.chmod && !fs7.lchmod) { - fs7.lchmod = function(path6, mode, cb) { + patchLchmod(fs8); + } + if (!fs8.lutimes) { + patchLutimes(fs8); + } + fs8.chown = chownFix(fs8.chown); + fs8.fchown = chownFix(fs8.fchown); + fs8.lchown = chownFix(fs8.lchown); + fs8.chmod = chmodFix(fs8.chmod); + fs8.fchmod = chmodFix(fs8.fchmod); + fs8.lchmod = chmodFix(fs8.lchmod); + fs8.chownSync = chownFixSync(fs8.chownSync); + fs8.fchownSync = chownFixSync(fs8.fchownSync); + fs8.lchownSync = chownFixSync(fs8.lchownSync); + fs8.chmodSync = chmodFixSync(fs8.chmodSync); + fs8.fchmodSync = chmodFixSync(fs8.fchmodSync); + fs8.lchmodSync = chmodFixSync(fs8.lchmodSync); + fs8.stat = statFix(fs8.stat); + fs8.fstat = statFix(fs8.fstat); + fs8.lstat = statFix(fs8.lstat); + fs8.statSync = statFixSync(fs8.statSync); + fs8.fstatSync = statFixSync(fs8.fstatSync); + fs8.lstatSync = statFixSync(fs8.lstatSync); + if (fs8.chmod && !fs8.lchmod) { + fs8.lchmod = function(path7, mode, cb) { if (cb) process.nextTick(cb); }; - fs7.lchmodSync = function() { + fs8.lchmodSync = function() { }; } - if (fs7.chown && !fs7.lchown) { - fs7.lchown = function(path6, uid, gid, cb) { + if (fs8.chown && !fs8.lchown) { + fs8.lchown = function(path7, uid, gid, cb) { if (cb) process.nextTick(cb); }; - fs7.lchownSync = function() { + fs8.lchownSync = function() { }; } if (platform === "win32") { - fs7.rename = typeof fs7.rename !== "function" ? fs7.rename : (function(fs$rename) { + fs8.rename = typeof fs8.rename !== "function" ? fs8.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() { - fs7.stat(to, function(stater, st) { + fs8.stat(to, function(stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else @@ -86954,9 +93028,9 @@ var require_polyfills = __commonJS({ } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); return rename; - })(fs7.rename); + })(fs8.rename); } - fs7.read = typeof fs7.read !== "function" ? fs7.read : (function(fs$read) { + fs8.read = typeof fs8.read !== "function" ? fs8.read : (function(fs$read) { function read(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { @@ -86964,22 +93038,22 @@ var require_polyfills = __commonJS({ callback = function(er, _2, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; - return fs$read.call(fs7, fd, buffer, offset, length, position, callback); + return fs$read.call(fs8, fd, buffer, offset, length, position, callback); } callback_.apply(this, arguments); }; } - return fs$read.call(fs7, fd, buffer, offset, length, position, callback); + return fs$read.call(fs8, fd, buffer, offset, length, position, callback); } if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); return read; - })(fs7.read); - fs7.readSync = typeof fs7.readSync !== "function" ? fs7.readSync : /* @__PURE__ */ (function(fs$readSync) { + })(fs8.read); + fs8.readSync = typeof fs8.readSync !== "function" ? fs8.readSync : /* @__PURE__ */ (function(fs$readSync) { return function(fd, buffer, offset, length, position) { var eagCounter = 0; while (true) { try { - return fs$readSync.call(fs7, fd, buffer, offset, length, position); + return fs$readSync.call(fs8, fd, buffer, offset, length, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; @@ -86989,11 +93063,11 @@ var require_polyfills = __commonJS({ } } }; - })(fs7.readSync); - function patchLchmod(fs8) { - fs8.lchmod = function(path6, mode, callback) { - fs8.open( - path6, + })(fs8.readSync); + function patchLchmod(fs9) { + fs9.lchmod = function(path7, mode, callback) { + fs9.open( + path7, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { @@ -87001,80 +93075,80 @@ var require_polyfills = __commonJS({ if (callback) callback(err); return; } - fs8.fchmod(fd, mode, function(err2) { - fs8.close(fd, function(err22) { + fs9.fchmod(fd, mode, function(err2) { + fs9.close(fd, function(err22) { if (callback) callback(err2 || err22); }); }); } ); }; - fs8.lchmodSync = function(path6, mode) { - var fd = fs8.openSync(path6, constants.O_WRONLY | constants.O_SYMLINK, mode); + fs9.lchmodSync = function(path7, mode) { + var fd = fs9.openSync(path7, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret; try { - ret = fs8.fchmodSync(fd, mode); + ret = fs9.fchmodSync(fd, mode); threw = false; } finally { if (threw) { try { - fs8.closeSync(fd); + fs9.closeSync(fd); } catch (er) { } } else { - fs8.closeSync(fd); + fs9.closeSync(fd); } } return ret; }; } - function patchLutimes(fs8) { - if (constants.hasOwnProperty("O_SYMLINK") && fs8.futimes) { - fs8.lutimes = function(path6, at, mt, cb) { - fs8.open(path6, constants.O_SYMLINK, function(er, fd) { + function patchLutimes(fs9) { + if (constants.hasOwnProperty("O_SYMLINK") && fs9.futimes) { + fs9.lutimes = function(path7, at, mt, cb) { + fs9.open(path7, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; } - fs8.futimes(fd, at, mt, function(er2) { - fs8.close(fd, function(er22) { + fs9.futimes(fd, at, mt, function(er2) { + fs9.close(fd, function(er22) { if (cb) cb(er2 || er22); }); }); }); }; - fs8.lutimesSync = function(path6, at, mt) { - var fd = fs8.openSync(path6, constants.O_SYMLINK); + fs9.lutimesSync = function(path7, at, mt) { + var fd = fs9.openSync(path7, constants.O_SYMLINK); var ret; var threw = true; try { - ret = fs8.futimesSync(fd, at, mt); + ret = fs9.futimesSync(fd, at, mt); threw = false; } finally { if (threw) { try { - fs8.closeSync(fd); + fs9.closeSync(fd); } catch (er) { } } else { - fs8.closeSync(fd); + fs9.closeSync(fd); } } return ret; }; - } else if (fs8.futimes) { - fs8.lutimes = function(_a, _b, _c, cb) { + } else if (fs9.futimes) { + fs9.lutimes = function(_a, _b, _c, cb) { if (cb) process.nextTick(cb); }; - fs8.lutimesSync = function() { + fs9.lutimesSync = function() { }; } } function chmodFix(orig) { if (!orig) return orig; return function(target, mode, cb) { - return orig.call(fs7, target, mode, function(er) { + return orig.call(fs8, target, mode, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -87084,7 +93158,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, mode) { try { - return orig.call(fs7, target, mode); + return orig.call(fs8, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } @@ -87093,7 +93167,7 @@ var require_polyfills = __commonJS({ function chownFix(orig) { if (!orig) return orig; return function(target, uid, gid, cb) { - return orig.call(fs7, target, uid, gid, function(er) { + return orig.call(fs8, target, uid, gid, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -87103,7 +93177,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, uid, gid) { try { - return orig.call(fs7, target, uid, gid); + return orig.call(fs8, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } @@ -87123,13 +93197,13 @@ var require_polyfills = __commonJS({ } if (cb) cb.apply(this, arguments); } - return options ? orig.call(fs7, target, options, callback) : orig.call(fs7, target, callback); + return options ? orig.call(fs8, target, options, callback) : orig.call(fs8, target, callback); }; } function statFixSync(orig) { if (!orig) return orig; return function(target, options) { - var stats = options ? orig.call(fs7, target, options) : orig.call(fs7, target); + var stats = options ? orig.call(fs8, target, options) : orig.call(fs8, target); if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; @@ -87158,16 +93232,16 @@ var require_legacy_streams = __commonJS({ "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { var Stream = require("stream").Stream; module2.exports = legacy; - function legacy(fs7) { + function legacy(fs8) { return { ReadStream, WriteStream }; - function ReadStream(path6, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path6, options); + function ReadStream(path7, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path7, options); Stream.call(this); var self2 = this; - this.path = path6; + this.path = path7; this.fd = null; this.readable = true; this.paused = false; @@ -87201,7 +93275,7 @@ var require_legacy_streams = __commonJS({ }); return; } - fs7.open(this.path, this.flags, this.mode, function(err, fd) { + fs8.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self2.emit("error", err); self2.readable = false; @@ -87212,10 +93286,10 @@ var require_legacy_streams = __commonJS({ self2._read(); }); } - function WriteStream(path6, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path6, options); + function WriteStream(path7, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path7, options); Stream.call(this); - this.path = path6; + this.path = path7; this.fd = null; this.writable = true; this.flags = "w"; @@ -87240,7 +93314,7 @@ var require_legacy_streams = __commonJS({ this.busy = false; this._queue = []; if (this.fd === null) { - this._open = fs7.open; + this._open = fs8.open; this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); this.flush(); } @@ -87275,7 +93349,7 @@ var require_clone = __commonJS({ // node_modules/graceful-fs/graceful-fs.js var require_graceful_fs = __commonJS({ "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - var fs7 = require("fs"); + var fs8 = require("fs"); var polyfills = require_polyfills(); var legacy = require_legacy_streams(); var clone = require_clone(); @@ -87283,8 +93357,8 @@ var require_graceful_fs = __commonJS({ var gracefulQueue; var previousSymbol; if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = Symbol.for("graceful-fs.queue"); - previousSymbol = Symbol.for("graceful-fs.previous"); + gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"); + previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous"); } else { gracefulQueue = "___graceful-fs.queue"; previousSymbol = "___graceful-fs.previous"; @@ -87307,12 +93381,12 @@ var require_graceful_fs = __commonJS({ m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; - if (!fs7[gracefulQueue]) { + if (!fs8[gracefulQueue]) { queue = global[gracefulQueue] || []; - publishQueue(fs7, queue); - fs7.close = (function(fs$close) { + publishQueue(fs8, queue); + fs8.close = (function(fs$close) { function close(fd, cb) { - return fs$close.call(fs7, fd, function(err) { + return fs$close.call(fs8, fd, function(err) { if (!err) { resetQueue(); } @@ -87324,48 +93398,48 @@ var require_graceful_fs = __commonJS({ value: fs$close }); return close; - })(fs7.close); - fs7.closeSync = (function(fs$closeSync) { + })(fs8.close); + fs8.closeSync = (function(fs$closeSync) { function closeSync(fd) { - fs$closeSync.apply(fs7, arguments); + fs$closeSync.apply(fs8, arguments); resetQueue(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }); return closeSync; - })(fs7.closeSync); + })(fs8.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function() { - debug4(fs7[gracefulQueue]); - require("assert").equal(fs7[gracefulQueue].length, 0); + debug4(fs8[gracefulQueue]); + require("assert").equal(fs8[gracefulQueue].length, 0); }); } } var queue; if (!global[gracefulQueue]) { - publishQueue(global, fs7[gracefulQueue]); - } - module2.exports = patch(clone(fs7)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs7.__patched) { - module2.exports = patch(fs7); - fs7.__patched = true; - } - function patch(fs8) { - polyfills(fs8); - fs8.gracefulify = patch; - fs8.createReadStream = createReadStream; - fs8.createWriteStream = createWriteStream2; - var fs$readFile = fs8.readFile; - fs8.readFile = readFile; - function readFile(path6, options, cb) { + publishQueue(global, fs8[gracefulQueue]); + } + module2.exports = patch(clone(fs8)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs8.__patched) { + module2.exports = patch(fs8); + fs8.__patched = true; + } + function patch(fs9) { + polyfills(fs9); + fs9.gracefulify = patch; + fs9.createReadStream = createReadStream; + fs9.createWriteStream = createWriteStream3; + var fs$readFile = fs9.readFile; + fs9.readFile = readFile; + function readFile(path7, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$readFile(path6, options, cb); - function go$readFile(path7, options2, cb2, startTime) { - return fs$readFile(path7, options2, function(err) { + return go$readFile(path7, options, cb); + function go$readFile(path8, options2, cb2, startTime) { + return fs$readFile(path8, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path7, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$readFile, [path8, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -87373,16 +93447,16 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$writeFile = fs8.writeFile; - fs8.writeFile = writeFile; - function writeFile(path6, data, options, cb) { + var fs$writeFile = fs9.writeFile; + fs9.writeFile = writeFile; + function writeFile(path7, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$writeFile(path6, data, options, cb); - function go$writeFile(path7, data2, options2, cb2, startTime) { - return fs$writeFile(path7, data2, options2, function(err) { + return go$writeFile(path7, data, options, cb); + function go$writeFile(path8, data2, options2, cb2, startTime) { + return fs$writeFile(path8, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path7, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$writeFile, [path8, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -87390,17 +93464,17 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$appendFile = fs8.appendFile; + var fs$appendFile = fs9.appendFile; if (fs$appendFile) - fs8.appendFile = appendFile; - function appendFile(path6, data, options, cb) { + fs9.appendFile = appendFile; + function appendFile(path7, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$appendFile(path6, data, options, cb); - function go$appendFile(path7, data2, options2, cb2, startTime) { - return fs$appendFile(path7, data2, options2, function(err) { + return go$appendFile(path7, data, options, cb); + function go$appendFile(path8, data2, options2, cb2, startTime) { + return fs$appendFile(path8, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path7, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$appendFile, [path8, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -87408,9 +93482,9 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$copyFile = fs8.copyFile; + var fs$copyFile = fs9.copyFile; if (fs$copyFile) - fs8.copyFile = copyFile; + fs9.copyFile = copyFile; function copyFile(src, dest, flags, cb) { if (typeof flags === "function") { cb = flags; @@ -87428,34 +93502,34 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$readdir = fs8.readdir; - fs8.readdir = readdir; + var fs$readdir = fs9.readdir; + fs9.readdir = readdir; var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path6, options, cb) { + function readdir(path7, options, cb) { if (typeof options === "function") cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path7, options2, cb2, startTime) { - return fs$readdir(path7, fs$readdirCallback( - path7, + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path8, options2, cb2, startTime) { + return fs$readdir(path8, fs$readdirCallback( + path8, options2, cb2, startTime )); - } : function go$readdir2(path7, options2, cb2, startTime) { - return fs$readdir(path7, options2, fs$readdirCallback( - path7, + } : function go$readdir2(path8, options2, cb2, startTime) { + return fs$readdir(path8, options2, fs$readdirCallback( + path8, options2, cb2, startTime )); }; - return go$readdir(path6, options, cb); - function fs$readdirCallback(path7, options2, cb2, startTime) { + return go$readdir(path7, options, cb); + function fs$readdirCallback(path8, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, - [path7, options2, cb2], + [path8, options2, cb2], err, startTime || Date.now(), Date.now() @@ -87470,63 +93544,63 @@ var require_graceful_fs = __commonJS({ } } if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs8); + var legStreams = legacy(fs9); ReadStream = legStreams.ReadStream; WriteStream = legStreams.WriteStream; } - var fs$ReadStream = fs8.ReadStream; + var fs$ReadStream = fs9.ReadStream; if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype); ReadStream.prototype.open = ReadStream$open; } - var fs$WriteStream = fs8.WriteStream; + var fs$WriteStream = fs9.WriteStream; if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype); WriteStream.prototype.open = WriteStream$open; } - Object.defineProperty(fs8, "ReadStream", { + Object.defineProperty(fs9, "ReadStream", { get: function() { return ReadStream; }, - set: function(val2) { - ReadStream = val2; + set: function(val) { + ReadStream = val; }, enumerable: true, configurable: true }); - Object.defineProperty(fs8, "WriteStream", { + Object.defineProperty(fs9, "WriteStream", { get: function() { return WriteStream; }, - set: function(val2) { - WriteStream = val2; + set: function(val) { + WriteStream = val; }, enumerable: true, configurable: true }); var FileReadStream = ReadStream; - Object.defineProperty(fs8, "FileReadStream", { + Object.defineProperty(fs9, "FileReadStream", { get: function() { return FileReadStream; }, - set: function(val2) { - FileReadStream = val2; + set: function(val) { + FileReadStream = val; }, enumerable: true, configurable: true }); var FileWriteStream = WriteStream; - Object.defineProperty(fs8, "FileWriteStream", { + Object.defineProperty(fs9, "FileWriteStream", { get: function() { return FileWriteStream; }, - set: function(val2) { - FileWriteStream = val2; + set: function(val) { + FileWriteStream = val; }, enumerable: true, configurable: true }); - function ReadStream(path6, options) { + function ReadStream(path7, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else @@ -87546,7 +93620,7 @@ var require_graceful_fs = __commonJS({ } }); } - function WriteStream(path6, options) { + function WriteStream(path7, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else @@ -87564,22 +93638,22 @@ var require_graceful_fs = __commonJS({ } }); } - function createReadStream(path6, options) { - return new fs8.ReadStream(path6, options); + function createReadStream(path7, options) { + return new fs9.ReadStream(path7, options); } - function createWriteStream2(path6, options) { - return new fs8.WriteStream(path6, options); + function createWriteStream3(path7, options) { + return new fs9.WriteStream(path7, options); } - var fs$open = fs8.open; - fs8.open = open; - function open(path6, flags, mode, cb) { + var fs$open = fs9.open; + fs9.open = open; + function open(path7, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; - return go$open(path6, flags, mode, cb); - function go$open(path7, flags2, mode2, cb2, startTime) { - return fs$open(path7, flags2, mode2, function(err, fd) { + return go$open(path7, flags, mode, cb); + function go$open(path8, flags2, mode2, cb2, startTime) { + return fs$open(path8, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path7, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$open, [path8, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -87587,20 +93661,20 @@ var require_graceful_fs = __commonJS({ }); } } - return fs8; + return fs9; } function enqueue(elem) { debug4("ENQUEUE", elem[0].name, elem[1]); - fs7[gracefulQueue].push(elem); + fs8[gracefulQueue].push(elem); retry3(); } var retryTimer; function resetQueue() { var now = Date.now(); - for (var i = 0; i < fs7[gracefulQueue].length; ++i) { - if (fs7[gracefulQueue][i].length > 2) { - fs7[gracefulQueue][i][3] = now; - fs7[gracefulQueue][i][4] = now; + for (var i = 0; i < fs8[gracefulQueue].length; ++i) { + if (fs8[gracefulQueue][i].length > 2) { + fs8[gracefulQueue][i][3] = now; + fs8[gracefulQueue][i][4] = now; } } retry3(); @@ -87608,9 +93682,9 @@ var require_graceful_fs = __commonJS({ function retry3() { clearTimeout(retryTimer); retryTimer = void 0; - if (fs7[gracefulQueue].length === 0) + if (fs8[gracefulQueue].length === 0) return; - var elem = fs7[gracefulQueue].shift(); + var elem = fs8[gracefulQueue].shift(); var fn = elem[0]; var args = elem[1]; var err = elem[2]; @@ -87632,7 +93706,7 @@ var require_graceful_fs = __commonJS({ debug4("RETRY", fn.name, args); fn.apply(null, args.concat([startTime])); } else { - fs7[gracefulQueue].push(elem); + fs8[gracefulQueue].push(elem); } } if (retryTimer === void 0) { @@ -87775,7 +93849,7 @@ var require_safe_buffer = __commonJS({ }); // node_modules/core-util-is/lib/util.js -var require_util12 = __commonJS({ +var require_util11 = __commonJS({ "node_modules/core-util-is/lib/util.js"(exports2) { function isArray(arg) { if (Array.isArray) { @@ -87932,7 +94006,7 @@ var require_BufferList = __commonJS({ this.head = this.tail = null; this.length = 0; }; - BufferList.prototype.join = function join7(s) { + BufferList.prototype.join = function join8(s) { if (this.length === 0) return ""; var p = this.head; var ret = "" + p.data; @@ -88057,7 +94131,7 @@ var require_stream_writable = __commonJS({ var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; var Duplex; Writable.WritableState = WritableState; - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var internalUtil = { deprecate: require_node2() @@ -88493,7 +94567,7 @@ var require_stream_duplex = __commonJS({ return keys2; }; module2.exports = Duplex; - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var Readable = require_stream_readable(); var Writable = require_stream_writable(); @@ -88818,7 +94892,7 @@ var require_stream_readable = __commonJS({ function _isUint8Array(obj) { return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; } - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var debugUtil = require("util"); var debug4 = void 0; @@ -89487,7 +95561,7 @@ var require_stream_transform = __commonJS({ "use strict"; module2.exports = Transform; var Duplex = require_stream_duplex(); - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); util.inherits(Transform, Duplex); function afterTransform(er, data) { @@ -89587,7 +95661,7 @@ var require_stream_passthrough = __commonJS({ "use strict"; module2.exports = PassThrough; var Transform = require_stream_transform(); - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); util.inherits(PassThrough, Transform); function PassThrough(options) { @@ -89680,22 +95754,22 @@ var require_lazystream = __commonJS({ // node_modules/normalize-path/index.js var require_normalize_path = __commonJS({ "node_modules/normalize-path/index.js"(exports2, module2) { - module2.exports = function(path6, stripTrailing) { - if (typeof path6 !== "string") { + module2.exports = function(path7, stripTrailing) { + if (typeof path7 !== "string") { throw new TypeError("expected path to be a string"); } - if (path6 === "\\" || path6 === "/") return "/"; - var len = path6.length; - if (len <= 1) return path6; + if (path7 === "\\" || path7 === "/") return "/"; + var len = path7.length; + if (len <= 1) return path7; var prefix = ""; - if (len > 4 && path6[3] === "\\") { - var ch = path6[2]; - if ((ch === "?" || ch === ".") && path6.slice(0, 2) === "\\\\") { - path6 = path6.slice(2); + if (len > 4 && path7[3] === "\\") { + var ch = path7[2]; + if ((ch === "?" || ch === ".") && path7.slice(0, 2) === "\\\\") { + path7 = path7.slice(2); prefix = "//"; } } - var segs = path6.split(/[/\\]+/); + var segs = path7.split(/[/\\]+/); if (stripTrailing !== false && segs[segs.length - 1] === "") { segs.pop(); } @@ -90505,8 +96579,8 @@ var require_primordials = __commonJS({ PromiseReject(err) { return Promise.reject(err); }, - PromiseResolve(val2) { - return Promise.resolve(val2); + PromiseResolve(val) { + return Promise.resolve(val); }, ReflectApply: Reflect.apply, RegExpPrototypeTest(self2, value) { @@ -90531,8 +96605,8 @@ var require_primordials = __commonJS({ SymbolAsyncIterator: Symbol.asyncIterator, SymbolHasInstance: Symbol.hasInstance, SymbolIterator: Symbol.iterator, - SymbolDispose: Symbol.dispose || Symbol("Symbol.dispose"), - SymbolAsyncDispose: Symbol.asyncDispose || Symbol("Symbol.asyncDispose"), + SymbolDispose: Symbol.dispose || /* @__PURE__ */ Symbol("Symbol.dispose"), + SymbolAsyncDispose: Symbol.asyncDispose || /* @__PURE__ */ Symbol("Symbol.asyncDispose"), TypedArrayPrototypeSet(self2, buf, len) { return self2.set(buf, len); }, @@ -91211,7 +97285,7 @@ var require_abort_controller = __commonJS({ }); // node_modules/readable-stream/lib/ours/util.js -var require_util13 = __commonJS({ +var require_util12 = __commonJS({ "node_modules/readable-stream/lib/ours/util.js"(exports2, module2) { "use strict"; var bufferModule = require("buffer"); @@ -91394,7 +97468,7 @@ var require_util13 = __commonJS({ return ac.signal; } }; - module2.exports.promisify.custom = Symbol.for("nodejs.util.promisify.custom"); + module2.exports.promisify.custom = /* @__PURE__ */ Symbol.for("nodejs.util.promisify.custom"); } }); @@ -91402,9 +97476,9 @@ var require_util13 = __commonJS({ var require_errors4 = __commonJS({ "node_modules/readable-stream/lib/ours/errors.js"(exports2, module2) { "use strict"; - var { format, inspect, AggregateError: CustomAggregateError } = require_util13(); + var { format, inspect, AggregateError: CustomAggregateError } = require_util12(); var AggregateError = globalThis.AggregateError || CustomAggregateError; - var kIsNodeError = Symbol("kIsNodeError"); + var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); var kTypes = [ "string", "function", @@ -91425,14 +97499,14 @@ var require_errors4 = __commonJS({ throw new codes.ERR_INTERNAL_ASSERTION(message); } } - function addNumericalSeparator(val2) { + function addNumericalSeparator(val) { let res = ""; - let i = val2.length; - const start = val2[0] === "-" ? 1 : 0; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; for (; i >= start + 4; i -= 3) { - res = `_${val2.slice(i - 3, i)}${res}`; + res = `_${val.slice(i - 3, i)}${res}`; } - return `${val2.slice(0, i)}${res}`; + return `${val.slice(0, i)}${res}`; } function getMessage(key, msg, args) { if (typeof msg === "function") { @@ -91738,8 +97812,8 @@ var require_validators = __commonJS({ hideStackFrames, codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL } } = require_errors4(); - var { normalizeEncoding } = require_util13(); - var { isAsyncFunction, isArrayBufferView } = require_util13().types; + var { normalizeEncoding } = require_util12(); + var { isAsyncFunction, isArrayBufferView } = require_util12().types; var signals = {}; function isInt32(value) { return value === (value | 0); @@ -91986,7 +98060,7 @@ var require_process = __commonJS({ }); // node_modules/readable-stream/lib/internal/streams/utils.js -var require_utils6 = __commonJS({ +var require_utils9 = __commonJS({ "node_modules/readable-stream/lib/internal/streams/utils.js"(exports2, module2) { "use strict"; var { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require_primordials(); @@ -92200,7 +98274,7 @@ var require_end_of_stream = __commonJS({ var process2 = require_process(); var { AbortError, codes } = require_errors4(); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes; - var { kEmptyObject, once } = require_util13(); + var { kEmptyObject, once } = require_util12(); var { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require_validators(); var { Promise: Promise2, PromisePrototypeThen, SymbolDispose } = require_primordials(); var { @@ -92218,7 +98292,7 @@ var require_end_of_stream = __commonJS({ isNodeStream, willEmitClose: _willEmitClose, kIsClosedPromise - } = require_utils6(); + } = require_utils9(); var addAbortListener; function isRequest(stream) { return stream.setHeader && typeof stream.abort === "function"; @@ -92373,7 +98447,7 @@ var require_end_of_stream = __commonJS({ if (options.signal.aborted) { process2.nextTick(abort); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(options.signal, abort); const originalCallback = callback; callback = once((...args) => { @@ -92400,7 +98474,7 @@ var require_end_of_stream = __commonJS({ if (options.signal.aborted) { process2.nextTick(abort); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(options.signal, abort); const originalCallback = callback; callback = once((...args) => { @@ -92456,7 +98530,7 @@ var require_destroy2 = __commonJS({ AbortError } = require_errors4(); var { Symbol: Symbol2 } = require_primordials(); - var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils6(); + var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils9(); var kDestroy = Symbol2("kDestroy"); var kConstruct = Symbol2("kConstruct"); function checkError(err, w, r) { @@ -92794,7 +98868,7 @@ var require_add_abort_signal = __commonJS({ "use strict"; var { SymbolDispose } = require_primordials(); var { AbortError, codes } = require_errors4(); - var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils6(); + var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils9(); var eos = require_end_of_stream(); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes; var addAbortListener; @@ -92830,7 +98904,7 @@ var require_add_abort_signal = __commonJS({ if (signal.aborted) { onAbort(); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(signal, onAbort); eos(stream, disposable[SymbolDispose]); } @@ -92845,7 +98919,7 @@ var require_buffer_list = __commonJS({ "use strict"; var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials(); var { Buffer: Buffer2 } = require("buffer"); - var { inspect } = require_util13(); + var { inspect } = require_util12(); module2.exports = class BufferList { constructor() { this.head = null; @@ -92981,7 +99055,7 @@ var require_buffer_list = __commonJS({ return ret; } // Make sure the linked list only shows the minimal necessary information. - [Symbol.for("nodejs.util.inspect.custom")](_2, options) { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_2, options) { return inspect(this, { ...options, // Only inspect one level. @@ -93079,19 +99153,19 @@ var require_from = __commonJS({ next(); } }; - readable._destroy = function(error4, cb) { + readable._destroy = function(error3, cb) { PromisePrototypeThen( - close(error4), - () => process2.nextTick(cb, error4), + close(error3), + () => process2.nextTick(cb, error3), // nextTick is here in case cb throws - (e) => process2.nextTick(cb, e || error4) + (e) => process2.nextTick(cb, e || error3) ); }; - async function close(error4) { - const hadError = error4 !== void 0 && error4 !== null; + async function close(error3) { + const hadError = error3 !== void 0 && error3 !== null; const hasThrow = typeof iterator.throw === "function"; if (hadError && hasThrow) { - const { value, done } = await iterator.throw(error4); + const { value, done } = await iterator.throw(error3); await value; if (done) { return; @@ -93156,7 +99230,7 @@ var require_readable3 = __commonJS({ var { Buffer: Buffer2 } = require("buffer"); var { addAbortSignal } = require_add_abort_signal(); var eos = require_end_of_stream(); - var debug4 = require_util13().debuglog("stream", (fn) => { + var debug4 = require_util12().debuglog("stream", (fn) => { debug4 = fn; }); var BufferList = require_buffer_list(); @@ -93299,12 +99373,12 @@ var require_readable3 = __commonJS({ this.destroy(err); }; Readable.prototype[SymbolAsyncDispose] = function() { - let error4; + let error3; if (!this.destroyed) { - error4 = this.readableEnded ? null : new AbortError(); - this.destroy(error4); + error3 = this.readableEnded ? null : new AbortError(); + this.destroy(error3); } - return new Promise2((resolve5, reject) => eos(this, (err) => err && err !== error4 ? reject(err) : resolve5(null))); + return new Promise2((resolve5, reject) => eos(this, (err) => err && err !== error3 ? reject(err) : resolve5(null))); }; Readable.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); @@ -93857,14 +99931,14 @@ var require_readable3 = __commonJS({ } } stream.on("readable", next); - let error4; + let error3; const cleanup = eos( stream, { writable: false }, (err) => { - error4 = err ? aggregateTwoErrors(error4, err) : null; + error3 = err ? aggregateTwoErrors(error3, err) : null; callback(); callback = nop; } @@ -93874,19 +99948,19 @@ var require_readable3 = __commonJS({ const chunk = stream.destroyed ? null : stream.read(); if (chunk !== null) { yield chunk; - } else if (error4) { - throw error4; - } else if (error4 === null) { + } else if (error3) { + throw error3; + } else if (error3 === null) { return; } else { await new Promise2(next); } } } catch (err) { - error4 = aggregateTwoErrors(error4, err); - throw error4; + error3 = aggregateTwoErrors(error3, err); + throw error3; } finally { - if ((error4 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error4 === void 0 || stream._readableState.autoDestroy)) { + if ((error3 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error3 === void 0 || stream._readableState.autoDestroy)) { destroyImpl.destroyer(stream, null); } else { stream.off("readable", next); @@ -93901,9 +99975,9 @@ var require_readable3 = __commonJS({ const r = this._readableState; return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted; }, - set(val2) { + set(val) { if (this._readableState) { - this._readableState.readable = !!val2; + this._readableState.readable = !!val; } } }, @@ -94615,9 +100689,9 @@ var require_writable = __commonJS({ const w = this._writableState; return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; }, - set(val2) { + set(val) { if (this._writableState) { - this._writableState.writable = !!val2; + this._writableState.writable = !!val; } } }, @@ -94731,7 +100805,7 @@ var require_duplexify = __commonJS({ isDuplexNodeStream, isReadableStream, isWritableStream - } = require_utils6(); + } = require_utils9(); var eos = require_end_of_stream(); var { AbortError, @@ -94741,7 +100815,7 @@ var require_duplexify = __commonJS({ var Duplex = require_duplex(); var Readable = require_readable3(); var Writable = require_writable(); - var { createDeferredPromise } = require_util13(); + var { createDeferredPromise } = require_util12(); var from = require_from(); var Blob2 = globalThis.Blob || bufferModule.Blob; var isBlob = typeof Blob2 !== "undefined" ? function isBlob2(b) { @@ -94814,9 +100888,9 @@ var require_duplexify = __commonJS({ const promise = FunctionPrototypeCall( then2, value, - (val2) => { - if (val2 != null) { - throw new ERR_INVALID_RETURN_VALUE("nully", "body", val2); + (val) => { + if (val != null) { + throw new ERR_INVALID_RETURN_VALUE("nully", "body", val); } }, (err) => { @@ -94870,9 +100944,9 @@ var require_duplexify = __commonJS({ FunctionPrototypeCall( then, body, - (val2) => { - if (val2 != null) { - d.push(val2); + (val) => { + if (val != null) { + d.push(val); } d.push(null); }, @@ -95255,13 +101329,13 @@ var require_transform = __commonJS({ const rState = this._readableState; const wState = this._writableState; const length = rState.length; - this._transform(chunk, encoding, (err, val2) => { + this._transform(chunk, encoding, (err, val) => { if (err) { callback(err); return; } - if (val2 != null) { - this.push(val2); + if (val != null) { + this.push(val); } if (wState.ended || // Backwards compat. length === rState.length || // Backwards compat. @@ -95302,12 +101376,12 @@ var require_passthrough2 = __commonJS({ }); // node_modules/readable-stream/lib/internal/streams/pipeline.js -var require_pipeline3 = __commonJS({ +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 { once } = require_util12(); var destroyImpl = require_destroy2(); var Duplex = require_duplex(); var { @@ -95331,7 +101405,7 @@ var require_pipeline3 = __commonJS({ isWebStream, isReadableStream, isReadableFinished - } = require_utils6(); + } = require_utils9(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough; var Readable; @@ -95364,26 +101438,26 @@ var require_pipeline3 = __commonJS({ validateFunction(streams[streams.length - 1], "streams[stream.length - 1]"); return streams.pop(); } - function makeAsyncIterable(val2) { - if (isIterable(val2)) { - return val2; - } else if (isReadableNodeStream(val2)) { - return fromReadable(val2); + function makeAsyncIterable(val) { + if (isIterable(val)) { + return val; + } else if (isReadableNodeStream(val)) { + return fromReadable(val); } - throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val2); + throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val); } - async function* fromReadable(val2) { + async function* fromReadable(val) { if (!Readable) { Readable = require_readable3(); } - yield* Readable.prototype[SymbolAsyncIterator].call(val2); + yield* Readable.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { - let error4; + let error3; let onresolve = null; const resume = (err) => { if (err) { - error4 = err; + error3 = err; } if (onresolve) { const callback = onresolve; @@ -95392,12 +101466,12 @@ var require_pipeline3 = __commonJS({ } }; const wait = () => new Promise2((resolve5, reject) => { - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { onresolve = () => { - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve5(); } @@ -95427,7 +101501,7 @@ var require_pipeline3 = __commonJS({ } finish(); } catch (err) { - finish(error4 !== err ? aggregateTwoErrors(error4, err) : err); + finish(error3 !== err ? aggregateTwoErrors(error3, err) : err); } finally { cleanup(); writable.off("drain", resume); @@ -95476,12 +101550,12 @@ var require_pipeline3 = __commonJS({ function abort() { finishImpl(new AbortError()); } - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; let disposable; if (outerSignal) { disposable = addAbortListener(outerSignal, abort); } - let error4; + let error3; let value; const destroys = []; let finishCount = 0; @@ -95490,23 +101564,23 @@ var require_pipeline3 = __commonJS({ } function finishImpl(err, final) { var _disposable; - if (err && (!error4 || error4.code === "ERR_STREAM_PREMATURE_CLOSE")) { - error4 = err; + if (err && (!error3 || error3.code === "ERR_STREAM_PREMATURE_CLOSE")) { + error3 = err; } - if (!error4 && !final) { + if (!error3 && !final) { return; } while (destroys.length) { - destroys.shift()(error4); + destroys.shift()(error3); } ; (_disposable = disposable) === null || _disposable === void 0 ? void 0 : _disposable[SymbolDispose](); ac.abort(); if (final) { - if (!error4) { + if (!error3) { lastStreamCleanup.forEach((fn) => fn()); } - process2.nextTick(callback, error4, value); + process2.nextTick(callback, error3, value); } } let ret; @@ -95577,10 +101651,10 @@ var require_pipeline3 = __commonJS({ finishCount++; then.call( ret, - (val2) => { - value = val2; - if (val2 != null) { - pt.write(val2); + (val) => { + value = val; + if (val != null) { + pt.write(val); } if (end) { pt.end(); @@ -95733,7 +101807,7 @@ var require_pipeline3 = __commonJS({ var require_compose = __commonJS({ "node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) { "use strict"; - var { pipeline } = require_pipeline3(); + var { pipeline } = require_pipeline4(); var Duplex = require_duplex(); var { destroyer } = require_destroy2(); var { @@ -95744,7 +101818,7 @@ var require_compose = __commonJS({ isTransformStream, isWritableStream, isReadableStream - } = require_utils6(); + } = require_utils9(); var { AbortError, codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS } @@ -95937,8 +102011,8 @@ var require_operators = __commonJS({ var { finished } = require_end_of_stream(); var staticCompose = require_compose(); var { addAbortSignalNoValidate } = require_add_abort_signal(); - var { isWritable, isNodeStream } = require_utils6(); - var { deprecate } = require_util13(); + var { isWritable, isNodeStream } = require_utils9(); + var { deprecate } = require_util12(); var { ArrayPrototypePush, Boolean: Boolean2, @@ -95991,7 +102065,7 @@ var require_operators = __commonJS({ validateInteger(highWaterMark, "options.highWaterMark", 0); highWaterMark += concurrency; return async function* map3() { - const signal = require_util13().AbortSignalAny( + const signal = require_util12().AbortSignalAny( [options === null || options === void 0 ? void 0 : options.signal].filter(Boolean2) ); const stream = this; @@ -96019,7 +102093,7 @@ var require_operators = __commonJS({ } async function pump() { try { - for await (let val2 of stream) { + for await (let val of stream) { if (done) { return; } @@ -96027,17 +102101,17 @@ var require_operators = __commonJS({ throw new AbortError(); } try { - val2 = fn(val2, signalOpt); - if (val2 === kEmpty) { + val = fn(val, signalOpt); + if (val === kEmpty) { continue; } - val2 = PromiseResolve(val2); + val = PromiseResolve(val); } catch (err) { - val2 = PromiseReject(err); + val = PromiseReject(err); } cnt += 1; - PromisePrototypeThen(val2, afterItemProcessed, onCatch); - queue.push(val2); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue.push(val); if (next) { next(); next = null; @@ -96050,9 +102124,9 @@ var require_operators = __commonJS({ } queue.push(kEof); } catch (err) { - const val2 = PromiseReject(err); - PromisePrototypeThen(val2, afterItemProcessed, onCatch); - queue.push(val2); + const val = PromiseReject(err); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue.push(val); } finally { done = true; if (next) { @@ -96065,15 +102139,15 @@ var require_operators = __commonJS({ try { while (true) { while (queue.length > 0) { - const val2 = await queue[0]; - if (val2 === kEof) { + const val = await queue[0]; + if (val === kEof) { return; } if (signal.aborted) { throw new AbortError(); } - if (val2 !== kEmpty) { - yield val2; + if (val !== kEmpty) { + yield val; } queue.shift(); maybeResume(); @@ -96100,14 +102174,14 @@ var require_operators = __commonJS({ } return async function* asIndexedPairs2() { let index = 0; - for await (const val2 of this) { + 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 [index++, val2]; + yield [index++, val]; } }.call(this); } @@ -96227,22 +102301,22 @@ var require_operators = __commonJS({ validateAbortSignal(options.signal, "options.signal"); } const result = []; - for await (const val2 of this) { + 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, val2); + ArrayPrototypePush(result, val); } return result; } function flatMap(fn, options) { const values = map2.call(this, fn, options); return async function* flatMap2() { - for await (const val2 of values) { - yield* val2; + for await (const val of values) { + yield* val; } }.call(this); } @@ -96269,13 +102343,13 @@ var require_operators = __commonJS({ if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) { throw new AbortError(); } - for await (const val2 of this) { + 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 (number-- <= 0) { - yield val2; + yield val; } } }.call(this); @@ -96293,13 +102367,13 @@ var require_operators = __commonJS({ if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted) { throw new AbortError(); } - for await (const val2 of this) { + 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 (number-- > 0) { - yield val2; + yield val; } if (number <= 0) { return; @@ -96332,8 +102406,8 @@ 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_utils6(); - var { pipelineImpl: pl } = require_pipeline3(); + var { isIterable, isNodeStream, isWebStream } = require_utils9(); + var { pipelineImpl: pl } = require_pipeline4(); var { finished } = require_end_of_stream(); require_stream2(); function pipeline(...streams) { @@ -96376,18 +102450,18 @@ var require_stream2 = __commonJS({ var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(); var { promisify: { custom: customPromisify } - } = require_util13(); + } = require_util12(); var { streamReturningOperators, promiseReturningOperators } = require_operators(); var { codes: { ERR_ILLEGAL_CONSTRUCTOR } } = require_errors4(); var compose = require_compose(); var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state3(); - var { pipeline } = require_pipeline3(); + var { pipeline } = require_pipeline4(); var { destroyer } = require_destroy2(); var eos = require_end_of_stream(); var promises3 = require_promises(); - var utils = require_utils6(); + var utils = require_utils9(); var Stream = module2.exports = require_legacy().Stream; Stream.isDestroyed = utils.isDestroyed; Stream.isDisturbed = utils.isDisturbed; @@ -97356,52 +103430,128 @@ var require_isPlainObject = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/brace-expansion/index.js -var require_brace_expansion3 = __commonJS({ - "node_modules/archiver-utils/node_modules/brace-expansion/index.js"(exports2, module2) { - var balanced = require_balanced_match(); - module2.exports = expandTop; +// node_modules/@isaacs/balanced-match/dist/commonjs/index.js +var require_commonjs18 = __commonJS({ + "node_modules/@isaacs/balanced-match/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.range = exports2.balanced = void 0; + var balanced = (a, b, str2) => { + const ma = a instanceof RegExp ? maybeMatch(a, str2) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str2) : b; + const r = ma !== null && mb != null && (0, exports2.range)(ma, mb, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + ma.length, r[1]), + post: str2.slice(r[1] + mb.length) + }; + }; + exports2.balanced = balanced; + var maybeMatch = (reg, str2) => { + const m = str2.match(reg); + return m ? m[0] : null; + }; + var range = (a, b, str2) => { + let begs, beg, left, right = void 0, result; + let ai = str2.indexOf(a); + let bi = str2.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str2.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 = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== void 0) { + result = [left, right]; + } + } + return result; + }; + exports2.range = range; + } +}); + +// node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +var require_commonjs19 = __commonJS({ + "node_modules/@isaacs/brace-expansion/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.expand = expand; + var balanced_match_1 = require_commonjs18(); 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; function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + return !isNaN(str2) ? parseInt(str2, 10) : str2.charCodeAt(0); } function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + return str2.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod); } function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + return str2.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, "."); } function parseCommaParts(str2) { - if (!str2) + if (!str2) { return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) + } + const parts = []; + const m = (0, balanced_match_1.balanced)("{", "}", str2); + if (!m) { return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); + } + const { pre, body, post } = m; + const p = pre.split(","); p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); + 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 expandTop(str2) { - if (!str2) + function expand(str2) { + if (!str2) { return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); } - return expand(escapeBraces(str2), true).map(unescapeBraces); + if (str2.slice(0, 2) === "{}") { + str2 = "\\{\\}" + str2.slice(2); + } + return expand_(escapeBraces(str2), true).map(unescapeBraces); } function embrace(str2) { return "{" + str2 + "}"; @@ -97412,76 +103562,77 @@ var require_brace_expansion3 = __commonJS({ function lte(i, y) { return i <= y; } - function gte5(i, y) { + function gte6(i, y) { return i >= y; } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m) return [str2]; - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; + function expand_(str2, isTop) { + const expansions = []; + const m = (0, balanced_match_1.balanced)("{", "}", str2); + if (!m) + return [str2]; + const pre = m.pre; + const post = m.post.length ? expand_(m.post, false) : [""]; if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + "{" + m.body + "}" + post[k]; + for (let k = 0; k < post.length; k++) { + const expansion = pre + "{" + m.body + "}" + post[k]; expansions.push(expansion); } } else { - 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; + 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(/,(?!,).*\}/)) { str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); + return expand_(str2); } return [str2]; } - var n; + let n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); + if (n.length === 1 && n[0] !== void 0) { + n = expand_(n[0], false).map(embrace); if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); + return post.map((p) => m.pre + n[0] + p); } } } - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; + let N; + if (isSequence && n[0] !== void 0 && n[1] !== void 0) { + 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.abs(numeric(n[2])) : 1; + let test = lte; + const reverse = y < x; if (reverse) { incr *= -1; - test = gte5; + test = gte6; } - var pad = n.some(isPadded); + const pad = n.some(isPadded); N = []; - for (var i = x; test(i, y); i += incr) { - var c; + for (let i = x; test(i, y); i += incr) { + let c; if (isAlphaSequence) { c = String.fromCharCode(i); - if (c === "\\") + if (c === "\\") { c = ""; + } } else { c = String(i); if (pad) { - var need = width - c.length; + const need = width - c.length; if (need > 0) { - var z = new Array(need + 1).join("0"); - if (i < 0) + const z = new Array(need + 1).join("0"); + if (i < 0) { c = "-" + z + c.slice(1); - else + } else { c = z + c; + } } } } @@ -97489,15 +103640,16 @@ var require_brace_expansion3 = __commonJS({ } } else { N = []; - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], false)); } } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { expansions.push(expansion); + } } } } @@ -97506,9 +103658,9 @@ var require_brace_expansion3 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js var require_assert_valid_pattern = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.assertValidPattern = void 0; @@ -97525,9 +103677,9 @@ var require_assert_valid_pattern = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/brace-expressions.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js var require_brace_expressions = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseClass = void 0; @@ -97642,22 +103794,25 @@ var require_brace_expressions = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/unescape.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js var require_unescape = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/unescape.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = void 0; - var unescape = (s, { windowsPathsNoEscape = false } = {}) => { - return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"); + var unescape = (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"); }; exports2.unescape = unescape; } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/ast.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js var require_ast = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; @@ -98013,7 +104168,7 @@ var require_ast = __commonJS({ if (this.#root === this) this.#fillNegs(); if (!this.type) { - const noEmpty = this.isStart() && this.isEnd(); + 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" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; @@ -98123,10 +104278,7 @@ var require_ast = __commonJS({ } } if (c === "*") { - if (noEmpty && glob2 === "*") - re += starNoEmpty; - else - re += star; + re += noEmpty && glob2 === "*" ? starNoEmpty : star; hasMagic = true; continue; } @@ -98144,29 +104296,29 @@ var require_ast = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/escape.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js var require_escape = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/escape.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.escape = void 0; - var escape = (s, { windowsPathsNoEscape = false } = {}) => { + var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { + if (magicalBraces) { + return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&"); + } return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); }; exports2.escape = escape; } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/index.js -var require_commonjs13 = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/index.js"(exports2) { +// node_modules/glob/node_modules/minimatch/dist/commonjs/index.js +var require_commonjs20 = __commonJS({ + "node_modules/glob/node_modules/minimatch/dist/commonjs/index.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = exports2.escape = exports2.AST = exports2.Minimatch = exports2.match = exports2.makeRe = exports2.braceExpand = exports2.defaults = exports2.filter = exports2.GLOBSTAR = exports2.sep = exports2.minimatch = void 0; - var brace_expansion_1 = __importDefault4(require_brace_expansion3()); + var brace_expansion_1 = require_commonjs19(); var assert_valid_pattern_js_1 = require_assert_valid_pattern(); var ast_js_1 = require_ast(); var escape_js_1 = require_escape(); @@ -98230,13 +104382,13 @@ var require_commonjs13 = __commonJS({ 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 path6 = { + var path7 = { win32: { sep: "\\" }, posix: { sep: "/" } }; - exports2.sep = defaultPlatform === "win32" ? path6.win32.sep : path6.posix.sep; + exports2.sep = defaultPlatform === "win32" ? path7.win32.sep : path7.posix.sep; exports2.minimatch.sep = exports2.sep; - exports2.GLOBSTAR = Symbol("globstar **"); + exports2.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); exports2.minimatch.GLOBSTAR = exports2.GLOBSTAR; var qmark = "[^/]"; var star = qmark + "*?"; @@ -98289,7 +104441,7 @@ var require_commonjs13 = __commonJS({ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } - return (0, brace_expansion_1.default)(pattern); + return (0, brace_expansion_1.expand)(pattern); }; exports2.braceExpand = braceExpand; exports2.minimatch.braceExpand = exports2.braceExpand; @@ -98813,16 +104965,27 @@ var require_commonjs13 = __commonJS({ pp[i] = twoStar; } } else if (next === void 0) { - pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?"; + pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?"; } else if (next !== exports2.GLOBSTAR) { pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next; pp[i + 1] = exports2.GLOBSTAR; } }); - return pp.filter((p) => p !== exports2.GLOBSTAR).join("/"); + const filtered = pp.filter((p) => p !== exports2.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] = set2.length > 1 ? ["(?:", ")"] : ["", ""]; re = "^" + open + re + close + "$"; + if (this.partial) { + re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$"; + } if (this.negate) re = "^(?!" + re + ").+$"; try { @@ -98909,9 +105072,9 @@ var require_commonjs13 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/lru-cache/dist/commonjs/index.js -var require_commonjs14 = __commonJS({ - "node_modules/archiver-utils/node_modules/lru-cache/dist/commonjs/index.js"(exports2) { +// node_modules/lru-cache/dist/commonjs/index.js +var require_commonjs21 = __commonJS({ + "node_modules/lru-cache/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.LRUCache = void 0; @@ -98958,7 +105121,6 @@ var require_commonjs14 = __commonJS({ }; } var shouldWarn = (code) => !warned.has(code); - var TYPE = Symbol("type"); var isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; var ZeroArray = class extends Array { @@ -99000,6 +105162,7 @@ var require_commonjs14 = __commonJS({ #max; #maxSize; #dispose; + #onInsert; #disposeAfter; #fetchMethod; #memoMethod; @@ -99081,6 +105244,7 @@ var require_commonjs14 = __commonJS({ #hasDispose; #hasFetchMethod; #hasDisposeAfter; + #hasOnInsert; /** * Do not call this method unless you need to inspect the * inner workings of the cache. If anything returned by this @@ -99157,6 +105321,12 @@ var require_commonjs14 = __commonJS({ get dispose() { return this.#dispose; } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } /** * {@link LRUCache.OptionsBase.disposeAfter} (read-only) */ @@ -99164,7 +105334,7 @@ var require_commonjs14 = __commonJS({ return this.#disposeAfter; } constructor(options) { - const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; if (max !== 0 && !isPosInt(max)) { throw new TypeError("max option must be a nonnegative integer"); } @@ -99206,6 +105376,9 @@ var require_commonjs14 = __commonJS({ if (typeof dispose === "function") { this.#dispose = dispose; } + if (typeof onInsert === "function") { + this.#onInsert = onInsert; + } if (typeof disposeAfter === "function") { this.#disposeAfter = disposeAfter; this.#disposed = []; @@ -99214,6 +105387,7 @@ var require_commonjs14 = __commonJS({ this.#disposed = void 0; } this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; this.#hasDisposeAfter = !!this.#disposeAfter; this.noDisposeOnSet = !!noDisposeOnSet; this.noUpdateTTL = !!noUpdateTTL; @@ -99616,7 +105790,7 @@ var require_commonjs14 = __commonJS({ } /** * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to {@link LRLUCache#load}. + * passed to {@link LRUCache#load}. * * The `start` fields are calculated relative to a portable `Date.now()` * timestamp, even if `performance.now()` is available. @@ -99727,6 +105901,9 @@ var require_commonjs14 = __commonJS({ if (status) status.set = "add"; noUpdateTTL = false; + if (this.#hasOnInsert) { + this.#onInsert?.(v, k, "add"); + } } else { this.#moveToTail(index); const oldVal = this.#valList[index]; @@ -99762,6 +105939,9 @@ var require_commonjs14 = __commonJS({ } else if (status) { status.set = "update"; } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, v === oldVal ? "update" : "replace"); + } } if (ttl !== 0 && !this.#ttls) { this.#initializeTTLTracking(); @@ -99789,14 +105969,14 @@ var require_commonjs14 = __commonJS({ pop() { try { while (this.#size) { - const val2 = this.#valList[this.#head]; + const val = this.#valList[this.#head]; this.#evict(true); - if (this.#isBackgroundFetch(val2)) { - if (val2.__staleWhileFetching) { - return val2.__staleWhileFetching; + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; } - } else if (val2 !== void 0) { - return val2; + } else if (val !== void 0) { + return val; } } } finally { @@ -100287,10 +106467,10 @@ var require_commonjs14 = __commonJS({ }); // node_modules/minipass/dist/commonjs/index.js -var require_commonjs15 = __commonJS({ +var require_commonjs22 = __commonJS({ "node_modules/minipass/dist/commonjs/index.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -100300,7 +106480,7 @@ var require_commonjs15 = __commonJS({ stderr: null }; var node_events_1 = require("node:events"); - var node_stream_1 = __importDefault4(require("node:stream")); + var node_stream_1 = __importDefault2(require("node:stream")); var node_string_decoder_1 = require("node:string_decoder"); var isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass || s instanceof node_stream_1.default || (0, exports2.isReadable)(s) || (0, exports2.isWritable)(s)); exports2.isStream = isStream; @@ -100309,37 +106489,37 @@ var require_commonjs15 = __commonJS({ exports2.isReadable = isReadable; var isWritable = (s) => !!s && typeof s === "object" && s instanceof node_events_1.EventEmitter && typeof s.write === "function" && typeof s.end === "function"; exports2.isWritable = isWritable; - var EOF = Symbol("EOF"); - var MAYBE_EMIT_END = Symbol("maybeEmitEnd"); - var EMITTED_END = Symbol("emittedEnd"); - var EMITTING_END = Symbol("emittingEnd"); - var EMITTED_ERROR = Symbol("emittedError"); - var CLOSED = Symbol("closed"); - var READ = Symbol("read"); - var FLUSH = Symbol("flush"); - var FLUSHCHUNK = Symbol("flushChunk"); - var ENCODING = Symbol("encoding"); - var DECODER = Symbol("decoder"); - var FLOWING = Symbol("flowing"); - var PAUSED = Symbol("paused"); - var RESUME = Symbol("resume"); - var BUFFER = Symbol("buffer"); - var PIPES = Symbol("pipes"); - var BUFFERLENGTH = Symbol("bufferLength"); - var BUFFERPUSH = Symbol("bufferPush"); - var BUFFERSHIFT = Symbol("bufferShift"); - var OBJECTMODE = Symbol("objectMode"); - var DESTROYED = Symbol("destroyed"); - var ERROR = Symbol("error"); - var EMITDATA = Symbol("emitData"); - var EMITEND = Symbol("emitEnd"); - var EMITEND2 = Symbol("emitEnd2"); - var ASYNC = Symbol("async"); - var ABORT = Symbol("abort"); - var ABORTED = Symbol("aborted"); - var SIGNAL = Symbol("signal"); - var DATALISTENERS = Symbol("dataListeners"); - var DISCARDED = Symbol("discarded"); + var EOF = /* @__PURE__ */ Symbol("EOF"); + var MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd"); + var EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd"); + var EMITTING_END = /* @__PURE__ */ Symbol("emittingEnd"); + var EMITTED_ERROR = /* @__PURE__ */ Symbol("emittedError"); + var CLOSED = /* @__PURE__ */ Symbol("closed"); + var READ = /* @__PURE__ */ Symbol("read"); + var FLUSH = /* @__PURE__ */ Symbol("flush"); + var FLUSHCHUNK = /* @__PURE__ */ Symbol("flushChunk"); + var ENCODING = /* @__PURE__ */ Symbol("encoding"); + var DECODER = /* @__PURE__ */ Symbol("decoder"); + var FLOWING = /* @__PURE__ */ Symbol("flowing"); + var PAUSED = /* @__PURE__ */ Symbol("paused"); + var RESUME = /* @__PURE__ */ Symbol("resume"); + var BUFFER = /* @__PURE__ */ Symbol("buffer"); + var PIPES = /* @__PURE__ */ Symbol("pipes"); + var BUFFERLENGTH = /* @__PURE__ */ Symbol("bufferLength"); + var BUFFERPUSH = /* @__PURE__ */ Symbol("bufferPush"); + var BUFFERSHIFT = /* @__PURE__ */ Symbol("bufferShift"); + var OBJECTMODE = /* @__PURE__ */ Symbol("objectMode"); + var DESTROYED = /* @__PURE__ */ Symbol("destroyed"); + var ERROR = /* @__PURE__ */ Symbol("error"); + var EMITDATA = /* @__PURE__ */ Symbol("emitData"); + var EMITEND = /* @__PURE__ */ Symbol("emitEnd"); + var EMITEND2 = /* @__PURE__ */ Symbol("emitEnd2"); + var ASYNC = /* @__PURE__ */ Symbol("async"); + var ABORT = /* @__PURE__ */ Symbol("abort"); + var ABORTED = /* @__PURE__ */ Symbol("aborted"); + var SIGNAL = /* @__PURE__ */ Symbol("signal"); + var DATALISTENERS = /* @__PURE__ */ Symbol("dataListeners"); + var DISCARDED = /* @__PURE__ */ Symbol("discarded"); var defer = (fn) => Promise.resolve().then(fn); var nodefer = (fn) => fn(); var isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; @@ -101178,11 +107358,11 @@ var require_commonjs15 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js -var require_commonjs16 = __commonJS({ - "node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js"(exports2) { +// node_modules/path-scurry/dist/commonjs/index.js +var require_commonjs23 = __commonJS({ + "node_modules/path-scurry/dist/commonjs/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -101195,30 +107375,30 @@ var require_commonjs16 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.PathScurry = exports2.Path = exports2.PathScurryDarwin = exports2.PathScurryPosix = exports2.PathScurryWin32 = exports2.PathScurryBase = exports2.PathPosix = exports2.PathWin32 = exports2.PathBase = exports2.ChildrenCache = exports2.ResolveCache = void 0; - var lru_cache_1 = require_commonjs14(); + var lru_cache_1 = require_commonjs21(); var node_path_1 = require("node:path"); var node_url_1 = require("node:url"); var fs_1 = require("fs"); - var actualFS = __importStar4(require("node:fs")); + var actualFS = __importStar2(require("node:fs")); var realpathSync = fs_1.realpathSync.native; var promises_1 = require("node:fs/promises"); - var minipass_1 = require_commonjs15(); + var minipass_1 = require_commonjs22(); var defaultFS = { lstatSync: fs_1.lstatSync, readdir: fs_1.readdir, @@ -101296,7 +107476,7 @@ var require_commonjs16 = __commonJS({ } }; exports2.ChildrenCache = ChildrenCache; - var setAsCwd = Symbol("PathScurry setAsCwd"); + var setAsCwd = /* @__PURE__ */ Symbol("PathScurry setAsCwd"); var PathBase = class { /** * the basename of this path @@ -101433,6 +107613,8 @@ var require_commonjs16 = __commonJS({ /** * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, * this property refers to the *parent* path, not the path object itself. + * + * @deprecated */ get path() { return this.parentPath; @@ -101482,12 +107664,12 @@ var require_commonjs16 = __commonJS({ /** * Get the Path object referenced by the string path, resolved from this Path */ - resolve(path6) { - if (!path6) { + resolve(path7) { + if (!path7) { return this; } - const rootPath = this.getRootString(path6); - const dir = path6.substring(rootPath.length); + const rootPath = this.getRootString(path7); + const dir = path7.substring(rootPath.length); const dirParts = dir.split(this.splitSep); const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts); return result; @@ -102240,8 +108422,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - getRootString(path6) { - return node_path_1.win32.parse(path6).root; + getRootString(path7) { + return node_path_1.win32.parse(path7).root; } /** * @internal @@ -102288,8 +108470,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - getRootString(path6) { - return path6.startsWith("/") ? "/" : ""; + getRootString(path7) { + return path7.startsWith("/") ? "/" : ""; } /** * @internal @@ -102339,8 +108521,8 @@ var require_commonjs16 = __commonJS({ * * @internal */ - constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs7 = defaultFS } = {}) { - this.#fs = fsFromOption(fs7); + constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs8 = defaultFS } = {}) { + this.#fs = fsFromOption(fs8); if (cwd instanceof URL || cwd.startsWith("file://")) { cwd = (0, node_url_1.fileURLToPath)(cwd); } @@ -102379,11 +108561,11 @@ var require_commonjs16 = __commonJS({ /** * Get the depth of a provided path, string, or the cwd */ - depth(path6 = this.cwd) { - if (typeof path6 === "string") { - path6 = this.cwd.resolve(path6); + depth(path7 = this.cwd) { + if (typeof path7 === "string") { + path7 = this.cwd.resolve(path7); } - return path6.depth(); + return path7.depth(); } /** * Return the cache of child entries. Exposed so subclasses can create @@ -102870,9 +109052,9 @@ var require_commonjs16 = __commonJS({ process2(); return results; } - chdir(path6 = this.cwd) { + chdir(path7 = this.cwd) { const oldCwd = this.cwd; - this.cwd = typeof path6 === "string" ? this.cwd.resolve(path6) : path6; + this.cwd = typeof path7 === "string" ? this.cwd.resolve(path7) : path7; this.cwd[setAsCwd](oldCwd); } }; @@ -102899,8 +109081,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - newRoot(fs7) { - return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs7 }); + newRoot(fs8) { + return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs8 }); } /** * Return true if the provided path string is an absolute path @@ -102929,8 +109111,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - newRoot(fs7) { - return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs7 }); + newRoot(fs8) { + return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs8 }); } /** * Return true if the provided path string is an absolute path @@ -102952,13 +109134,13 @@ var require_commonjs16 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/pattern.js +// node_modules/glob/dist/commonjs/pattern.js var require_pattern = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/pattern.js"(exports2) { + "node_modules/glob/dist/commonjs/pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var isPatternList = (pl) => pl.length >= 1; var isGlobList = (gl) => gl.length >= 1; var Pattern = class _Pattern { @@ -103126,13 +109308,13 @@ var require_pattern = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/ignore.js +// node_modules/glob/dist/commonjs/ignore.js var require_ignore = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/ignore.js"(exports2) { + "node_modules/glob/dist/commonjs/ignore.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Ignore = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var pattern_js_1 = require_pattern(); var defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux"; var Ignore = class { @@ -103223,13 +109405,13 @@ var require_ignore = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/processor.js +// node_modules/glob/dist/commonjs/processor.js var require_processor = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/processor.js"(exports2) { + "node_modules/glob/dist/commonjs/processor.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Processor = exports2.SubWalks = exports2.MatchRecord = exports2.HasWalkedCache = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var HasWalkedCache = class _HasWalkedCache { store; constructor(store = /* @__PURE__ */ new Map()) { @@ -103260,8 +109442,8 @@ var require_processor = __commonJS({ } // match, absolute, ifdir entries() { - return [...this.store.entries()].map(([path6, n]) => [ - path6, + return [...this.store.entries()].map(([path7, n]) => [ + path7, !!(n & 2), !!(n & 1) ]); @@ -103456,13 +109638,13 @@ var require_processor = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/walker.js +// node_modules/glob/dist/commonjs/walker.js var require_walker = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/walker.js"(exports2) { + "node_modules/glob/dist/commonjs/walker.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.GlobStream = exports2.GlobWalker = exports2.GlobUtil = void 0; - var minipass_1 = require_commonjs15(); + var minipass_1 = require_commonjs22(); var ignore_js_1 = require_ignore(); var processor_js_1 = require_processor(); var makeIgnore = (ignore, opts) => typeof ignore === "string" ? new ignore_js_1.Ignore([ignore], opts) : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore; @@ -103479,9 +109661,9 @@ var require_walker = __commonJS({ signal; maxDepth; includeChildMatches; - constructor(patterns, path6, opts) { + constructor(patterns, path7, opts) { this.patterns = patterns; - this.path = path6; + this.path = path7; this.opts = opts; this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/"; this.includeChildMatches = opts.includeChildMatches !== false; @@ -103500,11 +109682,11 @@ var require_walker = __commonJS({ }); } } - #ignored(path6) { - return this.seen.has(path6) || !!this.#ignore?.ignored?.(path6); + #ignored(path7) { + return this.seen.has(path7) || !!this.#ignore?.ignored?.(path7); } - #childrenIgnored(path6) { - return !!this.#ignore?.childrenIgnored?.(path6); + #childrenIgnored(path7) { + return !!this.#ignore?.childrenIgnored?.(path7); } // backpressure mechanism pause() { @@ -103720,8 +109902,8 @@ var require_walker = __commonJS({ exports2.GlobUtil = GlobUtil; var GlobWalker = class extends GlobUtil { matches = /* @__PURE__ */ new Set(); - constructor(patterns, path6, opts) { - super(patterns, path6, opts); + constructor(patterns, path7, opts) { + super(patterns, path7, opts); } matchEmit(e) { this.matches.add(e); @@ -103759,8 +109941,8 @@ var require_walker = __commonJS({ exports2.GlobWalker = GlobWalker; var GlobStream = class extends GlobUtil { results; - constructor(patterns, path6, opts) { - super(patterns, path6, opts); + constructor(patterns, path7, opts) { + super(patterns, path7, opts); this.results = new minipass_1.Minipass({ signal: this.signal, objectMode: true @@ -103796,15 +109978,15 @@ var require_walker = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/glob.js +// node_modules/glob/dist/commonjs/glob.js var require_glob2 = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/glob.js"(exports2) { + "node_modules/glob/dist/commonjs/glob.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Glob = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var node_url_1 = require("node:url"); - var path_scurry_1 = require_commonjs16(); + var path_scurry_1 = require_commonjs23(); var pattern_js_1 = require_pattern(); var walker_js_1 = require_walker(); var defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux"; @@ -104009,13 +110191,13 @@ var require_glob2 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/has-magic.js +// node_modules/glob/dist/commonjs/has-magic.js var require_has_magic = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/has-magic.js"(exports2) { + "node_modules/glob/dist/commonjs/has-magic.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hasMagic = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var hasMagic = (pattern, options = {}) => { if (!Array.isArray(pattern)) { pattern = [pattern]; @@ -104030,9 +110212,9 @@ var require_has_magic = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/index.js -var require_commonjs17 = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/index.js"(exports2) { +// node_modules/glob/dist/commonjs/index.js +var require_commonjs24 = __commonJS({ + "node_modules/glob/dist/commonjs/index.js"(exports2) { "use strict"; 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; @@ -104041,10 +110223,10 @@ var require_commonjs17 = __commonJS({ exports2.globSync = globSync; exports2.globIterateSync = globIterateSync; exports2.globIterate = globIterate; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var glob_js_1 = require_glob2(); var has_magic_js_1 = require_has_magic(); - var minimatch_2 = require_commonjs13(); + var minimatch_2 = require_commonjs20(); Object.defineProperty(exports2, "escape", { enumerable: true, get: function() { return minimatch_2.escape; } }); @@ -104115,13 +110297,13 @@ var require_commonjs17 = __commonJS({ // node_modules/archiver-utils/file.js var require_file3 = __commonJS({ "node_modules/archiver-utils/file.js"(exports2, module2) { - var fs7 = require_graceful_fs(); - var path6 = require("path"); + var fs8 = require_graceful_fs(); + var path7 = require("path"); var flatten = require_flatten(); var difference = require_difference(); var union = require_union(); var isPlainObject = require_isPlainObject(); - var glob2 = require_commonjs17(); + var glob2 = require_commonjs24(); var file = module2.exports = {}; var pathSeparatorRe = /[\/\\]/g; var processPatterns = function(patterns, fn) { @@ -104141,8 +110323,8 @@ var require_file3 = __commonJS({ return result; }; file.exists = function() { - var filepath = path6.join.apply(path6, arguments); - return fs7.existsSync(filepath); + var filepath = path7.join.apply(path7, arguments); + return fs8.existsSync(filepath); }; file.expand = function(...args) { var options = isPlainObject(args[0]) ? args.shift() : {}; @@ -104155,12 +110337,12 @@ var require_file3 = __commonJS({ }); if (options.filter) { matches = matches.filter(function(filepath) { - filepath = path6.join(options.cwd || "", filepath); + filepath = path7.join(options.cwd || "", filepath); try { if (typeof options.filter === "function") { return options.filter(filepath); } else { - return fs7.statSync(filepath)[options.filter](); + return fs8.statSync(filepath)[options.filter](); } } catch (e) { return false; @@ -104172,7 +110354,7 @@ var require_file3 = __commonJS({ file.expandMapping = function(patterns, destBase, options) { options = Object.assign({ rename: function(destBase2, destPath) { - return path6.join(destBase2 || "", destPath); + return path7.join(destBase2 || "", destPath); } }, options); var files = []; @@ -104180,14 +110362,14 @@ var require_file3 = __commonJS({ file.expand(options, patterns).forEach(function(src) { var destPath = src; if (options.flatten) { - destPath = path6.basename(destPath); + destPath = path7.basename(destPath); } if (options.ext) { destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); } var dest = options.rename(destBase, destPath, options); if (options.cwd) { - src = path6.join(options.cwd, src); + src = path7.join(options.cwd, src); } dest = dest.replace(pathSeparatorRe, "/"); src = src.replace(pathSeparatorRe, "/"); @@ -104268,8 +110450,8 @@ var require_file3 = __commonJS({ // node_modules/archiver-utils/index.js var require_archiver_utils = __commonJS({ "node_modules/archiver-utils/index.js"(exports2, module2) { - var fs7 = require_graceful_fs(); - var path6 = require("path"); + var fs8 = require_graceful_fs(); + var path7 = require("path"); var isStream = require_is_stream(); var lazystream = require_lazystream(); var normalizePath = require_normalize_path(); @@ -104317,7 +110499,7 @@ var require_archiver_utils = __commonJS({ }; utils.lazyReadStream = function(filepath) { return new lazystream.Readable(function() { - return fs7.createReadStream(filepath); + return fs8.createReadStream(filepath); }); }; utils.normalizeInputSource = function(source) { @@ -104345,7 +110527,7 @@ var require_archiver_utils = __commonJS({ callback = base; base = dirpath; } - fs7.readdir(dirpath, function(err, list) { + fs8.readdir(dirpath, function(err, list) { var i = 0; var file; var filepath; @@ -104357,11 +110539,11 @@ var require_archiver_utils = __commonJS({ if (!file) { return callback(null, results); } - filepath = path6.join(dirpath, file); - fs7.stat(filepath, function(err2, stats) { + filepath = path7.join(dirpath, file); + fs8.stat(filepath, function(err2, stats) { results.push({ path: filepath, - relative: path6.relative(base, filepath).replace(/\\/g, "/"), + relative: path7.relative(base, filepath).replace(/\\/g, "/"), stats }); if (stats && stats.isDirectory()) { @@ -104385,7 +110567,7 @@ var require_archiver_utils = __commonJS({ }); // node_modules/archiver/lib/error.js -var require_error2 = __commonJS({ +var require_error3 = __commonJS({ "node_modules/archiver/lib/error.js"(exports2, module2) { var util = require("util"); var ERROR_CODES = { @@ -104418,15 +110600,15 @@ var require_error2 = __commonJS({ }); // node_modules/archiver/lib/core.js -var require_core2 = __commonJS({ +var require_core4 = __commonJS({ "node_modules/archiver/lib/core.js"(exports2, module2) { - var fs7 = require("fs"); + var fs8 = require("fs"); var glob2 = require_readdir_glob(); var async = require_async(); - var path6 = require("path"); + var path7 = require("path"); var util = require_archiver_utils(); var inherits = require("util").inherits; - var ArchiverError = require_error2(); + var ArchiverError = require_error3(); var Transform = require_ours().Transform; var win32 = process.platform === "win32"; var Archiver = function(format, options) { @@ -104484,7 +110666,7 @@ var require_core2 = __commonJS({ data.sourcePath = filepath; task.data = data; this._entriesCount++; - if (data.stats && data.stats instanceof fs7.Stats) { + if (data.stats && data.stats instanceof fs8.Stats) { task = this._updateQueueTaskWithStats(task, data.stats); if (task) { if (data.stats.size) { @@ -104655,7 +110837,7 @@ var require_core2 = __commonJS({ callback(); return; } - fs7.lstat(task.filepath, function(err, stats) { + fs8.lstat(task.filepath, function(err, stats) { if (this._state.aborted) { setImmediate(callback); return; @@ -104698,10 +110880,10 @@ var require_core2 = __commonJS({ task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) { - var linkPath = fs7.readlinkSync(task.filepath); - var dirName = path6.dirname(task.filepath); + var linkPath = fs8.readlinkSync(task.filepath); + var dirName = path7.dirname(task.filepath); task.data.type = "symlink"; - task.data.linkname = path6.relative(dirName, path6.resolve(dirName, linkPath)); + task.data.linkname = path7.relative(dirName, path7.resolve(dirName, linkPath)); task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else { @@ -104969,7 +111151,7 @@ var require_archive_entry = __commonJS({ }); // node_modules/compress-commons/lib/archivers/zip/util.js -var require_util14 = __commonJS({ +var require_util13 = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/util.js"(exports2, module2) { var util = module2.exports = {}; util.dateToDos = function(d, forceLocalTime) { @@ -104980,7 +111162,7 @@ var require_util14 = __commonJS({ } else if (year >= 2044) { return 2141175677; } - var val2 = { + var val = { year, month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), date: forceLocalTime ? d.getDate() : d.getUTCDate(), @@ -104988,7 +111170,7 @@ var require_util14 = __commonJS({ minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() }; - return val2.year - 1980 << 25 | val2.month + 1 << 21 | val2.date << 16 | val2.hours << 11 | val2.minutes << 5 | val2.seconds / 2; + return val.year - 1980 << 25 | val.month + 1 << 21 | val.date << 16 | val.hours << 11 | val.minutes << 5 | val.seconds / 2; }; util.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); @@ -105027,7 +111209,7 @@ var require_util14 = __commonJS({ // node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js var require_general_purpose_bit = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js"(exports2, module2) { - var zipUtil = require_util14(); + var zipUtil = require_util13(); var DATA_DESCRIPTOR_FLAG = 1 << 3; var ENCRYPTION_FLAG = 1 << 0; var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2; @@ -105154,7 +111336,7 @@ var require_unix_stat = __commonJS({ }); // node_modules/compress-commons/lib/archivers/zip/constants.js -var require_constants9 = __commonJS({ +var require_constants13 = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/constants.js"(exports2, module2) { module2.exports = { WORD: 4, @@ -105238,8 +111420,8 @@ var require_zip_archive_entry = __commonJS({ var ArchiveEntry = require_archive_entry(); var GeneralPurposeBit = require_general_purpose_bit(); var UnixStat = require_unix_stat(); - var constants = require_constants9(); - var zipUtil = require_util14(); + var constants = require_constants13(); + var zipUtil = require_util13(); var ZipArchiveEntry = module2.exports = function(name) { if (!(this instanceof ZipArchiveEntry)) { return new ZipArchiveEntry(name); @@ -105419,7 +111601,7 @@ var require_is_stream2 = __commonJS({ }); // node_modules/compress-commons/lib/util/index.js -var require_util15 = __commonJS({ +var require_util14 = __commonJS({ "node_modules/compress-commons/lib/util/index.js"(exports2, module2) { var Stream = require("stream").Stream; var PassThrough = require_ours().PassThrough; @@ -105447,7 +111629,7 @@ var require_archive_output_stream = __commonJS({ var isStream = require_is_stream2(); var Transform = require_ours().Transform; var ArchiveEntry = require_archive_entry(); - var util = require_util15(); + var util = require_util14(); var ArchiveOutputStream = module2.exports = function(options) { if (!(this instanceof ArchiveOutputStream)) { return new ArchiveOutputStream(options); @@ -105710,7 +111892,7 @@ var require_deflate_crc32_stream = __commonJS({ }); // node_modules/crc32-stream/lib/index.js -var require_lib8 = __commonJS({ +var require_lib6 = __commonJS({ "node_modules/crc32-stream/lib/index.js"(exports2, module2) { "use strict"; module2.exports = { @@ -105725,14 +111907,14 @@ var require_zip_archive_output_stream = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js"(exports2, module2) { var inherits = require("util").inherits; var crc32 = require_crc32(); - var { CRC32Stream } = require_lib8(); - var { DeflateCRC32Stream } = require_lib8(); + var { CRC32Stream } = require_lib6(); + var { DeflateCRC32Stream } = require_lib6(); var ArchiveOutputStream = require_archive_output_stream(); var ZipArchiveEntry = require_zip_archive_entry(); var GeneralPurposeBit = require_general_purpose_bit(); - var constants = require_constants9(); - var util = require_util15(); - var zipUtil = require_util14(); + var constants = require_constants13(); + var util = require_util14(); + var zipUtil = require_util13(); var ZipArchiveOutputStream = module2.exports = function(options) { if (!(this instanceof ZipArchiveOutputStream)) { return new ZipArchiveOutputStream(options); @@ -105848,18 +112030,18 @@ var require_zip_archive_output_stream = __commonJS({ ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { var deflate = ae.getMethod() === constants.METHOD_DEFLATED; var process2 = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream(); - var error4 = null; + 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(error4, ae); + callback(error3, ae); } process2.once("end", handleStuff.bind(this)); process2.once("error", function(err) { - error4 = err; + error3 = err; }); process2.pipe(this, { end: false }); return process2; @@ -106230,29 +112412,29 @@ var require_fast_fifo = __commonJS({ this.head.clear(); this.length = 0; } - push(val2) { + push(val) { this.length++; - if (!this.head.push(val2)) { + if (!this.head.push(val)) { const prev = this.head; this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length); - this.head.push(val2); + this.head.push(val); } } shift() { if (this.length !== 0) this.length--; - const val2 = this.tail.shift(); - if (val2 === void 0 && this.tail.next) { + 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 val2; + return val; } peek() { - const val2 = this.tail.peek(); - if (val2 === void 0 && this.tail.next) return this.tail.next.peek(); - return val2; + const val = this.tail.peek(); + if (val === void 0 && this.tail.next) return this.tail.next.peek(); + return val; } isEmpty() { return this.length === 0; @@ -106678,7 +112860,7 @@ var require_streamx = __commonJS({ 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 || Symbol("asyncIterator"); + var asyncIterator = Symbol.asyncIterator || /* @__PURE__ */ Symbol("asyncIterator"); var WritableState = class { constructor(stream, { highWaterMark = 16384, map: map2 = null, mapWritable, byteLength, byteLengthWritable } = {}) { this.stream = stream; @@ -107225,11 +113407,11 @@ var require_streamx = __commonJS({ } [asyncIterator]() { const stream = this; - let error4 = null; + let error3 = null; let promiseResolve = null; let promiseReject = null; this.on("error", (err) => { - error4 = err; + error3 = err; }); this.on("readable", onreadable); this.on("close", onclose); @@ -107261,7 +113443,7 @@ var require_streamx = __commonJS({ } function ondata(data) { if (promiseReject === null) return; - if (error4) promiseReject(error4); + if (error3) promiseReject(error3); else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED); else promiseResolve({ value: data, done: data === null }); promiseReject = promiseResolve = null; @@ -107435,7 +113617,7 @@ var require_streamx = __commonJS({ if (all.length < 2) throw new Error("Pipeline requires at least 2 streams"); let src = all[0]; let dest = null; - let error4 = null; + let error3 = null; for (let i = 1; i < all.length; i++) { dest = all[i]; if (isStreamx(src)) { @@ -107450,14 +113632,14 @@ var require_streamx = __commonJS({ let fin = false; const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy); dest.on("error", (err) => { - if (error4 === null) error4 = err; + if (error3 === null) error3 = err; }); dest.on("finish", () => { fin = true; - if (!autoDestroy) done(error4); + if (!autoDestroy) done(error3); }); if (autoDestroy) { - dest.on("close", () => done(error4 || (fin ? null : PREMATURE_CLOSE))); + dest.on("close", () => done(error3 || (fin ? null : PREMATURE_CLOSE))); } } return dest; @@ -107470,8 +113652,8 @@ var require_streamx = __commonJS({ } } function onerror(err) { - if (!err || error4) return; - error4 = err; + if (!err || error3) return; + error3 = err; for (const s of all) { s.destroy(err); } @@ -107730,10 +113912,10 @@ var require_headers2 = __commonJS({ for (let j = 156; j < 512; j++) sum += block[j]; return sum; } - function encodeOct(val2, n) { - val2 = val2.toString(8); - if (val2.length > n) return SEVENS.slice(0, n) + " "; - return ZEROS.slice(0, n - val2.length) + val2 + " "; + 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; @@ -107768,21 +113950,21 @@ var require_headers2 = __commonJS({ } return positive ? sum : -1 * sum; } - function decodeOct(val2, offset, length) { - val2 = val2.subarray(offset, offset + length); + function decodeOct(val, offset, length) { + val = val.subarray(offset, offset + length); offset = 0; - if (val2[offset] & 128) { - return parse256(val2); + if (val[offset] & 128) { + return parse256(val); } else { - while (offset < val2.length && val2[offset] === 32) offset++; - const end = clamp(indexOf(val2, 32, offset, val2.length), val2.length, val2.length); - while (offset < end && val2[offset] === 0) offset++; + 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(val2.subarray(offset, end)), 8); + return parseInt(b4a.toString(val.subarray(offset, end)), 8); } } - function decodeStr(val2, offset, length, encoding) { - return b4a.toString(val2.subarray(offset, indexOf(val2, 0, offset, offset + length)), encoding); + function decodeStr(val, offset, length, encoding) { + return b4a.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding); } function addLength(str2) { const len = b4a.byteLength(str2); @@ -108037,7 +114219,7 @@ var require_extract = __commonJS({ cb(null); } [Symbol.asyncIterator]() { - let error4 = null; + let error3 = null; let promiseResolve = null; let promiseReject = null; let entryStream = null; @@ -108045,7 +114227,7 @@ var require_extract = __commonJS({ const extract2 = this; this.on("entry", onentry); this.on("error", (err) => { - error4 = err; + error3 = err; }); this.on("close", onclose); return { @@ -108069,8 +114251,8 @@ var require_extract = __commonJS({ cb(err); } function onnext(resolve5, reject) { - if (error4) { - return reject(error4); + if (error3) { + return reject(error3); } if (entryStream) { resolve5({ value: entryStream, done: false }); @@ -108096,9 +114278,9 @@ var require_extract = __commonJS({ } } function onclose() { - consumeCallback(error4); + consumeCallback(error3); if (!promiseResolve) return; - if (error4) promiseReject(error4); + if (error3) promiseReject(error3); else promiseResolve({ value: void 0, done: true }); promiseResolve = promiseReject = null; } @@ -108128,7 +114310,7 @@ var require_extract = __commonJS({ }); // node_modules/tar-stream/constants.js -var require_constants10 = __commonJS({ +var require_constants14 = __commonJS({ "node_modules/tar-stream/constants.js"(exports2, module2) { var constants = { // just for envs without fs @@ -108152,7 +114334,7 @@ var require_pack = __commonJS({ "node_modules/tar-stream/pack.js"(exports2, module2) { var { Readable, Writable, getStreamError } = require_streamx(); var b4a = require_b4a(); - var constants = require_constants10(); + var constants = require_constants14(); var headers = require_headers2(); var DMODE = 493; var FMODE = 420; @@ -108468,7 +114650,7 @@ var require_tar2 = __commonJS({ }); // node_modules/buffer-crc32/dist/index.cjs -var require_dist8 = __commonJS({ +var require_dist5 = __commonJS({ "node_modules/buffer-crc32/dist/index.cjs"(exports2, module2) { "use strict"; function getDefaultExportFromCjs(x) { @@ -108780,7 +114962,7 @@ var require_json = __commonJS({ "node_modules/archiver/lib/plugins/json.js"(exports2, module2) { var inherits = require("util").inherits; var Transform = require_ours().Transform; - var crc32 = require_dist8(); + var crc32 = require_dist5(); var util = require_archiver_utils(); var Json = function(options) { if (!(this instanceof Json)) { @@ -108832,7 +115014,7 @@ var require_json = __commonJS({ // node_modules/archiver/index.js var require_archiver = __commonJS({ "node_modules/archiver/index.js"(exports2, module2) { - var Archiver = require_core2(); + var Archiver = require_core4(); var formats = {}; var vending = function(format, options) { return vending.create(format, options); @@ -108876,7 +115058,7 @@ var require_archiver = __commonJS({ var require_zip2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/zip.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -108889,31 +115071,31 @@ var require_zip2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -108943,10 +115125,10 @@ var require_zip2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ZipUploadStream = exports2.DEFAULT_COMPRESSION_LEVEL = void 0; exports2.createZipUploadStream = createZipUploadStream; - var stream = __importStar4(require("stream")); + var stream = __importStar2(require("stream")); var promises_1 = require("fs/promises"); - var archiver2 = __importStar4(require_archiver()); - var core14 = __importStar4(require_core()); + var archiver2 = __importStar2(require_archiver()); + var core14 = __importStar2(require_core()); var config_1 = require_config2(); exports2.DEFAULT_COMPRESSION_LEVEL = 6; var ZipUploadStream = class extends stream.Transform { @@ -108962,7 +115144,7 @@ var require_zip2 = __commonJS({ }; exports2.ZipUploadStream = ZipUploadStream; function createZipUploadStream(uploadSpecification_1) { - return __awaiter4(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { + return __awaiter2(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { core14.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); const zip = archiver2.create("zip", { highWaterMark: (0, config_1.getUploadChunkSize)(), @@ -108994,18 +115176,18 @@ var require_zip2 = __commonJS({ return zipUploadStream; }); } - var zipErrorCallback = (error4) => { + var zipErrorCallback = (error3) => { core14.error("An error has occurred while creating the zip file for upload"); - core14.info(error4); + core14.info(error3); throw new Error("An error has occurred during zip creation for the artifact"); }; - var zipWarningCallback = (error4) => { - if (error4.code === "ENOENT") { + var zipWarningCallback = (error3) => { + if (error3.code === "ENOENT") { core14.warning("ENOENT warning during artifact zip creation. No such file or directory"); - core14.info(error4); + core14.info(error3); } else { - core14.warning(`A non-blocking warning has occurred during artifact zip creation: ${error4.code}`); - core14.info(error4); + core14.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); + core14.info(error3); } }; var zipFinishCallback = () => { @@ -109021,7 +115203,7 @@ var require_zip2 = __commonJS({ var require_upload_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/upload-artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -109034,31 +115216,31 @@ var require_upload_artifact = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -109087,18 +115269,18 @@ var require_upload_artifact = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadArtifact = uploadArtifact; - var core14 = __importStar4(require_core()); + var core14 = __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 util_1 = require_util10(); 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -109297,7 +115479,7 @@ var require_traverse = __commonJS({ })(this.value); }; function walk(root, cb, immutable) { - var path6 = []; + var path7 = []; var parents = []; var alive = true; return (function walker(node_) { @@ -109306,11 +115488,11 @@ var require_traverse = __commonJS({ var state = { node, node_, - path: [].concat(path6), + path: [].concat(path7), parent: parents.slice(-1)[0], - key: path6.slice(-1)[0], - isRoot: path6.length === 0, - level: path6.length, + key: path7.slice(-1)[0], + isRoot: path7.length === 0, + level: path7.length, circular: null, update: function(x) { if (!state.isRoot) { @@ -109365,7 +115547,7 @@ var require_traverse = __commonJS({ parents.push(state); var keys = Object.keys(state.node); keys.forEach(function(key, i2) { - path6.push(key); + path7.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)) { @@ -109374,7 +115556,7 @@ var require_traverse = __commonJS({ child.isLast = i2 == keys.length - 1; child.isFirst = i2 == 0; if (modifiers.post) modifiers.post.call(state, child); - path6.pop(); + path7.pop(); }); parents.pop(); } @@ -110070,18 +116252,18 @@ var require_binary = __commonJS({ return acc; } function decodeBEs(bytes) { - var val2 = decodeBEu(bytes); + var val = decodeBEu(bytes); if ((bytes[0] & 128) == 128) { - val2 -= Math.pow(256, bytes.length); + val -= Math.pow(256, bytes.length); } - return val2; + return val; } function decodeLEs(bytes) { - var val2 = decodeLEu(bytes); + var val = decodeLEu(bytes); if ((bytes[bytes.length - 1] & 128) == 128) { - val2 -= Math.pow(256, bytes.length); + val -= Math.pow(256, bytes.length); } - return val2; + return val; } function words(decode) { var self2 = {}; @@ -110395,11 +116577,11 @@ var require_unzip_stream = __commonJS({ return requiredLength; case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: var isUtf8 = (this.parsedEntity.flags & 2048) !== 0; - var path6 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); + var path7 = 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) { - path6 = extra.parsed.path; + path7 = extra.parsed.path; } this.parsedEntity.extra = extra.parsed; var isUnix = (this.parsedEntity.versionMadeBy & 65280) >> 8 === 3; @@ -110411,7 +116593,7 @@ var require_unzip_stream = __commonJS({ } if (this.options.debug) { const debugObj = Object.assign({}, this.parsedEntity, { - path: path6, + path: path7, flags: "0x" + this.parsedEntity.flags.toString(16), unixAttrs: unixAttrs && "0" + unixAttrs.toString(8), isSymlink, @@ -110812,8 +116994,8 @@ var require_parser_stream = __commonJS({ this.unzipStream.on("entry", function(entry) { self2.push(entry); }); - this.unzipStream.on("error", function(error4) { - self2.emit("error", error4); + this.unzipStream.on("error", function(error3) { + self2.emit("error", error3); }); } util.inherits(ParserStream, Transform); @@ -110848,8 +117030,8 @@ var require_parser_stream = __commonJS({ // node_modules/mkdirp/index.js var require_mkdirp = __commonJS({ "node_modules/mkdirp/index.js"(exports2, module2) { - var path6 = require("path"); - var fs7 = require("fs"); + var path7 = require("path"); + var fs8 = require("fs"); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP(p, opts, f, made) { @@ -110860,7 +117042,7 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs7; + var xfs = opts.fs || fs8; if (mode === void 0) { mode = _0777; } @@ -110868,7 +117050,7 @@ var require_mkdirp = __commonJS({ var cb = f || /* istanbul ignore next */ function() { }; - p = path6.resolve(p); + p = path7.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; @@ -110876,8 +117058,8 @@ var require_mkdirp = __commonJS({ } switch (er.code) { case "ENOENT": - if (path6.dirname(p) === p) return cb(er); - mkdirP(path6.dirname(p), opts, function(er2, made2) { + if (path7.dirname(p) === p) return cb(er); + mkdirP(path7.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); @@ -110899,19 +117081,19 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs7; + var xfs = opts.fs || fs8; if (mode === void 0) { mode = _0777; } if (!made) made = null; - p = path6.resolve(p); + p = path7.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": - made = sync(path6.dirname(p), opts, made); + made = sync(path7.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir @@ -110936,8 +117118,8 @@ var require_mkdirp = __commonJS({ // node_modules/unzip-stream/lib/extract.js var require_extract2 = __commonJS({ "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { - var fs7 = require("fs"); - var path6 = require("path"); + var fs8 = require("fs"); + var path7 = require("path"); var util = require("util"); var mkdirp = require_mkdirp(); var Transform = require("stream").Transform; @@ -110953,8 +117135,8 @@ var require_extract2 = __commonJS({ this.createdDirectories = {}; var self2 = this; this.unzipStream.on("entry", this._processEntry.bind(this)); - this.unzipStream.on("error", function(error4) { - self2.emit("error", error4); + this.unzipStream.on("error", function(error3) { + self2.emit("error", error3); }); } util.inherits(Extract, Transform); @@ -110979,17 +117161,17 @@ var require_extract2 = __commonJS({ }; Extract.prototype._processEntry = function(entry) { var self2 = this; - var destPath = path6.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path6.dirname(destPath); + var destPath = path7.join(this.opts.path, entry.path); + var directory = entry.isDirectory ? destPath : path7.dirname(destPath); this.unfinishedEntries++; var writeFileFn = function() { - var pipedStream = fs7.createWriteStream(destPath); + var pipedStream = fs8.createWriteStream(destPath); pipedStream.on("close", function() { self2.unfinishedEntries--; self2._notifyAwaiter(); }); - pipedStream.on("error", function(error4) { - self2.emit("error", error4); + pipedStream.on("error", function(error3) { + self2.emit("error", error3); }); entry.pipe(pipedStream); }; @@ -111030,7 +117212,7 @@ var require_unzip = __commonJS({ var require_download_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/download/download-artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111043,31 +117225,31 @@ var require_download_artifact = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -111094,54 +117276,54 @@ var require_download_artifact = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.streamExtractExternal = streamExtractExternal; exports2.downloadArtifactPublic = downloadArtifactPublic; exports2.downloadArtifactInternal = downloadArtifactInternal; - var promises_1 = __importDefault4(require("fs/promises")); - var crypto = __importStar4(require("crypto")); - var stream = __importStar4(require("stream")); - var github2 = __importStar4(require_github()); - var core14 = __importStar4(require_core()); - var httpClient = __importStar4(require_lib7()); - var unzip_stream_1 = __importDefault4(require_unzip()); + var promises_1 = __importDefault2(require("fs/promises")); + var crypto2 = __importStar2(require("crypto")); + var stream = __importStar2(require("stream")); + var github2 = __importStar2(require_github()); + var core14 = __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 util_1 = require_util10(); var errors_1 = require_errors3(); var scrubQueryParameters = (url) => { const parsed = new URL(url); parsed.search = ""; return parsed.toString(); }; - function exists(path6) { - return __awaiter4(this, void 0, void 0, function* () { + function exists(path7) { + return __awaiter2(this, void 0, void 0, function* () { try { - yield promises_1.default.access(path6); + yield promises_1.default.access(path7); return true; - } catch (error4) { - if (error4.code === "ENOENT") { + } catch (error3) { + if (error3.code === "ENOENT") { return false; } else { - throw error4; + throw error3; } } }); } function streamExtract(url, directory) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let retryCount = 0; while (retryCount < 5) { try { return yield streamExtractExternal(url, directory); - } catch (error4) { + } catch (error3) { retryCount++; - core14.debug(`Failed to download artifact after ${retryCount} retries due to ${error4.message}. Retrying in 5 seconds...`); + core14.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); yield new Promise((resolve5) => setTimeout(resolve5, 5e3)); } } @@ -111149,7 +117331,7 @@ var require_download_artifact = __commonJS({ }); } function streamExtractExternal(url_1, directory_1) { - return __awaiter4(this, arguments, void 0, function* (url, directory, opts = { timeout: 30 * 1e3 }) { + return __awaiter2(this, arguments, void 0, function* (url, directory, opts = { timeout: 30 * 1e3 }) { const client = new httpClient.HttpClient((0, user_agent_1.getUserAgentString)()); const response = yield client.get(url); if (response.message.statusCode !== 200) { @@ -111163,17 +117345,17 @@ var require_download_artifact = __commonJS({ reject(timeoutError); }; const timer = setTimeout(timerFn, opts.timeout); - const hashStream = crypto.createHash("sha256").setEncoding("hex"); + const hashStream = crypto2.createHash("sha256").setEncoding("hex"); const passThrough = new stream.PassThrough(); response.message.pipe(passThrough); passThrough.pipe(hashStream); const extractStream = passThrough; extractStream.on("data", () => { timer.refresh(); - }).on("error", (error4) => { - core14.debug(`response.message: Artifact download failed: ${error4.message}`); + }).on("error", (error3) => { + core14.debug(`response.message: Artifact download failed: ${error3.message}`); clearTimeout(timer); - reject(error4); + reject(error3); }).pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", () => { clearTimeout(timer); if (hashStream) { @@ -111182,14 +117364,14 @@ var require_download_artifact = __commonJS({ core14.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); } resolve5({ sha256Digest: `sha256:${sha256Digest}` }); - }).on("error", (error4) => { - reject(error4); + }).on("error", (error3) => { + reject(error3); }); }); }); } function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); const api = github2.getOctokit(token); let digestMismatch = false; @@ -111222,14 +117404,14 @@ var require_download_artifact = __commonJS({ core14.debug(`Expected digest: ${options.expectedHash}`); } } - } catch (error4) { - throw new Error(`Unable to download and extract artifact: ${error4.message}`); + } catch (error3) { + throw new Error(`Unable to download and extract artifact: ${error3.message}`); } return { downloadPath, digestMismatch }; }); } function downloadArtifactInternal(artifactId, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -111265,14 +117447,14 @@ Are you trying to download from a different run? Try specifying a github-token w core14.debug(`Expected digest: ${options.expectedHash}`); } } - } catch (error4) { - throw new Error(`Unable to download and extract artifact: ${error4.message}`); + } catch (error3) { + throw new Error(`Unable to download and extract artifact: ${error3.message}`); } return { downloadPath, digestMismatch }; }); } function resolveOrCreateDirectory() { - return __awaiter4(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { + return __awaiter2(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { if (!(yield exists(downloadPath))) { core14.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); yield promises_1.default.mkdir(downloadPath, { recursive: true }); @@ -111289,7 +117471,7 @@ Are you trying to download from a different run? Try specifying a github-token w var require_retry_options = __commonJS({ "node_modules/@actions/artifact/lib/internal/find/retry-options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111302,33 +117484,33 @@ var require_retry_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRetryOptions = getRetryOptions; - var core14 = __importStar4(require_core()); + var core14 = __importStar2(require_core()); var defaultMaxRetryNumber = 5; var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { @@ -111360,13 +117542,13 @@ var require_dist_node16 = __commonJS({ octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path6 = requestOptions.url.replace(options.baseUrl, ""); + const path7 = requestOptions.url.replace(options.baseUrl, ""); return request(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path6} - ${response.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path7} - ${response.status} in ${Date.now() - start}ms`); return response; - }).catch((error4) => { - octokit.log.info(`${requestOptions.method} ${path6} - ${error4.status} in ${Date.now() - start}ms`); - throw error4; + }).catch((error3) => { + octokit.log.info(`${requestOptions.method} ${path7} - ${error3.status} in ${Date.now() - start}ms`); + throw error3; }); }); } @@ -111384,22 +117566,22 @@ var require_dist_node17 = __commonJS({ return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; } var Bottleneck = _interopDefault(require_light()); - async function errorRequest(octokit, state, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(octokit, state, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } async function wrapRequest(state, request, options) { const limiter = new Bottleneck(); - limiter.on("failed", function(error4, info7) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info7) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -111421,12 +117603,12 @@ var require_dist_node17 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -111441,7 +117623,7 @@ var require_dist_node17 = __commonJS({ var require_get_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/find/get-artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111454,31 +117636,31 @@ var require_get_artifact = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -111510,17 +117692,17 @@ var require_get_artifact = __commonJS({ exports2.getArtifactInternal = getArtifactInternal; var github_1 = require_github(); var plugin_retry_1 = require_dist_node17(); - var core14 = __importStar4(require_core()); + var core14 = __importStar2(require_core()); var utils_1 = require_utils4(); var retry_options_1 = require_retry_options(); var plugin_request_log_1 = require_dist_node16(); - var util_1 = require_util11(); + var util_1 = require_util10(); 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { var _a; const [retryOpts, requestOpts] = (0, retry_options_1.getRetryOptions)(utils_1.defaults); const opts = { @@ -111562,7 +117744,7 @@ var require_get_artifact = __commonJS({ }); } function getArtifactInternal(artifactName) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { var _a; const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)(); @@ -111600,7 +117782,7 @@ var require_get_artifact = __commonJS({ var require_delete_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/delete/delete-artifact.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -111638,12 +117820,12 @@ var require_delete_artifact = __commonJS({ var plugin_request_log_1 = require_dist_node16(); var plugin_retry_1 = require_dist_node17(); var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var util_1 = require_util11(); + var util_1 = require_util10(); 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { var _a; const [retryOpts, requestOpts] = (0, retry_options_1.getRetryOptions)(utils_1.defaults); const opts = { @@ -111669,7 +117851,7 @@ var require_delete_artifact = __commonJS({ }); } function deleteArtifactInternal(artifactName) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -111705,7 +117887,7 @@ var require_delete_artifact = __commonJS({ var require_list_artifacts = __commonJS({ "node_modules/@actions/artifact/lib/internal/find/list-artifacts.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -111743,14 +117925,14 @@ var require_list_artifacts = __commonJS({ var plugin_request_log_1 = require_dist_node16(); var plugin_retry_1 = require_dist_node17(); var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var util_1 = require_util11(); + var util_1 = require_util10(); 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 __awaiter4(this, arguments, void 0, function* (workflowRunId, repositoryOwner, repositoryName, token, latest = false) { + 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); @@ -111815,7 +117997,7 @@ var require_list_artifacts = __commonJS({ }); } function listArtifactsInternal() { - return __awaiter4(this, arguments, void 0, function* (latest = false) { + 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 = { @@ -111861,7 +118043,7 @@ var require_list_artifacts = __commonJS({ var require_client2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/client.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -111888,7 +118070,7 @@ var require_client2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __rest4 = exports2 && exports2.__rest || function(s, e) { + 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]; @@ -111911,45 +118093,45 @@ var require_client2 = __commonJS({ var errors_1 = require_errors3(); var DefaultArtifactClient2 = class { uploadArtifact(name, files, rootDirectory, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 (error4) { - (0, core_1.warning)(`Artifact upload failed with error: ${error4}. + } 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 error4; + throw error3; } }); } downloadArtifact(artifactId, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = __rest4(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 (error4) { - (0, core_1.warning)(`Download Artifact failed with error: ${error4}. + } 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 error4; + throw error3; } }); } listArtifacts(options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { if ((0, config_1.isGhes)()) { throw new errors_1.GHESNotSupportedError(); @@ -111959,18 +118141,18 @@ If the error persists, please check whether Actions and API requests are operati 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 (error4) { - (0, core_1.warning)(`Listing Artifacts failed with error: ${error4}. + } 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 error4; + throw error3; } }); } getArtifact(artifactName, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { if ((0, config_1.isGhes)()) { throw new errors_1.GHESNotSupportedError(); @@ -111980,18 +118162,18 @@ If the error persists, please check whether Actions and API requests are operati return (0, get_artifact_1.getArtifactPublic)(artifactName, workflowRunId, repositoryOwner, repositoryName, token); } return (0, get_artifact_1.getArtifactInternal)(artifactName); - } catch (error4) { - (0, core_1.warning)(`Get Artifact failed with error: ${error4}. + } 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 error4; + throw error3; } }); } deleteArtifact(artifactName, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { if ((0, config_1.isGhes)()) { throw new errors_1.GHESNotSupportedError(); @@ -112001,13 +118183,13 @@ If the error persists, please check whether Actions and API requests are operati return (0, delete_artifact_1.deleteArtifactPublic)(artifactName, workflowRunId, repositoryOwner, repositoryName, token); } return (0, delete_artifact_1.deleteArtifactInternal)(artifactName); - } catch (error4) { - (0, core_1.warning)(`Delete Artifact failed with error: ${error4}. + } 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 error4; + throw error3; } }); } @@ -112028,7 +118210,7 @@ var require_interfaces2 = __commonJS({ var require_artifact2 = __commonJS({ "node_modules/@actions/artifact/lib/artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -112041,82 +118223,142 @@ var require_artifact2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); + 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(); - __exportStar4(require_interfaces2(), exports2); - __exportStar4(require_errors3(), exports2); - __exportStar4(require_client2(), exports2); + __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/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) { +// 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.checkArtifactFilePath = exports2.checkArtifactName = 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 checkArtifactName(name) { - if (!name) { - throw new Error(`Artifact name: ${name}, is incorrectly provided`); + 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; } - 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.`); - } + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - (0, core_1.info)(`Artifact name is valid!`); + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; } - exports2.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path6) { - if (!path6) { - throw new Error(`Artifact path: ${path6}, is incorrectly provided`); + exports2.toCommandProperties = toCommandProperties; + } +}); + +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/command.js +var require_command4 = __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]; + } }; } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path6.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path6}. 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. - `); + 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 os2 = __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() + os2.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"); } - 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/file-command.js +var require_file_command4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -112129,579 +118371,864 @@ var require_upload_specification = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUploadSpecification = void 0; - var fs7 = __importStar4(require("fs")); - var core_1 = require_core(); - 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 (!fs7.existsSync(rootDirectory)) { - throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs8 = __importStar2(require("fs")); + var os2 = __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 (!fs7.statSync(rootDirectory).isDirectory()) { - throw new Error(`Provided rootDirectory ${rootDirectory} is not a valid directory`); + if (!fs8.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - rootDirectory = (0, path_1.normalize)(rootDirectory); - rootDirectory = (0, path_1.resolve)(rootDirectory); - for (let file of artifactFiles) { - if (!fs7.existsSync(file)) { - throw new Error(`File ${file} does not exist`); - } - if (!fs7.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`); - } + fs8.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - return specifications; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.getUploadSpecification = getUploadSpecification; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/tmp/lib/tmp.js -var require_tmp = __commonJS({ - "node_modules/tmp/lib/tmp.js"(exports2, module2) { - var fs7 = require("fs"); - var os = require("os"); - var path6 = require("path"); - var crypto = require("crypto"); - var _c = { fs: fs7.constants, os: os.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 = os.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 = fs7.rmdirSync.bind(fs7); - var _gracefulCleanup = false; - function rimraf(dirPath, callback) { - return fs7.rm(dirPath, { recursive: true }, callback); +// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js +var require_proxy5 = __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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; + } } - function FN_RIMRAF_SYNC(dirPath) { - return fs7.rmSync(dirPath, { recursive: true }); + 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; } - 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() { + 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(url, base) { + super(url, 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_lib7 = __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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { try { - const name = _generateTmpName(sanitizedOptions); - fs7.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); + step(generator.next(value)); + } catch (e) { + reject(e); } - })(); - }); - } - function tmpNameSync(options) { - const args = _parseArguments(options), opts = args[0]; - const sanitizedOptions = _assertAndSanitizeOptionsSync(opts); - let tries = sanitizedOptions.tries; - do { - const name = _generateTmpName(sanitizedOptions); - try { - fs7.statSync(name); - } catch (e) { - return name; } - } while (tries-- > 0); - throw new Error("Could not get a unique tmp filename, max tries reached"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve5(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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy5()); + 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 : ""; } - 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); - fs7.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { - if (err2) return cb(err2); - if (opts.discardDescriptor) { - return fs7.close(fd, function _discardCallback(possibleErr) { - return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false)); + 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((resolve5) => __awaiter2(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on("data", (chunk) => { + output = Buffer.concat([output, chunk]); }); - } else { - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false)); + this.message.on("end", () => { + resolve5(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve5(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(userAgent, 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 = userAgent; + 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 || {}); }); - }); - } - function fileSync(options) { - const args = _parseArguments(options), opts = args[0]; - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - const name = tmpNameSync(opts); - let fd = fs7.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); - if (opts.discardDescriptor) { - fs7.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); - fs7.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { - if (err2) return cb(err2); - cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); }); - }); - } - function dirSync(options) { - const args = _parseArguments(options), opts = args[0]; - const name = tmpNameSync(opts); - fs7.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]) - fs7.close(fdPath[0], function() { - fs7.unlink(fdPath[1], _handler); + } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); - else fs7.unlink(fdPath[1], _handler); - } - function _removeFileSync(fdPath) { - let rethrownException = null; - try { - if (0 <= fdPath[0]) fs7.closeSync(fdPath[0]); - } catch (e) { - if (!_isEBADF(e) && !_isENOENT(e)) throw e; - } finally { - try { - fs7.unlinkSync(fdPath[1]); - } catch (e) { - if (!_isENOENT(e)) rethrownException = e; - } } - if (rethrownException !== null) { - throw rethrownException; + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); } - } - 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 : fs7.rmdir.bind(fs7); - 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 index = _removeObjects.indexOf(toRemove); - if (index >= 0) _removeObjects.splice(index, 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) { - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - } - function _randomChars(howMany) { - let value = [], rnd = null; - try { - rnd = crypto.randomBytes(howMany); - } catch (e) { - rnd = crypto.pseudoRandomBytes(howMany); + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - for (let i = 0; i < howMany; i++) { - value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - return value.join(""); - } - function _isUndefined(obj) { - return typeof obj === "undefined"; - } - function _parseArguments(options, callback) { - if (typeof options === "function") { - return [{}, options]; + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } - if (_isUndefined(options)) { - return [{}, callback]; + /** + * 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); + }); } - const actualOptions = {}; - for (const key of Object.getOwnPropertyNames(options)) { - actualOptions[key] = options[key]; + 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); + }); } - return [actualOptions, callback]; - } - function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path6.isAbsolute(name) ? name : path6.join(tmpDir, name); - fs7.stat(pathToResolve, function(err) { - if (err) { - fs7.realpath(path6.dirname(pathToResolve), function(err2, parentDir) { - if (err2) return cb(err2); - cb(null, path6.join(parentDir, path6.basename(pathToResolve))); + 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 info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, 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(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve5(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; + } + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.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: ${info7.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 { - fs7.realpath(path6, cb); + req.end(); } - }); - } - function _resolvePathSync(name, tmpDir) { - const pathToResolve = path6.isAbsolute(name) ? name : path6.join(tmpDir, name); - try { - fs7.statSync(pathToResolve); - return fs7.realpathSync(pathToResolve); - } catch (_err) { - const parentDir = fs7.realpathSync(path6.dirname(pathToResolve)); - return path6.join(parentDir, path6.basename(pathToResolve)); - } - } - function _generateTmpName(opts) { - const tmpDir = opts.tmpdir; - if (!_isUndefined(opts.name)) { - return path6.join(tmpDir, opts.dir, opts.name); } - if (!_isUndefined(opts.template)) { - return path6.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + /** + * 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); } - const name = [ - opts.prefix ? opts.prefix : "tmp", - "-", - process.pid, - "-", - _randomChars(12), - opts.postfix ? "-" + opts.postfix : "" - ].join(""); - return path6.join(tmpDir, opts.dir, name); - } - function _assertOptionsBase(options) { - if (!_isUndefined(options.name)) { - const name = options.name; - if (path6.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename = path6.basename(name); - if (basename === ".." || basename === "." || basename !== name) - throw new Error(`name option must not contain a path, found "${name}".`); + 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); } - if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) { - throw new Error(`Invalid template, found "${options.template}".`); + _prepareRequest(method, requestUrl, headers) { + const info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); + } + } + return info7; } - if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) { - throw new Error(`Invalid tries, found "${options.tries}".`); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - 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) ? "" : options.prefix; - options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; - } - function _getRelativePath(option, name, tmpDir, cb) { - if (_isUndefined(name)) return cb(null); - _resolvePath(name, tmpDir, function(err, resolvedPath) { - if (err) return cb(err); - const relativePath = path6.relative(tmpDir, resolvedPath); - if (!resolvedPath.startsWith(tmpDir)) { - return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - cb(null, relativePath); - }); - } - function _getRelativePathSync(option, name, tmpDir) { - if (_isUndefined(name)) return; - const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath = path6.relative(tmpDir, resolvedPath); - if (!resolvedPath.startsWith(tmpDir)) { - throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); + return additionalHeaders[header] || clientHeader || _default2; } - return relativePath; - } - 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); + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - _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(error4) { - return _isExpectedError(error4, -EBADF, "EBADF"); - } - function _isENOENT(error4) { - return _isExpectedError(error4, -ENOENT, "ENOENT"); - } - function _isExpectedError(error4, errno, code) { - return IS_WIN32 ? error4.code === code : error4.code === code && error4.errno === errno; - } - function setGracefulCleanup() { - _gracefulCleanup = true; - } - function _getTmpDir(options, cb) { - return fs7.realpath(options && options.tmpdir || os.tmpdir(), cb); - } - function _getTmpDirSync(options) { - return fs7.realpathSync(options && options.tmpdir || os.tmpdir()); - } - process.addListener(EXIT, _garbageCollector); - Object.defineProperty(module2.exports, "tmpdir", { - enumerable: true, - configurable: false, - get: function() { - return _getTmpDirSync(); + 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 https2.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; } - }); - 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, path6, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path6, fd, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.file = async (options) => fileWithOptions(options); - module2.exports.withFile = async function withFile(fn, options) { - const { path: path6, fd, cleanup } = await module2.exports.file(options); - try { - return await fn({ path: path6, fd }); - } finally { - await cleanup(); + _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; } - }; - module2.exports.dirSync = tmp.dirSync; - var dirWithOptions = promisify( - (options, cb) => tmp.dir( - options, - (err, path6, cleanup) => err ? cb(err) : cb(void 0, { path: path6, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.dir = async (options) => dirWithOptions(options); - module2.exports.withDir = async function withDir(fn, options) { - const { path: path6, cleanup } = await module2.exports.dir(options); - try { - return await fn({ path: path6 }); - } finally { - await cleanup(); + _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((resolve5) => setTimeout(() => resolve5(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve5(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 { + resolve5(response); + } + })); + }); } }; - module2.exports.tmpNameSync = tmp.tmpNameSync; - module2.exports.tmpName = promisify(tmp.tmpName); - module2.exports.tmpdir = tmp.tmpdir; - module2.exports.setGracefulCleanup = tmp.setGracefulCleanup; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js -var require_proxy7 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js +var require_auth4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } else { - return void 0; + function step(result) { + result.done ? resolve5(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; } - } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { + 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; } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { + }; + 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; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - 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; + // 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")}`; } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - get password() { - return this._decodedPassword; + 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/http-client/lib/index.js -var require_lib9 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -112729,571 +119256,616 @@ var require_lib9 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy7()); - var tunnel = __importStar4(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.OidcClient = void 0; + var http_client_1 = require_lib7(); + var auth_1 = require_auth4(); + var core_1 = require_core5(); + 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); } - }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + 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; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(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", () => { - resolve5(output.toString()); - }); - })); + 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 _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); + } + return id_token; }); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve5(Buffer.concat(chunks)); - }); - })); + 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.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/summary.js +var require_summary4 = __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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; + } + function step(result) { + result.done ? resolve5(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; } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + 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.`); } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); + this._filePath = pathFromEnv; + return this._filePath; }); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + /** + * 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}`; } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); + /** + * 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(); }); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + /** + * 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 }); }); } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + * 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 */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(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); - }); + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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(); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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(); } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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); + addTable(rows) { + const tableBody = rows.map((row) => { + const cells = row.map((cell) => { + if (typeof cell === "string") { + return this.wrap("td", cell); } - } while (numTries < maxTries); - return response; - }); + 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(); } /** - * Needs to be called if keepAlive is set to true in request options. + * 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 */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; + addDetails(label, content) { + const element = this.wrap("details", this.wrap("summary", label) + content); + return this.addRaw(element).addEOL(); } /** - * Raw request. - * @param info - * @param data + * 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 */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve5(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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(); } /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * 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 */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info7.httpModule.request(info7.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: ${info7.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(); - } + 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(); } /** - * 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 + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); + addSeparator() { + const element = this.wrap("hr", null); + return this.addRaw(element).addEOL(); } - 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); + /** + * 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(); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } - } - return info7; + /** + * 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(); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + /** + * 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(); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + }; + 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_utils4 = __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]; + } }; } - _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; + 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 path7 = __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, path7.sep); + } + exports2.toPlatformPath = toPlatformPath; + } +}); + +// node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io-util.js +var require_io_util4 = __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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (proxyAgent) { - return proxyAgent; + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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 - }); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + 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 fs8 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); + _a = fs8.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs8.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 proxyAgent; + 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'); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); - }); + if (exports2.IS_WINDOWS) { + return p.startsWith("\\") || /^[A-Z]:/i.test(p); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve5(response); + 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 = path7.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { + return filePath; } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; + } else { + if (isUnixExecutable(stats)) { + return filePath; } - 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) { + } + } + 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 (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; - } else { - msg = `Failed request: (${statusCode})`; + } + if (stats && stats.isFile()) { + if (exports2.IS_WINDOWS) { + try { + const directory = path7.dirname(filePath); + const upperName = path7.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path7.join(directory, actualName); + break; + } + } + } catch (err) { + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); + return filePath; } else { - resolve5(response); + 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, "\\"); } - }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js -var require_auth4 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io.js +var require_io4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -113321,793 +119893,795 @@ var require_auth4 = __commonJS({ }); }; 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"); + exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + var assert_1 = require("assert"); + var path7 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util4()); + 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; } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path7.join(dest, path7.basename(source)) : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + 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 (path7.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// 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.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 = path7.join(dest, path7.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(path7.dirname(dest)); + yield ioUtil.rename(source, dest); + }); } - exports2.getInitialRetryIntervalInMilliseconds = getInitialRetryIntervalInMilliseconds; - function getDownloadFileConcurrency() { - return 2; + 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.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.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.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.mkdirP = mkdirP; + function which6(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + if (check) { + const result = yield which6(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.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.which = which6; + 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(path7.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(path7.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path7.delimiter)) { + if (p) { + directories.push(p); + } + } + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path7.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); } - 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.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 }; } - exports2.getWorkSpaceDirectory = getWorkSpaceDirectory; - function getRetentionDays() { - return process.env["GITHUB_RETENTION_DAYS"]; + 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 copyFile(srcFile, destFile, force); + } + } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - exports2.getRetentionDays = getRetentionDays; - function isGhes() { - const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); - return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; + function copyFile(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); + } + }); } - 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner4 = __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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; 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); + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path7 = __importStar2(require("path")); + var io6 = __importStar2(require_io4()); + var ioUtil = __importStar2(require_io_util4()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - 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); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); } - 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(); + _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(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.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(str2, end) { + return str2.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; } - toBuffer() { - return Buffer.from([0, 8, 16, 24, 32, 40, 48, 56].map((s) => Number(this._crc >> BigInt(s) & BigInt(255)))); + _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; } - static flip64Bits(n) { - return (BigInt(1) << BigInt(64)) - BigInt(1) - n; + /** + * 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 = path7.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve5, 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) + os2.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 { + resolve5(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - exports2.default = CRC64; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/utils.js -var require_utils7 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/utils.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; + } + arg += c; + escaped = false; } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); } + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + if (c === "\\" && escaped) { + append(c); + continue; } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + if (c === "\\" && inQuotes) { + escaped = true; + continue; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("crypto")); - var fs_1 = require("fs"); - var core_1 = require_core(); - var http_client_1 = require_lib9(); - var auth_1 = require_auth4(); - var config_variables_1 = require_config_variables(); - var crc64_1 = __importDefault4(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; + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; } - (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; + append(c); } - if (digest) { - requestOptions["x-actions-results-crc64"] = digest.crc64; - requestOptions["x-actions-results-md5"] = digest.md5; + if (arg.length > 0) { + args.push(arg.trim()); } - return requestOptions; - } - exports2.getUploadHeaders = getUploadHeaders; - function createHttpClient(userAgent) { - return new http_client_1.HttpClient(userAgent, [ - 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 ######`); + return args; } - exports2.displayHttpDiagnostics = displayHttpDiagnostics; - function createDirectoriesForArtifact(directories) { - return __awaiter4(this, void 0, void 0, function* () { - for (const directory of directories) { - yield fs_1.promises.mkdir(directory, { - recursive: true - }); + 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"); } - }); - } - exports2.createDirectoriesForArtifact = createDirectoriesForArtifact; - function createEmptyFilesForArtifact(emptyFilesToCreate) { - return __awaiter4(this, void 0, void 0, function* () { - for (const filePath of emptyFilesToCreate) { - yield (yield fs_1.promises.open(filePath, "w")).close(); + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - }); - } - exports2.createEmptyFilesForArtifact = createEmptyFilesForArtifact; - function getFileSize(filePath) { - return __awaiter4(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 __awaiter4(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; + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - return retention; - } - exports2.getProperRetention = getProperRetention; - function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => setTimeout(resolve5, milliseconds)); - }); - } - exports2.sleep = sleep; - function digestForStream(stream) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - const crc64 = new crc64_1.default(); - const md5 = crypto_1.default.createHash("md5"); - stream.on("data", (data) => { - crc64.update(data); - md5.update(data); - }).on("end", () => resolve5({ - 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_core(); - 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}`); + _debug(message) { + this.emit("debug", message); } - stop() { - if (this.totalFileStatus) { - clearInterval(this.totalFileStatus); + _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); } - incrementProcessedCount() { - this.processedCount++; - } - formatPercentage(numerator, denominator) { - return (numerator / denominator * 100).toFixed(4).toString(); + 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(); } }; - 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/exec.js +var require_exec4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpManager = void 0; - var utils_1 = require_utils7(); - var HttpManager = class { - constructor(clientCount, userAgent) { - if (clientCount < 1) { - throw new Error("There must be at least one client"); - } - this.userAgent = userAgent; - this.clients = new Array(clientCount).fill((0, utils_1.createHttpClient)(userAgent)); - } - getClient(index) { - return this.clients[index]; + 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); } - // 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(index) { - this.clients[index].dispose(); - this.clients[index] = (0, utils_1.createHttpClient)(this.userAgent); + __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(resolve5) { + resolve5(value); + }); } - disposeAndReplaceAllClients() { - for (const [index] of this.clients.entries()) { - this.disposeAndReplaceClient(index); + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - exports2.HttpManager = HttpManager; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner4()); + 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 _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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/lib/internal/upload-gzip.js -var require_upload_gzip = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/upload-gzip.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/platform.js +var require_platform4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -114120,21 +120694,21 @@ var require_upload_gzip = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -114161,120 +120735,72 @@ var require_upload_gzip = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; - var fs7 = __importStar4(require("fs")); - var zlib = __importStar4(require("zlib")); - var util_1 = require("util"); - var stat = (0, util_1.promisify)(fs7.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 __awaiter4(this, void 0, void 0, function* () { - for (const gzipExemptExtension of gzipExemptFileExtensions) { - if (originalFilePath.endsWith(gzipExemptExtension)) { - return Number.MAX_SAFE_INTEGER; - } - } - return new Promise((resolve5, reject) => { - const inputStream = fs7.createReadStream(originalFilePath); - const gzip = zlib.createGzip(); - const outputStream = fs7.createWriteStream(tempFilePath); - inputStream.pipe(gzip).pipe(outputStream); - outputStream.on("finish", () => __awaiter4(this, void 0, void 0, function* () { - const size = (yield stat(tempFilePath)).size; - resolve5(size); - })); - outputStream.on("error", (error4) => { - console.log(error4); - reject(error4); - }); - }); + exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; + var os_1 = __importDefault2(require("os")); + var exec3 = __importStar2(require_exec4()); + 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 }); - } - exports2.createGZipFileOnDisk = createGZipFileOnDisk; - function createGZipFileInBuffer(originalFilePath) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - var _a, e_1, _b, _c; - const inputStream = fs7.createReadStream(originalFilePath); - const gzip = zlib.createGzip(); - inputStream.pipe(gzip); - const chunks = []; - try { - for (var _d = true, gzip_1 = __asyncValues4(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), _a = gzip_1_1.done, !_a; ) { - _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 && !_a && (_b = gzip_1.return)) yield _b.call(gzip_1); - } finally { - if (e_1) throw e_1.error; - } - } - resolve5(Buffer.concat(chunks)); - })); + 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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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.createGZipFileInBuffer = createGZipFileInBuffer; + exports2.getDetails = getDetails; } }); -// node_modules/@actions/artifact-legacy/lib/internal/requestUtils.js -var require_requestUtils2 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/requestUtils.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/core.js +var require_core5 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/core.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -114287,21 +120813,21 @@ var require_requestUtils2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -114329,488 +120855,1086 @@ var require_requestUtils2 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientRequest = exports2.retry = void 0; - var utils_1 = require_utils7(); - var core14 = __importStar4(require_core()); - var config_variables_1 = require_config_variables(); - function retry3(name, operation, customErrorMessages, maxAttempts) { - return __awaiter4(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 (error4) { - isRetryable = true; - errorMessage = error4.message; + 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_command4(); + var file_command_1 = require_file_command4(); + var utils_1 = require_utils10(); + var os2 = __importStar2(require("os")); + var path7 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils4(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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 = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(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}${path7.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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 setOutput(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(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(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 = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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_summary4(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary4(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils4(); + 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_platform4()); + } +}); + +// 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_core5(); + 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(path7) { + if (!path7) { + throw new Error(`Artifact path: ${path7}, is incorrectly provided`); + } + for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { + if (path7.includes(invalidCharacterKey)) { + throw new Error(`Artifact path is not valid: ${path7}. 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 fs8 = __importStar2(require("fs")); + var core_1 = require_core5(); + 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 (!fs8.existsSync(rootDirectory)) { + throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); + } + if (!fs8.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 (!fs8.existsSync(file)) { + throw new Error(`File ${file} does not exist`); + } + if (!fs8.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}`); } - if (!isRetryable) { - core14.info(`${name} - Error is not retryable`); - if (response) { - (0, utils_1.displayHttpDiagnostics)(response); - } - break; + 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 fs8 = require("fs"); + var os2 = require("os"); + var path7 = require("path"); + var crypto2 = require("crypto"); + var _c = { fs: fs8.constants, os: os2.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 = os2.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 = fs8.rmdirSync.bind(fs8); + var _gracefulCleanup = false; + function rimraf(dirPath, callback) { + return fs8.rm(dirPath, { recursive: true }, callback); + } + function FN_RIMRAF_SYNC(dirPath) { + return fs8.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); + fs8.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); } - core14.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 = retry3; - function retryHttpClientRequest(name, method, customErrorMessages = /* @__PURE__ */ new Map(), maxAttempts = (0, config_variables_1.getRetryLimit)()) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3(name, method, customErrorMessages, maxAttempts); + function tmpNameSync(options) { + const args = _parseArguments(options), opts = args[0]; + const sanitizedOptions = _assertAndSanitizeOptionsSync(opts); + let tries = sanitizedOptions.tries; + do { + const name = _generateTmpName(sanitizedOptions); + try { + fs8.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); + fs8.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { + if (err2) return cb(err2); + if (opts.discardDescriptor) { + return fs8.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)); + } + }); }); } - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + function fileSync(options) { + const args = _parseArguments(options), opts = args[0]; + const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; + const name = tmpNameSync(opts); + let fd = fs8.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + if (opts.discardDescriptor) { + fs8.closeSync(fd); + fd = void 0; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); + 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); + fs8.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); + fs8.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]) + fs8.close(fdPath[0], function() { + fs8.unlink(fdPath[1], _handler); }); + else fs8.unlink(fdPath[1], _handler); + } + function _removeFileSync(fdPath) { + let rethrownException = null; + try { + if (0 <= fdPath[0]) fs8.closeSync(fdPath[0]); + } catch (e) { + if (!_isEBADF(e) && !_isENOENT(e)) throw e; + } finally { + try { + fs8.unlinkSync(fdPath[1]); + } catch (e) { + if (!_isENOENT(e)) rethrownException = e; + } } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(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 : fs8.rmdir.bind(fs8); + 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 index = _removeObjects.indexOf(toRemove); + if (index >= 0) _removeObjects.splice(index, 1); + called = true; + if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { + return removeFunction(fileOrDirName); + } else { + return removeFunction(fileOrDirName, next || function() { + }); } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + }; + } + function _garbageCollector() { + if (!_gracefulCleanup) return; + while (_removeObjects.length) { + try { + _removeObjects[0](); + } catch (e) { } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + } + function _randomChars(howMany) { + let value = [], rnd = null; + try { + rnd = crypto2.randomBytes(howMany); + } catch (e) { + rnd = crypto2.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 = path7.isAbsolute(name) ? name : path7.join(tmpDir, name); + fs8.stat(pathToResolve, function(err) { + if (err) { + fs8.realpath(path7.dirname(pathToResolve), function(err2, parentDir) { + if (err2) return cb(err2); + cb(null, path7.join(parentDir, path7.basename(pathToResolve))); + }); + } else { + fs8.realpath(path7, cb); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UploadHttpClient = void 0; - var fs7 = __importStar4(require("fs")); - var core14 = __importStar4(require_core()); - var tmp = __importStar4(require_tmp_promise()); - var stream = __importStar4(require("stream")); - var utils_1 = require_utils7(); - 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_lib9(); - var http_manager_1 = require_http_manager(); - var upload_gzip_1 = require_upload_gzip(); - var requestUtils_1 = require_requestUtils2(); - var stat = (0, util_1.promisify)(fs7.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); + } + function _resolvePathSync(name, tmpDir) { + const pathToResolve = path7.isAbsolute(name) ? name : path7.join(tmpDir, name); + try { + fs8.statSync(pathToResolve); + return fs8.realpathSync(pathToResolve); + } catch (_err) { + const parentDir = fs8.realpathSync(path7.dirname(pathToResolve)); + return path7.join(parentDir, path7.basename(pathToResolve)); } - /** - * 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 __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return client.post(artifactUrl, data, headers); - }), customErrorMessages); - const body = yield response.readBody(); - return JSON.parse(body); - }); + } + function _generateTmpName(opts) { + const tmpDir = opts.tmpdir; + if (!_isUndefined(opts.name)) { + return path7.join(tmpDir, opts.dir, opts.name); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - const FILE_CONCURRENCY = (0, config_variables_1.getUploadFileConcurrency)(); - const MAX_CHUNK_SIZE = (0, config_variables_1.getUploadChunkSize)(); - core14.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((index) => __awaiter4(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(index, currentFileParameters); - if (core14.isDebug()) { - core14.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) { - core14.error(`aborting artifact upload`); - abortPendingFileUploads = true; - } - } - this.statusReporter.incrementProcessedCount(); - } - }))); - this.statusReporter.stop(); - this.uploadHttpManager.disposeAndReplaceAllClients(); - core14.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); - return { - uploadSize: uploadFileSize, - totalSize: totalFileSize, - failedItems: failedItemsToReport - }; - }); + if (!_isUndefined(opts.template)) { + return path7.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - const fileStat = yield stat(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) { - core14.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) { - core14.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 = () => fs7.createReadStream(parameters.file); - isGzip = false; - uploadFileSize = totalFileSize; - } else { - core14.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 stream.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; - core14.warning(`Aborting upload for ${parameters.file} due to failure`); - } - return { - isSuccess: isUploadSuccessful, - successfulUploadSize: uploadFileSize - failedChunkSizes, - totalSize: totalFileSize - }; - } else { - const tempFile = yield tmp.file(); - core14.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) { - core14.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 { - core14.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, () => fs7.createReadStream(uploadFilePath, { - start: startChunkIndex, - end: endChunkIndex, - autoClose: false - }), startChunkIndex, endChunkIndex, uploadFileSize, isGzip, totalFileSize); - if (!result) { - isUploadSuccessful = false; - failedChunkSizes += chunkSize; - core14.warning(`Aborting upload for ${parameters.file} due to failure`); - abortFileUpload = true; - } else { - if (uploadFileSize > 8388608) { - this.statusReporter.updateLargeFileStatus(parameters.file, startChunkIndex, endChunkIndex, uploadFileSize); - } - } - } - core14.debug(`deleting temporary gzip file ${tempFile.path}`); - yield tempFile.cleanup(); - return { - isSuccess: isUploadSuccessful, - successfulUploadSize: uploadFileSize - failedChunkSizes, - totalSize: totalFileSize - }; - } - }); + const name = [ + opts.prefix ? opts.prefix : "tmp", + "-", + process.pid, + "-", + _randomChars(12), + opts.postfix ? "-" + opts.postfix : "" + ].join(""); + return path7.join(tmpDir, opts.dir, name); + } + function _assertOptionsBase(options) { + if (!_isUndefined(options.name)) { + const name = options.name; + if (path7.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); + const basename2 = path7.basename(name); + if (basename2 === ".." || basename2 === "." || basename2 !== name) + throw new Error(`name option must not contain a path, found "${name}".`); } - /** - * 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 __awaiter4(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 = () => __awaiter4(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); - } - core14.info(`Retry limit has been reached for chunk at offset ${start} to ${resourceUrl}`); - return true; - } - return false; - }; - const backOff = (retryAfterValue) => __awaiter4(this, void 0, void 0, function* () { - this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); - if (retryAfterValue) { - core14.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); - core14.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); - yield (0, utils_1.sleep)(backoffTime); - } - core14.info(`Finished backoff for retry #${retryCount}, continuing with upload`); - return; + if (!_isUndefined(options.template) && !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) ? "" : options.prefix; + options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; + } + function _getRelativePath(option, name, tmpDir, cb) { + if (_isUndefined(name)) return cb(null); + _resolvePath(name, tmpDir, function(err, resolvedPath) { + if (err) return cb(err); + const relativePath = path7.relative(tmpDir, resolvedPath); + if (!resolvedPath.startsWith(tmpDir)) { + return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); + } + cb(null, relativePath); + }); + } + function _getRelativePathSync(option, name, tmpDir) { + if (_isUndefined(name)) return; + const resolvedPath = _resolvePathSync(name, tmpDir); + const relativePath = path7.relative(tmpDir, resolvedPath); + if (!resolvedPath.startsWith(tmpDir)) { + throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); + } + return relativePath; + } + 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); }); - while (retryCount <= retryLimit) { - let response; - try { - response = yield uploadChunkRequest(); - } catch (error4) { - core14.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); - console.log(error4); - 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)) { - core14.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 { - core14.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); - (0, utils_1.displayHttpDiagnostics)(response); - return false; - } - } - return false; }); + }); + } + 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 fs8.realpath(options && options.tmpdir || os2.tmpdir(), cb); + } + function _getTmpDirSync(options) { + return fs8.realpathSync(options && options.tmpdir || os2.tmpdir()); + } + process.addListener(EXIT, _garbageCollector); + Object.defineProperty(module2.exports, "tmpdir", { + enumerable: true, + configurable: false, + get: function() { + return _getTmpDirSync(); } - /** - * 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 __awaiter4(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); - core14.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", () => __awaiter4(this, void 0, void 0, function* () { - return client.patch(resourceUrl.toString(), data, headers); - }), customErrorMessages); - yield response.readBody(); - core14.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); - }); + }); + 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, path7, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path7, fd, cleanup: promisify(cleanup) }) + ) + ); + module2.exports.file = async (options) => fileWithOptions(options); + module2.exports.withFile = async function withFile(fn, options) { + const { path: path7, fd, cleanup } = await module2.exports.file(options); + try { + return await fn({ path: path7, fd }); + } finally { + await cleanup(); } }; - exports2.UploadHttpClient = UploadHttpClient; + module2.exports.dirSync = tmp.dirSync; + var dirWithOptions = promisify( + (options, cb) => tmp.dir( + options, + (err, path7, cleanup) => err ? cb(err) : cb(void 0, { path: path7, cleanup: promisify(cleanup) }) + ) + ); + module2.exports.dir = async (options) => dirWithOptions(options); + module2.exports.withDir = async function withDir(fn, options) { + const { path: path7, cleanup } = await module2.exports.dir(options); + try { + return await fn({ path: path7 }); + } 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/download-http-client.js -var require_download_http_client = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/download-http-client.js"(exports2) { +// 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"; - var __createBinding4 = 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(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(); + } } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -114837,296 +121961,319 @@ var require_download_http_client = __commonJS({ 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.DownloadHttpClient = void 0; - var fs7 = __importStar4(require("fs")); - var core14 = __importStar4(require_core()); - var zlib = __importStar4(require("zlib")); - var utils_1 = require_utils7(); - 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(); + 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_core5(); + var http_client_1 = require_lib7(); + var auth_1 = require_auth4(); 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); + 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)(); } - /** - * Gets a list of all artifacts that are in a specific container - */ - listArtifacts() { - return __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return client.get(artifactUrl, headers); - })); - const body = yield response.readBody(); - return JSON.parse(body); - }); + 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; } - /** - * 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 __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return client.get(resourceUrl.toString(), headers); - })); - const body = yield response.readBody(); - return JSON.parse(body); - }); + return value; + } + exports2.parseEnvNumber = parseEnvNumber; + function getApiVersion() { + return "6.0-preview"; + } + exports2.getApiVersion = getApiVersion; + function isSuccessStatusCode(statusCode) { + if (!statusCode) { + return false; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - const DOWNLOAD_CONCURRENCY = (0, config_variables_1.getDownloadFileConcurrency)(); - core14.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); - const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; - let currentFile = 0; - let downloadedFiles = 0; - core14.info(`Total number of files that will be downloaded: ${downloadItems.length}`); - this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); - this.statusReporter.start(); - yield Promise.all(parallelDownloads.map((index) => __awaiter4(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(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); - if (core14.isDebug()) { - core14.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); - } - this.statusReporter.incrementProcessedCount(); - } - }))).catch((error4) => { - throw new Error(`Unable to download the artifact: ${error4}`); - }).finally(() => { - this.statusReporter.stop(); - this.downloadHttpManager.disposeAndReplaceAllClients(); - }); - }); + return statusCode >= 200 && statusCode < 300; + } + exports2.isSuccessStatusCode = isSuccessStatusCode; + function isForbiddenStatusCode(statusCode) { + if (!statusCode) { + return false; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - let retryCount = 0; - const retryLimit = (0, config_variables_1.getRetryLimit)(); - let destinationStream = fs7.createWriteStream(downloadPath); - const headers = (0, utils_1.getDownloadHeaders)("application/json", true, true); - const makeDownloadRequest = () => __awaiter4(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) => __awaiter4(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) { - core14.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); - core14.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); - yield (0, utils_1.sleep)(backoffTime); - } - core14.info(`Finished backoff for retry #${retryCount}, continuing with download`); - } - }); - const isAllBytesReceived = (expected, received) => { - if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { - core14.info("Skipping download validation."); - return true; - } - return parseInt(expected) === received; - }; - const resetDestinationStream = (fileDownloadPath) => __awaiter4(this, void 0, void 0, function* () { - destinationStream.close(); - yield new Promise((resolve5) => { - destinationStream.on("close", resolve5); - if (destinationStream.writableFinished) { - resolve5(); - } - }); - yield (0, utils_1.rmFile)(fileDownloadPath); - destinationStream = fs7.createWriteStream(fileDownloadPath); - }); - while (retryCount <= retryLimit) { - let response; - try { - response = yield makeDownloadRequest(); - } catch (error4) { - core14.info("An error occurred while attempting to download a file"); - console.log(error4); - 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 (error4) { - forceRetry = true; - } - } - if (forceRetry || (0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core14.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}`)); - } - } - }); + return statusCode === http_client_1.HttpCodes.Forbidden; + } + exports2.isForbiddenStatusCode = isForbiddenStatusCode; + function isRetryableStatusCode(statusCode) { + if (!statusCode) { + return false; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - yield new Promise((resolve5, reject) => { - if (isGzip) { - const gunzip = zlib.createGunzip(); - response.message.on("error", (error4) => { - core14.info(`An error occurred while attempting to read the response stream`); - gunzip.close(); - destinationStream.close(); - reject(error4); - }).pipe(gunzip).on("error", (error4) => { - core14.info(`An error occurred while attempting to decompress the response stream`); - destinationStream.close(); - reject(error4); - }).pipe(destinationStream).on("close", () => { - resolve5(); - }).on("error", (error4) => { - core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error4); - }); - } else { - response.message.on("error", (error4) => { - core14.info(`An error occurred while attempting to read the response stream`); - destinationStream.close(); - reject(error4); - }).pipe(destinationStream).on("close", () => { - resolve5(); - }).on("error", (error4) => { - core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error4); - }); - } + 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(userAgent) { + return new http_client_1.HttpClient(userAgent, [ + 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 }); - return; - }); + } + }); + } + 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."); } - }; - exports2.DownloadHttpClient = DownloadHttpClient; + 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((resolve5) => setTimeout(resolve5, milliseconds)); + }); + } + exports2.sleep = sleep; + function digestForStream(stream) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => { + const crc64 = new crc64_1.default(); + const md5 = crypto_1.default.createHash("md5"); + stream.on("data", (data) => { + crc64.update(data); + md5.update(data); + }).on("end", () => resolve5({ + crc64: crc64.digest("base64"), + md5: md5.digest("base64") + })).on("error", reject); + }); + }); + } + exports2.digestForStream = digestForStream; } }); -// 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) { +// 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"; - var __createBinding4 = 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(exports2, "__esModule", { value: true }); + exports2.StatusReporter = void 0; + var core_1 = require_core5(); + var StatusReporter = class { + constructor(displayFrequencyInMilliseconds) { + this.totalNumberOfFilesToProcess = 0; + this.processedCount = 0; + this.largeFiles = /* @__PURE__ */ new Map(); + this.totalFileStatus = void 0; + this.displayFrequencyInMilliseconds = displayFrequencyInMilliseconds; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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(); } - __setModuleDefault4(result, mod); - return result; }; + 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.getDownloadSpecification = void 0; - var path6 = __importStar4(require("path")); - function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { - const directories = /* @__PURE__ */ new Set(); - const specifications = { - rootDownloadLocation: includeRootDirectory ? path6.join(downloadPath, artifactName) : downloadPath, - directoryStructure: [], - emptyFilesToCreate: [], - filesToDownload: [] - }; - for (const entry of artifactEntries) { - if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { - const normalizedPathEntry = path6.normalize(entry.path); - const filePath = path6.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); - if (entry.itemType === "file") { - directories.add(path6.dirname(filePath)); - if (entry.fileLength === 0) { - specifications.emptyFilesToCreate.push(filePath); - } else { - specifications.filesToDownload.push({ - sourceLocation: entry.contentLocation, - targetPath: filePath - }); - } - } + exports2.HttpManager = void 0; + var utils_1 = require_utils11(); + var HttpManager = class { + constructor(clientCount, userAgent) { + if (clientCount < 1) { + throw new Error("There must be at least one client"); + } + this.userAgent = userAgent; + this.clients = new Array(clientCount).fill((0, utils_1.createHttpClient)(userAgent)); + } + getClient(index) { + return this.clients[index]; + } + // 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(index) { + this.clients[index].dispose(); + this.clients[index] = (0, utils_1.createHttpClient)(this.userAgent); + } + disposeAndReplaceAllClients() { + for (const [index] of this.clients.entries()) { + this.disposeAndReplaceClient(index); } } - specifications.directoryStructure = Array.from(directories); - return specifications; - } - exports2.getDownloadSpecification = getDownloadSpecification; + }; + exports2.HttpManager = HttpManager; } }); -// 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) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115139,21 +122286,21 @@ var require_artifact_client = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -115180,386 +122327,120 @@ var require_artifact_client = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultArtifactClient = void 0; - var core14 = __importStar4(require_core()); - var upload_specification_1 = require_upload_specification(); - var upload_http_client_1 = require_upload_http_client(); - var utils_1 = require_utils7(); - 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 __awaiter4(this, void 0, void 0, function* () { - core14.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) { - core14.warning(`No files found that can be uploaded`); - } else { - const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); - if (!response.fileContainerResourceUrl) { - core14.debug(response.toString()); - throw new Error("No URL provided by the Artifact Service to upload an artifact to"); - } - core14.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); - core14.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); - const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); - core14.info(`File upload process has finished. Finalizing the artifact upload`); - yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); - if (uploadResult.failedItems.length > 0) { - core14.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); - } else { - core14.info(`Artifact has been finalized. All files have been successfully uploaded!`); - } - core14.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, path6, options) { - return __awaiter4(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; + 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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); }); - if (!artifactToDownload) { - throw new Error(`Unable to find an artifact with the name: ${name}`); - } - const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl); - if (!path6) { - path6 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path6 = (0, path_1.normalize)(path6); - path6 = (0, path_1.resolve)(path6); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path6, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); - if (downloadSpecification.filesToDownload.length === 0) { - core14.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); - } else { - yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); - core14.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(path6) { - return __awaiter4(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) { - core14.info("Unable to find any artifacts for the associated workflow"); - return response; - } - if (!path6) { - path6 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path6 = (0, path_1.normalize)(path6); - path6 = (0, path_1.resolve)(path6); - let downloadedArtifacts = 0; - while (downloadedArtifacts < artifacts.count) { - const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; - downloadedArtifacts += 1; - core14.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, path6, true); - if (downloadSpecification.filesToDownload.length === 0) { - core14.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/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ value: v2, done: d }); + }, reject); } - __setModuleDefault4(result, mod); - return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(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; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); - } - if (typeof copy.matchDirectories === "boolean") { - result.matchDirectories = copy.matchDirectories; - core14.debug(`matchDirectories '${result.matchDirectories}'`); - } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); - } - if (typeof copy.excludeHiddenFiles === "boolean") { - result.excludeHiddenFiles = copy.excludeHiddenFiles; - core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; + var fs8 = __importStar2(require("fs")); + var zlib = __importStar2(require("zlib")); + var util_1 = require("util"); + var stat = (0, util_1.promisify)(fs8.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 result; - } - exports2.getOptions = getOptions; - } -}); - -// node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path6 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname2(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - let result = path6.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; + return new Promise((resolve5, reject) => { + const inputStream = fs8.createReadStream(originalFilePath); + const gzip = zlib.createGzip(); + const outputStream = fs8.createWriteStream(tempFilePath); + inputStream.pipe(gzip).pipe(outputStream); + outputStream.on("finish", () => __awaiter2(this, void 0, void 0, function* () { + const size = (yield stat(tempFilePath)).size; + resolve5(size); + })); + outputStream.on("error", (error3) => { + console.log(error3); + reject(error3); + }); + }); + }); } - exports2.dirname = dirname2; - 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 += "\\"; + exports2.createGZipFileOnDisk = createGZipFileOnDisk; + function createGZipFileInBuffer(originalFilePath) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { + var _a, e_1, _b, _c; + const inputStream = fs8.createReadStream(originalFilePath); + const gzip = zlib.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(), _a = gzip_1_1.done, !_a; ) { + _c = gzip_1_1.value; + _d = false; + try { + const chunk = _c; + chunks.push(chunk); + } finally { + _d = true; } - return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; } - } else { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_d && !_a && (_b = gzip_1.return)) yield _b.call(gzip_1); + } finally { + if (e_1) throw e_1.error; + } } - } 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 += path6.sep; - } - return root + itemPath; - } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - 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("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - 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("/"); - } - exports2.hasRoot = hasRoot; - 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, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; - } - p = normalizeSeparators(p); - if (!p.endsWith(path6.sep)) { - return p; - } - if (p === path6.sep) { - return p; - } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; - } - return p.substr(0, p.length - 1); + resolve5(Buffer.concat(chunks)); + })); + }); } - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind2 = __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 = {})); + exports2.createGZipFileInBuffer = createGZipFileInBuffer; } }); -// node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115572,182 +122453,111 @@ var require_internal_pattern_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(require_internal_path_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - 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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); - } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; - } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); - } - exports2.partialMatch = partialMatch; - } -}); - -// node_modules/@actions/glob/lib/internal-path.js -var require_internal_path2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path6 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(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(path6.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path6.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); + exports2.retryHttpClientRequest = exports2.retry = void 0; + var utils_1 = require_utils11(); + var core14 = __importStar2(require_core5()); + var config_variables_1 = require_config_variables(); + function retry3(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; } - this.segments.unshift(remaining); + 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; } - } 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(path6.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); + if (!isRetryable) { + core14.info(`${name} - Error is not retryable`); + if (response) { + (0, utils_1.displayHttpDiagnostics)(response); } + break; } + core14.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + yield (0, utils_1.sleep)((0, utils_1.getExponentialRetryTimeInMilliseconds)(attempt)); + attempt++; } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path6.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path6.sep; - } - result += this.segments[i]; + if (response) { + (0, utils_1.displayHttpDiagnostics)(response); } - return result; - } - }; - exports2.Path = Path; + if (customErrorInformation) { + throw Error(`${name} failed: ${customErrorInformation}`); + } + throw Error(`${name} failed: ${errorMessage}`); + }); + } + exports2.retry = retry3; + function retryHttpClientRequest(name, method, customErrorMessages = /* @__PURE__ */ new Map(), maxAttempts = (0, config_variables_1.getRetryLimit)()) { + return __awaiter2(this, void 0, void 0, function* () { + return yield retry3(name, method, customErrorMessages, maxAttempts); + }); + } + exports2.retryHttpClientRequest = retryHttpClientRequest; } }); -// node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115760,215 +122570,386 @@ var require_internal_pattern2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os = __importStar4(require("os")); - var path6 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(require("assert")); - var minimatch_1 = require_minimatch(); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_path_1 = require_internal_path2(); - var IS_WINDOWS = process.platform === "win32"; - var Pattern = class _Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { - 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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path6.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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path6.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path6.sep}`; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - 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); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.UploadHttpClient = void 0; + var fs8 = __importStar2(require("fs")); + var core14 = __importStar2(require_core5()); + var tmp = __importStar2(require_tmp_promise()); + var stream = __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_lib7(); + var http_manager_1 = require_http_manager(); + var upload_gzip_1 = require_upload_gzip(); + var requestUtils_1 = require_requestUtils2(); + var stat = (0, util_1.promisify)(fs8.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); } /** - * Escapes glob patterns within a path + * 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 */ - static globEscape(s) { - return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); + 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); + }); } /** - * Normalizes slashes and ensures absolute root + * 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 */ - static fixupPattern(pattern, homedir) { - (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(`.${path6.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path6.sep}`)) { - homedir = homedir || os.homedir(); - (0, assert_1.default)(homedir, "Unable to determine HOME directory"); - (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 += "\\"; + 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)(); + core14.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); + const parameters = []; + let continueOnError = true; + if (options) { + if (options.continueOnError === false) { + continueOnError = false; + } } - 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 += "\\"; + 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 + }); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + 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((index) => __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(index, currentFileParameters); + if (core14.isDebug()) { + core14.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) { + core14.error(`aborting artifact upload`); + abortPendingFileUploads = true; + } + } + this.statusReporter.incrementProcessedCount(); + } + }))); + this.statusReporter.stop(); + this.uploadHttpManager.disposeAndReplaceAllClients(); + core14.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); + return { + uploadSize: uploadFileSize, + totalSize: totalFileSize, + failedItems: failedItemsToReport + }; + }); } /** - * Attempts to unescape a pattern segment to create a literal path segment. - * Otherwise returns empty string. + * 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 */ - 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; + uploadFileAsync(httpClientIndex, parameters) { + return __awaiter2(this, void 0, void 0, function* () { + const fileStat = yield stat(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) { + core14.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) { + core14.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 = () => fs8.createReadStream(parameters.file); + isGzip = false; + uploadFileSize = totalFileSize; + } else { + core14.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 stream.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; + core14.warning(`Aborting upload for ${parameters.file} due to failure`); + } + return { + isSuccess: isUploadSuccessful, + successfulUploadSize: uploadFileSize - failedChunkSizes, + totalSize: totalFileSize + }; + } else { + const tempFile = yield tmp.file(); + core14.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) { + core14.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 { + core14.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; - } else if (c2 === "]") { - closed = i2; - break; + } + const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs8.createReadStream(uploadFilePath, { + start: startChunkIndex, + end: endChunkIndex, + autoClose: false + }), startChunkIndex, endChunkIndex, uploadFileSize, isGzip, totalFileSize); + if (!result) { + isUploadSuccessful = false; + failedChunkSizes += chunkSize; + core14.warning(`Aborting upload for ${parameters.file} due to failure`); + abortFileUpload = true; } else { - set2 += c2; + if (uploadFileSize > 8388608) { + this.statusReporter.updateLargeFileStatus(parameters.file, startChunkIndex, endChunkIndex, uploadFileSize); + } } } - if (closed >= 0) { - if (set2.length > 1) { - return ""; + core14.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); } - if (set2) { - literal += set2; - i = closed; - continue; + core14.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) { + core14.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); + core14.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); + yield (0, utils_1.sleep)(backoffTime); + } + core14.info(`Finished backoff for retry #${retryCount}, continuing with upload`); + return; + }); + while (retryCount <= retryLimit) { + let response; + try { + response = yield uploadChunkRequest(); + } catch (error3) { + core14.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); + console.log(error3); + if (incrementAndCheckRetryLimit()) { + return false; } + yield backOff(); + continue; } - } - literal += c; - } - return literal; + yield response.readBody(); + if ((0, utils_1.isSuccessStatusCode)(response.message.statusCode)) { + return true; + } else if ((0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { + core14.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 { + core14.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); + (0, utils_1.displayHttpDiagnostics)(response); + return false; + } + } + return false; + }); } /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping + * 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 */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); - } - }; - exports2.Pattern = Pattern; - } -}); - -// node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state2 = __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(path6, level) { - this.path = path6; - this.level = level; + 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); + core14.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(); + core14.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); + }); } }; - exports2.SearchState = SearchState; + exports2.UploadHttpClient = UploadHttpClient; } }); -// node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115981,21 +122962,21 @@ var require_internal_globber2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -116022,225 +123003,230 @@ var require_internal_globber2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); - } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await4 ? 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 core14 = __importStar4(require_core()); - var fs7 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper2()); - var path6 = __importStar4(require("path")); - var patternHelper = __importStar4(require_internal_pattern_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_pattern_1 = require_internal_pattern2(); - var internal_search_state_1 = require_internal_search_state2(); - var IS_WINDOWS = process.platform === "win32"; - var DefaultGlobber = class _DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); + exports2.DownloadHttpClient = void 0; + var fs8 = __importStar2(require("fs")); + var core14 = __importStar2(require_core5()); + var zlib = __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); } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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); + }); } - glob() { - var _a, e_1, _b, _c; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _d = true, _e = __asyncValues4(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); - } finally { - if (e_1) throw e_1.error; - } - } - return result; + /** + * 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); }); } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs7.promises.lstat(searchPath)); - } catch (err) { - if (err.code === "ENOENT") { - continue; + /** + * 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)(); + core14.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); + const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; + let currentFile = 0; + let downloadedFiles = 0; + core14.info(`Total number of files that will be downloaded: ${downloadItems.length}`); + this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); + this.statusReporter.start(); + yield Promise.all(parallelDownloads.map((index) => __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(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); + if (core14.isDebug()) { + core14.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); } - throw err; + this.statusReporter.incrementProcessedCount(); } - stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); - } - const traversalChain = []; - while (stack.length) { - const item = stack.pop(); - const match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; + }))).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 = fs8.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) { + core14.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); + core14.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); + yield (0, utils_1.sleep)(backoffTime); + } + core14.info(`Finished backoff for retry #${retryCount}, continuing with download`); } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; + }); + const isAllBytesReceived = (expected, received) => { + if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { + core14.info("Skipping download validation."); + return true; } - if (options.excludeHiddenFiles && path6.basename(item.path).match(/^\./)) { + return parseInt(expected) === received; + }; + const resetDestinationStream = (fileDownloadPath) => __awaiter2(this, void 0, void 0, function* () { + destinationStream.close(); + yield new Promise((resolve5) => { + destinationStream.on("close", resolve5); + if (destinationStream.writableFinished) { + resolve5(); + } + }); + yield (0, utils_1.rmFile)(fileDownloadPath); + destinationStream = fs8.createWriteStream(fileDownloadPath); + }); + while (retryCount <= retryLimit) { + let response; + try { + response = yield makeDownloadRequest(); + } catch (error3) { + core14.info("An error occurred while attempting to download a file"); + console.log(error3); + yield backOff(); continue; } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { - yield yield __await4(item.path); - } else if (!partialMatch) { - 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; } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs7.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path6.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); + } + if (forceRetry || (0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { + core14.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}`)); } } }); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; + pipeResponseToFile(response, destinationStream, isGzip) { + return __awaiter2(this, void 0, void 0, function* () { + yield new Promise((resolve5, reject) => { + if (isGzip) { + const gunzip = zlib.createGunzip(); + response.message.on("error", (error3) => { + core14.info(`An error occurred while attempting to read the response stream`); + gunzip.close(); + destinationStream.close(); + reject(error3); + }).pipe(gunzip).on("error", (error3) => { + core14.info(`An error occurred while attempting to decompress the response stream`); + destinationStream.close(); + reject(error3); + }).pipe(destinationStream).on("close", () => { + resolve5(); + }).on("error", (error3) => { + core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + reject(error3); + }); } 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 __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs7.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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 fs7.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs7.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + response.message.on("error", (error3) => { + core14.info(`An error occurred while attempting to read the response stream`); + destinationStream.close(); + reject(error3); + }).pipe(destinationStream).on("close", () => { + resolve5(); + }).on("error", (error3) => { + core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + reject(error3); + }); } - traversalChain.push(realPath); - } - return stats; + }); + return; }); } }; - exports2.DefaultGlobber = DefaultGlobber; + exports2.DownloadHttpClient = DownloadHttpClient; } }); -// 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) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -116253,134 +123239,87 @@ var require_internal_hash_files = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); - } - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = void 0; - var crypto = __importStar4(require("crypto")); - var core14 = __importStar4(require_core()); - var fs7 = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var path6 = __importStar4(require("path")); - function hashFiles2(globber, currentWorkspace, verbose = false) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const writeDelegate = verbose ? core14.info : core14.debug; - let hasMatch = false; - const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const result = crypto.createHash("sha256"); - let count = 0; - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path6.sep}`)) { - writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); - continue; - } - if (fs7.statSync(file).isDirectory()) { - writeDelegate(`Skip directory '${file}'.`); - continue; - } - const hash = crypto.createHash("sha256"); - const pipeline = util.promisify(stream.pipeline); - yield pipeline(fs7.createReadStream(file), hash); - result.write(hash.digest()); - count++; - if (!hasMatch) { - hasMatch = true; + exports2.getDownloadSpecification = void 0; + var path7 = __importStar2(require("path")); + function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { + const directories = /* @__PURE__ */ new Set(); + const specifications = { + rootDownloadLocation: includeRootDirectory ? path7.join(downloadPath, artifactName) : downloadPath, + directoryStructure: [], + emptyFilesToCreate: [], + filesToDownload: [] + }; + for (const entry of artifactEntries) { + if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { + const normalizedPathEntry = path7.normalize(entry.path); + const filePath = path7.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); + if (entry.itemType === "file") { + directories.add(path7.dirname(filePath)); + if (entry.fileLength === 0) { + specifications.emptyFilesToCreate.push(filePath); + } else { + specifications.filesToDownload.push({ + sourceLocation: entry.contentLocation, + targetPath: filePath + }); } } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a && (_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 ""; } - }); + } + specifications.directoryStructure = Array.from(directories); + return specifications; } - exports2.hashFiles = hashFiles2; + exports2.getDownloadSpecification = getDownloadSpecification; } }); -// node_modules/@actions/glob/lib/glob.js -var require_glob3 = __commonJS({ - "node_modules/@actions/glob/lib/glob.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -116408,31 +123347,161 @@ var require_glob3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = exports2.create = void 0; - var internal_globber_1 = require_internal_globber2(); - var internal_hash_files_1 = require_internal_hash_files(); - function create3(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.DefaultArtifactClient = void 0; + var core14 = __importStar2(require_core5()); + 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* () { + core14.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) { + core14.warning(`No files found that can be uploaded`); + } else { + const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); + if (!response.fileContainerResourceUrl) { + core14.debug(response.toString()); + throw new Error("No URL provided by the Artifact Service to upload an artifact to"); + } + core14.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); + core14.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); + const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); + core14.info(`File upload process has finished. Finalizing the artifact upload`); + yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); + if (uploadResult.failedItems.length > 0) { + core14.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); + } else { + core14.info(`Artifact has been finalized. All files have been successfully uploaded!`); + } + core14.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, path7, 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 (!path7) { + path7 = (0, config_variables_1.getWorkSpaceDirectory)(); + } + path7 = (0, path_1.normalize)(path7); + path7 = (0, path_1.resolve)(path7); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path7, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); + if (downloadSpecification.filesToDownload.length === 0) { + core14.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); + } else { + yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); + core14.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(path7) { + 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) { + core14.info("Unable to find any artifacts for the associated workflow"); + return response; + } + if (!path7) { + path7 = (0, config_variables_1.getWorkSpaceDirectory)(); + } + path7 = (0, path_1.normalize)(path7); + path7 = (0, path_1.resolve)(path7); + let downloadedArtifacts = 0; + while (downloadedArtifacts < artifacts.count) { + const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; + downloadedArtifacts += 1; + core14.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, path7, true); + if (downloadSpecification.filesToDownload.length === 0) { + core14.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; - function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - }); - } - exports2.hashFiles = hashFiles2; } }); // src/analyze-action-post.ts -var fs6 = __toESM(require("fs")); +var fs7 = __toESM(require("fs")); var core13 = __toESM(require_core()); // src/actions-util.ts @@ -116440,13 +123509,12 @@ var fs = __toESM(require("fs")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -116456,21 +123524,21 @@ async function getFolderSize(itemPath, options) { 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 fs7 = options.fs || await import("node:fs/promises"); + const fs8 = 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 fs7.lstat(itemPath, { bigint: true }) : await fs7.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs8.lstat(itemPath, { bigint: true }) : await fs8.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 fs7.readdir(itemPath) : await fs7.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs8.readdir(itemPath) : await fs8.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -116481,13 +123549,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -117367,6 +124435,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -117486,7 +124566,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -117526,16 +124606,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -119090,7 +126161,7 @@ var safeDump = renamed("safeDump", "dump"); var semver = __toESM(require_semver2()); // src/api-compatibility.json -var maximumVersion = "3.19"; +var maximumVersion = "3.20"; var minimumVersion = "3.14"; // src/util.ts @@ -119105,9 +126176,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -119145,7 +126216,7 @@ function parseGitHubUrl(inputUrl) { var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; var hasBeenWarnedAboutVersion = false; function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== 1 /* GHES */) { + if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { return; } const disallowedAPIVersionReason = apiVersionInRange( @@ -119200,11 +126271,14 @@ function getCachedCodeQlVersion() { async function codeQlVersionAtLeast(codeql, requiredVersion) { return semver.gte((await codeql.getVersion()).version, requiredVersion); } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function isInTestMode() { + return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; +} +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } function cloneObject(obj) { return JSON.parse(JSON.stringify(obj)); @@ -119347,17 +126421,17 @@ function getApiClient() { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -119405,19 +126479,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -119433,9 +126507,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -119640,22 +126714,45 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); +// src/logging.ts +var core7 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup + }; +} +function withGroup(groupName, f) { + core7.startGroup(groupName); + try { + return f(); + } finally { + core7.endGroup(); + } +} + // src/feature-flags.ts -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); // src/overlay-database-utils.ts var fs2 = __toESM(require("fs")); var path2 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core7.debug(`Running git command: git ${args.join(" ")}`); + core8.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -119670,13 +126767,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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."; } - core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error4; + core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -119737,8 +126834,8 @@ var getFileOidsUnderPath = async function(basePath) { const match = line.match(regex); if (match) { const oid = match[1]; - const path6 = decodeGitFilePath(match[2]); - fileOidMap[path6] = oid; + const path7 = decodeGitFilePath(match[2]); + fileOidMap[path7] = oid; } else { throw new Error(`Unexpected "git ls-files" output: ${line}`); } @@ -119786,7 +126883,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core7.debug( + core8.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -119811,30 +126908,8 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/logging.ts -var core8 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup - }; -} -function withGroup(groupName, f) { - core8.startGroup(groupName); - try { - return f(); - } finally { - core8.endGroup(); - } -} - // src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -119895,13 +126970,13 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { } // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __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); + return !codeQlVersion ? true : semver4.gte(codeQlVersion, SafeArtifactUploadVersion); } // src/feature-flags.ts @@ -119911,11 +126986,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -119927,6 +126997,16 @@ var featureConfig = { 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", @@ -119955,12 +127035,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -120061,6 +127135,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -120072,21 +127151,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -120096,9 +127176,12 @@ var featureConfig = { }; // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -120169,20 +127252,20 @@ function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { // src/setup-codeql.ts var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // src/tar.ts var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); // src/tools-download.ts var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // src/tracer-config.ts @@ -120607,6 +127690,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -120743,26 +127843,268 @@ async function getJobRunUuidSarifOptions(codeql) { } // src/debug-artifacts.ts -var fs5 = __toESM(require("fs")); -var path5 = __toESM(require("path")); +var fs6 = __toESM(require("fs")); +var path6 = __toESM(require("path")); var artifact = __toESM(require_artifact2()); var artifactLegacy = __toESM(require_artifact_client2()); var core12 = __toESM(require_core()); var import_archiver = __toESM(require_archiver()); // src/analyze.ts -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); // src/autobuild.ts var core11 = __toESM(require_core()); // src/dependency-caching.ts var import_path = require("path"); -var actionsCache3 = __toESM(require_cache3()); -var glob = __toESM(require_glob3()); +var actionsCache3 = __toESM(require_cache4()); +var glob = __toESM(require_glob()); function getJavaTempDependencyDir() { return (0, import_path.join)(getTemporaryDirectory(), "codeql_java", "repository"); } +function getCsharpTempDependencyDir() { + return (0, import_path.join)(getTemporaryDirectory(), "codeql_csharp", "repository"); +} + +// src/artifact-scanner.ts +var fs5 = __toESM(require("fs")); +var os = __toESM(require("os")); +var path5 = __toESM(require("path")); +var exec = __toESM(require_exec()); +var GITHUB_TOKEN_PATTERNS = [ + { + name: "Personal Access Token", + pattern: /\bghp_[a-zA-Z0-9]{36}\b/g + }, + { + name: "OAuth Access Token", + pattern: /\bgho_[a-zA-Z0-9]{36}\b/g + }, + { + name: "User-to-Server Token", + pattern: /\bghu_[a-zA-Z0-9]{36}\b/g + }, + { + name: "Server-to-Server Token", + pattern: /\bghs_[a-zA-Z0-9]{36}\b/g + }, + { + name: "Refresh Token", + pattern: /\bghr_[a-zA-Z0-9]{36}\b/g + }, + { + name: "App Installation Access Token", + pattern: /\bghs_[a-zA-Z0-9]{255}\b/g + } +]; +function scanFileForTokens(filePath, relativePath, logger) { + const findings = []; + try { + const content = fs5.readFileSync(filePath, "utf8"); + for (const { name, pattern } of GITHUB_TOKEN_PATTERNS) { + const matches = content.match(pattern); + if (matches) { + for (let i = 0; i < matches.length; i++) { + findings.push({ tokenType: name, filePath: relativePath }); + } + logger.debug(`Found ${matches.length} ${name}(s) in ${relativePath}`); + } + } + 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}` + ); + } + const result = { + scannedFiles: 0, + findings: [] + }; + try { + const tempExtractDir = fs5.mkdtempSync( + path5.join(extractDir, `extract-${depth}-`) + ); + const fileName = path5.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 = path5.join( + tempExtractDir, + path5.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 = path5.join( + tempExtractDir, + path5.basename(archivePath, ".gz") + ); + await exec.exec("gunzip", ["-c", archivePath], { + outStream: fs5.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); + fs5.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, relativePath, extractDir, logger, depth = 0) { + const result = { + scannedFiles: 1, + findings: [] + }; + const fileName = path5.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); + } + const fileFindings = scanFileForTokens(fullPath, relativePath, logger); + result.findings.push(...fileFindings); + return result; +} +async function scanDirectory(dirPath, baseRelativePath, logger, depth = 0) { + const result = { + scannedFiles: 0, + findings: [] + }; + const entries = fs5.readdirSync(dirPath, { withFileTypes: true }); + for (const entry of entries) { + const fullPath = path5.join(dirPath, entry.name); + const relativePath = path5.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, + path5.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 = fs5.mkdtempSync(path5.join(os.tmpdir(), "artifact-scan-")); + try { + for (const filePath of filesToScan) { + const stats = fs5.statSync(filePath); + const fileName = path5.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(([type2, count]) => `${count} ${type2}${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 { + fs5.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) { @@ -120775,14 +128117,14 @@ async function uploadCombinedSarifArtifacts(logger, gitHubVariant, codeQlVersion logger.info( "Uploading available combined SARIF files as Actions debugging artifact..." ); - const baseTempDir = path5.resolve(tempDir, "combined-sarif"); + const baseTempDir = path6.resolve(tempDir, "combined-sarif"); const toUpload = []; - if (fs5.existsSync(baseTempDir)) { - const outputDirs = fs5.readdirSync(baseTempDir); + if (fs6.existsSync(baseTempDir)) { + const outputDirs = fs6.readdirSync(baseTempDir); for (const outputDir of outputDirs) { - const sarifFiles = fs5.readdirSync(path5.resolve(baseTempDir, outputDir)).filter((f) => path5.extname(f) === ".sarif"); + const sarifFiles = fs6.readdirSync(path6.resolve(baseTempDir, outputDir)).filter((f) => path6.extname(f) === ".sarif"); for (const sarifFile of sarifFiles) { - toUpload.push(path5.resolve(baseTempDir, outputDir, sarifFile)); + toUpload.push(path6.resolve(baseTempDir, outputDir, sarifFile)); } } } @@ -120816,6 +128158,10 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV ); return "upload-not-supported"; } + if (isInTestMode()) { + await scanArtifactsForTokens(toUpload, logger); + core12.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true"); + } let suffix = ""; const matrix = getOptionalInput("matrix"); if (matrix) { @@ -120834,8 +128180,8 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV try { await artifactUploader.uploadArtifact( sanitizeArtifactName(`${artifactName}${suffix}`), - toUpload.map((file) => path5.normalize(file)), - path5.normalize(rootDir), + toUpload.map((file) => path6.normalize(file)), + path6.normalize(rootDir), { // ensure we don't keep the debug artifacts around for too long since they can be large. retentionDays: 7 @@ -120848,7 +128194,7 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV } } async function getArtifactUploaderClient(logger, ghVariant) { - if (ghVariant === 1 /* GHES */) { + 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." ); @@ -120883,19 +128229,24 @@ async function runWrapper() { ); } } - const javaTempDependencyDir = getJavaTempDependencyDir(); - if (fs6.existsSync(javaTempDependencyDir)) { - try { - fs6.rmSync(javaTempDependencyDir, { recursive: true }); - } catch (error4) { - logger.info( - `Failed to remove temporary Java dependencies directory: ${getErrorMessage(error4)}` - ); + const tempDependencyDirs = [ + getJavaTempDependencyDir(), + getCsharpTempDependencyDir() + ]; + for (const tempDependencyDir of tempDependencyDirs) { + if (fs7.existsSync(tempDependencyDir)) { + try { + fs7.rmSync(tempDependencyDir, { recursive: true }); + } catch (error3) { + logger.info( + `Failed to remove temporary dependencies directory: ${getErrorMessage(error3)}` + ); + } } } - } catch (error4) { + } catch (error3) { core13.setFailed( - `analyze post-action step failed: ${getErrorMessage(error4)}` + `analyze post-action step failed: ${getErrorMessage(error3)}` ); } } @@ -120984,5 +128335,5 @@ tmp/lib/tmp.js: *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) */ diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 1751b03359..9475a1cd67 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os5 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os5 = __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() + os5.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto2 = __importStar4(require("crypto")); - var fs17 = __importStar4(require("fs")); - var os5 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto3 = __importStar2(require("crypto")); + var fs17 = __importStar2(require("fs")); + var os5 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + 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}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug5("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto2; + var crypto3; try { - crypto2 = require("crypto"); + crypto3 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto2.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); + supportedHashes = crypto3.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto2 === void 0) { + if (crypto3 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto2 = require("node:crypto"); - random = (max) => crypto2.randomInt(0, max); + const crypto3 = require("node:crypto"); + random = (max) => crypto3.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable2 { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable2 { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay: delay2, persist } = mockDispatch2; + 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 (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable2({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve8({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto2; + var crypto3; try { - crypto2 = require("crypto"); + crypto3 = require("crypto"); } catch { } function establishWebSocketConnection(url2, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto2.randomBytes(16).toString("base64"); + const keyValue = crypto3.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto2; + var crypto3; try { - crypto2 = require("crypto"); + crypto3 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto2.randomBytes(4); + this.maskKey = crypto3.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path16 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path16 = __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, path16.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs17 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); - _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs17 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs17.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs17.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path16.dirname(filePath); const upperName = path16.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path16.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which7; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path16 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path16 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which7; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os5 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path16 = __importStar4(require("path")); - var io7 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os5 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner6 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io7.which(this.toolPath, true); - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve8(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + exports2.exec = exec; + exports2.getExecOutput = getExecOutput; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner()); + function exec(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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 exec = __importStar2(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 = exportVariable8; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput2; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug5; + exports2.error = error3; + exports2.warning = warning10; + exports2.notice = notice; + exports2.info = info6; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os5 = __importStar4(require("os")); - var path16 = __importStar4(require("path")); + var os5 = __importStar2(require("os")); + var path16 = __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 exportVariable8(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable8(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable8; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19681,18 +19872,16 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,19 +19889,17 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput2(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { @@ -19721,50 +19908,39 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.stdout.write(os5.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput2; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug5(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug5; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning9(message, properties = {}) { + function warning10(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning9; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info6(message) { process.stdout.write(message + os5.EOL); } - exports2.info = info6; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url2, opts) => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url: url2, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url: url2, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url2 = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,532 +25406,74 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs17 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); - _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs17.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs17.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path16.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 = path16.dirname(filePath); - const upperName = path16.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path16.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 = which7; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path16 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path16.join(dest, path16.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 (path16.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path16.join(dest, path16.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(path16.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which7(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 __awaiter4(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(path16.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(path16.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path16.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path16.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug5; - } -}); - -// 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 debug5 = 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}}`); + var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug5; + } +}); + +// 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 debug5 = 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; }; @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare3 = require_compare(); - var gte5 = (a, b, loose) => compare3(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare3(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises4)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run2, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } } doExpire(clearGlobalState, run2, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run2, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run2, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve8, returned, task; + var args, cb, error3, reject, resolve8, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve8, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve8(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info6) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info6) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29565,8 +29279,8 @@ var require_helpers = __commonJS({ } return decimalPlaces; }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; }; } }); @@ -30548,1424 +30262,1097 @@ var require_lib3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core15 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core15.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core15.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os5 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os5.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core15.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path16 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto3 = __importStar2(require("crypto")); + var fs17 = __importStar2(require("fs")); + var os5 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path16.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs17.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs17.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os5.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname3; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + 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}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path16.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path16.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path16.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __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", () => { + resolve8(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve8(Buffer.concat(chunks)); + }); + })); + }); + } }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var 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 expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path16 = (function() { - try { - return require("path"); - } catch (e) { + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path16.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + /** + * 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); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path16.sep !== "/") { - pattern = pattern.split(path16.sep).join("/"); + 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); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + 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); + }); } - if (!pattern) { - this.empty = true; - return; + 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); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug5() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.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++; + /** + * 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate2; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve8(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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(); + } } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + /** + * 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); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; } + return info6; } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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; } - 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; - } - 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve8) => setTimeout(() => resolve8(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve8(response); } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } - var cs = pattern.substring(classStart + 1, i); + let obj; + let contents; 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; + 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) { } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + 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 { + resolve8(response); } - 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]; + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/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(resolve8) { + resolve8(value); + }); } - 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(_, $1, $2) { - if (!$2) { - $2 = "\\"; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve8(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; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - 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 = "$"; + 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"); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + options.headers["Authorization"] = `Bearer ${this.token}`; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - if (addPatternStart) { - re = patternStart + re; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - if (!hasMagic) { - return globUnescape(pattern); + // 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")}`; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path16.sep !== "/") { - f = f.split(path16.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - 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] === ""; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - throw new Error("wtf?"); }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path16 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path16.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path16.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path16.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path16.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os5 = __importStar4(require("os")); - var path16 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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 || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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(path16.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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path16.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path16.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; + 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 internal_match_kind_1.MatchKind.None; + return token; } - /** - * 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); + 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 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, "[*]"); + return runtimeUrl; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir2) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path16.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { - homedir2 = homedir2 || os5.homedir(); - assert_1.default(homedir2, "Unable to determine HOME directory"); - 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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path16, level) { - this.path = path16; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -31992,263 +31379,323 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); + 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 = ""; } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + /** + * 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}`; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * 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(); + }); } - function fulfill(value) { - resume("next", value); + /** + * 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 }); + }); } - function reject(value) { - resume("throw", value); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core15 = __importStar4(require_core()); - var fs17 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path16 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - globGenerator() { - return __asyncGenerator4(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)) { - core15.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs17.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs17.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path16.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; - }); + 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(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs17.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core15.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 fs17.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs17.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core15.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + /** + * 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); } - traversalChain.push(realPath); - } - return stats; - }); + 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create2(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path16 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.create = create2; + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path16.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32257,21 +31704,21 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -32301,14 +31748,14 @@ var require_io_util3 = __commonJS({ var _a; 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 fs17 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); + var fs17 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs17.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -32322,7 +31769,7 @@ var require_io_util3 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -32340,7 +31787,7 @@ var require_io_util3 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -32417,11 +31864,11 @@ var require_io_util3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32430,21 +31877,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -32474,10 +31921,10 @@ var require_io3 = __commonJS({ 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 path16 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); + var path16 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -32504,7 +31951,7 @@ var require_io3 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -32525,7 +31972,7 @@ var require_io3 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -32545,14 +31992,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32576,7 +32023,7 @@ var require_io3 = __commonJS({ } exports2.which = which7; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32624,7 +32071,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -32644,7 +32091,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -32665,1200 +32112,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug5; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug5 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug5 = 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 + "}"); +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - 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++) { - debug5(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; + __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(resolve8) { + resolve8(value); + }); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 os5 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + _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 { - version = version.version; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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); - } - debug5("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"); + return cmd; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os5.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os5.EOL.length); + n = s.indexOf(os5.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - 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; + _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 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) { - debug5("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 this.args; } - 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug5("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); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } 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]; - debug5("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); + if (!arg) { + return '""'; } - } 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++; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - 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]; + } + 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 { - 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]; - } + quoteHit = false; } - 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; + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.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 = rcompare; - function rcompare(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 = lt; - function lt(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 = gte5; - function gte5(a, b, loose) { - return compare3(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + 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(""); } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _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; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug5("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; - } - debug5("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); + /** + * 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 = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io7.which(this.toolPath, true); + return new Promise((resolve8, 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) + os5.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 { + resolve8(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug5("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; + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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; }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug5("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); }); } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - 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(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug5("comp", comp, options); - comp = replaceCarets(comp, options); - debug5("caret", comp); - comp = replaceTildes(comp, options); - debug5("tildes", comp); - comp = replaceXRanges(comp, options); - debug5("xrange", comp); - comp = replaceStars(comp, options); - debug5("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(_, M, m, p, pr) { - debug5("tilde", comp, _, 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) { - debug5("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + 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 exec(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.`); } - debug5("tilde return", ret); - return ret; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug5("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug5("caret", comp, _, 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) { - debug5("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"; + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } else { - debug5("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"; + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - debug5("caret return", ret); - return ret; + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; }); } - function replaceXRanges(comp, options) { - debug5("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) { - debug5("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; } - debug5("xRange return", ret); - return ret; + function step(result) { + result.done ? resolve8(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 exec = __importStar2(require_exec2()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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 + }); }); } - function replaceStars(comp, options) { - debug5("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; - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + 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); } - return false; + __setModuleDefault2(result, mod); + return result; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug5(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve8(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_utils5(); + var os5 = __importStar2(require("os")); + var path16 = __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 exportVariable8(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable8; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; + return inputs.map((input) => input.trim()); } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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 && range.test(minver)) { - return minver; - } - return null; + process.stdout.write(os5.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning10(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning10; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os5.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(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.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); + exports2.getState = getState2; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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/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]; + } }; } - if (satisfies2(version, range, options)) { - return false; + 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); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core15 = __importStar2(require_core2()); + 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; + core15.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core15.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core15.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core15.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core15.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + return result; } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path16 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname3(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + let result = path16.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname3; + 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)}`; } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } 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)}`; } - safeRe[t.COERCERTL].lastIndex = -1; } - if (match === null) { - return null; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path16.sep; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path16.sep)) { + return p; + } + if (p === path16.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -33871,932 +33289,1220 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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); + } } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core15 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob2 = __importStar4(require_glob()); - var io7 = __importStar4(require_io3()); - var crypto2 = __importStar4(require("crypto")); - var fs17 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path16.join(baseLocation, "actions", "temp"); - } - const dest = path16.join(tempDirectory, crypto2.randomUUID()); - yield io7.mkdirP(dest); - return dest; - }); + return result; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs17.statSync(filePath).size; + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - 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 = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path16.relative(workspace, file).replace(new RegExp(`\\${path16.sep}`, "g"), "/"); - core15.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; + }; + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs17.unlink)(filePath); - }); + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core15.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - }); - } catch (err) { - core15.debug(err.message); + bi = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - versionOutput = versionOutput.trim(); - core15.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core15.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + if (begs.length) { + result = [left, right]; } - }); + } + return result; } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs17.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io7.which("tar") : ""; - }); + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - components.push(versionSalt); - return crypto2.createHash("sha256").update(components.join("|")).digest("hex"); + parts.push.apply(parts, p); + return parts; } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - return token; + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } 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}`); + N = concatMap(n, function(el) { + return expand(el, false); + }); } - 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; + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); } } - 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]"); + return expansions; } - 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/cache/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path16 = (function() { + try { + return require("path"); + } catch (e) { } - __setModuleDefault4(result, mod); - return result; + })() || { + sep: "/" }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + minimatch.sep = path16.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } }; - 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); } - 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); + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(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", () => { - resolve8(output.toString()); - }); - })); - }); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve8(Buffer.concat(chunks)); - }); - })); - }); + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path16.sep !== "/") { + pattern = pattern.split(path16.sep).join("/"); } + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + Minimatch.prototype.debug = function() { }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + Minimatch.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 set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug5() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + Minimatch.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; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; } + self2.debug("clearStateChar %j %j", stateChar, re); + stateChar = false; } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + 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 && reSpecials[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; + } + 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 (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; + } } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + 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(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + clearStateChar(); + if (escaping) { + re += "\\\\"; } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + 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; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + if (re !== "" && hasMagic) { + re = "(?=.)" + re; } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + if (addPatternStart) { + re = patternStart + re; } - /** - * 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 __awaiter4(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); - }); + if (isSub === SUBPARSE) { + return [re, hasMagic]; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + if (!hasMagic) { + return globUnescape(pattern); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re + "$", flags); + } catch (er) { + return new RegExp("$."); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + regExp._glob = pattern; + regExp._src = re; + return regExp; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, data); - } else { - return response; - } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path16.sep !== "/") { + f = f.split(path16.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; } - 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) { + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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); + this.debug("globstar swallow a segment, and continue"); + fr++; } - } 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(); + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + return false; } - this._disposed = true; + 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 regExpEscape(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 || 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.Path = void 0; + var path16 = __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 { /** - * Raw request. - * @param info - * @param data + * Constructs a Path + * @param itemPath Path or array of segments */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve8(res); - } + 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(path16.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path16.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); + 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(path16.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } } /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * Converts the path to it's string representation */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path16.sep; } + result += this.segments[i]; } - const req = info6.httpModule.request(info6.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(); + 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 || 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.Pattern = void 0; + var os5 = __importStar2(require("os")); + var path16 = __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}`; } - handleResult(new Error(`Request timeout: ${info6.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(); + 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(path16.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); } /** - * 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 + * Matches the pattern against the specified path */ - 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 info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path16.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path16.sep}`; } + } else { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); } - return info6; + 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; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + /** + * 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 lowercaseKeys(headers || {}); + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + /** + * 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(`.${path16.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { + homedir2 = homedir2 || os5.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 additionalHeaders[header] || clientHeader || _default2; + return pathHelper.normalizeSeparators(pattern); } - _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 https2.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 __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve8(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + /** + * 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; + } else { + set2 += c2; } - 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; + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - 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})`; + if (set2) { + literal += set2; + i = closed; + continue; } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve8(response); } - })); - }); + } + literal += c; + } + return literal; + } + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.Pattern = Pattern; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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(path16, level) { + this.path = path16; + 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -34823,3172 +34529,2309 @@ var require_auth2 = __commonJS({ 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; + 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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ value: v2, done: d }); + }, reject); } }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - // 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"); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - // 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")}`; + function fulfill(value) { + resume("next", value); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + function reject(value) { + resume("throw", value); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + exports2.DefaultGlobber = void 0; + var core15 = __importStar2(require_core2()); + var fs17 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path16 = __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); } - 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; + getSearchPaths() { + return this.searchPaths.slice(); } - 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; + glob() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } } + return result; }); - this._orderedPolicies = void 0; - return removedPolicies; - } - sendRequest(httpClient, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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); - } + 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("**"))); } } - if (options.beforePolicies) { - for (const beforePolicyName of options.beforePolicies) { - const beforeNode = policyMap.get(beforePolicyName); - if (beforeNode) { - beforeNode.dependsOn.add(node); - node.dependants.add(beforeNode); + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core15.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs17.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } + throw err; } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - } - function walkPhase(phase) { - phase.hasRun = true; - for (const node of phase.policies) { - if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) { + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { continue; } - if (node.dependsOn.size === 0) { - result.push(node.policy); - for (const dependant of node.dependants) { - dependant.dependsOn.delete(node); + 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 && path16.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await2(item.path); + } else if (!partialMatch) { + continue; } - policyMap.delete(node.policy.name); - phase.policies.delete(node); + const childLevel = item.level + 1; + const childItems = (yield __await2(fs17.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path16.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); } } - } - function walkPhases() { - for (const phase of orderedPhases) { - walkPhase(phase); - if (phase.policies.size > 0 && phase !== noPhase) { - if (!noPhase.hasRun) { - walkPhase(noPhase); - } - return; + }); + } + /** + * 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)); } - if (phase.hasAfterPolicies) { - walkPhase(noPhase); + } + 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 fs17.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core15.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 fs17.promises.lstat(item.path); } - } - 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."); + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs17.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + if (traversalChain.some((x) => x === realPath)) { + core15.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); } - } - return result; + return stats; + }); } }; - function createEmptyPipeline() { - return HttpPipeline.create(); - } + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os5 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os5.EOL}`); - } - 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 - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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]; + } }; } - } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + 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); } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + __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(resolve8) { + resolve8(value); + }); } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } - return false; - } - 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: extend3 - }); - function debug6(...args) { - if (!newDebugger.enabled) { - return; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; - } - return false; - } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; - } - var debug5 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug5("azure"); - AzureLogger.log = (...args) => { - debug5.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } - } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + 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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); + }); + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); - } + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ value: v2, done: d }); + }, reject); } - debug5.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; - } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto3 = __importStar2(require("crypto")); + var core15 = __importStar2(require_core2()); + var fs17 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path16 = __importStar2(require("path")); + function hashFiles2(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core15.info : core15.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(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path16.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs17.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash2 = crypto3.createHash("sha256"); + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(fs17.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 && !_a && (_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 ""; + } }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug5.disable(); - debug5.enable(enabledNamespaces2 + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); + exports2.hashFiles = hashFiles2; } }); -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve8, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - try { - buildPromise((x) => { - removeListeners(); - resolve8(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/delay.js -var require_delay = __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 random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve8) => { - token = setTimeout(resolve8, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage + exports2.hashFiles = exports2.create = void 0; + var internal_globber_1 = require_internal_globber(); + var internal_hash_files_1 = require_internal_hash_files(); + function create2(patterns, options) { + return __awaiter2(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); }); } - 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 }; + exports2.create = create2; + function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create2(patterns, { followSymbolicLinks }); + return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); + }); } + exports2.hashFiles = hashFiles2; } }); -// 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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } +// 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 debug5; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug5 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug5 = function() { + }; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + 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++; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + 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 false; + return value; } - function getErrorMessage2(e) { - if (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}`; + 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++) { + debug5(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + var i; + exports2.parse = parse; + function parse(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; + } } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return 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); } - return true; - } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID2; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID2() { - return uuidFunction(); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; + if (!(this instanceof SemVer)) { + return new SemVer(version, options); + } + debug5("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; } - seen.add(value); } - return value; - }, 2); + return id; + }); } - 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(); + 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("."); } - 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; + return this.version; + }; + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug5("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - 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; + 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); }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); - } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url2 = new URL(locationHeader, request.url); - request.url = url2.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; - } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - 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(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var i2 = 0; + do { + var a = this.prerelease[i2]; + var b = other.prerelease[i2]; + debug5("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); } - } - function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { 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]); + var i2 = 0; + do { + var a = this.build[i2]; + var b = other.build[i2]; + debug5("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); }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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; + 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 4: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; + 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); } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; + this.inc("pre", identifier); + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + 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; } - op = body.call(thisArg, _); - } 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 }; + exports2.diff = diff; + function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(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; + } } - }; - 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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } - 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]; + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - } - 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]); + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } - 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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; + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - 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); - } + exports2.compare = compare3; + function compare3(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os5 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare3(a, b, true); } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os5.arch()}-${os5.type()}-${os5.release()})`); + 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); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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(" "); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare3(b, a, loose); } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - 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; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); - } - }; + exports2.gt = gt; + function gt(a, b, loose) { + return compare3(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - exports2.isReadableStream = isReadableStream; - exports2.isBlob = isBlob; - function isNodeReadableStream(x) { - return Boolean(x && typeof x["pipe"] === "function"); + exports2.lt = lt; + function lt(a, b, loose) { + return compare3(a, b, loose) < 0; } - function isWebReadableStream(x) { - return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); + exports2.eq = eq; + function eq(a, b, loose) { + return compare3(a, b, loose) === 0; } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + exports2.neq = neq; + function neq(a, b, loose) { + return compare3(a, b, loose) !== 0; } - function isBlob(x) { - return typeof x.stream === "function"; + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare3(a, b, loose) >= 0; } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; + exports2.lte = lte; + function lte(a, b, loose) { + return compare3(a, b, loose) <= 0; } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); + 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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } } - function createFileFromStream(stream2, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream2(); - if ((0, typeGuards_js_1.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 = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); - } - yield yield tslib_1.__await(value); - } - } finally { - reader.releaseLock(); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - }); - } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return node_stream_1.Readable.fromWeb(stream2); + comp = comp.trim().split(/\s+/).join(" "); + debug5("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; } else { - return stream2; + this.value = this.operator + this.semver.version; } + debug5("comp", this); } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); - } else { - return ensureNodeStream(source); + 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); } - } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream2 of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream2)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } - } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; - } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; } - 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; + if (!m[2]) { + this.semver = ANY; } else { - return void 0; + this.semver = new SemVer(m[2], this.options.loose); } - } - 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; - } + }; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug5("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; } - return total; - } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } } - request.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`); + 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 (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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 !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); - } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); + var rangeTmp; + if (this.operator === "") { + if (this.value === "") { + return true; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __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; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); + rangeTmp = new Range2(comp.value, options); + return satisfies2(this.value, rangeTmp, options); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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"; + 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.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve8, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); - }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); - } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); - } - removeListeners(); - return rejectOnAbort(); + exports2.Range = Range2; + function Range2(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve8(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + } + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); } + } + if (range instanceof Comparator) { + return new Range2(range.value, options); + } + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - function parseHeaderValueAsNumber(response, headerName) { - const value = response.headers.get(headerName); - if (!value) - return; - const valueAsNum = Number(value); - if (Number.isNaN(valueAsNum)) - return; - return valueAsNum; + 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(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug5("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; + }; + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); + } + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.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; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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; - } + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); + } + function parseComparator(comp, options) { + debug5("comp", comp, options); + comp = replaceCarets(comp, options); + debug5("caret", comp); + comp = replaceTildes(comp, options); + debug5("tildes", comp); + comp = replaceXRanges(comp, options); + debug5("xrange", comp); + comp = replaceStars(comp, options); + debug5("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(_, M, m, p, pr) { + debug5("tilde", comp, _, 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) { + debug5("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - 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 (_a) { - return void 0; - } + debug5("tilde return", ret); + return ret; + }); } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; + function replaceCaret(comp, options) { + debug5("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("caret", comp, _, 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) { + debug5("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 { + debug5("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"; } - return { - retryAfterInMs - }; } - }; + debug5("caret return", ret); + return ret; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + function replaceXRanges(comp, options) { + debug5("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) { + debug5("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 = "*"; } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; + } 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; + } } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; + 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; } - }; + debug5("xRange return", ret); + return ret; + }); } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + function replaceStars(comp, options) { + debug5("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - function isSystemError(err) { - if (!err) { - return false; + 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; } - return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.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/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); - } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; + 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(); } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); - } + Range2.prototype.test = function(version) { + if (!version) { + return false; + } + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; } } - /** - * 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() }); + for (var i2 = 0; i2 < this.set.length; i2++) { + if (testSet(this.set[i2], version, this.options)) { + return true; + } } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + return false; + }; + function testSet(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } } - /** - * 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)); + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug5(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } + } + } + return false; } - /** - * Remove the header with the provided headerName. - * @param name - The name of the header to remove. - */ - delete(name) { - this._headersMap.delete(normalizeName(name)); + return true; + } + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - /** - * 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; + return range.test(version); + } + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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); } - } else { - for (const [normalizedName, entry] of this._headersMap) { - result[normalizedName] = entry.value; + } + }); + return max; + } + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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 result; + }); + return min; + } + exports2.minVersion = minVersion; + function minVersion(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJSON({ preserveCase: true })); + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; } - /** - * Iterate over tuples of header [name, value] pairs. - */ - [Symbol.iterator]() { - return headerIterator(this._headersMap); + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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); + } + }); } - }; - function createHttpHeaders(rawHeaders) { - return new HttpHeadersImpl(rawHeaders); + if (minver && range.test(minver)) { + return minver; + } + return null; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __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 core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; } - return formDataMap; } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies2(version, range, options)) { + return false; + } + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.set[i2]; + var high = null; + var low = null; + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 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; } - return next(request); + }); + if (high.operator === comp || high.operator === ecomp) { + return false; } - }; - } - 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()); + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; } } - return urlSearchParams.toString(); + return true; } - async function prepareFormData(formData, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; + exports2.prerelease = prerelease; + function prerelease(version, options) { + var parsed = parse(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; } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); + if (typeof version === "number") { + version = String(version); + } + if (typeof version !== "string") { + return null; + } + options = options || {}; + var match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } + safeRe[t.COERCERTL].lastIndex = -1; } - request.multipartBody = { parts }; + if (match === null) { + return null; + } + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); - }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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/@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.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); } }); -// 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; +// 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]); } - return createDebug.colors[Math.abs(hash2) % createDebug.colors.length]; + __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(resolve8) { + resolve8(value); + }); } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug5(...args) { - if (!debug5.enabled) { - return; - } - const self2 = debug5; - 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"); + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); } - debug5.namespace = namespace; - debug5.useColors = createDebug.useColors(); - debug5.color = createDebug.selectColor(namespace); - debug5.extend = extend3; - debug5.destroy = createDebug.destroy; - Object.defineProperty(debug5, "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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug5); } - return debug5; + function step(result) { + result.done ? resolve8(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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); + }); + }; } - function extend3(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ value: v2, done: d }); + }, reject); } - 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)); + }; + 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 core15 = __importStar2(require_core()); + var exec = __importStar2(require_exec()); + var glob2 = __importStar2(require_glob()); + var io7 = __importStar2(require_io()); + var crypto3 = __importStar2(require("crypto")); + var fs17 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 { - createDebug.names.push(ns); + if (process.platform === "darwin") { + baseLocation = "/Users"; + } else { + baseLocation = "/home"; + } } + tempDirectory = path16.join(baseLocation, "actions", "temp"); } - } - 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++; + const dest = path16.join(tempDirectory, crypto3.randomUUID()); + yield io7.mkdirP(dest); + return dest; + }); + } + function getArchiveFileSizeInBytes(filePath) { + return fs17.statSync(filePath).size; + } + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path16.relative(workspace, file).replace(new RegExp(`\\${path16.sep}`, "g"), "/"); + core15.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); } else { - searchIndex++; - templateIndex++; + paths.push(`${relativeFile}`); } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; + return paths; + }); + } + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs17.unlink)(filePath); + }); + } + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core15.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() + } + }); + } catch (err) { + core15.debug(err.message); } - 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; - } + versionOutput = versionOutput.trim(); + core15.debug(versionOutput); + return versionOutput; + }); + } + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core15.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } + }); + } + 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 (fs17.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } - return false; + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io7.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - function coerce3(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - 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`."); + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - createDebug.enable(createDebug.load()); - return createDebug; + 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; } - 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+)/); +// 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]]; } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); + 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 _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.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], context2); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; } - exports2.log = console.debug || console.log || (() => { + } + 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(resolve8) { + resolve8(value); }); - function save(namespaces) { + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { + step(generator.next(value)); + } catch (e) { + reject(e); } } - function load2() { - let r; + function rejected(value) { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return r; } - function localstorage() { - try { - return localStorage; - } catch (error4) { - } + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.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); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { 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]); }; } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os5 = 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 step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) 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: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; + 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 }; } - 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 = os5.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; + }; + 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; } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); - return translateLevel(level); + } + 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]; } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) + } + 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); }; } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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]; + 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 { - 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 (error4) { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - 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, (_, k) => { - return k.toUpperCase(); + } + 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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); - } - obj[prop] = val2; - 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(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } + }; + } + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ 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]; } - function load2() { - return process.env.DEBUG; + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function init(debug5) { - debug5.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug5.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { + try { + inner.call(this); + } catch (e) { + return Promise.reject(e); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + env.stack.push({ value, dispose, async }); + } else if (async) { + env.stack.push({ async: true }); } -}); - -// 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(); + 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; } -}); - -// node_modules/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + return next(); +} +function __rewriteRelativeImportExtension(path16, preserveJsx) { + if (typeof path16 === "string" && /^\.\.?\//.test(path16)) { + return path16.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path16; +} +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)) { @@ -38000,980 +36843,760 @@ var require_helpers3 = __commonJS({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + }); + __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; }; + 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.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(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 json2(stream2) { - const buf = await toBuffer(stream2); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; + 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}`); } - exports2.json = json2; - function req(url2, opts = {}) { - const href = typeof url2 === "string" ? url2 : url2.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); - const promise = new Promise((resolve8, reject) => { - req2.once("response", resolve8).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) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + 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 }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); + } } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = Symbol("AgentBaseInternalState"); - var Agent = class extends http.Agent { - constructor(opts) { - super(opts); - this[INTERNAL] = {}; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - /** - * 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); + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - // 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] = []; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; } - 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 index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; } } - // 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); + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - 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); + 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; } } - 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"); + 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; } - return socket; } - get defaultPort() { - return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); - } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + 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(debug5, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug5(...args) { + if (!newDebugger.enabled) { + return; } - } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); - } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; } + newDebugger.log(...args); } - }; - exports2.Agent = Agent; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; + } + function extend3(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; + } + exports2.default = debugObj; } }); -// 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) { +// 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"; - var __importDefault4 = 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 = __importDefault4(require_src()); - var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve8, 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); + 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(",")}`); } - function onend() { - cleanup(); - debug5("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + logLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } } - function onerror(err) { - cleanup(); - debug5("onerror %o", err); - reject(err); + 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 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) { - debug5("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; - } - } - debug5("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve8({ - connect: { - statusCode, - statusText, - headers - }, - buffered - }); + } + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); + } + function createLogger(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); } - socket.on("error", onerror); - socket.on("end", onend); - read(); - }); + registeredLoggers.add(logger); + return logger; + } + function contextGetLogLevel() { + return logLevel; + } + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; + } + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/https-proxy-agent/dist/index.js -var require_dist3 = __commonJS({ - "node_modules/https-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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(exports2, "__esModule", { value: true }); + exports2.createHttpHeaders = createHttpHeaders; + function normalizeName(name) { + return name.toLowerCase(); + } + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + } + 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]); + } + } } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug5 = (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 - }; + /** + * 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() }); } - return options; - }; - var HttpsProxyAgent = 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 ?? {}; - debug5("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 ? omit(opts, "headers") : null, - host, - port - }; + /** + * 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; } /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. + * 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. */ - async connect(req, opts) { - const { proxy } = this; - if (!opts.host) { - throw new TypeError('No "host" provided'); - } - let socket; - if (proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + 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 { - debug5("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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) { - debug5("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + for (const [normalizedName, entry] of this._headersMap) { + result[normalizedName] = entry.value; } - return socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug5("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + 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); } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); } - function omit(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/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 = randomUUID2; + function randomUUID2() { + return crypto.randomUUID(); } } }); -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; }; + 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.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug5 = (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 ?? {}; - debug5("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 ? omit(opts, "headers") : null, - host, - port - }; - } - addRequest(req, opts) { - req._header = null; - this.setRequestProps(req, opts); - super.addRequest(req, opts); + 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; } - 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); + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - req.path = String(url2); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - for (const name of Object.keys(headers)) { - const value = headers[name]; - if (value) { - req.setHeader(name, value); + 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, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); + } + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - async connect(req, opts) { - req._header = null; - if (!req.path.includes("://")) { - this.setRequestProps(req, opts); - } - let first; - let endOfHeaders; - debug5("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug5("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); - debug5("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug5("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 omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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_log(); - 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; + clone() { + return new _HttpPipeline(this._policies); } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + static create() { + return new _HttpPipeline(); } - let isBypassedFlag = false; - for (const pattern of noProxyList) { - if (pattern[0] === ".") { - if (host.endsWith(pattern)) { - isBypassedFlag = true; + 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 { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } else { - if (host === pattern) { - isBypassedFlag = true; + return noPhase; } } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url2 = new URL(request.url); - const isInsecure = url2.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + 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); } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + 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); + } + } + } } - request.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(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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); + } } - return next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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); + } } - return next(request); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __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; - exports2.tlsPolicyName = "tlsPolicy"; - function tlsPolicy(tlsSettings) { - return { - name: exports2.tlsPolicyName, - sendRequest: async (req, next) => { - if (!req.tlsSettings) { - req.tlsSettings = tlsSettings; + 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 next(req); } - }; - } - } -}); - -// 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.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; - } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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; + return result; } }; - 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 - }; + function createEmptyPipeline() { + return HttpPipeline.create(); + } } }); -// node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js -var require_instrumenter = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js"(exports2) { +// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } - exports2.getInstrumenter = getInstrumenter; } }); -// node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js -var require_tracingClient = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js"(exports2) { +// 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.createTracingClient = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); - } - function parseTraceparentHeader(traceparentHeader) { - return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); - } - function createRequestHeaders(tracingContext) { - return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + 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 { - startSpan, - withSpan, - withContext, - parseTraceparentHeader, - createRequestHeaders - }; + return false; } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/inspect.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.custom = void 0; @@ -38982,18 +37605,196 @@ var require_inspect = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { +// 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 core_util_1 = require_commonjs2(); + 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"; @@ -39001,212 +37802,86 @@ var require_restError = __commonJS({ 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); } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } }; exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; function isRestError(e) { if (e instanceof RestError) { return true; } - return (0, core_util_1.isError)(e) && e.name === "RestError"; + return (0, error_js_1.isError)(e) && e.name === "RestError"; } } }); -// 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) { +// 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.tracingPolicyName = void 0; - exports2.tracingPolicy = tracingPolicy; - var core_tracing_1 = require_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.statusCode); - } - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + exports2.uint8ArrayToString = uint8ArrayToString; + exports2.stringToUint8Array = stringToUint8Array; + function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); } - 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); - } - span.setStatus({ - status: "success" - }); - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + function stringToUint8Array(value, format) { + return Buffer.from(value, format); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { +// 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.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 multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { + "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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib2 = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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((resolve8) => { const handler = () => { resolve8(); @@ -39223,6 +37898,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -39236,25 +37913,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -39263,13 +37937,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -39293,8 +37970,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -39316,7 +37996,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -39334,9 +38014,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -39345,29 +38024,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url2 = new URL(request.url); const isInsecure = url2.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url2.hostname, path: `${url2.pathname}${url2.search}`, port: url2.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve8, reject) => { - const req = isInsecure ? http.request(options, resolve8) : https2.request(options, resolve8); + const req = isInsecure ? node_http_1.default.request(options, resolve8) : node_https_1.default.request(options, resolve8); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -39388,30 +38066,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -39434,11 +38113,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream2, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib2.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream2.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib2.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream2.pipe(inflate); return inflate; } @@ -39458,7 +38137,7 @@ var require_nodeHttpClient = __commonJS({ resolve8(Buffer.concat(buffer).toString("utf8")); }); stream2.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -39489,9 +38168,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -39502,9462 +38181,16753 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url2 = new URL(locationHeader, request.url); + request.url = url2.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.systemErrorRetryPolicyName = void 0; - exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; - function systemErrorRetryPolicy(options = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; + 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.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest + name: exports2.userAgentPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } }; } } }); -// 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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + exports2.decompressResponsePolicyName = void 0; + exports2.decompressResponsePolicy = decompressResponsePolicy; + exports2.decompressResponsePolicyName = "decompressResponsePolicy"; + function decompressResponsePolicy() { + return { + name: exports2.decompressResponsePolicyName, + async sendRequest(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; + } +}); + +// 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((resolve8, 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); } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + }; + onAborted = () => { + if (timer) { + clearTimeout(timer); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + removeListeners(); + return rejectOnAbort(); + }; + if (options?.abortSignal && options.abortSignal.aborted) { + return rejectOnAbort(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve8(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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; + } } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; +}); + +// 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 debug5(...args) { + if (!debug5.enabled) { + return; } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; + const self2 = debug5; + 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"); } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + debug5.namespace = namespace; + debug5.useColors = createDebug.useColors(); + debug5.color = createDebug.selectColor(namespace); + debug5.extend = extend3; + debug5.destroy = createDebug.destroy; + Object.defineProperty(debug5, "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 (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } 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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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 __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); + if (typeof createDebug.init === "function") { + createDebug.init(debug5); + } + return debug5; + } + function extend3(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; } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); +}); + +// 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 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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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]; + args.splice(lastC, 0, c); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { + function load2() { + let r; try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error3) { } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + function localstorage() { 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); + return localStorage; + } catch (error3) { } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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 __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - } }; + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 }; } }); -// node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js -var require_azureKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js"(exports2) { +// node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "node_modules/has-flag/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureKeyCredential = void 0; - var AzureKeyCredential = class { - /** - * 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; - } + 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); }; - 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) { +// node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs2(); - function isKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; + var os5 = 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; } - } -}); - -// 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + 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); } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + } + function translateLevel(level) { + if (level === 0) { + return false; } - /** - * 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"); + 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 = os5.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } - this._name = name; - this._key = key; + return 1; } - /** - * 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"); + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; } - this._name = newName; - this._key = newKey; + return min; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } - /** - * 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; + if (env.COLORTERM === "truecolor") { + return 3; } - /** - * 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"); + 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; } - this._signature = newSignature; } - }; - exports2.AzureSASCredential = AzureSASCredential; - function isSASCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; + 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/@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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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, (_, 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(util.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 init(debug5) { + debug5.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug5.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; } }); -// node_modules/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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/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/@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) { +// 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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); - } - }; + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __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.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); + exports2.toBuffer = toBuffer; + async function json2(stream2) { + const buf = await toBuffer(stream2); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; + exports2.json = json2; + function req(url2, opts = {}) { + const href = typeof url2 === "string" ? url2 : url2.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); + const promise = new Promise((resolve8, reject) => { + req2.once("response", resolve8).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; + } + exports2.req = req; } }); -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// node_modules/agent-base/dist/index.js +var require_dist = __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 result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(thisArg, body) { - var _ = { 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]); + 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); }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; + 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 (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; + if (typeof options.protocol === "string") { + return options.protocol === "https:"; } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; + } + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + } } - op = body.call(thisArg, _); - } 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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 __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + // 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); }); - }; - 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 __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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 __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + 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; } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); - }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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]; + 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; } - return t; - }; - return __assign3.apply(this, arguments); - }; - __createBinding3 = 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]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 }; + exports2.Agent = Agent; } }); -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); - } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); - } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); - } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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) { +// 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.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; - } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); - } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, 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 = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; - } - } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + exports2.parseProxyResponse = void 0; + var debug_1 = __importDefault2(require_src()); + var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve8, 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(); + debug5("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); + } + function onerror(err) { + cleanup(); + debug5("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) { + debug5("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; + } } + debug5("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve8({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - 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) + socket.on("error", onerror); + socket.on("end", onend); + read(); }); } - exports2.flattenResponse = flattenResponse; + exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/@azure/core-client/dist/commonjs/serializer.js -var require_serializer = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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.MapperTypeNames = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + 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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug5 = (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 + }; } - /** - * @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}.`); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port }; - 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 + * Called when the node-core HTTP client library is creating a + * new HTTP request. */ - serialize(mapper, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : 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) { - object = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + async connect(req, opts) { + const { proxy } = this; + if (!opts.host) { + throw new TypeError('No "host" provided'); } - if (object === void 0 || object === null) { - payload = object; + let socket; + if (proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - let payload; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - 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); - } + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r +`; } - if (mapper.isConstant) { - payload = mapper.defaultValue; + 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) { + debug5("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; } - return payload; + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug5("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } } - return str2.substr(0, len); + return ret; } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var debug5 = (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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + addRequest(req, opts) { + req._header = null; + this.setRequestProps(req, opts); + super.addRequest(req, opts); } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - 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.`); - } + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); } - } - 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(); + let first; + let endOfHeaders; + debug5("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug5("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); + debug5("Output buffer: %o", req.outputData[0].data); } - 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.`); + let socket; + if (this.proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - value = base64.encodeByteArray(value); + await (0, events_1.once)(socket, "connect"); + return socket; } - 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.`); + }; + HttpProxyAgent.protocols = ["http", "https"]; + exports2.HttpProxyAgent = HttpProxyAgent; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); - } - } + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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 value; + return void 0; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - 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}.`); + 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; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + const host = new URL(uri).hostname; + if (bypassedMap?.has(host)) { + return bypassedMap.get(host); } - const tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + let isBypassedFlag = false; + for (const pattern of noProxyList) { + if (pattern[0] === ".") { + if (host.endsWith(pattern)) { + isBypassedFlag = true; } else { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url2 = new URL(request.url); + const isInsecure = url2.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream2) { + if (stream2 instanceof ReadableStream) { + makeAsyncIterable(stream2); + return stream_1.Readable.fromWeb(stream2); + } else { + return stream2; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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; } } - } 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; - } + })()); + }; + } + } +}); + +// 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; } } - 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 total; + } + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); + } + request.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(request, next) { + if (!request.multipartBody) { + return next(request); } - return true; - }; - for (const responsePropName in responseBody) { - if (isAdditionalProperty(responsePropName)) { - instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); } - } - } 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]; + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - } - 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); + } +}); + +// 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - return tempDictionary; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - return responseBody; - } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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}`); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - if (responseBody) { - if (!Array.isArray(responseBody)) { - responseBody = [responseBody]; - } - if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } + } +}); + +// 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); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + }; + } + } +}); + +// 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(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url2 = new URL(request.url); + if (url2.hostname === "localhost" || url2.hostname === "127.0.0.1") { + return true; } - return tempArray; } - return responseBody; + return false; } - 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]; + function emitInsecureConnectionWarning() { + const warning10 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning10); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning10); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } 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); - } - } + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - return void 0; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); } + request.headers.set(scheme.name, options.credential.key); + return next(request); } - } - 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; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); + } + }; + } } }); -// node_modules/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } - } else { - if (parameterMapper.required) { - value = {}; + }; + } + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } - 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 pipeline; + } + 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_multipart2 = __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 value; + return void 0; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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; + 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 (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; } - return result; + return disposition; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + 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 getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); + 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); } - let info6 = state_js_1.state.operationRequestMap.get(request); - if (!info6) { - info6 = {}; - state_js_1.state.operationRequestMap.set(request, info6); + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); } - return info6; + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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_multipart2(); + async function sendRequest(method, url2, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url2, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + 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, rawHeaders: headers, parsedBody }); } - }; - return { - name: exports2.deserializationPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + return { + request, + 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, rawHeaders }, e); } - }; + throw e; + } } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + 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 result; + return "application/json"; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); - } - return result; + 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 + }); } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if ((0, typeGuards_js_1.isReadableStream)(body)) { + return { body }; } - 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] : []; + 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) }; } - 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; + return { body: JSON.stringify(body) }; + case "text/plain": + return { body: String(body) }; + default: + if (typeof body === "string") { + return { body }; } - } 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 { body: JSON.stringify(body) }; } - return parsedResponse; } - function isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + 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 + }); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; + } +}); + +// 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${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 { - return { error: null, shouldReturnResponse: false }; + paramStrings.push(getQueryParamValue(key, options.skipUrlEncoding ?? false, style, rawValue)); } } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); + } + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; + } + 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 (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); + if (!param.toString || typeof param.toString !== "function") { + throw new Error(`Path parameters must be able to be represented as string, ${key} can't`); } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + let value = param.toISOString !== void 0 ? param.toISOString() : String(param); + if (!options.skipUrlEncoding) { + value = encodeURIComponent(param); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return { error: error4, shouldReturnResponse: false }; + return endpoint; } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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 operationResponse; + return routePath; + } + function replaceAll(value, searchValue, replaceValue) { + return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); } } }); -// node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js -var require_interfaceHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js"(exports2) { +// 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - return result; + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path16, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path16, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + function buildOperation(method, url2, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline, { ...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, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline, { ...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."); + } + } + }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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; + exports2.operationOptionsToRequestParameters = operationOptionsToRequestParameters; + function operationOptionsToRequestParameters(options) { return { - name: exports2.serializationPolicyName, - async sendRequest(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } + 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 }; } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } - } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); - } - } + } +}); + +// 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) + }); } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } + function toPipelineResponse(response) { + return { + headers: (0, httpHeaders_js_1.createHttpHeaders)(response.headers), + request: response.request, + status: statusCodeToNumber(response.status) ?? -1 }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } - } - } - } - exports2.serializeRequestBody = serializeRequestBody; - 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; + function statusCodeToNumber(statusCode) { + const status = Number.parseInt(statusCode); + return Number.isNaN(status) ? void 0 : status; } } }); -// node_modules/@azure/core-client/dist/commonjs/pipeline.js +// 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-client/dist/commonjs/pipeline.js"(exports2) { + "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); - } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; + exports2.createEmptyPipeline = createEmptyPipeline; + var ts_http_runtime_1 = require_commonjs(); + function createEmptyPipeline() { + return (0, ts_http_runtime_1.createEmptyPipeline)(); } - exports2.createClientPipeline = createClientPipeline; } }); -// node_modules/@azure/core-client/dist/commonjs/httpClientCache.js -var require_httpClientCache = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/httpClientCache.js"(exports2) { +// 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.getCachedDefaultHttpClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); - } - return cachedHttpClient; - } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; + 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/core-client/dist/commonjs/urlHelpers.js -var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { +// 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.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path16 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path16.startsWith("/")) { - path16 = path16.substring(1); - } - if (isAbsoluteUrl(path16)) { - requestUrl = path16; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path16); - } - } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; + exports2.AzureLogger = void 0; + exports2.setLogLevel = setLogLevel; + exports2.getLogLevel = getLogLevel; + exports2.createClientLogger = createClientLogger; + var logger_1 = require_internal(); + var context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); - } - return result; + function getLogLevel() { + return context2.getLogLevel(); } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function isAbsoluteUrl(url2) { - return url2.includes("://"); + } +}); + +// 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 + }); } - 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 path16 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path16; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; - } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); + } +}); + +// 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 + }; } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } - } - } + } +}); + +// 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 { - queryParams: result, - sequenceParams + 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 }; } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; - } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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(); - } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url: url2 - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, 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; + 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-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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"; } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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; + } +}); + +// 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; + return parts.join(" "); } - 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) => Object.assign(Object.assign({}, a), b), {}); + function getUserAgentHeaderName() { + return (0, userAgentPlatform_js_1.getHeaderName)(); } - function requestToOptions(request) { - return { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions - }; + 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-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } + }; + } + } +}); + +// 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 serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + var uuidUtils_js_1 = require_uuidUtils(); + Object.defineProperty(exports2, "randomUUID", { enumerable: true, get: function() { + return uuidUtils_js_1.randomUUID; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var checkEnvironment_js_1 = require_checkEnvironment(); + Object.defineProperty(exports2, "isBrowser", { enumerable: true, get: function() { + return checkEnvironment_js_1.isBrowser; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + Object.defineProperty(exports2, "isBun", { enumerable: true, get: function() { + return checkEnvironment_js_1.isBun; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "isNodeLike", { enumerable: true, get: function() { + return checkEnvironment_js_1.isNodeLike; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; + exports2.cancelablePromiseRace = cancelablePromiseRace; + async function cancelablePromiseRace(abortablePromiseBuilders, options) { + const aborter = new AbortController(); + function abortHandler() { + aborter.abort(); } - } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; + 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); } } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); - } - var HttpHeaders = class _HttpHeaders { - 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); + } +}); + +// 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.HttpHeaders = HttpHeaders; + exports2.AbortError = AbortError; } }); -// 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } - } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); - } - } - exports2.toPipelineResponse = toPipelineResponse; + 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-http-compat/dist/commonjs/extendedClient.js -var require_extendedClient = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/extendedClient.js"(exports2) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); + exports2.createAbortablePromise = createAbortablePromise; + var abort_controller_1 = require_commonjs3(); + function createAbortablePromise(buildPromise, options) { + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; + return new Promise((resolve8, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.handleRedirects) === false) { - this.pipeline.removePolicy({ - name: core_rest_pipeline_1.redirectPolicyName - }); + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - /** - * Compatible send operation request function. - * - * @param operationArguments - Operation arguments - * @param operationSpec - Operation Spec - * @returns - */ - async sendOperationRequest(operationArguments, operationSpec) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - operationArguments.options = Object.assign(Object.assign({}, operationArguments.options), { onResponse }); - const result = await super.sendOperationRequest(operationArguments, operationSpec); - if (lastResponse) { - Object.defineProperty(result, "_response", { - value: (0, response_js_1.toCompatResponse)(lastResponse) + if (abortSignal?.aborted) { + return rejectOnAbort(); + } + try { + buildPromise((x) => { + removeListeners(); + resolve8(x); + }, (x) => { + removeListeners(); + reject(x); }); + } catch (err) { + reject(err); } - return result; - } - }; - exports2.ExtendedServiceClient = ExtendedServiceClient; + abortSignal?.addEventListener("abort", onAbort); + }); + } } }); -// 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) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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(request, 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)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + 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)((resolve8) => { + token = setTimeout(resolve8, 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}`; + } } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); + exports2.isDefined = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; } - }; + } + return true; + } + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 = randomUUID2; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var createAbortablePromise_js_1 = require_createAbortablePromise(); + Object.defineProperty(exports2, "createAbortablePromise", { enumerable: true, get: function() { + return createAbortablePromise_js_1.createAbortablePromise; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var delay_js_1 = require_delay2(); + Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { + return delay_js_1.delay; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error2(); + Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { + return error_js_1.getErrorMessage; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var typeGuards_js_1 = require_typeGuards2(); + Object.defineProperty(exports2, "isDefined", { enumerable: true, get: function() { + return typeGuards_js_1.isDefined; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "isObjectWithProperties", { enumerable: true, get: function() { + return typeGuards_js_1.isObjectWithProperties; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + Object.defineProperty(exports2, "objectHasProperty", { enumerable: true, get: function() { + return typeGuards_js_1.objectHasProperty; } }); - } -}); - -// node_modules/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } - } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; - } - }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; - } -}); - -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { - "use strict"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } - return i; + function calculateRetryDelay(retryAttempt, config) { + return tspRuntime.calculateRetryDelay(retryAttempt, config); } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } - } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); - } - } - return true; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; + function isError(e) { + return tspRuntime.isError(e); } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col - } - }; + function isObject2(input) { + return tspRuntime.isObject(input); } - function validateAttrName(attrName) { - return util.isName(attrName); + function randomUUID2() { + 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 validateTagName(tagname) { - return util.isName(tagname); + function stringToUint8Array(value, format) { + return tspRuntime.stringToUint8Array(value, format); } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; + } +}); + +// 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"); } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true + var unimplementedMethods = { + arrayBuffer: () => { + throw new Error("Not implemented"); }, - tagValueProcessor: function(tagName, val2) { - return val2; + bytes: () => { + throw new Error("Not implemented"); }, - attributeValueProcessor: function(attrName, val2) { - return val2; + slice: () => { + throw new Error("Not implemented"); }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } - } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); - } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); + text: () => { + throw new Error("Not implemented"); } - return { entities, i }; + }; + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); + } else { + return blob; } - return [entityName2, val2, i]; - } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; - } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; - } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; - } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; + 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 validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber2(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); + 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 { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; - } - } else { - return str2; - } + return new File([toArrayBuffer(content)], name, options); } } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } - return numStr; + return source.map((x) => x); } - module2.exports = toNumber2; } }); -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; +// 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } - }; - } - return () => false; + return tspPolicy.sendRequest(request, next); + } + }; } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber2 = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + 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)(); } - var replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); - } - return val2; - }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; + } +}); + +// 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); } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; + } +}); + +// 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)(); } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } + } +}); + +// 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 findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); - } else { - return closingIndex + str2.length - 1; - } + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + } +}); + +// 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 { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName - }; - } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } + name: exports2.setClientRequestIdPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - } - } - function parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber2(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } - } + }; } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; - } - } - } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + 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); } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); +// 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; + } + 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; } }; - module2.exports = XMLParser; + exports2.TracingContextImpl = TracingContextImpl; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; +// 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: () => { } - isPreviousElementTag = true; - } - return xmlStr; + }; } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } + 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); } - } - return attrStr; + }; } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); } - return textValue; + return state_js_1.state.instrumenterImplementation; } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; + 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 }; - this.tagEndChar = ">"; - this.newLine = ""; } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; + 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(); } - return this.j2x(jObj, 0, []).val; } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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(request, next) { + if (!tracingClient) { + return next(request); } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; } } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); + }; + } + 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; } } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.tracingOptions }, { + spanKind: "client", + spanAttributes + }); + if (!span.isRecording()) { + span.end(); + return void 0; } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; + const headers = tracingClient.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); + for (const [key, value] of Object.entries(headers)) { + request.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; } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); + } + 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)}`); } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; + } +}); + +// 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 }; } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder - }; + 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); + } + } + }; + } } }); -// 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) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + } + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false - }; - } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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 }); - } - 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(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); - } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; - } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - 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; + async sendRequest(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); + } } - } - return parsedXml; + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; - } }); + exports2.createHttpHeaders = createHttpHeaders; + var ts_http_runtime_1 = require_commonjs(); + function createHttpHeaders(rawHeaders) { + return (0, ts_http_runtime_1.createHttpHeaders)(rawHeaders); + } } }); -// 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) { +// 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.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; + exports2.createPipelineRequest = createPipelineRequest; + var ts_http_runtime_1 = require_commonjs(); + function createPipelineRequest(options) { + return (0, ts_http_runtime_1.createPipelineRequest)(options); + } } }); -// node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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; } - 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); + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } - /** - * 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."); + 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(); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + }; + 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; } - /** - * 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; + return async (scopes, tokenOptions) => { + const hasClaimChallenge = Boolean(tokenOptions.claims); + const tenantIdChanged = tenantId !== tokenOptions.tenantId; + if (hasClaimChallenge) { + token = null; } - for (const parentSignal of parentSignals) { - if (parentSignal.aborted) { - this.abort(); - } else { - parentSignal.addEventListener("abort", () => { - this.abort(); - }); - } + const mustRefresh = tenantIdChanged || hasClaimChallenge || cycler.mustRefresh; + if (mustRefresh) { + return refresh(scopes, tokenOptions); } - } - /** - * 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(); + if (cycler.shouldRefresh) { + refresh(scopes, tokenOptions); } - return signal; - } - }; - exports2.AbortController = AbortController2; - exports2.AbortError = AbortError; - exports2.AbortSignal = AbortSignal2; + return token; + }; + } } }); -// node_modules/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { + 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(request, next) { try { - return JSON.parse(serializedState).state; + return [await next(request), void 0]; } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); - } - throw error4; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - 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 isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - 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.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 - })); + 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 buildResult(inputs) { - const { processResult, response, state } = inputs; - return processResult ? processResult(response, state) : response; - } - async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation + 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) }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; - } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; + 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(request, next) { + if (!request.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, + getAccessToken, + logger + }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } } - } - return { response, status }; + }; } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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; } - 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) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; + } +}); + +// 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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); } } + return next(request); } - } + }; } - 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; - } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions + }; + return (await getAccessToken(scopes, getTokenOptions))?.token ?? ""; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - } - } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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; + } +}); + +// 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; } - return void 0; - } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; + /** + * 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; } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; + /** + * 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; } - return error4; + }; + 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"; } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + } +}); + +// 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; } - return void 0; - } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case void 0: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; } - const status = helper(); - return status === "running" && operationLocation === void 0 ? "succeeded" : status; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return 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 - }); - } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + /** + * 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"); } - case "Body": - default: { - return void 0; + 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); - } - case "Body": { - return getProvisioningState(rawResponse); + } +}); + +// 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + this._signature = signature; } - } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + /** + * 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; } - return state.config.resourceLocation; + }; + exports2.AzureSASCredential = AzureSASCredential; + function isSASCredential(credential) { + return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; } - function isOperationError(e) { - return e.name === "RestError"; + } +}); + +// 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"; } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); + function isPopToken(accessToken) { + return accessToken.tokenType === "pop"; } - var createStateProxy$1 = () => ({ - /** - * 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, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } }; } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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; + } +}); + +// 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_utils6 = __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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + } + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + 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]; + } } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (parsedHeaders) { + for (const key of Object.keys(parsedHeaders)) { + arrayResponse[key] = parsedHeaders[key]; + } } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + 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_utils6(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Serializes the Poller operation. + * @deprecated Removing the constraints validation on client side. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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); + } + } } - }; - 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); + * Serialize the given object based on its metadata defined in the mapper * - * // You can assign more local properties here. - * } - * } - * ``` + * @param mapper - The mapper which defines the metadata of the serializable object * - * 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. + * @param object - A valid Javascript object to be serialized * - * 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: + * @param objectName - Name of the serialized object * - * ```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 options - additional options to serialization * - * @param operation - Must contain the basic properties of `PollOperation`. + * @returns A valid serialized Javascript object */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve8, reject) => { - this.resolve = resolve8; - 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; + serialize(mapper, object, 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; } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - } - /** - * 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) - }); + if (mapper.isConstant) { + object = mapper.defaultValue; } - this.processUpdatedState(); + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. + * Deserialize the given object based on its metadata defined in the mapper * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * @param mapper - The mapper which defines the metadata of the serializable object * - * @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. + * @param responseBody - A valid Javascript entity to be deserialized * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @param objectName - Name of the deserialized object * - * @param options - Optional properties passed to the operation's update method. + * @param options - Controls behavior of XML parser and builder. + * + * @returns A valid deserialized Javascript object */ - 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; + 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; } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + 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 (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + if (mapper.isConstant) { + payload = mapper.defaultValue; } + return payload; } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; + } + return str2.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 str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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 = ""; + } } - 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); - }; + return classes; + } + function dateToUnixTime(d) { + if (!d) { + return void 0; } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + if (typeof d.valueOf() === "string") { + d = new Date(d); } - /** - * 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")); + 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.`); } } } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + 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.`); } - /** - * 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"); + const isPresent = allowedValues.some((item) => { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); } - return this.cancelPromise; + return item === value; + }); + if (!isPresent) { + throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); } - /** - * 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; + 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); } - /** - * 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; + 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); } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); + 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}".`); + } + } } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + return value; + } + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve8) => setTimeout(() => resolve8(), this.config.intervalInMs)); + 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}.`); } - }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto2 = require("crypto"); - var coreTracing = require_commonjs4(); - var stream2 = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs17 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; + } + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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; + } } - n.default = e; - return Object.freeze(n); + return tempArray; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs17); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - /** - * 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); + 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}.`); } - /** - * 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); + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + 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; } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url3) { - const urlParsed = new URL(url3); - let path16 = urlParsed.pathname; - path16 = path16 || "/"; - path16 = escape(path16); - urlParsed.pathname = path16; - return urlParsed.toString(); + return tempDictionary; } - 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]; - } - } + 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 proxyUri; + return additionalProperties; } - function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; + 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 ""; + return modelProps; } - function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - 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'"); + if (object !== void 0 && object !== null) { + const payload = {}; + const modelProps = resolveModelProperties(serializer, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); + 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) && (object[key] !== void 0 && object[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 = object[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; + } + } } - 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 escape(text) { - return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); - } - function appendToURLPath(url3, name) { - const urlParsed = new URL(url3); - let path16 = urlParsed.pathname; - path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; - urlParsed.pathname = path16; - return urlParsed.toString(); - } - function setURLParameter(url3, name, value) { - const urlParsed = new URL(url3); - 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); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } } } + return payload; } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); - } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url3, name) { - var _a; - const urlParsed = new URL(url3); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : void 0; - } - function setURLHost(url3, host) { - const urlParsed = new URL(url3); - urlParsed.hostname = host; - return urlParsed.toString(); - } - function getURLPath(url3) { - try { - const urlParsed = new URL(url3); - return urlParsed.pathname; - } catch (e) { - return void 0; - } - } - function getURLScheme(url3) { - try { - const urlParsed = new URL(url3); - return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; - } catch (e) { - return void 0; - } - } - function getURLPathAndQuery(url3) { - const urlParsed = new URL(url3); - 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}`; + return object; } - function getURLQueries(url3) { - let queryString = new URL(url3).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; + function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; } - return queries; - } - function appendToURLQuery(url3, queryParts) { - const urlParsed = new URL(url3); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + 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; + } } - 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"; + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + function isSpecialXmlProperty(propertyName, options) { + return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + 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 res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve8, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve8(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== void 0) { - aborter.addEventListener("abort", abortHandler); + 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; } - }); - } - 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); + 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; + } } - return padString.slice(0, targetLength) + currentString; } - } - function iEqual(str1, str2) { - return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); - } - function getAccountNameFromUrl(url3) { - const parsedUrl = new URL(url3); - 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 = ""; + 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 accountName; - } catch (error4) { - throw new Error("Unable to extract accountName with provided information."); } + return instance; } - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); } + return tempDictionary; } - return tagPairs.join("&"); + return responseBody; } - function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + 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 res; + return responseBody; } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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); + } + } + } } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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 res; + return mapper; } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + 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]; } - 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 - } + 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); } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - }; - case "parquet": - return { - format: { - type: "parquet" + 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 = {}; } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + value[propertyName] = propertyValue; + } + } } + return value; } - 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); + 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 { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); + break; } } - return orProperties; + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } + let info6 = state_js_1.state.operationRequestMap.get(request); + if (!info6) { + info6 = {}; + state_js_1.state.operationRequestMap.set(request, info6); + } + return info6; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; } - 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; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } - 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 - }; - } + return result; } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return split.join("/"); + return result; } - function assertResponse(response) { - if (`_response` in response) { - return response; + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; } - throw new TypeError(`Unexpected response object ${response}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); + const operationSpec = operationInfo?.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + const responseSpec = getOperationResponseMap(parsedResponse); + const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); + if (error3) { + throw error3; + } else if (shouldReturnResponse) { + return parsedResponse; } - /** - * 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); + 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 (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); } - let response; + } + 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 parse(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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; + 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; } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw 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; } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; + 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)); } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; + } + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } 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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + } + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path16 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path16.startsWith("/")) { + path16 = path16.substring(1); + } + if (isAbsoluteUrl(path16)) { + requestUrl = path16; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path16); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + 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); } - } else { - delayTimeInMs = Math.random() * 1e3; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } - }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + return result; + } + function isAbsoluteUrl(url2) { + return url2.includes("://"); + } + function appendPath(url2, pathToAppend) { + if (!pathToAppend) { + return url2; } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + const parsedUrl = new URL(url2); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path16 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path16; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + } + } else { + newPath = newPath + pathToAppend; } - }; - 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; + parsedUrl.pathname = newPath; + return parsedUrl.toString(); } - 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; + 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); + } } - 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; + } + return { + queryParams: result, + sequenceParams + }; + } + function simpleParseQueryParams(queryString) { + const result = /* @__PURE__ */ new Map(); + if (!queryString || queryString[0] !== "?") { + return result; + } + queryString = queryString.slice(1); + const pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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 { - return weight1 < weight2; + result.set(name, value); } } - return false; + 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(); } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { + } +}); + +// 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_utils6(); + 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 { /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - + * 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. */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; - } + _endpoint; /** - * Signs request. - * - * @param request - + * The default request content type for the service. + * Used if no requestContentType is present on an OperationSpec. */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + _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(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url: url2 + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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 request; + } 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") { + request.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)) { + request[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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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_util8(); + 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(request, 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)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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 = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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 path16 = urlParsed.pathname; + path16 = path16 || "/"; + path16 = escape(path16); + urlParsed.pathname = path16; + 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 escape(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 path16 = urlParsed.pathname; + path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; + urlParsed.pathname = path16; + 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((resolve8, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve8(); + }; + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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((resolve8, 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(resolve8).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve8(); + } + } + }); + }); + } + /** + * 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 path16 = urlParsed.pathname; + path16 = path16 || "/"; + path16 = escape(path16); + urlParsed.pathname = path16; + 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 escape(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 path16 = urlParsed.pathname; + path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; + urlParsed.pathname = path16; + 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((resolve8, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve8(); + }; + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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" + } + } + } + } } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; } - /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + }; + 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" + } + } } - 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + }; + 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" + } } - 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(request) { - const path16 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path16}`; - const queries = getURLQueries(request.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); + }; + 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" } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } - return canonicalizedResourceString; } }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); + 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" + } + } + } } }; - var StorageSharedKeyCredential = class extends Credential { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto2.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + 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" + } + } + } } }; - var AnonymousCredentialPolicy = class extends 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.QuerySerialization = { + serializedName: "QuerySerialization", + type: { + name: "Composite", + className: "QuerySerialization", + modelProperties: { + format: { + serializedName: "Format", + xmlName: "Format", + type: { + name: "Composite", + className: "QueryFormat" + } + } + } } }; - var AnonymousCredential = class extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + 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" } } + } + } + } } }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); + 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" + } + } + } } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); + }; + exports2.JsonTextConfiguration = { + serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", + type: { + name: "Composite", + className: "JsonTextConfiguration", + modelProperties: { + recordSeparator: { + serializedName: "RecordSeparator", + xmlName: "RecordSeparator", + type: { + name: "String" + } } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + } + }; + 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" + } + } + } } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; + 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" + } + } } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + }; + 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" } } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } } - return false; } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; + }; + 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" + } } - } else { - delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } + }; + 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" } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay2(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + }, + 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" } - attempt++; - } - if (response) { - return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto2.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + }; + 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" + } + } } - return value; } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); + }; + 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" + } } } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; } - function getCanonicalizedResourceString(request) { - const path16 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path16}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } } - return canonicalizedResourceString; } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); + }; + 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" + } + } } - }; - } - var StorageBrowserPolicy = class extends 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(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); - } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + }; + 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" + } + } } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); } }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); + 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" + } + } + } } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + 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" + } + } } } - return { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); + }; + 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" + } + } } - }; - } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * 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 - }; } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); + 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" + } + } + } } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; - } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; + }; + 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" + } + } } } - return void 0; - } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }; + 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" } } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + } + } + }; + 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" } } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); } - pipeline._corePipeline = corePipeline; - } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); - } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; + }; + 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" + } + } } } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; - } - return factory.constructor.name === "StorageSharedKeyCredential"; - } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; - } - return factory.constructor.name === "AnonymousCredential"; - } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); - } - function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; - } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof 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 (request) => { - return { - request, - headers: request.headers.clone(), - status: 500 - }; + }; + 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" + } + } } - }; - const mockRequestPolicyOptions = { - log(_logLevel, _message) { - }, - shouldLog(_logLevel) { - return false; + } + }; + 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" + } + } } - }; - const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions); - const policyName = policyInstance.constructor.name; - return knownPolicies.some((knownPolicyName) => { - return policyName.startsWith(knownPolicyName); - }); - } - var BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", + } + }; + exports2.ContainerGetPropertiesHeaders = { + serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", - className: "BlobServiceProperties", + className: "ContainerGetPropertiesHeaders", modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "Logging" + name: "Dictionary", + value: { type: { name: "String" } } } }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Composite", - className: "Metrics" + name: "String" } }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "Metrics" + name: "DateTimeRfc1123" } }, - cors: { - serializedName: "Cors", - xmlName: "Cors", - xmlIsWrapped: true, - xmlElementName: "CorsRule", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", + 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" } }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "StaticWebsite" + 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" } } } } }; - var Logging = { - serializedName: "Logging", + exports2.ContainerGetPropertiesExceptionHeaders = { + serializedName: "Container_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "Logging", + 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: "Version", - required: true, - xmlName: "Version", + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - deleteProperty: { - serializedName: "Delete", - required: true, - xmlName: "Delete", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + 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" } }, - read: { - serializedName: "Read", - required: true, - xmlName: "Read", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - write: { - serializedName: "Write", - required: true, - xmlName: "Write", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; - var RetentionPolicy = { - serializedName: "RetentionPolicy", + exports2.ContainerSetMetadataExceptionHeaders = { + serializedName: "Container_setMetadataExceptionHeaders", type: { name: "Composite", - className: "RetentionPolicy", + className: "ContainerSetMetadataExceptionHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var Metrics = { - serializedName: "Metrics", + exports2.ContainerGetAccessPolicyHeaders = { + serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", - className: "Metrics", + className: "ContainerGetAccessPolicyHeaders", modelProperties: { - version: { - serializedName: "Version", - xmlName: "Version", + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", type: { - name: "String" + name: "Enum", + allowedValues: ["container", "blob"] } }, - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Boolean" + name: "String" } }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } - } - } - } - }; - var CorsRule = { - serializedName: "CorsRule", - type: { - name: "Composite", - className: "CorsRule", - modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", - required: true, - xmlName: "AllowedOrigins", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - allowedMethods: { - serializedName: "AllowedMethods", - required: true, - xmlName: "AllowedMethods", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", + } + } + } + }; + exports2.ContainerGetAccessPolicyExceptionHeaders = { + serializedName: "Container_getAccessPolicyExceptionHeaders", + type: { + name: "Composite", + className: "ContainerGetAccessPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var StaticWebsite = { - serializedName: "StaticWebsite", + exports2.ContainerSetAccessPolicyHeaders = { + serializedName: "Container_setAccessPolicyHeaders", type: { name: "Composite", - className: "StaticWebsite", + className: "ContainerSetAccessPolicyHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Boolean" + name: "String" } }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } - } - } - } - }; - var StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - code: { - serializedName: "Code", - xmlName: "Code", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -48965,106 +54935,119 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", + exports2.ContainerSetAccessPolicyExceptionHeaders = { + serializedName: "Container_setAccessPolicyExceptionHeaders", type: { name: "Composite", - className: "BlobServiceStatistics", + className: "ContainerSetAccessPolicyExceptionHeaders", modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "GeoReplication" + name: "String" } } } } }; - var GeoReplication = { - serializedName: "GeoReplication", + exports2.ContainerRestoreHeaders = { + serializedName: "Container_restoreHeaders", type: { name: "Composite", - className: "GeoReplication", + className: "ContainerRestoreHeaders", modelProperties: { - status: { - serializedName: "Status", - required: true, - xmlName: "Status", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] + name: "String" } }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", + 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" + } } } } }; - var ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", + exports2.ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", - className: "ListContainersSegmentResponse", + className: "ContainerRestoreExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + } + } + } + }; + 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" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49072,184 +55055,188 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", + exports2.ContainerRenameExceptionHeaders = { + serializedName: "Container_renameExceptionHeaders", type: { name: "Composite", - className: "ContainerItem", + className: "ContainerRenameExceptionHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", - type: { - name: "Boolean" - } - }, - version: { - serializedName: "Version", - xmlName: "Version", + } + } + } + }; + exports2.ContainerSubmitBatchHeaders = { + serializedName: "Container_submitBatchHeaders", + type: { + name: "Composite", + className: "ContainerSubmitBatchHeaders", + modelProperties: { + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "ContainerProperties" + name: "String" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; - var ContainerProperties = { - serializedName: "ContainerProperties", + exports2.ContainerSubmitBatchExceptionHeaders = { + serializedName: "Container_submitBatchExceptionHeaders", type: { name: "Composite", - className: "ContainerProperties", + className: "ContainerSubmitBatchExceptionHeaders", modelProperties: { - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } - }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + } + } + } + }; + 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" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "DateTimeRfc1123" } - }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", + } + } + } + }; + exports2.ContainerFilterBlobsExceptionHeaders = { + serializedName: "Container_filterBlobsExceptionHeaders", + type: { + name: "Composite", + className: "ContainerFilterBlobsExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "String" } - }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", + } + } + } + }; + exports2.ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", + type: { + name: "Composite", + className: "ContainerAcquireLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Boolean" + name: "String" } }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } } } } }; - var KeyInfo = { - serializedName: "KeyInfo", + exports2.ContainerAcquireLeaseExceptionHeaders = { + serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "KeyInfo", + className: "ContainerAcquireLeaseExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49257,64 +55244,66 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { - serializedName: "UserDelegationKey", + exports2.ContainerReleaseLeaseHeaders = { + serializedName: "Container_releaseLeaseHeaders", type: { name: "Composite", - className: "UserDelegationKey", + className: "ContainerReleaseLeaseHeaders", modelProperties: { - signedObjectId: { - serializedName: "SignedOid", - required: true, - xmlName: "SignedOid", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } - }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + } + } + } + }; + 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" } @@ -49322,191 +55311,147 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", + exports2.ContainerRenewLeaseHeaders = { + serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "ContainerRenewLeaseHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - where: { - serializedName: "Where", - required: true, - xmlName: "Where", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - blobs: { - serializedName: "Blobs", - required: true, - xmlName: "Blobs", - xmlIsWrapped: true, - xmlElementName: "Blob", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } - } - } - } - }; - var FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", - type: { - name: "Composite", - className: "FilterBlobItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - tags: { - serializedName: "Tags", - xmlName: "Tags", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobTags" + name: "DateTimeRfc1123" } } } } }; - var BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", + exports2.ContainerRenewLeaseExceptionHeaders = { + serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobTags", + className: "ContainerRenewLeaseExceptionHeaders", modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } + name: "String" } } } } }; - var BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", + exports2.ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", - className: "BlobTag", + className: "ContainerBreakLeaseHeaders", modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + 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" } - } - } - } - }; - var SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", - type: { - name: "Composite", - className: "SignedIdentifier", - modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "AccessPolicy" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var AccessPolicy = { - serializedName: "AccessPolicy", + exports2.ContainerBreakLeaseExceptionHeaders = { + serializedName: "Container_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "AccessPolicy", + className: "ContainerBreakLeaseExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", - type: { - name: "String" - } - }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49514,200 +55459,140 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", + exports2.ContainerChangeLeaseHeaders = { + serializedName: "Container_changeLeaseHeaders", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "ContainerChangeLeaseHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", + exports2.ContainerChangeLeaseExceptionHeaders = { + serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobFlatListSegment", + className: "ContainerChangeLeaseExceptionHeaders", modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", + exports2.ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", - className: "BlobItemInternal", + className: "ContainerListBlobFlatSegmentHeaders", 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", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", 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", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobTags" + name: "String" } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTimeRfc1123" } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49715,1017 +55600,720 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.ContainerListBlobHierarchySegmentHeaders = { + serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "ContainerListBlobHierarchySegmentHeaders", 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", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "ByteArray" + name: "String" } - }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + } + } + } + }; + 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" } - }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + } + } + } + }; + 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" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "String" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "DateTimeRfc1123" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { name: "Enum", allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" ] } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", - type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] - } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", - type: { - name: "String" - } - }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + allowedValues: [ + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" + ] } }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", type: { - name: "String" + name: "Boolean" } - }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + } + } + } + }; + 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" } - }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + } + } + } + }; + exports2.BlobDownloadHeaders = { + serializedName: "Blob_downloadHeaders", + type: { + name: "Composite", + className: "BlobDownloadHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", - type: { - name: "String" - } - }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Boolean" + name: "Dictionary", + value: { type: { name: "String" } } } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { - name: "DateTimeRfc1123" + name: "Dictionary", + value: { type: { name: "String" } } } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { name: "Number" } }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "String" } }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + contentRange: { + serializedName: "content-range", + xmlName: "content-range", type: { - name: "Boolean" + name: "String" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "String" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { - name: "DateTimeRfc1123" + name: "String" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { - name: "Number" + name: "String" } }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { - name: "DateTimeRfc1123" + name: "String" } }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Boolean" + name: "Number" } }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: ["High", "Standard"] - } - }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", - type: { - name: "DateTimeRfc1123" + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", - type: { - name: "Boolean" - } - } - } - } - }; - var ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListBlobsHierarchySegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "String" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Number" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "String" + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "Enum", + allowedValues: ["locked", "unlocked"] } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } - } - } - } - }; - var 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" - } - } - } - } - } - } - }; - var BlobPrefix = { - serializedName: "BlobPrefix", - type: { - name: "Composite", - className: "BlobPrefix", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", - type: { - name: "Composite", - className: "BlobName" - } - } - } - } - }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } - } - } - } - }; - var BlockList = { - serializedName: "BlockList", - type: { - name: "Composite", - className: "BlockList", - modelProperties: { - committedBlocks: { - serializedName: "CommittedBlocks", - xmlName: "CommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + }, + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "Boolean" } }, - uncommittedBlocks: { - serializedName: "UncommittedBlocks", - xmlName: "UncommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } - } - } - } - }; - var Block = { - serializedName: "Block", - type: { - name: "Composite", - className: "Block", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } - } - } - } - }; - var PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "Boolean" } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } - } - } - } - }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", - type: { - name: "Composite", - className: "PageRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Number" + name: "ByteArray" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { name: "Number" } - } - } - } - }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", - type: { - name: "Composite", - className: "ClearRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "Number" + name: "Boolean" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { - name: "Number" + name: "DateTimeRfc1123" } - } - } - } - }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + }, + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "String" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "Composite", - className: "QuerySerialization" + name: "Boolean" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "BlobDownloadExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.BlobGetPropertiesHeaders = { + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "BlobGetPropertiesHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "DateTimeRfc1123" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "Dictionary", + value: { type: { name: "String" } } } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { name: "Dictionary", - value: { type: { name: "any" } } + value: { type: { name: "String" } } } - } - } - } - }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + }, + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { - name: "String" + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", - type: { - name: "Boolean" - } - } - } - } - }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration", - modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } - } - } - } - }; - var 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" - } - } - } - } - } - } - }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", - type: { - name: "Composite", - className: "ArrowField", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + }, + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - name: { - serializedName: "Name", - xmlName: "Name", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "String" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + isIncrementalCopy: { + serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { - name: "Number" + name: "Boolean" } }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + destinationSnapshot: { + serializedName: "x-ms-copy-destination-snapshot", + xmlName: "x-ms-copy-destination-snapshot", type: { - name: "Number" + name: "String" } - } - } - } - }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "String" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "String" + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "String" + name: "Enum", + allowedValues: ["locked", "unlocked"] } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } - } - } - } - }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } - } - } - } - }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } - } - } - } - }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsHeaders", - modelProperties: { + }, + 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", @@ -50754,210 +56342,137 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } - } - } - } - }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + 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", + accessTier: { + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { name: "String" } - } - } - } - }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + accessTierInferred: { + serializedName: "x-ms-access-tier-inferred", + xmlName: "x-ms-access-tier-inferred", type: { - name: "String" + name: "Boolean" } - } - } - } - }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + archiveStatus: { + serializedName: "x-ms-archive-status", + xmlName: "x-ms-archive-status", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + accessTierChangedOn: { + serializedName: "x-ms-access-tier-change-time", + xmlName: "x-ms-access-tier-change-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + expiresOn: { + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "String" + name: "Boolean" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + rehydratePriority: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, - date: { - serializedName: "date", - xmlName: "date", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "DateTimeRfc1123" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { name: "Boolean" } @@ -50972,11 +56487,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "BlobGetPropertiesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50988,15 +56503,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.BlobDeleteHeaders = { + serializedName: "Blob_deleteHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "BlobDeleteHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } @@ -51015,11 +56530,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, errorCode: { @@ -51032,11 +56547,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", + exports2.BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", + className: "BlobDeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51048,11 +56563,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", + exports2.BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + className: "BlobUndeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51092,11 +56607,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", + className: "BlobUndeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51108,11 +56623,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "BlobSetExpiryHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51155,22 +56670,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", + exports2.BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateExceptionHeaders", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51182,21 +56690,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", + exports2.BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "BlobSetHttpHeadersHeaders", 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", @@ -51211,34 +56710,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "Number" } }, clientRequestId: { @@ -51269,49 +56745,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51322,11 +56755,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51338,11 +56771,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.BlobSetImmutabilityPolicyHeaders = { + serializedName: "Blob_setImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + className: "BlobSetImmutabilityPolicyHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51372,21 +56805,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" + } + }, + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "BlobSetImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51398,26 +56839,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.BlobDeleteImmutabilityPolicyHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "BlobDeleteImmutabilityPolicyHeaders", 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", @@ -51445,22 +56872,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51472,34 +56892,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.BlobSetLegalHoldHeaders = { + serializedName: "Blob_setLegalHoldHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "BlobSetLegalHoldHeaders", 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", @@ -51528,21 +56926,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "String" + name: "Boolean" } } } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51554,11 +56952,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "BlobSetMetadataHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51595,6 +56993,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51602,6 +57007,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51612,11 +57038,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "BlobSetMetadataExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51628,12 +57054,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + 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", @@ -51661,22 +57108,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "BlobAcquireLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51688,12 +57128,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -51721,22 +57175,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51748,58 +57195,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "BlobRenewLeaseHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -51831,11 +57253,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51847,11 +57269,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "BlobChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51867,13 +57289,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51888,6 +57303,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51905,11 +57327,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", + className: "BlobChangeLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51921,11 +57343,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "BlobBreakLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51941,6 +57363,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51972,11 +57401,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51988,12 +57417,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "BlobCreateSnapshotHeaders", modelProperties: { + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", + type: { + name: "String" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -52008,13 +57444,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52036,21 +57465,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52062,11 +57512,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlobStartCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52082,13 +57532,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52110,21 +57553,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52132,15 +57604,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlobCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52151,16 +57637,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }, lastModified: { serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, clientRequestId: { @@ -52184,21 +57663,71 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52206,23 +57735,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52261,11 +57797,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52277,19 +57813,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlobSetTierHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52311,13 +57840,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52328,11 +57850,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52344,11 +57866,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52416,11 +57938,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52432,11 +57954,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlobQueryHeaders", modelProperties: { lastModified: { serializedName: "last-modified", @@ -52445,13 +57967,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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-", @@ -52461,22 +57976,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52555,293 +58054,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" - } - } - } - } - }; - var BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", - type: { - name: "Composite", - className: "BlobDownloadExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var 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: { + copyCompletionTime: { serializedName: "x-ms-copy-completion-time", xmlName: "x-ms-copy-completion-time", type: { @@ -52863,132 +58076,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }, 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", + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { - name: "ByteArray" + name: "String" } }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "String" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "String" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "String" + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "Number" + name: "Enum", + allowedValues: ["locked", "unlocked"] } }, clientRequestId: { @@ -53012,13 +58148,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, acceptRanges: { serializedName: "accept-ranges", xmlName: "accept-ranges", @@ -53026,6 +58155,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53054,104 +58190,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Boolean" + name: "ByteArray" } }, errorCode: { @@ -53160,15 +58203,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } } } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", + className: "BlobQueryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53180,11 +58230,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", + exports2.BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", type: { name: "Composite", - className: "BlobDeleteHeaders", + className: "BlobGetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53224,11 +58274,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53240,11 +58290,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + className: "BlobSetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53284,11 +58334,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53300,11 +58350,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "PageBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53320,6 +58370,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53341,21 +58398,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobSetExpiryExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53367,11 +58459,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersHeaders", + className: "PageBlobUploadPagesHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53387,6 +58479,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53422,89 +58528,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", - type: { - name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } } } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53516,65 +58575,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", + className: "PageBlobClearPagesHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - date: { - serializedName: "date", - xmlName: "date", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } - } - } - } - }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", - type: { - name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } - } - } - } - }; - var BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", - type: { - name: "Composite", - className: "BlobSetLegalHoldHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -53603,21 +58644,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53629,11 +58670,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "BlobSetMetadataHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53649,11 +58690,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + 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: { @@ -53670,13 +58725,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -53715,11 +58763,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobSetMetadataExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53727,23 +58775,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseHeaders", + className: "PageBlobGetPageRangesHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, lastModified: { serializedName: "last-modified", xmlName: "last-modified", @@ -53751,13 +58806,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + 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", @@ -53785,15 +58847,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53805,12 +58874,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -53818,11 +58894,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -53852,15 +58928,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53872,11 +58955,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "BlobRenewLeaseHeaders", + className: "PageBlobResizeHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53892,11 +58975,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } }, clientRequestId: { @@ -53926,16 +59009,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", - modelProperties: { + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -53946,69 +59020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var 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" - } - } - } - } - }; - var BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54020,11 +59036,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "BlobBreakLeaseHeaders", + className: "PageBlobUpdateSequenceNumberHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54040,9 +59056,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { name: "Number" } @@ -54074,15 +59090,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54094,19 +59117,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotHeaders", + className: "PageBlobCopyIncrementalHeaders", modelProperties: { - snapshot: { - serializedName: "x-ms-snapshot", - xmlName: "x-ms-snapshot", - type: { - name: "String" - } - }, etag: { serializedName: "etag", xmlName: "etag", @@ -54142,13 +59158,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54156,11 +59165,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { - name: "Boolean" + name: "String" + } + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", + type: { + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, errorCode: { @@ -54173,11 +59190,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54189,11 +59206,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLHeaders", + className: "AppendBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54209,6 +59226,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54244,19 +59268,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -54269,11 +59299,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54285,11 +59315,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "BlobCopyFromURLHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54305,6 +59335,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54326,13 +59370,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54340,33 +59377,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "ByteArray" + name: "Boolean" } }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "ByteArray" + name: "String" } }, encryptionScope: { @@ -54386,11 +59422,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54402,17 +59438,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAbortCopyFromURLHeaders = { - serializedName: "Blob_abortCopyFromURLHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "BlobAbortCopyFromURLHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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: "String" + name: "ByteArray" } }, requestId: { @@ -54436,57 +59493,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } - } - } - } - }; - var BlobAbortCopyFromURLExceptionHeaders = { - serializedName: "Blob_abortCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobAbortCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var BlobSetTierHeaders = { - serializedName: "Blob_setTierHeaders", - type: { - name: "Composite", - className: "BlobSetTierHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, errorCode: { @@ -54499,11 +59538,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierExceptionHeaders = { - serializedName: "Blob_setTierExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobSetTierExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54511,16 +59550,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobGetAccountInfoHeaders = { - serializedName: "Blob_getAccountInfoHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "BlobGetAccountInfoHeaders", + 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", @@ -54549,37 +59616,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } @@ -54587,11 +59626,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetAccountInfoExceptionHeaders = { - serializedName: "Blob_getAccountInfoExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "BlobGetAccountInfoExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54603,49 +59642,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQueryHeaders = { - serializedName: "Blob_queryHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "BlobQueryHeaders", + className: "BlockBlobUploadHeaders", 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", @@ -54653,6 +59655,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, contentMD5: { serializedName: "content-md5", xmlName: "content-md5", @@ -54660,120 +59669,113 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "ByteArray" } }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", 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", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + } + } + } + }; + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobUploadExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + } + } + } + }; + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", + type: { + name: "Composite", + className: "BlockBlobPutBlobFromUrlHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, clientRequestId: { @@ -54797,9 +59799,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } @@ -54811,16 +59813,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -54839,35 +59834,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" - } } } } }; - var BlobQueryExceptionHeaders = { - serializedName: "Blob_queryExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobQueryExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54875,16 +59856,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobGetTagsHeaders = { - serializedName: "Blob_getTagsHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "BlobGetTagsHeaders", + 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", @@ -54913,64 +59915,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var BlobGetTagsExceptionHeaders = { - serializedName: "Blob_getTagsExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetTagsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var BlobSetTagsHeaders = { - serializedName: "Blob_setTagsHeaders", - type: { - name: "Composite", - className: "BlobSetTagsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "DateTimeRfc1123" + name: "String" } }, errorCode: { @@ -54983,11 +59953,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "BlobSetTagsExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54999,26 +59969,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateHeaders = { - serializedName: "PageBlob_createHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "PageBlobCreateHeaders", + className: "BlockBlobStageBlockFromURLHeaders", 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", @@ -55026,6 +59982,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -55047,13 +60010,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -55092,11 +60048,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateExceptionHeaders = { - serializedName: "PageBlob_createExceptionHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "PageBlobCreateExceptionHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -55104,15 +60060,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var PageBlobUploadPagesHeaders = { - serializedName: "PageBlob_uploadPagesHeaders", + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesHeaders", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { etag: { serializedName: "etag", @@ -55142,13 +60112,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -55170,6 +60133,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -55208,11 +60178,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesExceptionHeaders = { - serializedName: "PageBlob_uploadPagesExceptionHeaders", + exports2.BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesExceptionHeaders", + className: "BlockBlobCommitBlockListExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -55224,19 +60194,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobClearPagesHeaders = { - serializedName: "PageBlob_clearPagesHeaders", + exports2.BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", type: { name: "Composite", - className: "PageBlobClearPagesHeaders", + className: "BlockBlobGetBlockListHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, lastModified: { serializedName: "last-modified", xmlName: "last-modified", @@ -55244,23 +60207,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "ByteArray" + name: "String" } }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "ByteArray" + name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } @@ -55303,1813 +60266,1238 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var 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.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" } } }; - var 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.action3 = { + parameterPath: "action", + mapper: { + defaultValue: "break", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.breakPeriod = { + parameterPath: ["options", "breakPeriod"], + mapper: { + serializedName: "x-ms-lease-break-period", + xmlName: "x-ms-lease-break-period", + type: { + name: "Number" } } }; - var 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.action4 = { + parameterPath: "action", + mapper: { + defaultValue: "change", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.proposedLeaseId1 = { + parameterPath: "proposedLeaseId", + mapper: { + serializedName: "x-ms-proposed-lease-id", + required: true, + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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", + exports2.include1 = { + parameterPath: ["options", "include"], + mapper: { + serializedName: "include", + xmlName: "include", + xmlElementName: "ListBlobsIncludeItem", + type: { + name: "Sequence", + element: { type: { - name: "String" + 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" + } } }; - var 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.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var 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.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.ifMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], + mapper: { + serializedName: "If-Match", + xmlName: "If-Match", + type: { + name: "String" } } }; - var 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.ifNoneMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], + mapper: { + serializedName: "If-None-Match", + xmlName: "If-None-Match", + type: { + name: "String" } } }; - var 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.ifTags = { + parameterPath: ["options", "modifiedAccessConditions", "ifTags"], + mapper: { + serializedName: "x-ms-if-tags", + xmlName: "x-ms-if-tags", + type: { + name: "String" } } }; - var 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.deleteSnapshots = { + parameterPath: ["options", "deleteSnapshots"], + mapper: { + serializedName: "x-ms-delete-snapshots", + xmlName: "x-ms-delete-snapshots", + type: { + name: "Enum", + allowedValues: ["include", "only"] } } }; - var 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.blobDeleteType = { + parameterPath: ["options", "blobDeleteType"], + mapper: { + serializedName: "deletetype", + xmlName: "deletetype", + type: { + name: "String" } } }; - var 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.comp11 = { + parameterPath: "comp", + mapper: { + defaultValue: "expiry", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.expiryOptions = { + parameterPath: "expiryOptions", + mapper: { + serializedName: "x-ms-expiry-option", + required: true, + xmlName: "x-ms-expiry-option", + type: { + name: "String" } } }; - var 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.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" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.comp12 = { + parameterPath: "comp", + mapper: { + defaultValue: "immutabilityPolicies", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.immutabilityPolicyExpiry = { + parameterPath: ["options", "immutabilityPolicyExpiry"], + mapper: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", + type: { + name: "DateTimeRfc1123" } } }; - var 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.immutabilityPolicyMode = { + parameterPath: ["options", "immutabilityPolicyMode"], + mapper: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } }; - var 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.comp13 = { + parameterPath: "comp", + mapper: { + defaultValue: "legalhold", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.legalHold = { + parameterPath: "legalHold", + mapper: { + serializedName: "x-ms-legal-hold", + required: true, + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.sealBlob = { + parameterPath: ["options", "sealBlob"], + mapper: { + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", + type: { + name: "Boolean" } } }; - var 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.legalHold1 = { + parameterPath: ["options", "legalHold"], + mapper: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.xMsRequiresSync = { + parameterPath: "xMsRequiresSync", + mapper: { + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", + type: { + name: "String" } } }; - var 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.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], + mapper: { + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", + type: { + name: "ByteArray" } } }; - var 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.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], + exports2.comp15 = { + parameterPath: "comp", mapper: { - defaultValue: "application/xml", + defaultValue: "copy", isConstant: true, - serializedName: "Content-Type", + serializedName: "comp", type: { name: "String" } } }; - var blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties - }; - var accept = { - parameterPath: "accept", + exports2.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", mapper: { - defaultValue: "application/xml", + defaultValue: "abort", isConstant: true, - serializedName: "Accept", + serializedName: "x-ms-copy-action", type: { name: "String" } } }; - var url2 = { - parameterPath: "url", + exports2.copyId = { + parameterPath: "copyId", mapper: { - serializedName: "url", + serializedName: "copyid", required: true, - xmlName: "url", + xmlName: "copyid", type: { name: "String" } - }, - skipEncoding: true + } }; - var restype = { - parameterPath: "restype", + exports2.comp16 = { + parameterPath: "comp", mapper: { - defaultValue: "service", + defaultValue: "tier", isConstant: true, - serializedName: "restype", + 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" } } }; - var comp = { + exports2.comp18 = { parameterPath: "comp", mapper: { - defaultValue: "properties", + defaultValue: "tags", isConstant: true, serializedName: "comp", type: { @@ -57117,41 +61505,86 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], + exports2.tags = { + parameterPath: ["options", "tags"], + mapper: mappers_js_1.BlobTags + }; + exports2.transactionalContentMD5 = { + parameterPath: ["options", "transactionalContentMD5"], mapper: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "timeout", - xmlName: "timeout", + serializedName: "Content-MD5", + xmlName: "Content-MD5", type: { - name: "Number" + name: "ByteArray" } } }; - var version = { - parameterPath: "version", + exports2.transactionalContentCrc64 = { + parameterPath: ["options", "transactionalContentCrc64"], mapper: { - defaultValue: "2024-11-04", + 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-version", + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var requestId = { - parameterPath: ["options", "requestId"], + exports2.blobContentLength = { + parameterPath: "blobContentLength", mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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" } } }; - var accept1 = { + exports2.body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" + } + } + }; + exports2.accept2 = { parameterPath: "accept", mapper: { defaultValue: "application/xml", @@ -57162,87 +61595,128 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp1 = { + exports2.comp19 = { parameterPath: "comp", mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", + 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: "String" + name: "Number" } } }; - var comp2 = { - parameterPath: "comp", + exports2.pageWrite1 = { + parameterPath: "pageWrite", mapper: { - defaultValue: "list", + defaultValue: "clear", isConstant: true, - serializedName: "comp", + serializedName: "x-ms-page-write", type: { name: "String" } } }; - var prefix = { - parameterPath: ["options", "prefix"], + exports2.sourceUrl = { + parameterPath: "sourceUrl", mapper: { - serializedName: "prefix", - xmlName: "prefix", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { name: "String" } } }; - var marker = { - parameterPath: ["options", "marker"], + exports2.sourceRange = { + parameterPath: "sourceRange", mapper: { - serializedName: "marker", - xmlName: "marker", + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", type: { name: "String" } } }; - var maxPageSize = { - parameterPath: ["options", "maxPageSize"], + exports2.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], mapper: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "maxresults", - xmlName: "maxresults", + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", type: { - name: "Number" + name: "ByteArray" } } }; - var include = { - parameterPath: ["options", "include"], + exports2.range1 = { + parameterPath: "range", mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + name: "String" } - }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + } }; - var comp3 = { + exports2.comp20 = { parameterPath: "comp", mapper: { - defaultValue: "userdelegationkey", + defaultValue: "pagelist", isConstant: true, serializedName: "comp", type: { @@ -57250,65 +61724,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var restype1 = { - parameterPath: "restype", + exports2.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", type: { name: "String" } } }; - var body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } - } - }; - var comp4 = { - parameterPath: "comp", + exports2.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", type: { name: "String" } } }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } - } - }; - var multipartContentType = { - parameterPath: "multipartContentType", + exports2.sequenceNumberAction = { + parameterPath: "sequenceNumberAction", mapper: { - serializedName: "Content-Type", + serializedName: "x-ms-sequence-number-action", required: true, - xmlName: "Content-Type", + xmlName: "x-ms-sequence-number-action", type: { - name: "String" + name: "Enum", + allowedValues: ["max", "update", "increment"] } } }; - var comp5 = { + exports2.comp21 = { parameterPath: "comp", mapper: { - defaultValue: "blobs", + defaultValue: "incrementalcopy", isConstant: true, serializedName: "comp", type: { @@ -57316,112 +61767,98 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var where = { - parameterPath: ["options", "where"], + exports2.blobType1 = { + parameterPath: "blobType", mapper: { - serializedName: "where", - xmlName: "where", + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var restype2 = { - parameterPath: "restype", + exports2.comp22 = { + parameterPath: "comp", mapper: { - defaultValue: "container", + defaultValue: "appendblock", isConstant: true, - serializedName: "restype", + serializedName: "comp", type: { name: "String" } } }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - }; - var access = { - parameterPath: ["options", "access"], + exports2.maxSize = { + parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", + serializedName: "x-ms-blob-condition-maxsize", + xmlName: "x-ms-blob-condition-maxsize", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "Number" } } }; - var defaultEncryptionScope = { + exports2.appendPosition = { parameterPath: [ "options", - "containerEncryptionScope", - "defaultEncryptionScope" + "appendPositionAccessConditions", + "appendPosition" ], mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", type: { - name: "String" + name: "Number" } } }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], + exports2.sourceRange1 = { + parameterPath: ["options", "sourceRange"], mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", type: { - name: "Boolean" + name: "String" } } }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], + exports2.comp23 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + defaultValue: "seal", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], + exports2.blobType2 = { + parameterPath: "blobType", mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], + exports2.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", type: { - name: "DateTimeRfc1123" + name: "Boolean" } } }; - var comp6 = { + exports2.comp24 = { parameterPath: "comp", mapper: { - defaultValue: "metadata", + defaultValue: "block", isConstant: true, serializedName: "comp", type: { @@ -57429,10 +61866,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp7 = { + 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: "acl", + defaultValue: "blocklist", isConstant: true, serializedName: "comp", type: { @@ -57440,5521 +61892,6155 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], + exports2.listType = { + parameterPath: "listType", mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", + defaultValue: "committed", + serializedName: "blocklisttype", + required: true, + xmlName: "blocklisttype", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; - var comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + } +}); + +// 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); } - }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } + /** + * 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); } - }; - var comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" - } + /** + * [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); } - }; - var sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * [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); } - }; - var duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" - } + /** + * [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); } - }; - var proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * [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); } - }; - var leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 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" - ] - } - } + var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerSetAccessPolicyHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerSetAccessPolicyExceptionHeaders } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" + 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 ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" + 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 ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" + 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 }; - var deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } + } +}); + +// 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; } - }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + /** + * 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); } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * 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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" - } + /** + * 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); } - }; - var comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } + /** + * [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); } - }; - var comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } + /** + * 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); } - }; - var comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var 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" - ] - } + /** + * 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); } - }; - var rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } + /** + * 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); } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } + /** + * 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); } - }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } + /** + * 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); } }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" + 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 copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + 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 blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" + 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 sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" + 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 legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" + 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 sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" + 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 copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" + 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 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"] + 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 comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" + 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 copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" + 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 comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var changeLeaseOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.BlobChangeLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobChangeLeaseExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + var createSnapshotOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlobCreateSnapshotHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobCreateSnapshotExceptionHeaders } - } - }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags + }, + 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 transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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 transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" + 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 blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + 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 blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + 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 contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + 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 body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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 accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } + /** + * 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); } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" - } + /** + * 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); } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" - } + /** + * 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); } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" - } + /** + * 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); } }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + 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 prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + 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 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"] + 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 comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + var updateSequenceNumberOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.PageBlobUpdateSequenceNumberHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUpdateSequenceNumberExceptionHeaders } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" + }, + 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 ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + 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 }; - var comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } + /** + * 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); } - }; - var copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" - } + /** + * 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); } }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList + 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 comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + 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 }; - var ServiceImpl = class { + } +}); + +// 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 Service class. + * Initialize a new instance of the class BlockBlob 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(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, 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$2); - } - /** - * 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. + * 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. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); + upload(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, uploadOperationSpec); } /** - * The List Containers Segment operation returns a list of the containers under the specified account + * 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. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); + putBlobFromUrl(contentLength, copySource, options) { + return this.client.sendOperationRequest({ contentLength, copySource, options }, putBlobFromUrlOperationSpec); } /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * @param keyInfo Key information + * 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. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); + stageBlock(blockId, contentLength, body, options) { + return this.client.sendOperationRequest({ blockId, contentLength, body, options }, stageBlockOperationSpec); } /** - * Returns the sku name and account kind + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); + stageBlockFromURL(blockId, contentLength, sourceUrl, options) { + return this.client.sendOperationRequest({ blockId, contentLength, sourceUrl, options }, stageBlockFromURLOperationSpec); } /** - * 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 + * 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. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); + commitBlockList(blocks, options) { + return this.client.sendOperationRequest({ blocks, options }, commitBlockListOperationSpec); } /** - * 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. + * 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. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); + getBlockList(listType, options) { + return this.client.sendOperationRequest({ listType, options }, getBlockListOperationSpec); } }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( + exports2.BlockBlobImpl = BlockBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var setPropertiesOperationSpec = { - path: "/", + var uploadOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders + 201: { + headersMapper: Mappers.BlockBlobUploadHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobUploadExceptionHeaders } }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url2], + requestBody: Parameters.body1, + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId + 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: "xml", - serializer: xmlSerializer$5 + mediaType: "binary", + serializer: xmlSerializer }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", + var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders + 201: { + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url2], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", + var stageBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockExceptionHeaders } }, + requestBody: Parameters.body1, queryParameters: [ - restype, - timeoutInSeconds, - comp1 + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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, - serializer: xmlSerializer$5 + contentType: "application/xml; charset=utf-8", + mediaType: "binary", + serializer: xmlSerializer }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", + var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", + var commitBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders + 201: { + headersMapper: Mappers.BlockBlobCommitBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobCommitBlockListExceptionHeaders } }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url2], + requestBody: Parameters.blocks, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp25], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId + 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$5 + serializer: xmlSerializer }; - var getAccountInfoOperationSpec$2 = { - path: "/", + var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - headersMapper: ServiceGetAccountInfoHeaders + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } }, queryParameters: [ - comp, - timeoutInSeconds, - restype1 + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.comp25, + Parameters.listType ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + } +}); + +// 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"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url2], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (!options) { + options = {}; } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + const defaults = { + 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 = { + ...defaults, + ...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); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * Encoded URL string value. */ - constructor(client) { - this.client = client; + 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, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url2); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url2); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + 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 new container under the specified account. If the container with the same name already - * exists, the operation fails - * @param options The options parameters. + * 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 - */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); + 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; } /** - * 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. + * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it + * and boolean values for them. + * + * @param permissionLike - */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); + 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; } /** - * 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. + * 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 - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); + 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; } /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it + * and boolean values for them. + * + * @param permissionLike - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); + 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; } /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * Specifies Read access granted. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + read = false; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Specifies Add access granted. */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + add = false; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Specifies Create access granted. */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); - } + create = false; /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Specifies Write access granted. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); - } + write = false; /** - * 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. + * Specifies Delete access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } + deleteVersion = false; /** - * [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. + * Specifies List access granted. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); - } + list = false; /** - * [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. + * Specfies Tag access granted. */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); - } + tag = false; /** - * [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. + * Specifies Move access granted. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); - } + move = false; /** - * [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. + * Specifies Execute access granted. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); - } + execute = false; /** - * [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. + * Specifies SetImmutabilityPolicy access granted. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); - } + setImmutabilityPolicy = false; /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. + * Specifies that Permanent Delete is permitted. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); - } + permanentDelete = false; /** - * [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. + * Specifies that Filter Blobs by Tags is permitted. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); - } + filterByTags = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * 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 + * */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); - } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + toString() { + const permissions = []; + if (this.read) { + permissions.push("r"); } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url2], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + if (this.move) { + permissions.push("m"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + if (this.execute) { + permissions.push("e"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + if (this.permanentDelete) { + permissions.push("y"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + if (this.filterByTags) { + permissions.push("f"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 + return permissions.join(""); + } }; - var BlobImpl = class { + 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; /** - * Initialize a new instance of the class Blob class. - * @param client Reference to the service client + * Azure Storage user delegation key; readonly. */ - constructor(client) { - this.client = client; - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - download(options) { - return this.client.sendOperationRequest({ options }, downloadOperationSpec); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * 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. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec); + 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 { /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. + * The storage API version. */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); - } + version; /** - * Sets the time a blob will expire and be deleted. - * @param expiryOptions Required. Indicates mode of the expiry time - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setExpiry(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); - } + protocol; /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); - } + startsOn; /** - * The Set Immutability Policy operation sets the immutability policy on the blob - * @param options The options parameters. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - setImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, setImmutabilityPolicyOperationSpec); - } + expiresOn; /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob - * @param options The options parameters. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - deleteImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, deleteImmutabilityPolicyOperationSpec); - } + permissions; /** - * 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. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - setLegalHold(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); - } + services; /** - * 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. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec); - } + resourceTypes; /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec); - } + identifier; /** - * [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. + * Optional. Encryption scope to use when sending requests authorized with this SAS URI. */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); - } + encryptionScope; /** - * [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. + * 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 */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); - } + resource; /** - * [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. + * The signature for the SAS token. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); - } + signature; /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. + * Value for cache-control header in Blob/File Service SAS. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec); - } + cacheControl; /** - * The Create Snapshot operation creates a read-only snapshot of a blob - * @param options The options parameters. + * Value for content-disposition header in Blob/File Service SAS. */ - createSnapshot(options) { - return this.client.sendOperationRequest({ options }, createSnapshotOperationSpec); - } + contentDisposition; /** - * 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. + * Value for content-encoding header in Blob/File Service SAS. */ - startCopyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); - } + contentEncoding; /** - * 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. + * Value for content-length header in Blob/File Service SAS. */ - copyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); - } + contentLanguage; /** - * 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. + * Value for content-type header in Blob/File Service SAS. */ - abortCopyFromURL(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); - } + contentType; /** - * 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. + * Inner value of getter ipRange. */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); - } + ipRangeInner; /** - * Returns the sku name and account kind - * @param options The options parameters. + * The Azure Active Directory object ID in GUID format. + * Property of user delegation key. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); - } + signedOid; /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * The Azure Active Directory tenant ID in GUID format. + * Property of user delegation key. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); - } + signedTenantId; /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * The date-time the key is active. + * Property of user delegation key. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); - } + signedStartsOn; /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. + * The date-time the key expires. + * Property of user delegation key. */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); - } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders + 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 + }; } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders + 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; + } } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders + } + /** + * 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; + } } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders + 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; } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 + } }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders + 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); + } } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders + } + 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); + } } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders + } + 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."); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders + } + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + } + 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(); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var PageBlobImpl = class { - /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; } + 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, + timestamp2, + 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; /** - * 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. + * Gets the lease Id. + * + * @readonly */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + get leaseId() { + return this._leaseId; } /** - * 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. + * Gets the url. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get url() { + return this._url; } /** - * 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. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + 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; } /** - * 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. + * 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. */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + 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 + })); + }); } /** - * 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. + * 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. */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + 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; + }); } /** - * 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. + * 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. */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + 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 + })); + }); } /** - * 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. + * 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. */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + 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 + }); + }); } /** - * 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. + * 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. */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + 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; /** - * 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. + * 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 - */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + 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(); } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders + _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; } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders + if (!this.push(data)) { + this.source.pause(); } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders + }; + 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; } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders + 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}`)); } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 + }; + _destroy(error3, callback) { + this.removeSourceEventHandlers(); + this.source.destroy(); + callback(error3 === null ? void 0 : error3); + } }; - var AppendBlobImpl = class { + 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; + } /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } /** - * 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. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get contentType() { + return this.originalResponse.contentType; } /** - * 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. + * 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 */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + get copyId() { + return this.originalResponse.copyId; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get copyProgress() { + return this.originalResponse.copyProgress; } /** - * 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. + * 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 */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copySource() { + return this.originalResponse.copySource; } /** - * 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. + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get leaseState() { + return this.originalResponse.leaseState; } /** - * 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. + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get leaseStatus() { + return this.originalResponse.leaseStatus; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. + * + * @readonly */ - constructor(url3, options) { - var _a, _b; - if (url3 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url3; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get date() { + return this.originalResponse.date; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly + */ + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly */ - constructor(url3, pipeline) { - this.url = escapeURLPath(url3); - this.accountName = getAccountNameFromUrl(url3); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get etag() { + return this.originalResponse.etag; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * The number of tags associated with the blob + * + * @readonly + */ + get tagCount() { + return this.originalResponse.tagCount; } /** - * 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. + * The error code. * - * @param permissions - + * @readonly */ - 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; + 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; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * - * @param permissionLike - + * @readonly */ - 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; + get requestId() { + return this.originalResponse.requestId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); + get clientRequestId() { + return this.originalResponse.clientRequestId; } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + /** + * Indicates the version of the Blob service used + * to execute the request. + * + * @readonly + */ + get version() { + return this.originalResponse.version; } /** - * 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. + * Indicates the versionId of the downloaded blob version. * - * @param permissions - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates whether version of this blob is a current version. * - * @param permissionLike - + * @readonly */ - 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; + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * 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. * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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 */ - 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(""); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * + * @readonly */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * If this blob has been sealed. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto2.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get isSealed() { + return this.originalResponse.isSealed; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * Indicates if a legal hold is present on the blob. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + 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 { /** - * A private helper method used to filter and append query key/value pairs into an array. + * Reads a fixed number of bytes from the stream. * - * @param queries - - * @param key - - * @param value - + * @param stream - + * @param length - + * @param options - */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); + 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; } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } + /** + * 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]; } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); + // 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); } - if (version2 >= "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."); - } + static async readLong(stream2, options = {}) { + return _AvroParser.readZigZagLong(stream2, options); } - 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."); + static async readInt(stream2, options = {}) { + return _AvroParser.readZigZagLong(stream2, options); } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; + static async readNull() { + return null; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readBoolean(stream2, options = {}) { + const b = await _AvroParser.readByte(stream2, options); + if (b === 1) { + return true; + } else if (b === 0) { + return false; } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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."); + 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); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + 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); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + 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 }); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + static async readString(stream2, options = {}) { + const u8arr = await _AvroParser.readBytes(stream2, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readMapPair(stream2, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream2, options); + const value = await readItemMethod(stream2, options); + return { key, value }; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readMap(stream2, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } + return dict; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + 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; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + return _AvroType.fromObjectSchema(schema2); } } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "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'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + // 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"); + } } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + // 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]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + async read(stream2, options = {}) { + const typeIndex = await AvroParser.readInt(stream2, options); + return this._types[typeIndex].read(stream2, options); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "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."); + // 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); } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + // 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; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + }; + } +}); + +// 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; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + return true; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + _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; } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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."); } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + this._metadata = await AvroParser_js_1.AvroParser.readMap(this._headerStream, AvroParser_js_1.AvroParser.readString, { + abortSignal: options.abortSignal }); - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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"); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal }); - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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; + } } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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((resolve8, 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(); + resolve8(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); + } + }); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream2.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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. @@ -63070,7 +68156,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -63177,14 +68263,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -63227,23 +68305,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63268,99 +68329,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * @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; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * Indicates immutability policy mode. + * Indicates the version of the File service used + * to execute the request. * * @readonly */ - get immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; + get version() { + return this.originalResponse.version; } /** - * Indicates if a legal hold is present on the blob. + * 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 legalHold() { - return this.originalResponse.legalHold; + 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. @@ -63368,19 +68365,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * @readonly */ - get contentAsBlob() { - return this.originalResponse.blobBody; + get blobBody() { + return void 0; } /** * The response body as a node.js Readable stream. * Always undefined in the browser. * - * It will automatically retry when internal read stream unexpected ends. + * It will parse avor data returned by blob query. * * @readonly */ get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** * The HTTP response. @@ -63388,1032 +68385,1289 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get _response() { return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** - * Creates an instance of BlobDownloadResponse. + * Creates an instance of BlobQueryResponse. * * @param originalResponse - - * @param getter - - * @param offset - - * @param count - * @param options - */ - constructor(originalResponse, getter, offset, count, options = {}) { + constructor(originalResponse, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + this.blobDownloadStream = new BlobQuickQueryStream_js_1.BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - var AvroParser = class _AvroParser { - /** - * Reads a fixed number of bytes from the stream. - * - * @param stream - - * @param length - - * @param options - - */ - static async readFixedBytes(stream3, length, options = {}) { - const bytes = await stream3.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(stream3, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream3, 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(stream3, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await _AvroParser.readByte(stream3, 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(stream3, 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(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, 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; } - static async readInt(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); + return tier; + } + function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } - static async readNull() { - return null; + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25; } - static async readBoolean(stream3, options = {}) { - const b = await _AvroParser.readByte(stream3, options); - if (b === 1) { - return true; - } else if (b === 0) { - return false; - } else { - throw new Error("Byte was not a boolean."); + } + 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}`); } - static async readFloat(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); - } - static async readDouble(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); - } - static async readBytes(stream3, options = {}) { - const size = await _AvroParser.readLong(stream3, options); - if (size < 0) { - throw new Error("Bytes size was negative."); + } + exports2.deserializeState = deserializeState; + function setStateError(inputs) { + const { state, stateProxy, isOperationError } = inputs; + return (error3) => { + if (isOperationError(error3)) { + stateProxy.setError(state, error3); + stateProxy.setFailed(state); } - return stream3.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream3, options = {}) { - const u8arr = await _AvroParser.readBytes(stream3, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); + throw error3; + }; + } + function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; } - static async readMapPair(stream3, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream3, options); - const value = await readItemMethod(stream3, options); - return { key, value }; + 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); } - static async readMap(stream3, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream3, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; + return { + code, + message + }; + } + function processOperationStatus(result) { + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; + switch (status) { + case "succeeded": { + stateProxy.setSucceeded(state); + break; } - return dict; - } - static async readArray(stream3, readItemMethod, options = {}) { - const items = []; - for (let count = await _AvroParser.readLong(stream3, options); count !== 0; count = await _AvroParser.readLong(stream3, options)) { - if (count < 0) { - await _AvroParser.readLong(stream3, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream3, options); - items.push(item); + 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; } - return items; - } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); + case "canceled": { + stateProxy.setCanceled(state); + break; } } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); + 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, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 + }; } } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); + 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); } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + case "DELETE": { + return void 0; } - } - }; - var AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream3, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream3, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream3, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream3, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream3, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream3, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream3, options); - default: - throw new Error("Unknown Avro Primitive"); + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); } } - }; - var AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, options = {}) { - const value = await AvroParser.readInt(stream3, options); - return this._symbols[value]; - } - }; - var AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; - } - async read(stream3, options = {}) { - const typeIndex = await AvroParser.readInt(stream3, options); - return this._types[typeIndex].read(stream3, options); - } - }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - const readItemMethod = (s, opts) => { - return this._itemType.read(s, opts); - }; - return AvroParser.readMap(stream3, readItemMethod, options); - } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, 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(stream3, options); + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; } } - return record; } - }; - 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; + } + 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; } - return true; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; - } - get objectIndex() { - return this._objectIndex; - } - 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; + 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.`); } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); - } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - }); - await 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--; - } + 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; } } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } - } - yield yield tslib.__await(result); - } - }); + } + 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; } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); - } - return data; + 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; } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + 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; } - get position() { - return this._position; + 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; } - async read(size, options = {}) { + return void 0; + } + function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - throw ABORT_ERROR; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); + } + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); } - if (size === 0) { - return new Uint8Array(); + case "ResourceLocation": { + return getLocationHeader(rawResponse); } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); + case "Body": + default: { + return void 0; } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve8, 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(); - resolve8(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.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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}`); } - }; - var BlobQuickQueryStream = class extends stream2.Readable { + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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 = () => ({ /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * 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. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new 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 schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 }); + 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, 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, + 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 }); } } - 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 }); + } 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`); } - 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 - }); + } + })().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; } - break; - default: - throw Error(`Unknown schema ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); - } - }; - 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; + } + 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; } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * 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; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * The number of bytes present in the - * response body. - * - * @readonly + * Serializes the Poller operation. */ - get contentLength() { - return this.originalResponse.contentLength; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * 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; + }; + 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); } - /** - * 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; + }; + 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 { /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @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. + * 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. * - * @readonly - */ - get copyCompletedOn() { - return void 0; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @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. + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @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. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @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' + * // You can assign more local properties here. + * } + * } + * ``` * - * @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. + * 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. * - * @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'. + * 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: * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get leaseState() { - return this.originalResponse.leaseState; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve8, reject) => { + this.resolve = resolve8; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The error code. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get errorCode() { - return this.originalResponse.errorCode; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * 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 + * Invokes the underlying operation's cancel method. */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * 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. + * 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. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get lastModified() { - return this.originalResponse.lastModified; + 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; } - /** - * A name-value pair - * to associate with a file storage object. - * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; + 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()); + } } /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get requestId() { - return this.originalResponse.requestId; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get clientRequestId() { - return this.originalResponse.clientRequestId; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * Indicates the version of the File service used - * to execute the request. - * - * @readonly + * Returns true if the poller has finished polling. */ - get version() { - return this.originalResponse.version; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * 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 + * Stops the poller from continuing to poll. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * 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) + * Returns true if the poller is stopped. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + isStopped() { + return this.stopped; } /** - * The response body as a browser Blob. - * Always undefined in node.js. + * Attempts to cancel the underlying operation. * - * @readonly + * 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. */ - get blobBody() { - return void 0; + 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; } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * Returns the state of the operation. * - * It will parse avor data returned by blob query. + * 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. * - * @readonly + * 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. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve8) => setTimeout(() => resolve8(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -64421,20 +69675,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -64442,10 +69697,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -64485,12 +69740,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + state: { ...state }, cancel, toString: toString3, 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.`); @@ -64500,27 +69764,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -64535,8 +69833,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -64551,9 +69849,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve8, reject) => { this.emitter.on("finish", resolve8); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -64590,333 +69888,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream2.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve8, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve8).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve8(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream3, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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((resolve8, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream3.on("readable", () => { + 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); resolve8(); return; } - let chunk = stream3.read(); + let chunk = stream2.read(); if (!chunk) { return; } @@ -64924,28 +69925,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream3.on("end", () => { + stream2.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve8(); }); - stream3.on("error", (msg) => { + stream2.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream3, buffer2, encoding) { + async function streamToBuffer2(stream2, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve8, reject) => { - stream3.on("readable", () => { - let chunk = stream3.read(); + stream2.on("readable", () => { + let chunk = stream2.read(); if (!chunk) { return; } @@ -64956,18 +69957,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream3.on("end", () => { + stream2.on("end", () => { resolve8(pos); }); - stream3.on("error", reject); + stream2.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve8, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve8(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve8, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -64978,9 +69991,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_utils7(); + 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. */ @@ -64996,49 +70048,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url3; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + let url2; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; + url2 = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -65047,8 +70099,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -65057,8 +70109,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -65088,7 +70140,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -65097,76 +70149,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -65174,8 +70256,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -65183,9 +70264,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -65194,7 +70275,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -65211,9 +70295,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -65224,7 +70308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -65234,7 +70318,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -65245,17 +70329,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -65263,19 +70355,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -65285,19 +70379,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65307,13 +70409,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -65324,7 +70426,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -65336,14 +70438,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -65354,22 +70458,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65385,15 +70491,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -65403,15 +70511,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -65422,24 +70537,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65460,57 +70577,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * Example using copy cancellation: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -65518,15 +70636,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -65538,14 +70656,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -65555,36 +70673,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -65595,31 +70716,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -65627,12 +70749,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -65643,26 +70765,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -65676,8 +70801,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream3 = response.readableStreamBody; - await streamToBuffer(stream3, buffer2, off - offset, chunkEnd - offset); + 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 }); @@ -65685,7 +70810,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -65705,10 +70830,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -65723,7 +70851,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -65739,7 +70867,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -65751,21 +70879,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -65773,12 +70903,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -65790,18 +70920,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve8) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve8(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve8((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -65810,17 +70946,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve8) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve8((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. @@ -65828,8 +71014,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -65840,8 +71026,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -65854,8 +71040,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -65865,60 +71051,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -65929,40 +71120,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -65970,20 +71176,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65996,20 +71213,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -66018,29 +71237,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -66055,7 +71289,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -66069,74 +71303,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; + url2 = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -66148,8 +71397,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -66158,15 +71407,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -66182,26 +71448,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -66219,7 +71487,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -66230,32 +71498,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66280,22 +71564,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -66303,10 +71602,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -66324,7 +71623,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -66341,18 +71640,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -66363,30 +71663,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66394,20 +71696,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -66436,18 +71740,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -66474,7 +71778,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -66495,23 +71799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -66521,32 +71824,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -66572,15 +71875,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -66599,27 +71905,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream3, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + 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 tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream3, + const scheduler = new storage_common_1.BufferScheduler( + stream2, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -66637,50 +71943,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -66691,13 +72005,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -66705,23 +72019,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66730,21 +72046,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -66752,7 +72080,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -66760,19 +72088,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -66785,7 +72115,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -66796,32 +72126,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -66830,13 +72163,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -66846,7 +72181,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -66855,16 +72190,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -66872,22 +72209,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -66907,17 +72246,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -66926,94 +72263,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```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); * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * // 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()`: * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67039,13 +72361,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67055,17 +72380,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -67074,7 +72401,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67082,20 +72409,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67116,17 +72445,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -67136,94 +72463,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67232,7 +72553,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -67250,13 +72573,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67264,24 +72590,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -67289,12 +72617,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -67302,22 +72632,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67327,38 +72659,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_utils7(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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."); @@ -67369,15 +72735,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -67389,18 +72755,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -67420,7 +72786,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -67435,7 +72801,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -67450,6 +72816,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -67489,6 +72865,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve8(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -67505,11 +72883,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -67533,13 +72936,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -67551,13 +72954,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url3; + let url2; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url3 = urlOrBlobClient; + 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 BlobClient) { - url3 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url2 = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -67566,28 +72969,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url3, + url: url2, credential }, async () => { - await new BlobClient(url3, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url3; + let url2; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url3 = urlOrBlobClient; + 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; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url3 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url2 = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -67595,24 +72998,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url3, + url: url2, credential }, async () => { - await new BlobClient(url3, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -67625,9 +73036,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -67636,19 +73047,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -67657,23 +73068,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path16 = getURLPath(subRequest.url); + const path16 = (0, utils_common_js_1.getURLPath)(subRequest.url); if (!path16 || path16 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } @@ -67684,7 +73095,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -67701,7 +73112,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -67712,7 +73123,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -67723,18 +73134,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url3, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url2, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url3, getCoreClientOptions(pipeline)); - const path16 = getURLPath(url3); + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path16 = (0, utils_common_js_1.getURLPath)(url2); if (path16 && path16 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { @@ -67746,10 +73175,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -67760,7 +73189,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -67778,11 +73207,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -67790,17 +73233,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -67809,10 +73267,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -67829,7 +73289,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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. */ @@ -67838,48 +73326,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -67887,34 +73375,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -67931,7 +73437,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -67953,7 +73459,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67961,7 +73467,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67971,15 +73477,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * const content = "Hello world!"; * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); * ``` */ getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67987,12 +73505,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -68005,14 +73523,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -68020,8 +73542,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -68032,19 +73554,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68056,24 +73585,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -68086,7 +73615,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -68094,8 +73623,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -68144,29 +73673,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -68181,7 +73710,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -68195,7 +73724,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -68205,10 +73734,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -68220,14 +73749,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -68240,18 +73769,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -68260,23 +73809,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -68292,44 +73864,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -68337,64 +73891,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -68402,41 +73955,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -68455,7 +74011,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68472,17 +74031,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -68490,35 +74047,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -68526,118 +74070,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -68655,7 +74219,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68676,23 +74243,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -68712,18 +74283,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -68734,27 +74303,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -68764,53 +74317,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: - * - * ```js - * let i = 1; + * // 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 @@ -68818,11 +74372,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -68834,7 +74387,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -68853,7 +74408,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -68862,14 +74420,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -68881,7 +74439,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -68891,7 +74449,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -68901,18 +74459,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve8) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve8(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve8((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -68921,45 +74482,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve8) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve8((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -69063,6 +74657,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -69070,7 +74716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69117,12 +74763,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -69148,10 +74799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69168,13 +74831,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -69203,6 +74870,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -69224,44 +74907,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -69272,22 +74973,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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. @@ -69302,35 +75031,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url3, credentialOrPipeline, options) { + constructor(url2, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url3, pipeline); + super(url2, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -69341,22 +75070,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -69373,7 +75111,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -69387,47 +75125,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -69436,15 +75156,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -69454,14 +75174,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -69472,14 +75192,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -69487,7 +75207,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -69499,9 +75219,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -69522,23 +75248,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -69558,18 +75288,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -69580,27 +75308,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -69608,57 +75320,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // 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 @@ -69670,7 +75378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -69682,7 +75390,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -69701,7 +75411,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69717,45 +75430,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -69763,45 +75458,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientListContainers + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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}`); * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -69823,7 +75514,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -69835,17 +75526,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -69864,7 +75558,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69874,16 +75571,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -69897,19 +75594,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -69917,7 +75622,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69925,21 +75630,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -69947,7 +75653,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69955,66 +75661,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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; + } }); } }); @@ -70099,7 +75863,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70112,21 +75876,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -70154,9 +75928,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core15 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core15 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { constructor(contentLength) { @@ -70239,15 +76014,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -70258,15 +76035,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core15.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core15.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -70274,7 +76050,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70287,21 +76063,31 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -70329,9 +76115,14 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core15 = __importStar4(require_core()); - var http_client_1 = require_lib4(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core15 = __importStar2(require_core()); + var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -70339,14 +76130,12 @@ var require_requestUtils = __commonJS({ } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -70358,14 +76147,13 @@ var require_requestUtils = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8) => setTimeout(resolve8, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(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) { @@ -70374,12 +76162,12 @@ var require_requestUtils = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -70402,9 +76190,8 @@ var require_requestUtils = __commonJS({ throw Error(`${name} failed: ${errorMessage}`); }); } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3( name, method, @@ -70413,13 +76200,13 @@ var require_requestUtils = __commonJS({ delay2, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { + (error3) => { + if (error3 instanceof http_client_1.HttpClientError) { return { - statusCode: error4.statusCode, + statusCode: error3.statusCode, result: null, headers: {}, - error: error4 + error: error3 }; } else { return void 0; @@ -70428,13 +76215,155 @@ var require_requestUtils = __commonJS({ ); }); } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); }); } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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; } }); @@ -70442,7 +76371,7 @@ var require_requestUtils = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70455,21 +76384,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -70497,20 +76436,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core15 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs17 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core15 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs17 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream2.pipeline); yield pipeline(response.message, output); }); @@ -70612,10 +76554,10 @@ var require_downloadUtils = __commonJS({ }; exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const writeStream = fs17.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { + 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, () => { @@ -70635,17 +76577,16 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const archiveDescriptor = yield fs17.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", () => __awaiter4(this, void 0, void 0, function* () { + 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"]; @@ -70662,7 +76603,7 @@ var require_downloadUtils = __commonJS({ const count = Math.min(blockSize, length - offset); downloads.push({ offset, - promiseGetter: () => __awaiter4(this, void 0, void 0, function* () { + promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); }) }); @@ -70675,7 +76616,7 @@ var require_downloadUtils = __commonJS({ const progressFn = progress.onProgress(); const activeDownloads = []; let nextDownload; - const waitAndWrite = () => __awaiter4(this, void 0, void 0, function* () { + 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--; @@ -70699,9 +76640,8 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const retries = 5; let failures = 0; while (true) { @@ -70722,8 +76662,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { + 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}` }); @@ -70739,8 +76679,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { retryOptions: { // Override the timeout used when downloading each 4 MB chunk @@ -70784,8 +76724,7 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; const timeoutPromise = new Promise((resolve8) => { timeoutHandle = setTimeout(() => resolve8("timeout"), timeoutMs); @@ -70802,7 +76741,7 @@ var require_downloadUtils = __commonJS({ var require_options = __commonJS({ "node_modules/@actions/cache/lib/options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70815,23 +76754,34 @@ var require_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core15 = __importStar4(require_core()); + exports2.getUploadOptions = getUploadOptions; + exports2.getDownloadOptions = getDownloadOptions; + var core15 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -70856,7 +76806,6 @@ var require_options = __commonJS({ core15.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } - exports2.getUploadOptions = getUploadOptions; function getDownloadOptions(copy) { const result = { useAzureSdk: false, @@ -70898,7 +76847,6 @@ var require_options = __commonJS({ core15.debug(`Lookup only: ${result.lookupOnly}`); return result; } - exports2.getDownloadOptions = getDownloadOptions; } }); @@ -70907,7 +76855,9 @@ var require_config = __commonJS({ "node_modules/@actions/cache/lib/internal/config.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; + exports2.isGhes = isGhes; + exports2.getCacheServiceVersion = getCacheServiceVersion; + exports2.getCacheServiceURL = getCacheServiceURL; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); @@ -70916,13 +76866,11 @@ var require_config = __commonJS({ const isLocalHost = hostname.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } - exports2.isGhes = isGhes; function getCacheServiceVersion() { if (isGhes()) return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } - exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { const version = getCacheServiceVersion(); switch (version) { @@ -70934,7 +76882,6 @@ var require_config = __commonJS({ throw new Error(`Unsupported cache service version: ${version}`); } } - exports2.getCacheServiceURL = getCacheServiceURL; } }); @@ -70943,7 +76890,7 @@ var require_package2 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", - version: "4.1.0", + version: "5.0.1", preview: true, description: "Actions cache lib", keywords: [ @@ -70980,22 +76927,26 @@ var require_package2 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", + "@azure/core-rest-pipeline": "^1.22.0", + "@azure/storage-blob": "^12.29.1", semver: "^6.3.1" }, devDependencies: { - "@types/node": "^22.13.9", + "@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" } }; } @@ -71006,12 +76957,11 @@ 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 = void 0; + exports2.getUserAgentString = getUserAgentString; var packageJson = require_package2(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } - exports2.getUserAgentString = getUserAgentString; } }); @@ -71019,7 +76969,7 @@ var require_user_agent = __commonJS({ var require_cacheHttpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -71032,21 +76982,31 @@ var require_cacheHttpClient = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -71074,13 +77034,16 @@ var require_cacheHttpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core15 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var auth_1 = require_auth2(); - var fs17 = __importStar4(require("fs")); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache4; + var core15 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs17 = __importStar2(require("fs")); var url_1 = require("url"); - var utils = __importStar4(require_cacheUtils()); + var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); var downloadUtils_1 = require_downloadUtils(); var options_1 = require_options(); @@ -71113,11 +77076,11 @@ var require_cacheHttpClient = __commonJS({ return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); } function getCacheEntry(keys, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { @@ -71140,11 +77103,10 @@ var require_cacheHttpClient = __commonJS({ return cacheResult; }); } - exports2.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { @@ -71161,7 +77123,7 @@ Other caches with similar key:`); }); } function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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")) { @@ -71177,9 +77139,8 @@ Other caches with similar key:`); } }); } - exports2.downloadCache = downloadCache; function reserveCache(key, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -71187,24 +77148,23 @@ Other caches with similar key:`); version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); })); return response; }); } - exports2.reserveCache = reserveCache; function getContentRange(start, end) { return `bytes ${start}-${end}/*`; } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { core15.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})`, () => __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -71213,7 +77173,7 @@ Other caches with similar key:`); }); } function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); const fd = fs17.openSync(archivePath, "r"); @@ -71224,7 +77184,7 @@ Other caches with similar key:`); core15.debug("Awaiting all uploads"); let offset = 0; try { - yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -71235,8 +77195,8 @@ Other caches with similar key:`); start, end, autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); + }).on("error", (error3) => { + throw new Error(`Cache upload failed because file read failed with ${error3.message}`); }), start, end); } }))); @@ -71247,15 +77207,15 @@ Other caches with similar key:`); }); } function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); } function saveCache4(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { if (!signedUploadURL) { @@ -71277,7 +77237,6 @@ Other caches with similar key:`); } }); } - exports2.saveCache = saveCache4; } }); @@ -71449,7 +77408,7 @@ var require_binary_format_contract = __commonJS({ exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; var UnknownFieldHandler; (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = Symbol.for("protobuf-ts/unknown"); + 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 }); @@ -72374,7 +78333,7 @@ var require_message_type_contract = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); } }); @@ -72872,26 +78831,26 @@ var require_reflection_json_reader = __commonJS({ const fieldObj = target[localName]; for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { this.assert(jsonObjValue !== null, field.name + " map value", null); - let val2; + let val; switch (field.V.kind) { case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); + val = field.V.T().internalJsonRead(jsonObjValue, options); break; case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); break; } - this.assert(val2 !== void 0, field.name + " map value", jsonObjValue); + 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] = val2; + fieldObj[key] = val; } } else if (field.repeat) { if (jsonValue === null) @@ -72900,22 +78859,22 @@ var require_reflection_json_reader = __commonJS({ const fieldArr = target[localName]; for (const jsonItem of jsonValue) { this.assert(jsonItem !== null, field.name, null); - let val2; + let val; switch (field.kind) { case "message": - val2 = field.T().internalJsonRead(jsonItem, options); + val = field.T().internalJsonRead(jsonItem, options); break; case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); + val = this.scalar(jsonItem, field.T, field.L, field.name); break; } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); + this.assert(val !== void 0, field.name, jsonValue); + fieldArr.push(val); } } else { switch (field.kind) { @@ -72929,10 +78888,10 @@ var require_reflection_json_reader = __commonJS({ case "enum": if (jsonValue === null) continue; - let val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; - target[localName] = val2; + target[localName] = val; break; case "scalar": if (jsonValue === null) @@ -73082,8 +79041,8 @@ var require_reflection_json_reader = __commonJS({ break; return base64_1.base64decode(json2); } - } catch (error4) { - e = error4.message; + } catch (error3) { + e = error3.message; } this.assert(false, fieldName + (e ? " - " + e : ""), json2); } @@ -73137,26 +79096,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== void 0); + jsonObj[entryKey.toString()] = val; } break; } @@ -73168,26 +79127,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { - const val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== void 0); + jsonArr.push(val); } break; } @@ -73437,7 +79396,7 @@ var require_reflection_binary_reader = __commonJS({ let length = reader.uint32(); let end = reader.pos + length; let key = void 0; - let val2 = void 0; + let val = void 0; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -73450,13 +79409,13 @@ var require_reflection_binary_reader = __commonJS({ case 2: switch (field.V.kind) { case "scalar": - val2 = this.scalar(reader, field.V.T, field.V.L); + val = this.scalar(reader, field.V.T, field.V.L); break; case "enum": - val2 = reader.int32(); + val = reader.int32(); break; case "message": - val2 = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); break; } break; @@ -73468,19 +79427,19 @@ var require_reflection_binary_reader = __commonJS({ let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; } - if (val2 === void 0) + if (val === void 0) switch (field.V.kind) { case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); break; case "enum": - val2 = 0; + val = 0; break; case "message": - val2 = field.V.T().create(); + val = field.V.T().create(); break; } - return [key, val2]; + return [key, val]; } scalar(reader, type2, longType) { switch (type2) { @@ -73585,8 +79544,8 @@ var require_reflection_binary_writer = __commonJS({ break; case "map": assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); break; } } @@ -74156,18 +80115,18 @@ var require_enum_object = __commonJS({ } exports2.listEnumValues = listEnumValues; function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + return listEnumValues(enumObject).map((val) => val.name); } exports2.listEnumNames = listEnumNames; function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } exports2.listEnumNumbers = listEnumNumbers; } }); // node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ +var require_commonjs16 = __commonJS({ "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -74358,7 +80317,7 @@ var require_reflection_info2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function normalizeMethodInfo(method, service) { var _a, _b, _c; let m = method; @@ -74467,7 +80426,7 @@ var require_rpc_options = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function mergeRpcOptions(defaults, options) { if (!options) return defaults; @@ -74475,7 +80434,7 @@ var require_rpc_options = __commonJS({ copy(defaults, o); copy(options, o); for (let key of Object.keys(options)) { - let val2 = options[key]; + let val = options[key]; switch (key) { case "jsonOptions": o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); @@ -74489,7 +80448,7 @@ var require_rpc_options = __commonJS({ copy(options.meta, o.meta); break; case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); break; } } @@ -74581,9 +80540,9 @@ var require_deferred = __commonJS({ /** * Resolve the promise. Ignore if not pending. */ - resolvePending(val2) { + resolvePending(val) { if (this._state === DeferredState.PENDING) - this.resolve(val2); + this.resolve(val); } /** * Reject the promise. Ignore if not pending. @@ -74604,7 +80563,7 @@ var require_rpc_output_stream = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RpcOutputStreamController = void 0; var deferred_1 = require_deferred(); - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); var RpcOutputStreamController = class { constructor() { this._lis = { @@ -74654,12 +80613,12 @@ var require_rpc_output_stream = __commonJS({ * at a time. * Can be used to wrap a stream by using the other stream's `onNext`. */ - notifyNext(message, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); + 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 (error4) - this.notifyError(error4); + if (error3) + this.notifyError(error3); if (complete) this.notifyComplete(); } @@ -74679,12 +80638,12 @@ var require_rpc_output_stream = __commonJS({ * * Triggers onNext and onError callbacks. */ - notifyError(error4) { + notifyError(error3) { runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); + 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(); } /** @@ -74753,7 +80712,7 @@ var require_rpc_output_stream = __commonJS({ var require_unary_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/unary-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -74800,7 +80759,7 @@ var require_unary_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -74822,7 +80781,7 @@ var require_unary_call = __commonJS({ var require_server_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -74871,7 +80830,7 @@ var require_server_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -74892,7 +80851,7 @@ var require_server_streaming_call = __commonJS({ var require_client_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/client-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -74940,7 +80899,7 @@ var require_client_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -74961,7 +80920,7 @@ var require_client_streaming_call = __commonJS({ var require_duplex_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/duplex-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -75009,7 +80968,7 @@ var require_duplex_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -75029,7 +80988,7 @@ var require_duplex_streaming_call = __commonJS({ var require_test_transport = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/test-transport.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -75059,7 +81018,7 @@ var require_test_transport = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.TestTransport = void 0; var rpc_error_1 = require_rpc_error(); - var runtime_1 = require_commonjs11(); + 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(); @@ -75133,7 +81092,7 @@ var require_test_transport = __commonJS({ * not reject. If it does, code is broken. */ streamResponses(method, stream2, abort) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const messages = []; if (this.data.response === void 0) { messages.push(method.O.create()); @@ -75148,8 +81107,8 @@ var require_test_transport = __commonJS({ } try { yield delay2(this.responseDelay, abort)(void 0); - } catch (error4) { - stream2.notifyError(error4); + } catch (error3) { + stream2.notifyError(error3); return; } if (this.data.response instanceof rpc_error_1.RpcError) { @@ -75160,8 +81119,8 @@ var require_test_transport = __commonJS({ stream2.notifyMessage(msg); try { yield delay2(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream2.notifyError(error4); + } catch (error3) { + stream2.notifyError(error3); return; } } @@ -75303,7 +81262,7 @@ var require_rpc_interceptor = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.stackDuplexStreamingInterceptors = exports2.stackClientStreamingInterceptors = exports2.stackServerStreamingInterceptors = exports2.stackUnaryInterceptors = exports2.stackIntercept = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function stackIntercept(kind, transport, method, options, input) { var _a, _b, _c, _d; if (kind == "unary") { @@ -75427,7 +81386,7 @@ var require_server_call_context = __commonJS({ }); // node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs12 = __commonJS({ +var require_commonjs17 = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -75513,11 +81472,11 @@ var require_cachescope = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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", [ @@ -75589,11 +81548,11 @@ var require_cachemetadata = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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() { @@ -75655,17 +81614,17 @@ var require_cachemetadata = __commonJS({ }); // node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __commonJS({ +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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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() { @@ -76140,7 +82099,7 @@ var require_cache_twirp_client = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); + var cache_1 = require_cache3(); var CacheServiceClientJSON = class { constructor(rpc) { this.rpc = rpc; @@ -76208,11 +82167,12 @@ var require_cache_twirp_client = __commonJS({ }); // node_modules/@actions/cache/lib/internal/shared/util.js -var require_util10 = __commonJS({ +var require_util9 = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; var core_1 = require_core(); function maskSigUrl(url2) { if (!url2) @@ -76224,11 +82184,10 @@ var require_util10 = __commonJS({ (0, core_1.setSecret)(signature); (0, core_1.setSecret)(encodeURIComponent(signature)); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url2} ${error4 instanceof Error ? error4.message : String(error4)}`); + } 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"); @@ -76241,7 +82200,6 @@ var require_util10 = __commonJS({ maskSigUrl(body.signed_download_url); } } - exports2.maskSecretUrls = maskSecretUrls; } }); @@ -76249,7 +82207,7 @@ var require_util10 = __commonJS({ var require_cacheTwirpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -76277,16 +82235,16 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; + 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_auth2(); - var http_client_1 = require_lib4(); + 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 util_1 = require_util9(); var CacheServiceClient = class { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -76310,24 +82268,24 @@ var require_cacheTwirpClient = __commonJS({ // This function satisfies the Rpc interface. It is compatible with the JSON // JSON generated client. request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { + 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(() => __awaiter4(this, void 0, void 0, function* () { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { return this.httpClient.post(url2, JSON.stringify(data), headers); })); return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); } }); } retryableRequest(operation) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let attempt = 0; let errorMessage = ""; let rawBody = ""; @@ -76353,18 +82311,18 @@ var require_cacheTwirpClient = __commonJS({ } errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { + } catch (error3) { + if (error3 instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); } - if (error4 instanceof errors_1.UsageError) { - throw error4; + if (error3 instanceof errors_1.UsageError) { + throw error3; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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 = error4.message; + errorMessage = error3.message; } if (!isRetryable) { throw new Error(`Received non-retryable error: ${errorMessage}`); @@ -76398,7 +82356,7 @@ var require_cacheTwirpClient = __commonJS({ return retryableStatusCodes.includes(statusCode); } sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8) => setTimeout(resolve8, milliseconds)); }); } @@ -76418,7 +82376,6 @@ var require_cacheTwirpClient = __commonJS({ 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); } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; } }); @@ -76426,7 +82383,7 @@ var require_cacheTwirpClient = __commonJS({ var require_tar = __commonJS({ "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -76439,21 +82396,31 @@ var require_tar = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -76481,16 +82448,18 @@ var require_tar = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; + exports2.listTar = listTar; + exports2.extractTar = extractTar2; + exports2.createTar = createTar; var exec_1 = require_exec(); - var io7 = __importStar4(require_io3()); + var io7 = __importStar2(require_io()); var fs_1 = require("fs"); - var path16 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); + var path16 = __importStar2(require("path")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var IS_WINDOWS = process.platform === "win32"; function getTarPath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { switch (process.platform) { case "win32": { const gnuTar = yield utils.getGnuTarPathOnWindows(); @@ -76522,8 +82491,8 @@ var require_tar = __commonJS({ }; }); } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getTarArgs(tarPath_1, compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (tarPath, compressionMethod, type2, archivePath = "") { const args = [`"${tarPath.path}"`]; const cacheFileName = utils.getCacheFileName(compressionMethod); const tarFile = "cache.tar"; @@ -76553,8 +82522,8 @@ var require_tar = __commonJS({ return args; }); } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { let args; const tarPath = yield getTarPath(); const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); @@ -76576,7 +82545,7 @@ var require_tar = __commonJS({ return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); } function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + 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: @@ -76600,7 +82569,7 @@ var require_tar = __commonJS({ }); } function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -76625,51 +82594,48 @@ var require_tar = __commonJS({ }); } function execCommands(commands, cwd) { - return __awaiter4(this, void 0, void 0, function* () { + 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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + } 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commands = yield getCommands(compressionMethod, "list", archivePath); yield execCommands(commands); }); } - exports2.listTar = listTar; function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const workingDirectory = getWorkingDirectory(); yield io7.mkdirP(workingDirectory); const commands = yield getCommands(compressionMethod, "extract", archivePath); yield execCommands(commands); }); } - exports2.extractTar = extractTar2; function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { (0, fs_1.writeFileSync)(path16.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); } - exports2.createTar = createTar; } }); // node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ +var require_cache4 = __commonJS({ "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -76682,21 +82648,31 @@ var require_cache3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -76724,15 +82700,18 @@ var require_cache3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core15 = __importStar4(require_core()); - var path16 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; + var core15 = __importStar2(require_core()); + var path16 = __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_lib4(); + var http_client_1 = require_lib(); var ValidationError = class _ValidationError extends Error { constructor(message) { super(message); @@ -76781,9 +82760,8 @@ var require_cache3 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache4(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCache4(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)(); core15.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -76796,9 +82774,8 @@ var require_cache3 = __commonJS({ } }); } - exports2.restoreCache = restoreCache4; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; core15.debug("Resolved Keys:"); @@ -76834,29 +82811,29 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core15.info("Cache restored successfully"); return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core15.error(`Failed to restore: ${error4.message}`); + core15.error(`Failed to restore: ${error3.message}`); } else { - core15.warning(`Failed to restore: ${error4.message}`); + core15.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core15.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core15.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; @@ -76904,15 +82881,15 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core15.info("Cache restored successfully"); return response.matchedKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core15.error(`Failed to restore: ${error4.message}`); + core15.error(`Failed to restore: ${error3.message}`); } else { - core15.warning(`Failed to restore: ${error4.message}`); + core15.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -76920,15 +82897,15 @@ var require_cache3 = __commonJS({ if (archivePath) { yield utils.unlinkFile(archivePath); } - } catch (error4) { - core15.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core15.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function saveCache4(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function saveCache4(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core15.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -76942,10 +82919,9 @@ var require_cache3 = __commonJS({ } }); } - exports2.saveCache = saveCache4; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { + function saveCacheV1(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + var _a, _b, _c, _d, _e; const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); @@ -76983,10 +82959,10 @@ var require_cache3 = __commonJS({ } core15.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else if (typedError.name === ReserveCacheError2.name) { core15.info(`Failed to save: ${typedError.message}`); } else { @@ -76999,15 +82975,15 @@ var require_cache3 = __commonJS({ } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core15.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core15.debug(`Failed to delete archive: ${error3}`); } } return cacheId; }); } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: true }); const compressionMethod = yield utils.getCompressionMethod(); const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); @@ -77045,8 +83021,8 @@ var require_cache3 = __commonJS({ throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core15.debug(`Failed to reserve cache: ${error4}`); + } catch (error3) { + core15.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } core15.debug(`Attempting to upload cache located at: ${archivePath}`); @@ -77065,10 +83041,10 @@ var require_cache3 = __commonJS({ throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`); } cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else if (typedError.name === ReserveCacheError2.name) { core15.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { @@ -77083,8 +83059,8 @@ var require_cache3 = __commonJS({ } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core15.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core15.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -77093,432 +83069,129 @@ var require_cache3 = __commonJS({ } }); -// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a; 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 fs17 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); - _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs17.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path16.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 = path16.dirname(filePath); - const upperName = path16.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path16.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; - } - } - } - } + exports2.toCommandProperties = exports2.toCommandValue = void 0; + function toCommandValue(input) { + if (input === null || input === void 0) { return ""; - }); - } - exports2.tryGetExecutablePath = tryGetExecutablePath; - function normalizeSeparators(p) { - p = p || ""; - if (exports2.IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - return p.replace(/\\\\+/g, "\\"); + } else if (typeof input === "string" || input instanceof String) { + return input; } - 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(); + return JSON.stringify(input); } - function getCmdPath() { - var _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + 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.getCmdPath = getCmdPath; + exports2.toCommandProperties = toCommandProperties; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 path16 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); - function cp(source, dest, options = {}) { - return __awaiter4(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 ? path16.join(dest, path16.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 (path16.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path16.join(dest, path16.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(path16.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - exports2.mv = mv; - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); + exports2.issue = exports2.issueCommand = void 0; + var os5 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os5.EOL); } - exports2.mkdirP = mkdirP; - function which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which7(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.issueCommand = issueCommand; + function issue(name, message = "") { + issueCommand(name, {}, message); } - exports2.which = which7; - function findInPath(tool) { - return __awaiter4(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(path16.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(path16.sep)) { - return []; + exports2.issue = issue; + var CMD_STRING = "::"; + var Command = class { + constructor(command, properties, message) { + if (!command) { + command = "missing.command"; } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path16.delimiter)) { - if (p) { - directories.push(p); + 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)}`; + } } } } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path16.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); + 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 copyFile(srcFile, destFile, force) { - return __awaiter4(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); - } - }); + 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/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -77531,125 +83204,51 @@ var require_manifest = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os5 = require("os"); - var cp = require("child_process"); - var fs17 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os5.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os5.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; - } - } - } + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto3 = __importStar2(require("crypto")); + var fs17 = __importStar2(require("fs")); + var os5 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - return version; + if (!fs17.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs17.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os5.EOL}`, { + encoding: "utf8" + }); } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs17.existsSync(lsbReleaseFile)) { - contents = fs17.readFileSync(lsbReleaseFile).toString(); - } else if (fs17.existsSync(osReleaseFile)) { - contents = fs17.readFileSync(osReleaseFile).toString(); + 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}"`); } - return contents; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; } - exports2._readLinuxVersionFile = _readLinuxVersionFile; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); @@ -77739,7 +83338,7 @@ var require_proxy4 = __commonJS({ var require_lib5 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -77752,21 +83351,21 @@ var require_lib5 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -77795,10 +83394,10 @@ var require_lib5 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -77873,8 +83472,8 @@ var require_lib5 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -77886,8 +83485,8 @@ var require_lib5 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -77944,42 +83543,42 @@ var require_lib5 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -77988,14 +83587,14 @@ var require_lib5 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -78004,7 +83603,7 @@ var require_lib5 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -78013,7 +83612,7 @@ var require_lib5 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -78027,7 +83626,7 @@ var require_lib5 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -78101,7 +83700,7 @@ var require_lib5 = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8, reject) => { function callbackForResult(err, res) { if (err) { @@ -78267,98 +83866,594 @@ var require_lib5 = __commonJS({ } 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; + _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((resolve8) => setTimeout(() => resolve8(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve8(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 { + resolve8(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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_auth3(); + 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 _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.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/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 (_a) { + 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(); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); - }); + /** + * 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(); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve8(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 { - resolve8(response); - } - })); - }); + /** + * 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(); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78371,127 +84466,66 @@ var require_retry_helper = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 core15 = __importStar4(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 __awaiter4(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; - } - core15.info(err.message); - } - const seconds = this.getSleepAmount(); - core15.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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => setTimeout(resolve8, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path16 = __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, path16.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js +var require_io_util3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -78518,650 +84552,401 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; + var _a; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core15 = __importStar4(require_core()); - var io7 = __importStar4(require_io4()); - var crypto2 = __importStar4(require("crypto")); - var fs17 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os5 = __importStar4(require("os")); - var path16 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver8 = __importStar4(require_semver2()); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(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 userAgent = "actions/tool-cache"; - function downloadTool2(url2, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path16.join(_getTempDirectory(), crypto2.randomUUID()); - yield io7.mkdirP(path16.dirname(dest)); - core15.debug(`Downloading ${url2}`); - core15.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url2, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } + 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 fs17 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs17.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; } - return true; - }); + throw err; + } + return true; }); } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url2, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs17.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core15.debug("set auth"); - if (headers === void 0) { - headers = {}; + 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}`); } - headers.authorization = auth; - } - const response = yield http.get(url2, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core15.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; } - const pipeline = util.promisify(stream2.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs17.createWriteStream(dest)); - core15.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core15.debug("download failed"); - try { - yield io7.rmRF(dest); - } catch (err) { - core15.debug(`Failed to delete '${dest}'. ${err.message}`); + if (stats && stats.isFile()) { + if (exports2.IS_WINDOWS) { + const upperExt = path16.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } else { + if (isUnixExecutable(stats)) { + return filePath; } } } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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) { + const originalFilePath = filePath; + for (const extension of extensions) { + filePath = originalFilePath + extension; + stats = void 0; try { - const logLevel = core15.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); + stats = yield exports2.stat(filePath); + } catch (err) { + if (err.code !== "ENOENT") { + console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`); + } } - } else { - const escapedScript = path16.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 io7.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); + if (stats && stats.isFile()) { + if (exports2.IS_WINDOWS) { + try { + const directory = path16.dirname(filePath); + const upperName = path16.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path16.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 dest; + return ""; }); } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core15.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() - } - }); - core15.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core15.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"); + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js +var require_io3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - args.push("-C", destArg, "-f", fileArg); - yield (0, exec_1.exec)(`tar`, args); - return dest; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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]; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - args.push("-x", "-C", dest, "-f", file); - if (core15.isDebug()) { - args.push("-v"); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - const xarPath = yield io7.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); + }; + 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 path16 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); + 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; } - dest = yield _createExtractFolder(dest); - if (IS_WINDOWS) { - yield extractZipWin(file, dest); - } else { - yield extractZipNix(file, dest); + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path16.join(dest, path16.basename(source)) : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); } - return dest; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io7.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 - ]; - core15.debug(`Using pwsh at path: ${pwshPath}`); - yield (0, exec_1.exec)(`"${pwshPath}"`, args); + 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 { - 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 io7.which("powershell", true); - core15.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); + if (path16.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); } }); } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io7.which("unzip", true); - const args = [file]; - if (!core15.isDebug()) { - args.unshift("-q"); + 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 = path16.join(dest, path16.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"); + } + } } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + yield mkdirP(path16.dirname(dest)); + yield ioUtil.rename(source, dest); }); } - function cacheDir(sourceDir, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os5.arch(); - core15.debug(`Caching tool ${tool} ${version} ${arch2}`); - core15.debug(`source dir: ${sourceDir}`); - if (!fs17.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); + 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'); + } } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs17.readdirSync(sourceDir)) { - const s = path16.join(sourceDir, itemName); - yield io7.cp(s, destPath, { recursive: true }); + 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}`); } - _completeToolPath(tool, version, arch2); - return destPath; }); } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os5.arch(); - core15.debug(`Caching tool ${tool} ${version} ${arch2}`); - core15.debug(`source file: ${sourceFile}`); - if (!fs17.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path16.join(destFolder, targetFile); - core15.debug(`destination file ${destPath}`); - yield io7.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); - return destFolder; + 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.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch2) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch2 = arch2 || os5.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path16.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core15.debug(`checking cache: ${cachePath}`); - if (fs17.existsSync(cachePath) && fs17.existsSync(`${cachePath}.complete`)) { - core15.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); - toolPath = cachePath; - } else { - core15.debug("not found"); + exports2.mkdirP = mkdirP; + function which7(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch2) { - const versions = []; - arch2 = arch2 || os5.arch(); - const toolPath = path16.join(_getCacheDirectory(), toolName); - if (fs17.existsSync(toolPath)) { - const children = fs17.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path16.join(toolPath, child, arch2 || ""); - if (fs17.existsSync(fullPath) && fs17.existsSync(`${fullPath}.complete`)) { - versions.push(child); + if (check) { + const result = yield which7(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; } - } - return versions; + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core15.debug("set auth"); - headers.authorization = auth; + exports2.which = which7; + function findInPath(tool) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - const response = yield http.getJson(treeUrl, headers); - if (!response.result) { - return releases; + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { + for (const extension of process.env["PATHEXT"].split(path16.delimiter)) { + if (extension) { + extensions.push(extension); + } + } } - let manifestUrl = ""; - for (const item of response.result.tree) { - if (item.path === "versions-manifest.json") { - manifestUrl = item.url; - break; + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; } + return []; } - 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 (_a) { - core15.debug("Invalid json"); + if (tool.includes(path16.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path16.delimiter)) { + if (p) { + directories.push(p); + } } } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os5.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path16.join(_getTempDirectory(), crypto2.randomUUID()); + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path16.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } } - yield io7.mkdirP(dest); - return dest; - }); - } - function _createToolPath(tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path16.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - core15.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io7.rmRF(folderPath); - yield io7.rmRF(markerPath); - yield io7.mkdirP(folderPath); - return folderPath; + return matches; }); } - function _completeToolPath(tool, version, arch2) { - const folderPath = path16.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - const markerPath = `${folderPath}.complete`; - fs17.writeFileSync(markerPath, ""); - core15.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core15.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core15.debug(`explicit? ${valid3}`); - return valid3; + 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 }; } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core15.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; + 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 copyFile(srcFile, destFile, force); + } } - return -1; + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core15.debug(`matched: ${version}`); - } else { - core15.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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/@actions/http-client/lib/proxy.js -var require_proxy5 = __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 (_a) { - 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]"); + function copyFile(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); + } + }); } - 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/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -79189,1140 +84974,547 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(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", () => { - resolve8(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve8(Buffer.concat(chunks)); - }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os5 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + _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}`; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - } 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(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve8(res); - } + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info6.httpModule.request(info6.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: ${info6.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 info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } - } - return info6; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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 _default2; - } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; - } + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; } } - 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; + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os5.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os5.EOL.length); + n = s.indexOf(os5.EOL); } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - if (clientHeader !== void 0) { - return clientHeader; - } - return _default2; } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } } - if (!useProxy) { - agent = this._agent; + 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]; + } } - if (agent) { - return agent; + return this.args; + } + _endsWith(str2, end) { + return str2.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); } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (!arg) { + return '""'; } - 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; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; + if (!needsQuotes) { + return arg; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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; + } } - return agent; + reverse += '"'; + return reverse.split("").reverse().join(""); } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - if (proxyAgent) { - return proxyAgent; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - 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 - }); + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; } - return proxyAgent; + 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(""); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); - }); + _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; } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve8(response); + _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 = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io7.which(this.toolPath, true); + return new Promise((resolve8, 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}`); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os5.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); } - } - return value; + 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 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); + 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); } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { + 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); + } + }); + }); } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; + 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 { - msg = `Failed request: (${statusCode})`; + resolve8(exitCode); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve8(response); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } })); }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ - "node_modules/follow-redirects/debug.js"(exports2, module2) { - var debug5; - module2.exports = function() { - if (!debug5) { - try { - debug5 = require_src()("follow-redirects"); - } catch (error4) { - } - if (typeof debug5 !== "function") { - debug5 = function() { - }; - } - } - debug5.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 https2 = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug5 = require_debug2(); - (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 (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; - } - 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 || noop; - 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._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); - }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); - return this; - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString(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); + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } - self2._timeout = setTimeout(function() { - self2.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); + arg += c; + escaped = false; } - function clearTimer() { - if (self2._timeout) { - clearTimeout(self2._timeout); - self2._timeout = null; + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); + } + continue; } - self2.removeListener("abort", clearTimer); - self2.removeListener("error", clearTimer); - self2.removeListener("response", clearTimer); - self2.removeListener("close", clearTimer); - if (callback) { - self2.removeListener("timeout", callback); + if (c === "\\" && escaped) { + append(c); + continue; } - if (!self2.socket) { - self2._currentRequest.removeListener("socket", startTimer); + if (c === "\\" && inQuotes) { + escaped = true; + continue; } + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; + } + append(c); } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); + if (arg.length > 0) { + args.push(arg.trim()); } - 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]; + 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"); } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - }; - RedirectableRequest.prototype._performRequest = function() { - var protocol = this._options.protocol; - var nativeProtocol = this._options.nativeProtocols[protocol]; - if (!nativeProtocol) { - throw new TypeError("Unsupported protocol " + protocol); + _debug(message) { + this.emit("debug", message); } - if (this._options.agents) { - var scheme = protocol.slice(0, -1); - this._options.agent = this._options.agents[scheme]; + _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); } - var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); + 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(); } - 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(error4) { - if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self2._ended) { - request.end(); - } - } - })(); + }; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/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; }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); }); } - 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 = parseUrl(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); - debug5("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(/^(?:(?:proxy-)?authorization|cookie)$/i, 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 request(input, options, callback) { - if (isURL(input)) { - input = spreadUrlObject(input); - } else if (isString(input)) { - input = spreadUrlObject(parseUrl(input)); - } else { - callback = options; - options = validateUrl(input); - input = { protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug5("options", options); - return new RedirectableRequest(options, callback); } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - return exports3; - } - function noop() { - } - function parseUrl(input) { - var parsed; - if (useNativeURL) { - parsed = new URL2(input); - } else { - parsed = validateUrl(url2.parse(input)); - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - } - return parsed; - } - function resolveUrl(relative2, base) { - return useNativeURL ? new URL2(relative2, base) : parseUrl(url2.resolve(base, relative2)); - } - 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 + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + function exec(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(); }); - return CustomError; - } - function destroyRequest(request, error4) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.destroy(error4); - } - function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - function isString(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; + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); } - module2.exports = wrap({ http, https: https2 }); - module2.exports.wrap = wrap; + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80335,64 +85527,113 @@ var require_internal_glob_options_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core15 = __importStar4(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; - core15.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core15.debug(`implicitDescendants '${result.implicitDescendants}'`); - } - if (typeof copy.matchDirectories === "boolean") { - result.matchDirectories = copy.matchDirectories; - core15.debug(`matchDirectories '${result.matchDirectories}'`); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core15.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (typeof copy.excludeHiddenFiles === "boolean") { - result.excludeHiddenFiles = copy.excludeHiddenFiles; - core15.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; + 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 exec = __importStar2(require_exec3()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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.getOptions = getOptions; + exports2.getDetails = getDetails; } }); -// node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80405,145 +85646,223 @@ var require_internal_path_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path16 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - let result = path16.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; - } - exports2.dirname = dirname3; - 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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - 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)}`; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } 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)}`; } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve8(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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os5 = __importStar2(require("os")); + var path16 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable8(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, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + (0, command_1.issueCommand)("set-env", { name }, convertedVal); + } + exports2.exportVariable = exportVariable8; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); } else { - root += path16.sep; + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return root + itemPath; + process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - 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); + exports2.addPath = addPath; + 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}`); } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - 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); + if (options && options.trimWhitespace === false) { + return val; } - return itemPath.startsWith("/"); + return val.trim(); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + 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 p.replace(/\/\/+/g, "/"); + return inputs.map((input) => input.trim()); } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; - } - p = normalizeSeparators(p); - if (!p.endsWith(path16.sep)) { - return p; - } - if (p === path16.sep) { - return p; + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + process.stdout.write(os5.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning10(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning10; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os5.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return p.substr(0, p.length - 1); + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind2 = __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 = {})); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80556,81 +85875,133 @@ var require_internal_pattern_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(require_internal_path_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - 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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - const result = []; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - if (searchPathMap[key] === "included") { - continue; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os5 = require("os"); + var cp = require("child_process"); + var fs17 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os5.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } + } + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); } - exports2.getSearchPaths = getSearchPaths; - function match(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); + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os5.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 result; + return version; } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs17.existsSync(lsbReleaseFile)) { + contents = fs17.readFileSync(lsbReleaseFile).toString(); + } else if (fs17.existsSync(osReleaseFile)) { + contents = fs17.readFileSync(osReleaseFile).toString(); + } + return contents; } - exports2.partialMatch = partialMatch; + exports2._readLinuxVersionFile = _readLinuxVersionFile; } }); -// node_modules/@actions/glob/lib/internal-path.js -var require_internal_path2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80643,95 +86014,100 @@ var require_internal_path2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path16 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(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(path16.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path16.basename(remaining); - this.segments.unshift(basename); - 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(path16.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path16.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; + function step(result) { + result.done ? resolve8(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 core15 = __importStar2(require_core3()); + 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; + } + core15.info(err.message); + } + const seconds = this.getSleepAmount(); + core15.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((resolve8) => setTimeout(resolve8, seconds * 1e3)); + }); } }; - exports2.Path = Path; + exports2.RetryHelper = RetryHelper; } }); -// node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80744,674 +86120,1081 @@ var require_internal_pattern2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os5 = __importStar4(require("os")); - var path16 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(require("assert")); - var minimatch_1 = require_minimatch(); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_path_1 = require_internal_path2(); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core15 = __importStar2(require_core3()); + var io7 = __importStar2(require_io3()); + var crypto3 = __importStar2(require("crypto")); + var fs17 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os5 = __importStar2(require("os")); + var path16 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver9 = __importStar2(require_semver2()); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + 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 Pattern = class _Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir2) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url2, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path16.join(_getTempDirectory(), crypto3.randomUUID()); + yield io7.mkdirP(path16.dirname(dest)); + core15.debug(`Downloading ${url2}`); + core15.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 || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; + }); + }); + } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url2, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs17.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false + }); + if (auth) { + core15.debug("set auth"); + if (headers === void 0) { + headers = {}; + } + headers.authorization = auth; + } + const response = yield http.get(url2, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core15.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream2.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs17.createWriteStream(dest)); + core15.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core15.debug("download failed"); + try { + yield io7.rmRF(dest); + } catch (err) { + core15.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 = core15.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } } 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}`; + const escapedScript = path16.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 io7.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - while (pattern.startsWith("!")) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); } - pattern = _Pattern.fixupPattern(pattern, homedir2); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path16.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(path16.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path16.sep}`; + dest = yield _createExtractFolder(dest); + core15.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() } + }); + core15.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; } else { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + args = [flags]; + } + if (core15.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 (core15.isDebug()) { + args.push("-v"); + } + const xarPath = yield io7.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io7.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 + ]; + core15.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 io7.which("powershell", true); + core15.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 io7.which("unzip", true); + const args = [file]; + if (!core15.isDebug()) { + args.unshift("-q"); + } + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os5.arch(); + core15.debug(`Caching tool ${tool} ${version} ${arch2}`); + core15.debug(`source dir: ${sourceDir}`); + if (!fs17.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); + } + const destPath = yield _createToolPath(tool, version, arch2); + for (const itemName of fs17.readdirSync(sourceDir)) { + const s = path16.join(sourceDir, itemName); + yield io7.cp(s, destPath, { recursive: true }); + } + _completeToolPath(tool, version, arch2); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os5.arch(); + core15.debug(`Caching tool ${tool} ${version} ${arch2}`); + core15.debug(`source file: ${sourceFile}`); + if (!fs17.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); + } + const destFolder = yield _createToolPath(tool, version, arch2); + const destPath = path16.join(destFolder, targetFile); + core15.debug(`destination file ${destPath}`); + yield io7.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch2); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch2) { + if (!toolName) { + throw new Error("toolName parameter is required"); + } + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); + } + arch2 = arch2 || os5.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch2); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path16.join(_getCacheDirectory(), toolName, versionSpec, arch2); + core15.debug(`checking cache: ${cachePath}`); + if (fs17.existsSync(cachePath) && fs17.existsSync(`${cachePath}.complete`)) { + core15.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + toolPath = cachePath; + } else { + core15.debug("not found"); + } + } + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch2) { + const versions = []; + arch2 = arch2 || os5.arch(); + const toolPath = path16.join(_getCacheDirectory(), toolName); + if (fs17.existsSync(toolPath)) { + const children = fs17.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path16.join(toolPath, child, arch2 || ""); + if (fs17.existsSync(fullPath) && fs17.existsSync(`${fullPath}.complete`)) { + versions.push(child); + } + } + } + } + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core15.debug("set auth"); + headers.authorization = auth; + } + 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 (_a) { + core15.debug("Invalid json"); + } + } + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os5.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path16.join(_getTempDirectory(), crypto3.randomUUID()); } - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + yield io7.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + core15.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io7.rmRF(folderPath); + yield io7.rmRF(markerPath); + yield io7.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch2) { + const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const markerPath = `${folderPath}.complete`; + fs17.writeFileSync(markerPath, ""); + core15.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core15.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core15.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core15.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - 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, "[*]"); + if (version) { + core15.debug(`matched: ${version}`); + } else { + core15.debug("match not found"); } - /** - * 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(`.${path16.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { - homedir2 = homedir2 || os5.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 version; + } + exports2.evaluateVersions = evaluateVersions; + 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; } - 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } - } - } - literal += c; + 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 literal; - } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); + return true; } + return a !== a && b !== b; }; - exports2.Pattern = Pattern; } }); -// node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state2 = __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(path16, level) { - this.path = path16; - this.level = level; +// node_modules/follow-redirects/debug.js +var require_debug3 = __commonJS({ + "node_modules/follow-redirects/debug.js"(exports2, module2) { + var debug5; + module2.exports = function() { + if (!debug5) { + try { + debug5 = require_src()("follow-redirects"); + } catch (error3) { + } + if (typeof debug5 !== "function") { + debug5 = function() { + }; + } } + debug5.apply(null, arguments); }; - exports2.SearchState = SearchState; } }); -// node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-globber.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; +// 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 https2 = require("https"); + var Writable = require("stream").Writable; + var assert = require("assert"); + var debug5 = 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."); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + })(); + var useNativeURL = false; + try { + assert(new URL2("")); + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; + } + 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 __importStar4 = 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)) __createBinding4(result, mod, k); + 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 || noop; + 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); } - __setModuleDefault4(result, mod); - return result; + var self2 = this; + this._onNativeResponse = function(response) { + try { + self2._processResponse(response); + } catch (cause) { + self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); + } + }; + this._performRequest(); + } + RedirectableRequest.prototype = Object.create(Writable.prototype); + RedirectableRequest.prototype.abort = function() { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + 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(); } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!isString(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(); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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(); + } }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; + RedirectableRequest.prototype.end = function(data, encoding, callback) { + if (isFunction(data)) { + callback = data; + data = encoding = null; + } else if (isFunction(encoding)) { + callback = encoding; + encoding = null; } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); + 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; } }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); + RedirectableRequest.prototype.setHeader = function(name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + 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 resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + function startTimer(socket) { + if (self2._timeout) { + clearTimeout(self2._timeout); } + self2._timeout = setTimeout(function() { + self2.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + 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); + } } - function fulfill(value) { - resume("next", value); + if (callback) { + this.on("timeout", callback); } - function reject(value) { - resume("throw", value); + if (this.socket) { + startTimer(this.socket); + } else { + this._currentRequest.once("socket", startTimer); } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + 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 (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); + } } }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core15 = __importStar4(require_core()); - var fs17 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper2()); - var path16 = __importStar4(require("path")); - var patternHelper = __importStar4(require_internal_pattern_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_pattern_1 = require_internal_pattern2(); - var internal_search_state_1 = require_internal_search_state2(); - var IS_WINDOWS = process.platform === "win32"; - var DefaultGlobber = class _DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); + RedirectableRequest.prototype._performRequest = function() { + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + throw new TypeError("Unsupported protocol " + protocol); } - getSearchPaths() { - return this.searchPaths.slice(); + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; } - glob() { - var _a, e_1, _b, _c; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _d = true, _e = __asyncValues4(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); } - globGenerator() { - return __asyncGenerator4(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)) { - core15.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs17.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (options.excludeHiddenFiles && path16.basename(item.path).match(/^\./)) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; + 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 (request === self2._currentRequest) { + if (error3) { + self2.emit("error", error3); + } else if (i < buffers.length) { + var buffer = buffers[i++]; + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs17.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path16.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); + } else if (self2._ended) { + request.end(); } } - }); + })(); } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter4(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; + }; + RedirectableRequest.prototype._processResponse = function(response) { + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode }); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs17.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core15.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 fs17.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs17.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core15.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; - } - traversalChain.push(realPath); - } - return stats; - }); + 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; } - }; - 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 __createBinding4 = 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]; - } }; + destroyRequest(this._currentRequest); + response.destroy(); + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + 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); } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + var currentUrlParts = parseUrl(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); + debug5("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(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); + 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(); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = void 0; - var crypto2 = __importStar4(require("crypto")); - var core15 = __importStar4(require_core()); - var fs17 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var path16 = __importStar4(require("path")); - function hashFiles2(globber, currentWorkspace, verbose = false) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const writeDelegate = verbose ? core15.info : core15.debug; - let hasMatch = false; - const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const result = crypto2.createHash("sha256"); - let count = 0; - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path16.sep}`)) { - writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); - continue; - } - if (fs17.statSync(file).isDirectory()) { - writeDelegate(`Skip directory '${file}'.`); - continue; - } - const hash2 = crypto2.createHash("sha256"); - const pipeline = util.promisify(stream2.pipeline); - yield pipeline(fs17.createReadStream(file), hash2); - result.write(hash2.digest()); - count++; - if (!hasMatch) { - hasMatch = true; - } + 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 request(input, options, callback) { + if (isURL(input)) { + input = spreadUrlObject(input); + } else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } else { + callback = options; + options = validateUrl(input); + input = { protocol }; } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; + if (isFunction(options)) { + callback = options; + options = null; + } + options = Object.assign({ + maxRedirects: exports3.maxRedirects, + maxBodyLength: exports3.maxBodyLength + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; } + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug5("options", options); + return new RedirectableRequest(options, callback); } - result.end(); - if (hasMatch) { - writeDelegate(`Found ${count} files to hash.`); - return result.digest("hex"); - } else { - writeDelegate(`No matches found for glob`); - return ""; + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; } + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true } + }); }); + return exports3; } - exports2.hashFiles = hashFiles2; - } -}); - -// node_modules/@actions/glob/lib/glob.js -var require_glob2 = __commonJS({ - "node_modules/@actions/glob/lib/glob.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + function noop() { + } + function parseUrl(input) { + var parsed; + if (useNativeURL) { + parsed = new URL2(input); + } else { + parsed = validateUrl(url2.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + return parsed; + } + function resolveUrl(relative2, base) { + return useNativeURL ? new URL2(relative2, base) : parseUrl(url2.resolve(base, relative2)); + } + 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]; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + } + 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); } - function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + 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 } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = exports2.create = void 0; - var internal_globber_1 = require_internal_globber2(); - var internal_hash_files_1 = require_internal_hash_files(); - function create2(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); }); + return CustomError; } - exports2.create = create2; - function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { - return __awaiter4(this, void 0, void 0, function* () { - let followSymbolicLinks = true; - if (options && typeof options.followSymbolicLinks === "boolean") { - followSymbolicLinks = options.followSymbolicLinks; - } - const globber = yield create2(patterns, { followSymbolicLinks }); - return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); - }); + function destroyRequest(request, error3) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error3); } - exports2.hashFiles = hashFiles2; + function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); + } + function isString(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; + } + module2.exports = wrap({ http, https: https2 }); + module2.exports.wrap = wrap; } }); @@ -84328,7 +90111,7 @@ var path2 = __toESM(require("path")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var fs = __toESM(require("fs")); @@ -84336,8 +90119,7 @@ var fsPromises = __toESM(require("fs/promises")); var os = __toESM(require("os")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -84354,14 +90136,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs17.lstat(itemPath, { bigint: true }) : await fs17.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs17.lstat(itemPath, { bigint: true }) : await fs17.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 fs17.readdir(itemPath) : await fs17.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs17.readdir(itemPath) : await fs17.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -84372,13 +90154,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -85258,6 +91040,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -85377,7 +91171,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -85417,16 +91211,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -86992,9 +92777,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -87091,7 +92876,7 @@ function getCgroupMemoryLimitBytes(limitFile, logger) { ); return limit; } -function getMemoryFlagValue(userInput, logger) { +function getCodeQLMemoryLimit(userInput, logger) { return getMemoryFlagValueForPlatform( userInput, getTotalMemoryBytes(logger), @@ -87099,7 +92884,7 @@ function getMemoryFlagValue(userInput, logger) { ); } function getMemoryFlag(userInput, logger) { - const megabytes = getMemoryFlagValue(userInput, logger); + const megabytes = getCodeQLMemoryLimit(userInput, logger); return `--ram=${megabytes}`; } function getThreadsFlagValue(userInput, logger) { @@ -87378,11 +93163,11 @@ function parseMatrixInput(matrixInput) { } return JSON.parse(matrixInput); } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } async function checkDiskUsage(logger) { try { @@ -87405,22 +93190,22 @@ async function checkDiskUsage(logger) { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, numTotalBytes: diskUsage.blocks * blockSizeInBytes }; - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to check available disk space: ${getErrorMessage(error4)}` + `Failed to check available disk space: ${getErrorMessage(error3)}` ); return void 0; } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + 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 === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( + 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.11" + ">=3.20" )) { - core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + core3.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/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } @@ -87464,7 +93249,7 @@ async function asyncSome(array, predicate) { } function unsafeEntriesInvariant(object) { return Object.entries(object).filter( - ([_, val2]) => val2 !== void 0 + ([_, val]) => val !== void 0 ); } @@ -87718,7 +93503,7 @@ var SarifScanOrder = [CodeQuality, CodeScanning]; var fs12 = __toESM(require("fs")); var path12 = __toESM(require("path")); var import_perf_hooks2 = require("perf_hooks"); -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); // src/autobuild.ts var core11 = __toESM(require_core()); @@ -87791,17 +93576,17 @@ function getAuthorizationHeaderFor(logger, apiDetails, url2) { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -87923,7 +93708,7 @@ function wrapApiConfigurationError(e) { // src/codeql.ts var fs11 = __toESM(require("fs")); -var path10 = __toESM(require("path")); +var path11 = __toESM(require("path")); var core10 = __toESM(require_core()); var toolrunner3 = __toESM(require_toolrunner()); @@ -87957,19 +93742,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -87985,9 +93770,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -88169,9 +93954,10 @@ function wrapCliConfigurationError(cliError) { // src/config-utils.ts var fs6 = __toESM(require("fs")); -var path6 = __toESM(require("path")); +var path7 = __toESM(require("path")); // src/caching-utils.ts +var crypto2 = __toESM(require("crypto")); var core6 = __toESM(require_core()); async function getTotalCacheSize(paths, logger, quiet = false) { const sizes = await Promise.all( @@ -88182,6 +93968,11 @@ async function getTotalCacheSize(paths, logger, quiet = false) { function shouldStoreCache(kind) { return kind === "full" /* Full */ || kind === "store" /* Store */; } +var cacheKeyHashLength = 16; +function createCacheKeyHash(components) { + const componentsJson = JSON.stringify(components); + return crypto2.createHash("sha256").update(componentsJson).digest("hex").substring(0, cacheKeyHashLength); +} // src/config/db-config.ts var jsonschema = __toESM(require_lib3()); @@ -88193,33 +93984,113 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); +// src/diagnostics.ts +var import_fs = require("fs"); +var import_path = __toESM(require("path")); + +// src/logging.ts +var core7 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup + }; +} +async function withGroupAsync(groupName, f) { + core7.startGroup(groupName); + try { + return await f(); + } finally { + core7.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/diagnostics.ts +var unwrittenDiagnostics = []; +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 writeDiagnostic(config, language, diagnostic) { + const logger = getActionsLogger(); + const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; + const diagnosticsPath = import_path.default.resolve( + databasePath, + "diagnostic", + "codeql-action" + ); + try { + (0, import_fs.mkdirSync)(diagnosticsPath, { recursive: true }); + const jsonPath = import_path.default.resolve( + diagnosticsPath, + // Remove colons from the timestamp as these are not allowed in Windows filenames. + `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.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)); + } +} + // src/diff-informed-analysis-utils.ts var fs5 = __toESM(require("fs")); -var path5 = __toESM(require("path")); +var path6 = __toESM(require("path")); // src/feature-flags.ts var fs4 = __toESM(require("fs")); -var path4 = __toESM(require("path")); -var semver4 = __toESM(require_semver2()); +var path5 = __toESM(require("path")); +var semver5 = __toESM(require_semver2()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.23.3"; -var cliVersion = "2.23.3"; +var bundleVersion = "codeql-bundle-v2.23.8"; +var cliVersion = "2.23.8"; // src/overlay-database-utils.ts -var crypto = __toESM(require("crypto")); var fs3 = __toESM(require("fs")); -var path3 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var path4 = __toESM(require("path")); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core7.debug(`Running git command: git ${args.join(" ")}`); + core8.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -88234,13 +94105,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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."; } - core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error4; + core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -88384,7 +94255,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core7.debug( + core8.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -88409,41 +94280,8 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/logging.ts -var core8 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup - }; -} -async function withGroupAsync(groupName, f) { - core8.startGroup(groupName); - try { - return await f(); - } finally { - core8.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/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -88468,7 +94306,7 @@ async function readBaseDatabaseOidsFile(config, logger) { } } function getBaseDatabaseOidsFilePath(config) { - return path3.join(config.dbLocation, "base-database-oids.json"); + return path4.join(config.dbLocation, "base-database-oids.json"); } async function writeOverlayChangesFile(config, sourceRoot, logger) { const baseFileOids = await readBaseDatabaseOidsFile(config, logger); @@ -88478,7 +94316,7 @@ async function writeOverlayChangesFile(config, sourceRoot, logger) { `Found ${changedFiles.length} changed file(s) under ${sourceRoot}.` ); const changedFilesJson = JSON.stringify({ changes: changedFiles }); - const overlayChangesFile = path3.join( + const overlayChangesFile = path4.join( getTemporaryDirectory(), "overlay-changes.json" ); @@ -88505,7 +94343,7 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { var CACHE_VERSION = 1; var CACHE_PREFIX = "codeql-overlay-base-database"; var MAX_CACHE_OPERATION_MS = 6e5; -function checkOverlayBaseDatabase(config, logger, warningPrefix) { +async function checkOverlayBaseDatabase(codeql, config, logger, warningPrefix) { const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); if (!fs3.existsSync(baseDatabaseOidsFilePath)) { logger.warning( @@ -88513,9 +94351,26 @@ function checkOverlayBaseDatabase(config, logger, warningPrefix) { ); 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 uploadOverlayBaseDatabaseToCache(codeql, config, logger) { +async function cleanupAndUploadOverlayBaseDatabaseToCache(codeql, config, logger) { const overlayDatabaseMode = config.overlayDatabaseMode; if (overlayDatabaseMode !== "overlay-base" /* OverlayBase */) { logger.debug( @@ -88535,7 +94390,8 @@ async function uploadOverlayBaseDatabaseToCache(codeql, config, logger) { ); return false; } - const databaseIsValid = checkOverlayBaseDatabase( + const databaseIsValid = await checkOverlayBaseDatabase( + codeql, config, logger, "Abort uploading overlay-base database to cache" @@ -88544,7 +94400,7 @@ async function uploadOverlayBaseDatabaseToCache(codeql, config, logger) { return false; } await withGroupAsync("Cleaning up databases", async () => { - await codeql.databaseCleanupCluster(config, "overlay"); + await codeql.databaseCleanupCluster(config, "overlay" /* Overlay */); }); const dbLocation = config.dbLocation; const databaseSizeBytes = await tryGetFolderBytes(dbLocation, logger); @@ -88583,9 +94439,9 @@ async function uploadOverlayBaseDatabaseToCache(codeql, config, logger) { logger.warning("Timed out while uploading overlay-base database"); return false; } - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to upload overlay-base database to cache: ${error4 instanceof Error ? error4.message : String(error4)}` + `Failed to upload overlay-base database to cache: ${error3 instanceof Error ? error3.message : String(error3)}` ); return false; } @@ -88619,13 +94475,9 @@ async function getCacheRestoreKeyPrefix(config, codeQlVersion) { const componentsHash = createCacheKeyHash(cacheKeyComponents); return `${CACHE_PREFIX}-${CACHE_VERSION}-${componentsHash}-${languages}-${codeQlVersion}-`; } -function createCacheKeyHash(components) { - const componentsJson = JSON.stringify(components); - return crypto.createHash("sha256").update(componentsJson).digest("hex").substring(0, 16); -} // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); function isSupportedToolsFeature(versionInfo, feature) { return !!versionInfo.features && versionInfo.features[feature]; } @@ -88640,11 +94492,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -88656,6 +94503,16 @@ var featureConfig = { 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", @@ -88684,12 +94541,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -88790,6 +94641,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -88801,21 +94657,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -88830,7 +94687,7 @@ var Features = class { this.gitHubFeatureFlags = new GitHubFeatureFlags( gitHubVersion, repositoryNwo, - path4.join(tempDir, FEATURE_FLAGS_FILE_NAME), + path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), logger ); } @@ -88929,7 +94786,7 @@ var GitHubFeatureFlags = class { DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length, f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length ).replace(/_/g, "."); - if (!semver4.valid(version)) { + if (!semver5.valid(version)) { this.logger.warning( `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.` ); @@ -88938,15 +94795,15 @@ var GitHubFeatureFlags = class { return version; } async getDefaultCliVersion(variant) { - if (variant === 0 /* DOTCOM */) { - return await this.getDefaultDotcomCliVersion(); + if (supportsFeatureFlags(variant)) { + return await this.getDefaultCliVersionFromFlags(); } return { cliVersion, tagName: bundleVersion }; } - async getDefaultDotcomCliVersion() { + async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( ([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : void 0 @@ -89035,7 +94892,7 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (this.gitHubVersion.type !== 0 /* DOTCOM */ && this.gitHubVersion.type !== 2 /* GHE_DOTCOM */) { + if (!supportsFeatureFlags(this.gitHubVersion.type)) { this.logger.debug( "Not running against github.com. Disabling all toggleable features." ); @@ -89088,6 +94945,9 @@ var GitHubFeatureFlags = class { } } }; +function supportsFeatureFlags(githubVariant) { + return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; +} // src/diff-informed-analysis-utils.ts async function getDiffInformedAnalysisBranches(codeql, features, logger) { @@ -89095,7 +94955,7 @@ async function getDiffInformedAnalysisBranches(codeql, features, logger) { return void 0; } const gitHubVersion = await getGitHubVersion(); - if (gitHubVersion.type === 1 /* GHES */ && satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)) { + if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)) { return void 0; } const branches = getPullRequestBranches(); @@ -89107,7 +94967,7 @@ async function getDiffInformedAnalysisBranches(codeql, features, logger) { return branches; } function getDiffRangesJsonFilePath() { - return path5.join(getTemporaryDirectory(), "pr-diff-range.json"); + return path6.join(getTemporaryDirectory(), "pr-diff-range.json"); } function writeDiffRangesJsonFile(logger, ranges) { const jsonContents = JSON.stringify(ranges, null, 2); @@ -89172,22 +95032,22 @@ async function getFileDiffsWithBasehead(branches, logger) { ${JSON.stringify(response, null, 2)}` ); return response.data.files; - } catch (error4) { - if (error4.status) { - logger.warning(`Error retrieving diff ${basehead}: ${error4.message}`); + } catch (error3) { + if (error3.status) { + logger.warning(`Error retrieving diff ${basehead}: ${error3.message}`); logger.debug( `Error running compareCommitsWithBasehead(${basehead}): -Request: ${JSON.stringify(error4.request, null, 2)} -Error Response: ${JSON.stringify(error4.response, null, 2)}` +Request: ${JSON.stringify(error3.request, null, 2)} +Error Response: ${JSON.stringify(error3.response, null, 2)}` ); return void 0; } else { - throw error4; + throw error3; } } } function getDiffRanges(fileDiff, logger) { - const filename = path5.join(getRequiredInput("checkout_path"), fileDiff.filename).replaceAll(path5.sep, "/"); + const filename = path6.join(getRequiredInput("checkout_path"), fileDiff.filename).replaceAll(path6.sep, "/"); if (fileDiff.patch === void 0) { if (fileDiff.changes === 0) { return []; @@ -89244,7 +95104,7 @@ function getDiffRanges(fileDiff, logger) { } // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); var CACHE_VERSION2 = 1; var CODEQL_TRAP_CACHE_PREFIX = "codeql-trap"; var MINIMUM_CACHE_MB_TO_UPLOAD = 10; @@ -89366,6 +95226,9 @@ async function cachePrefix(codeql, language) { } // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -89391,7 +95254,7 @@ var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ }; function getPathToParsedConfigFile(tempDir) { - return path6.join(tempDir, "config"); + return path7.join(tempDir, "config"); } async function getConfig(tempDir, logger) { const configFile = getPathToParsedConfigFile(tempDir); @@ -89447,10 +95310,10 @@ function getPrimaryAnalysisConfig(config) { // src/setup-codeql.ts var fs9 = __toESM(require("fs")); -var path8 = __toESM(require("path")); +var path9 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // node_modules/uuid/dist-node/stringify.js var byteToHex = []; @@ -89511,9 +95374,9 @@ var import_child_process = require("child_process"); var fs7 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; async function getTarVersion() { @@ -89555,9 +95418,9 @@ async function isZstdAvailable(logger) { case "gnu": return { available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver5.gte( - semver5.coerce(version), - semver5.coerce(MIN_REQUIRED_GNU_TAR_VERSION) + semver6.gte( + semver6.coerce(version), + semver6.coerce(MIN_REQUIRED_GNU_TAR_VERSION) ), foundZstdBinary, version: tarVersion @@ -89566,7 +95429,7 @@ async function isZstdAvailable(logger) { return { available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain // a patch version number. - semver5.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), + semver6.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), foundZstdBinary, version: tarVersion }; @@ -89667,13 +95530,13 @@ function inferCompressionMethod(tarPath) { // src/tools-download.ts var fs8 = __toESM(require("fs")); var os2 = __toESM(require("os")); -var path7 = __toESM(require("path")); +var path8 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; var TOOLCACHE_TOOL_NAME = "CodeQL"; function makeDownloadFirstToolsDownloadDurations(downloadDurationMs, extractionDurationMs) { @@ -89800,10 +95663,10 @@ async function downloadAndExtractZstdWithStreaming(codeqlURL, dest, authorizatio await extractTarZst(response, dest, tarVersion, logger); } function getToolcacheDirectory(version) { - return path7.join( + return path8.join( getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, - semver6.clean(version) || version, + semver7.clean(version) || version, os2.arch() || "" ); } @@ -89928,13 +95791,13 @@ function tryGetTagNameFromUrl(url2, logger) { return match[1]; } function convertToSemVer(version, logger) { - if (!semver7.valid(version)) { + if (!semver8.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 = semver7.clean(version); + const s = semver8.clean(version); if (!s) { throw new Error(`Bundle version ${version} is not in SemVer format.`); } @@ -89944,7 +95807,7 @@ async function findOverridingToolsInCache(humanReadableVersion, logger) { const candidates = toolcache3.findAllVersions("CodeQL").filter(isGoodVersion).map((version) => ({ folder: toolcache3.find("CodeQL", version), version - })).filter(({ folder }) => fs9.existsSync(path8.join(folder, "pinned-version"))); + })).filter(({ folder }) => fs9.existsSync(path9.join(folder, "pinned-version"))); if (candidates.length === 1) { const candidate = candidates[0]; logger.debug( @@ -90042,7 +95905,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian url2 = toolsInput; if (tagName) { const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver7.valid(bundleVersion3)) { + if (bundleVersion3 && semver8.valid(bundleVersion3)) { cliVersion2 = convertToSemVer(bundleVersion3, logger); } } @@ -90125,7 +95988,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: cliVersion2 ?? humanReadableVersion }; } - if (variant !== 0 /* DOTCOM */ && !forceShippedTools && !toolsInput) { + if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { const result = await findOverridingToolsInCache( humanReadableVersion, logger @@ -90313,11 +96176,11 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau async function useZstdBundle(cliVersion2, tarSupportsZstd) { return ( // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver7.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) + process.platform !== "win32" && tarSupportsZstd && semver8.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) ); } function getTempExtractionDir(tempDir) { - return path8.join(tempDir, v4_default()); + return path9.join(tempDir, v4_default()); } async function getNightlyToolsUrl(logger) { const zstdAvailability = await isZstdAvailable(logger); @@ -90345,7 +96208,7 @@ async function getNightlyToolsUrl(logger) { } } function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver7.compare(b, a)); + const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver8.compare(b, a)); logger.debug( `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( allVersions @@ -90366,7 +96229,7 @@ function isReservedToolsValue(tools) { // src/tracer-config.ts var fs10 = __toESM(require("fs")); -var path9 = __toESM(require("path")); +var path10 = __toESM(require("path")); async function shouldEnableIndirectTracing(codeql, config) { if (config.buildMode === "none" /* None */) { return false; @@ -90381,7 +96244,7 @@ async function endTracingForCluster(codeql, config, logger) { logger.info( "Unsetting build tracing environment variables. Subsequent steps of this job will not be traced." ); - const envVariablesFile = path9.resolve( + const envVariablesFile = path10.resolve( config.dbLocation, "temp/tracingEnvironment/end-tracing.json" ); @@ -90438,7 +96301,7 @@ async function setupCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliV toolsDownloadStatusReport )}` ); - let codeqlCmd = path10.join(codeqlFolder, "codeql", "codeql"); + let codeqlCmd = path11.join(codeqlFolder, "codeql", "codeql"); if (process.platform === "win32") { codeqlCmd += ".exe"; } else if (process.platform !== "linux" && process.platform !== "darwin") { @@ -90500,7 +96363,7 @@ async function getCodeQLForCmd(cmd, checkVersion) { }, async isTracedLanguage(language) { const extractorPath = await this.resolveExtractor(language); - const tracingConfigPath = path10.join( + const tracingConfigPath = path11.join( extractorPath, "tools", "tracing-config.lua" @@ -90576,7 +96439,7 @@ async function getCodeQLForCmd(cmd, checkVersion) { }, async runAutobuild(config, language) { applyAutobuildAzurePipelinesTimeoutFix(); - const autobuildCmd = path10.join( + const autobuildCmd = path11.join( await this.resolveExtractor(language), "tools", process.platform === "win32" ? "autobuild.cmd" : "autobuild.sh" @@ -90867,6 +96730,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -90982,7 +96862,7 @@ async function getTrapCachingExtractorConfigArgsForLang(config, language) { ]; } function getGeneratedCodeScanningConfigPath(config) { - return path10.resolve(config.tempDir, "user-config.yaml"); + return path11.resolve(config.tempDir, "user-config.yaml"); } function getExtractionVerbosityArguments(enableDebugLogging) { return enableDebugLogging ? [`--verbosity=${EXTRACTION_DEBUG_MODE_VERBOSITY}`] : []; @@ -91050,74 +96930,133 @@ async function runAutobuild(config, language, logger) { // src/dependency-caching.ts var os3 = __toESM(require("os")); -var import_path = require("path"); -var actionsCache3 = __toESM(require_cache3()); -var glob = __toESM(require_glob2()); +var import_path2 = require("path"); +var actionsCache3 = __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_path.join)(getTemporaryDirectory(), "codeql_java", "repository"); + return (0, import_path2.join)(getTemporaryDirectory(), "codeql_java", "repository"); } -function getDefaultCacheConfig() { - return { - java: { - paths: [ - // Maven - (0, import_path.join)(os3.homedir(), ".m2", "repository"), - // Gradle - (0, import_path.join)(os3.homedir(), ".gradle", "caches"), - // CodeQL Java build-mode: none - getJavaTempDependencyDir() - ], - hash: [ - // Maven - "**/pom.xml", - // Gradle - "**/*.gradle*", - "**/gradle-wrapper.properties", - "buildSrc/**/Versions.kt", - "buildSrc/**/Dependencies.kt", - "gradle/*.versions.toml", - "**/versions.properties" - ] - }, - csharp: { - paths: [(0, import_path.join)(os3.homedir(), ".nuget", "packages")], - hash: [ - // NuGet - "**/packages.lock.json", - // Paket - "**/paket.lock" - ] - }, - go: { - paths: [(0, import_path.join)(os3.homedir(), "go", "pkg", "mod")], - hash: ["**/go.sum"] - } - }; +async function getJavaDependencyDirs() { + return [ + // Maven + (0, import_path2.join)(os3.homedir(), ".m2", "repository"), + // Gradle + (0, import_path2.join)(os3.homedir(), ".gradle", "caches"), + // CodeQL Java build-mode: none + getJavaTempDependencyDir() + ]; +} +function getCsharpTempDependencyDir() { + return (0, import_path2.join)(getTemporaryDirectory(), "codeql_csharp", "repository"); +} +async function getCsharpDependencyDirs(codeql, features) { + const dirs = [ + // Nuget + (0, import_path2.join)(os3.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_path2.join)(os3.homedir(), "go", "pkg", "mod")], + getHashPatterns: async () => internal.makePatternCheck(["**/go.sum"]) + } +}; async function makeGlobber(patterns) { return glob.create(patterns.join("\n")); } -async function uploadDependencyCaches(config, logger, minimizeJavaJars) { +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 uploadDependencyCaches(codeql, features, config, logger) { const status = []; for (const language of config.languages) { - const cacheConfig = getDefaultCacheConfig()[language]; + 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 globber = await makeGlobber(cacheConfig.hash); - if ((await globber.glob()).length === 0) { + const patterns = await checkHashPatterns( + codeql, + features, + language, + cacheConfig, + "upload", + logger + ); + if (patterns === void 0) { status.push({ language, result: "no-hash" /* NoHash */ }); - logger.info( - `Skipping upload of dependency cache for ${language} as we cannot calculate a hash for the cache key.` - ); continue; } - const size = await getTotalCacheSize(cacheConfig.paths, logger, true); + 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( @@ -91125,13 +97064,15 @@ async function uploadDependencyCaches(config, logger, minimizeJavaJars) { ); continue; } - const key = await cacheKey2(language, cacheConfig, minimizeJavaJars); logger.info( `Uploading cache of size ${size} for ${language} with key ${key}...` ); try { const start = performance.now(); - await actionsCache3.saveCache(cacheConfig.paths, key); + await actionsCache3.saveCache( + await cacheConfig.getDependencyPaths(codeql, features), + key + ); const upload_duration_ms = Math.round(performance.now() - start); status.push({ language, @@ -91139,89 +97080,61 @@ async function uploadDependencyCaches(config, logger, minimizeJavaJars) { upload_size_bytes: Math.round(size), upload_duration_ms }); - } catch (error4) { - if (error4 instanceof actionsCache3.ReserveCacheError) { + } catch (error3) { + if (error3 instanceof actionsCache3.ReserveCacheError) { logger.info( `Not uploading cache for ${language}, because ${key} is already in use.` ); - logger.debug(error4.message); + logger.debug(error3.message); status.push({ language, result: "duplicate" /* Duplicate */ }); } else { - throw error4; + throw error3; } } } return status; } -async function cacheKey2(language, cacheConfig, minimizeJavaJars = false) { - const hash2 = await glob.hashFiles(cacheConfig.hash.join("\n")); - return `${await cachePrefix2(language, minimizeJavaJars)}${hash2}`; +async function cacheKey2(codeql, features, language, patterns) { + const hash2 = await glob.hashFiles(patterns.join("\n")); + return `${await cachePrefix2(codeql, features, language)}${hash2}`; } -async function cachePrefix2(language, minimizeJavaJars) { +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}`; } - if (language === "java" /* java */ && minimizeJavaJars) { - prefix = `minify-${prefix}`; - } - return `${prefix}-${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`; -} - -// src/diagnostics.ts -var import_fs = require("fs"); -var import_path2 = __toESM(require("path")); -var unwrittenDiagnostics = []; -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 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 jsonPath = import_path2.default.resolve( - diagnosticsPath, - // Remove colons from the timestamp as these are not allowed in Windows filenames. - `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.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)); - } + const featurePrefix = await getFeaturePrefix(codeql, features, language); + return `${prefix}-${featurePrefix}${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`; } +var internal = { + makePatternCheck +}; // src/analyze.ts var CodeQLAnalysisError = class extends Error { - constructor(queriesStatusReport, message, error4) { + constructor(queriesStatusReport, message, error3) { super(message); this.queriesStatusReport = queriesStatusReport; this.message = message; - this.error = error4; + this.error = error3; this.name = "CodeQLAnalysisError"; } }; @@ -91235,7 +97148,7 @@ async function setupPythonExtractor(logger) { ); return; } -async function runExtraction(codeql, config, logger) { +async function runExtraction(codeql, features, config, logger) { for (const language of config.languages) { if (dbIsFinalized(config, language, logger)) { logger.debug( @@ -91255,6 +97168,9 @@ async function runExtraction(codeql, config, 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); @@ -91280,9 +97196,9 @@ function dbIsFinalized(config, language, logger) { return false; } } -async function finalizeDatabaseCreation(codeql, config, threadsFlag, memoryFlag, logger) { +async function finalizeDatabaseCreation(codeql, features, config, threadsFlag, memoryFlag, logger) { const extractionStart = import_perf_hooks2.performance.now(); - await runExtraction(codeql, config, logger); + await runExtraction(codeql, features, config, logger); const extractionTime = import_perf_hooks2.performance.now() - extractionStart; const trapImportStart = import_perf_hooks2.performance.now(); for (const language of config.languages) { @@ -91537,17 +97453,18 @@ async function runQueries(sarifFolder, memoryFlag, threadsFlag, diffRangePackDir return perQueryAlertCounts; } } -async function runFinalize(outputDir, threadsFlag, memoryFlag, codeql, config, logger) { +async function runFinalize(features, outputDir, threadsFlag, memoryFlag, codeql, config, logger) { try { await fs12.promises.rm(outputDir, { force: true, recursive: true }); - } catch (error4) { - if (error4?.code !== "ENOENT") { - throw error4; + } catch (error3) { + if (error3?.code !== "ENOENT") { + throw error3; } } await fs12.promises.mkdir(outputDir, { recursive: true }); const timings = await finalizeDatabaseCreation( codeql, + features, config, threadsFlag, memoryFlag, @@ -91589,31 +97506,33 @@ async function warnIfGoInstalledAfterInit(config, logger) { // src/database-upload.ts var fs13 = __toESM(require("fs")); -async function uploadDatabases(repositoryNwo, codeql, config, apiDetails, logger) { +async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetails, features, logger) { if (getRequiredInput("upload-database") !== "true") { logger.debug("Database upload disabled in workflow. Skipping upload."); - return; + return []; } if (!config.analysisKinds.includes("code-scanning" /* CodeScanning */)) { logger.debug( `Not uploading database because 'analysis-kinds: ${"code-scanning" /* CodeScanning */}' is not enabled.` ); - return; + return []; } if (isInTestMode()) { logger.debug("In test mode. Skipping database upload."); - return; + return []; } - if (config.gitHubVersion.type !== 0 /* DOTCOM */ && config.gitHubVersion.type !== 2 /* GHE_DOTCOM */) { + 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; + return []; } if (!await isAnalyzingDefaultBranch()) { logger.debug("Not analyzing default branch. Skipping upload."); - return; + return []; } + const shouldUploadOverlayBase = config.overlayDatabaseMode === "overlay-base" /* OverlayBase */ && await features.getValue("upload_overlay_db_to_api" /* UploadOverlayDbToApi */); + const cleanupLevel = shouldUploadOverlayBase ? "overlay" /* Overlay */ : "clear" /* Clear */; await withGroupAsync("Cleaning up databases", async () => { - await codeql.databaseCleanupCluster(config, "clear"); + await codeql.databaseCleanupCluster(config, cleanupLevel); }); const client = getApiClient(); const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url)); @@ -91622,15 +97541,18 @@ async function uploadDatabases(repositoryNwo, codeql, config, apiDetails, logger if (uploadsBaseUrl.endsWith("/")) { uploadsBaseUrl = uploadsBaseUrl.slice(0, -1); } + const reports = []; for (const language of config.languages) { + let bundledDbSize = void 0; try { const bundledDb = await bundleDb(config, language, codeql, language); - const bundledDbSize = fs13.statSync(bundledDb).size; + bundledDbSize = fs13.statSync(bundledDb).size; const bundledDbReadStream = fs13.createReadStream(bundledDb); const commitOid = await getCommitOid( getRequiredInput("checkout_path") ); try { + const startTime = performance.now(); await client.request( `POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, { @@ -91648,14 +97570,29 @@ async function uploadDatabases(repositoryNwo, codeql, config, apiDetails, logger } } ); + const endTime = performance.now(); + reports.push({ + language, + zipped_upload_size_bytes: bundledDbSize, + is_overlay_base: shouldUploadOverlayBase, + upload_duration_ms: endTime - startTime + }); logger.debug(`Successfully uploaded database for ${language}`); } finally { bundledDbReadStream.close(); } } catch (e) { - logger.warning(`Failed to upload database for ${language}: ${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 } : {} + }); } } + return reports; } // src/status-report.ts @@ -91667,9 +97604,9 @@ function isFirstPartyAnalysis(actionName) { } return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; } -function getActionsStatus(error4, otherFailureCause) { - if (error4 || otherFailureCause) { - return error4 instanceof ConfigurationError ? "user-error" : "failure"; +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; } else { return "success"; } @@ -92272,13 +98209,13 @@ function fromString(str2, unsigned, radix) { return result; } Long.fromString = fromString; -function fromValue(val2, unsigned) { - if (typeof val2 === "number") return fromNumber(val2, unsigned); - if (typeof val2 === "string") return fromString(val2, unsigned); +function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); return fromBits( - val2.low, - val2.high, - typeof unsigned === "boolean" ? unsigned : val2.unsigned + val.low, + val.high, + typeof unsigned === "boolean" ? unsigned : val.unsigned ); } Long.fromValue = fromValue; @@ -92350,8 +98287,8 @@ LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { LongPrototype.getNumBitsAbs = function getNumBitsAbs() { if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val2 = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) if ((val2 & 1 << bit) != 0) break; + 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() { @@ -92971,7 +98908,7 @@ async function addFingerprints(sarif, sourceRoot, logger) { // src/init.ts var toolrunner4 = __toESM(require_toolrunner()); -var io6 = __toESM(require_io2()); +var io6 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); const { @@ -93057,7 +98994,7 @@ function areAllRunsUnique(sarifObjects) { return true; } async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) { - if (githubVersion.type === 1 /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { + if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { return false; } return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; @@ -93072,7 +99009,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { ); } async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) { - if (githubVersion.type === 1 /* GHES */) { + if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) { if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) { return false; } @@ -93087,7 +99024,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo const sarifObjects = sarifFiles.map((sarifFile) => { return JSON.parse(fs15.readFileSync(sarifFile, "utf8")); }); - const deprecationWarningMessage = gitHubVersion.type === 1 /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025"; + 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); @@ -93228,23 +99165,6 @@ function findSarifFilesInDir(sarifPath, isSarif) { walkSarifFiles(sarifPath); return sarifFiles; } -function getSarifFilePaths(sarifPath, isSarif) { - if (!fs15.existsSync(sarifPath)) { - throw new ConfigurationError(`Path does not exist: ${sarifPath}`); - } - let sarifFiles; - if (fs15.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 = fs15.statSync(sarifPath, { throwIfNoEntry: false }); if (stats === void 0) { @@ -93336,15 +99256,15 @@ function validateSarifFileSchema(sarif, sarifFilePath, logger) { const warnings = (result.errors ?? []).filter( (err) => err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument) ); - for (const warning9 of warnings) { + for (const warning10 of warnings) { logger.info( - `Warning: '${warning9.instance}' is not a valid URI in '${warning9.property}'.` + `Warning: '${warning10.instance}' is not a valid URI in '${warning10.property}'.` ); } if (errors.length > 0) { - for (const error4 of errors) { - logger.startGroup(`Error details: ${error4.stack}`); - logger.info(JSON.stringify(error4, null, 2)); + 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}`); @@ -93435,36 +99355,6 @@ async function writePostProcessedFiles(logger, pathInput, uploadTarget, postProc 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 sarif = postProcessingResults.sarif; @@ -93597,10 +99487,10 @@ function shouldConsiderConfigurationError(processingErrors) { } function shouldConsiderInvalidRequest(processingErrors) { return processingErrors.every( - (error4) => error4.startsWith("rejecting SARIF") || error4.startsWith("an invalid URI was provided as a SARIF location") || error4.startsWith("locationFromSarifResult: expected artifact location") || error4.startsWith( + (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( - error4 + error3 ) ); } @@ -93716,8 +99606,8 @@ async function postProcessAndUploadSarif(logger, features, uploadKind, checkoutP } // src/analyze-action.ts -async function sendStatusReport2(startedAt, config, stats, error4, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanup, dependencyCacheResults, logger) { - const status = getActionsStatus(error4, stats?.analyze_failure_language); +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, @@ -93725,8 +99615,8 @@ async function sendStatusReport2(startedAt, config, stats, error4, trapCacheUplo config, await checkDiskUsage(logger), logger, - error4?.message, - error4?.stack + error3?.message, + error3?.stack ); if (statusReportBase !== void 0) { const report = { @@ -93734,7 +99624,8 @@ async function sendStatusReport2(startedAt, config, stats, error4, trapCacheUplo ...stats || {}, ...dbCreationTimings || {}, ...trapCacheCleanup || {}, - dependency_caching_upload_results: dependencyCacheResults + dependency_caching_upload_results: dependencyCacheResults, + database_upload_results: databaseUploadResults }; if (config && didUploadTrapCaches) { const trapCacheUploadStatusReport = { @@ -93816,6 +99707,7 @@ async function run() { let dbCreationTimings = void 0; let didUploadTrapCaches = false; let dependencyCacheResults; + let databaseUploadResults = []; initializeEnvironment(getActionVersion()); persistInputs(); const logger = getActionsLogger(); @@ -93882,6 +99774,7 @@ async function run() { await warnIfGoInstalledAfterInit(config, logger); await runAutobuildIfLegacyGoWorkflow(config, logger); dbCreationTimings = await runFinalize( + features, outputDir, threads, memory, @@ -93919,42 +99812,15 @@ async function run() { if (runStats) { const checkoutPath = getRequiredInput("checkout_path"); const category = getOptionalInput("category"); - if (await features.getValue("analyze_use_new_upload" /* AnalyzeUseNewUpload */)) { - uploadResults = await postProcessAndUploadSarif( - logger, - features, - uploadKind, - checkoutPath, - outputDir, - category, - getOptionalInput("post-processed-sarif-path") - ); - } else if (uploadKind === "always") { - uploadResults = {}; - if (isCodeScanningEnabled(config)) { - uploadResults["code-scanning" /* CodeScanning */] = await uploadFiles( - outputDir, - checkoutPath, - category, - features, - logger, - CodeScanning - ); - } - if (isCodeQualityEnabled(config)) { - uploadResults["code-quality" /* CodeQuality */] = await uploadFiles( - outputDir, - checkoutPath, - category, - features, - logger, - CodeQuality - ); - } - } else { - uploadResults = {}; - logger.info("Not uploading results"); - } + uploadResults = await postProcessAndUploadSarif( + logger, + features, + uploadKind, + checkoutPath, + outputDir, + category, + getOptionalInput("post-processed-sarif-path") + ); if (uploadResults["code-scanning" /* CodeScanning */] !== void 0) { core14.setOutput( "sarif-id", @@ -93970,8 +99836,15 @@ async function run() { } else { logger.info("Not uploading results"); } - await uploadOverlayBaseDatabaseToCache(codeql, config, logger); - await uploadDatabases(repositoryNwo, codeql, config, apiDetails, logger); + await cleanupAndUploadOverlayBaseDatabaseToCache(codeql, config, logger); + databaseUploadResults = await cleanupAndUploadDatabases( + repositoryNwo, + codeql, + config, + apiDetails, + features, + logger + ); const trapCacheUploadStartTime = import_perf_hooks3.performance.now(); didUploadTrapCaches = await uploadTrapCaches(codeql, config, logger); trapCacheUploadTime = import_perf_hooks3.performance.now() - trapCacheUploadStartTime; @@ -93981,14 +99854,11 @@ async function run() { logger ); if (shouldStoreCache(config.dependencyCachingEnabled)) { - const minimizeJavaJars = await features.getValue( - "java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */, - codeql - ); dependencyCacheResults = await uploadDependencyCaches( + codeql, + features, config, - logger, - minimizeJavaJars + logger ); } if (isInTestMode()) { @@ -94007,20 +99877,21 @@ async function run() { } core14.exportVariable("CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */, "true"); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); if (getOptionalInput("expect-error") !== "true" || hasBadExpectErrorInput()) { - core14.setFailed(error4.message); + core14.setFailed(error3.message); } await sendStatusReport2( startedAt, config, - error4 instanceof CodeQLAnalysisError ? error4.queriesStatusReport : void 0, - error4 instanceof CodeQLAnalysisError ? error4.error : error4, + error3 instanceof CodeQLAnalysisError ? error3.queriesStatusReport : void 0, + error3 instanceof CodeQLAnalysisError ? error3.error : error3, trapCacheUploadTime, dbCreationTimings, didUploadTrapCaches, trapCacheCleanupTelemetry, dependencyCacheResults, + databaseUploadResults, logger ); return; @@ -94039,6 +99910,7 @@ async function run() { didUploadTrapCaches, trapCacheCleanupTelemetry, dependencyCacheResults, + databaseUploadResults, logger ); } else if (runStats !== void 0) { @@ -94052,6 +99924,7 @@ async function run() { didUploadTrapCaches, trapCacheCleanupTelemetry, dependencyCacheResults, + databaseUploadResults, logger ); } else { @@ -94065,6 +99938,7 @@ async function run() { didUploadTrapCaches, trapCacheCleanupTelemetry, dependencyCacheResults, + databaseUploadResults, logger ); } @@ -94073,8 +99947,8 @@ var runPromise = run(); async function runWrapper() { try { await runPromise; - } catch (error4) { - core14.setFailed(`analyze action failed: ${getErrorMessage(error4)}`); + } catch (error3) { + core14.setFailed(`analyze action failed: ${getErrorMessage(error3)}`); } await checkForTimeout(); } @@ -94092,7 +99966,7 @@ undici/lib/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) long/index.js: (** diff --git a/lib/autobuild-action.js b/lib/autobuild-action.js index 58190c45d9..9d5b3fffd6 100644 --- a/lib/autobuild-action.js +++ b/lib/autobuild-action.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os2 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os2 = __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() + os2.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs7 = __importStar4(require("fs")); - var os2 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs7 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug5("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay, persist } = mockDispatch2; + const { data: { statusCode, data, headers, trailers, error: error3 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay === "number" && delay > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve5({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve5, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path7 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path7 = __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, path7.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs7 = __importStar4(require("fs")); - var path7 = __importStar4(require("path")); - _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs7 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); + _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs7.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs7.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path7.dirname(filePath); const upperName = path7.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path7.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which5; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path7 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path7 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which5(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which5; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os2 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path7 = __importStar4(require("path")); - var io5 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path7 = __importStar2(require("path")); + var io5 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner5 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path7.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io5.which(this.toolPath, true); - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve5(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + exports2.exec = exec; + exports2.getExecOutput = getExecOutput; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner()); + function exec(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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 exec = __importStar2(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 = exportVariable7; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug5; + exports2.error = error3; + exports2.warning = warning9; + exports2.notice = notice; + exports2.info = info6; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os2 = __importStar4(require("os")); - var path7 = __importStar4(require("path")); + var os2 = __importStar2(require("os")); + var path7 = __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 exportVariable7(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable7(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable7; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19681,18 +19872,16 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path7.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,19 +19889,17 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { @@ -19721,50 +19908,39 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.stdout.write(os2.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug5(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug5; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning8(message, properties = {}) { + function warning9(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning8; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info6(message) { process.stdout.write(message + os2.EOL); } - exports2.info = info6; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve5, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter4(this, void 0, void 0, function* () { + const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,532 +25406,74 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs7 = __importStar4(require("fs")); - var path7 = __importStar4(require("path")); - _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs7.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs7.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path7.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 = path7.dirname(filePath); - const upperName = path7.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path7.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 = which5; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path7 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path7.join(dest, path7.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 (path7.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path7.join(dest, path7.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(path7.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which5(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which5(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 __awaiter4(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(path7.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(path7.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path7.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path7.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug5; - } -}); - -// 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 debug5 = 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}}`); + var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug5; + } +}); + +// 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 debug5 = 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; }; @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare2 = require_compare(); - var gte5 = (a, b, loose) => compare2(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare2(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises2)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run2, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } } doExpire(clearGlobalState, run2, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run2, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run2, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve5, returned, task; + var args, cb, error3, reject, resolve5, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve5, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve5(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info6) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info6) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29565,8 +29279,8 @@ var require_helpers = __commonJS({ } return decimalPlaces; }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; }; } }); @@ -30548,1424 +30262,1097 @@ var require_lib3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path7 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname2(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs7 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path7.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs7.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs7.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname2; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path7.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path7.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path7.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __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", () => { + resolve5(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve5(Buffer.concat(chunks)); + }); + })); + }); + } }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var 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 expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path7 = (function() { - try { - return require("path"); - } catch (e) { + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path7.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + /** + * 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); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path7.sep !== "/") { - pattern = pattern.split(path7.sep).join("/"); + 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); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + 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); + }); } - if (!pattern) { - this.empty = true; - return; + 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); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug5() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = 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++) { - negate = !negate; - negateOffset++; + /** + * 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve5(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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(); + } } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + /** + * 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); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; } + return info6; } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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; } - 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; - } - 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve5) => setTimeout(() => resolve5(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve5(response); } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } - var cs = pattern.substring(classStart + 1, i); + let obj; + let contents; 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; + 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) { } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + 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 { + resolve5(response); } - 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]; + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/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(resolve5) { + resolve5(value); + }); } - 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(_, $1, $2) { - if (!$2) { - $2 = "\\"; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve5(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; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - 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 = "$"; + 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"); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + options.headers["Authorization"] = `Bearer ${this.token}`; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - if (addPatternStart) { - re = patternStart + re; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - if (!hasMagic) { - return globUnescape(pattern); + // 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")}`; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path7.sep !== "/") { - f = f.split(path7.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - 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] === ""; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - throw new Error("wtf?"); }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path7 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path7.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path7.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path7.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path7.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path7.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os2 = __importStar4(require("os")); - var path7 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path7.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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path7.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path7.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; + 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 internal_match_kind_1.MatchKind.None; + return token; } - /** - * 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); + 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 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, "[*]"); + return runtimeUrl; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path7.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path7.sep}`)) { - homedir = homedir || os2.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path7, level) { - this.path = path7; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -31992,263 +31379,323 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); + 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 = ""; } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + /** + * 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}`; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * 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(); + }); } - function fulfill(value) { - resume("next", value); + /** + * 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 }); + }); } - function reject(value) { - resume("throw", value); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core14 = __importStar4(require_core()); - var fs7 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path7 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs7.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs7.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path7.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; - }); + 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(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs7.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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 fs7.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs7.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + /** + * 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); } - traversalChain.push(realPath); - } - return stats; - }); + 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path7 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.create = create; + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path7.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32257,21 +31704,21 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -32301,14 +31748,14 @@ var require_io_util3 = __commonJS({ var _a; 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 fs7 = __importStar4(require("fs")); - var path7 = __importStar4(require("path")); + var fs7 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs7.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -32322,7 +31769,7 @@ var require_io_util3 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -32340,7 +31787,7 @@ var require_io_util3 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -32417,11 +31864,11 @@ var require_io_util3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32430,21 +31877,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -32474,10 +31921,10 @@ var require_io3 = __commonJS({ 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 path7 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); + var path7 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -32504,7 +31951,7 @@ var require_io3 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -32525,7 +31972,7 @@ var require_io3 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -32545,14 +31992,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which5(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32576,7 +32023,7 @@ var require_io3 = __commonJS({ } exports2.which = which5; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32624,7 +32071,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -32644,7 +32091,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -32665,1200 +32112,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug5; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug5 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug5 = 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 + "}"); +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - 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++) { - debug5(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; + __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(resolve5) { + resolve5(value); + }); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path7 = __importStar2(require("path")); + var io5 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + _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 { - version = version.version; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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); - } - debug5("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"); + return cmd; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - 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; + _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 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) { - debug5("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 this.args; } - 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug5("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); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } 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]; - debug5("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); + if (!arg) { + return '""'; } - } 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++; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - 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]; + } + 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 { - 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]; - } + quoteHit = false; } - 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; + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.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 = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(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 = rcompare; - function rcompare(a, b, loose) { - return compare2(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 compare2(a, b, loose) > 0; - } - exports2.lt = lt; - function lt(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports2.gte = gte5; - function gte5(a, b, loose) { - return compare2(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(a, b, loose) { - return compare2(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + 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(""); } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _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; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug5("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; - } - debug5("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); + /** + * 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 = path7.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io5.which(this.toolPath, true); + return new Promise((resolve5, 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) + os2.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 { + resolve5(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug5("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; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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; }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug5("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); }); } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - 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(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug5("comp", comp, options); - comp = replaceCarets(comp, options); - debug5("caret", comp); - comp = replaceTildes(comp, options); - debug5("tildes", comp); - comp = replaceXRanges(comp, options); - debug5("xrange", comp); - comp = replaceStars(comp, options); - debug5("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(_, M, m, p, pr) { - debug5("tilde", comp, _, 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) { - debug5("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + 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 exec(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.`); } - debug5("tilde return", ret); - return ret; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug5("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug5("caret", comp, _, 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) { - debug5("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"; + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } else { - debug5("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"; + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - debug5("caret return", ret); - return ret; + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; }); } - function replaceXRanges(comp, options) { - debug5("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) { - debug5("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; } - debug5("xRange return", ret); - return ret; + function step(result) { + result.done ? resolve5(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 exec = __importStar2(require_exec2()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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 + }); }); } - function replaceStars(comp, options) { - debug5("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; - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + 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); } - return false; + __setModuleDefault2(result, mod); + return result; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug5(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve5(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_utils5(); + var os2 = __importStar2(require("os")); + var path7 = __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 exportVariable7(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable7; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path7.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; + return inputs.map((input) => input.trim()); } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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 && range.test(minver)) { - return minver; - } - return null; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(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.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); + exports2.getState = getState2; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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/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]; + } }; } - if (satisfies2(version, range, options)) { - return false; + 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); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core14 = __importStar2(require_core2()); + 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; + core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core14.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + return result; } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path7 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname2(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + let result = path7.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname2; + 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)}`; } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } 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)}`; } - safeRe[t.COERCERTL].lastIndex = -1; } - if (match === null) { - return null; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path7.sep; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path7.sep)) { + return p; + } + if (p === path7.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -33871,313 +33289,871 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob = __importStar4(require_glob()); - var io5 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs7 = __importStar4(require("fs")); - var path7 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path7.join(baseLocation, "actions", "temp"); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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); } - const dest = path7.join(tempDirectory, crypto.randomUUID()); - yield io5.mkdirP(dest); - return dest; - }); + } + return result; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs7.statSync(filePath).size; + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const paths = []; - const workspace = (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const globber = yield glob.create(patterns.join("\n"), { - implicitDescendants: false - }); - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path7.relative(workspace, file).replace(new RegExp(`\\${path7.sep}`, "g"), "/"); - core14.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; + }; + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs7.unlink)(filePath); - }); + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - }); - } catch (err) { - core14.debug(err.message); + bi = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - versionOutput = versionOutput.trim(); - core14.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core14.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + if (begs.length) { + result = [left, right]; } - }); + } + return result; } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs7.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io5.which("tar") : ""; - }); + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + parts.push.apply(parts, p); + return parts; } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - return token; + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } else { - return void 0; + N = concatMap(n, function(el) { + return expand(el, false); + }); + } + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } + return expansions; } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path7 = (function() { + try { + return require("path"); + } catch (e) { } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + })() || { + sep: "/" + }; + minimatch.sep = path7.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { 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}`); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - 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; - } + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path7.sep !== "/") { + pattern = pattern.split(path7.sep).join("/"); } - 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]"); + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern = this.pattern; + var options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; } - get username() { - return this._decodedUsername; + if (!pattern) { + this.empty = true; + return; } - get password() { - return this._decodedPassword; + this.parseNegate(); + var set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug5() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = 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++) { + negate = !negate; + negateOffset++; } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); }; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + 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 && reSpecials[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; + } + 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 (reSpecials[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(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = 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 (addPatternStart) { + 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; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path7.sep !== "/") { + f = f.split(path7.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + 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 regExpEscape(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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -34190,613 +34166,615 @@ var require_lib4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 path7 = __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(path7.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path7.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); + } + this.segments.unshift(remaining); } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + } 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(path7.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } } } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path7.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path7.sep; + } + result += this.segments[i]; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 || 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.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(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", () => { - resolve5(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve5(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(userAgent, 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 = userAgent; - 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; + exports2.Pattern = void 0; + var os2 = __importStar2(require("os")); + var path7 = __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, homedir) { + 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}`; } } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path7.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); } /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + * Matches the pattern against the specified path */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(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 __awaiter4(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); - }); + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path7.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path7.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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * Escapes glob patterns within a path + */ + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * Normalizes slashes and ensures absolute root */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + static fixupPattern(pattern, homedir) { + (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(`.${path7.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path7.sep}`)) { + homedir = homedir || os2.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 += "\\"; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, data); + 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; } else { - return response; + set2 += c2; } } - 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."); + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + if (set2) { + literal += set2; + i = closed; + continue; } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + } + literal += c; } - this._disposed = true; + return literal; } /** - * Raw request. - * @param info - * @param data + * Escapes regexp special characters + * https://javascript.info/regexp-escaping */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve5(res); - } - } - this.requestRawWithCallback(info6, data, callbackForResult); - }); + 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(path7, level) { + this.path = path7; + 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 || 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(resolve5) { + resolve5(value); }); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - const req = info6.httpModule.request(info6.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(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - handleResult(new Error(`Request timeout: ${info6.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(); + function step(result) { + result.done ? resolve5(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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); + }); + }; } - /** - * 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); + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ value: v2, done: d }); + }, reject); } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } - } - return info6; + }; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - return lowercaseKeys(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + function fulfill(value) { + resume("next", value); } - _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; + function reject(value) { + resume("throw", value); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); + 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 core14 = __importStar2(require_core2()); + var fs7 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path7 = __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() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } + } + return result; }); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve5(response); + 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("**"))); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + } + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core14.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs7.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } - return value; + throw err; } - let obj; - let contents; + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !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 && path7.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & 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(fs7.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path7.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & 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 { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); + stats = yield fs7.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core14.debug(`Broken symlink '${item.path}'`); + return void 0; } - response.result = obj; + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); } - response.headers = res.message.headers; - } catch (err) { + throw 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 { - resolve5(response); + } else { + stats = yield fs7.promises.lstat(item.path); + } + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs7.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); } - })); + if (traversalChain.some((x) => x === realPath)) { + core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -34823,4390 +34801,3087 @@ var require_auth2 = __commonJS({ 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; + 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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ value: v2, done: d }); + }, reject); } }; - 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"); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core14 = __importStar2(require_core2()); + var fs7 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path7 = __importStar2(require("path")); + function hashFiles(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core14.info : core14.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path7.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs7.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs7.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; + } } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + result.end(); + if (hasMatch) { + writeDelegate(`Found ${count} files to hash.`); + return result.digest("hex"); + } else { + writeDelegate(`No matches found for glob`); + return ""; } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + }); + } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - addPolicy(policy, options = {}) { - if (options.phase && options.afterPhase) { - throw new Error("Policies inside a phase cannot specify afterPhase."); + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (options.phase && !ValidPhaseNames.has(options.phase)) { - throw new Error(`Invalid phase name: ${options.phase}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { - throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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; - } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - function createEmptyPipeline() { - return HttpPipeline.create(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = exports2.create = void 0; + var internal_globber_1 = require_internal_globber(); + var internal_hash_files_1 = require_internal_hash_files(); + function create(patterns, options) { + return __awaiter2(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); + } + exports2.create = create; + function hashFiles(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create(patterns, { followSymbolicLinks }); + return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); + }); } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os2 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os2.EOL}`); +// 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 debug5; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug5 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug5 = function() { + }; } - var debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; - var enabledString; - var enabledNamespaces = []; - var skippedNamespaces = []; - var debuggers = []; - if (debugEnvVariable) { - enable(debugEnvVariable); + 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 debugObj = Object.assign((namespace) => { - return createDebugger(namespace); - }, { - enable, - enabled, - disable, - log - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } + 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 + "}"); } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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++) { + debug5(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); } } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + if (version instanceof SemVer) { + return version; } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; - } + if (typeof version !== "string") { + return null; } - return false; - } - 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: extend3 - }); - function debug6(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); + if (version.length > MAX_LENGTH) { + return null; } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; + 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; } - return false; } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - var debug5 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug5("azure"); - AzureLogger.log = (...args) => { - debug5.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); + 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); } - debug5.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); + } + if (!(this instanceof SemVer)) { + return new SemVer(version, options); + } + debug5("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(); } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 + SemVer.prototype.format = function() { + this.version = this.major + "." + this.minor + "." + this.patch; + if (this.prerelease.length) { + this.version += "-" + this.prerelease.join("."); + } + return this.version; }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug5.disable(); - debug5.enable(enabledNamespaces2 + "," + logger.namespace); + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug5("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __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"; + 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); }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve5, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); + 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]; + debug5("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); } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + } 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]; + debug5("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); } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + } 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 = parse(version1); + var v2 = parse(version2); + var prefix = ""; + if (v1.prerelease.length || v2.prerelease.length) { + prefix = "pre"; + var defaultResult = "prerelease"; } - try { - buildPromise((x) => { - removeListeners(); - resolve5(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + for (var key in v1) { + if (key === "major" || key === "minor" || key === "patch") { + if (v1[key] !== v2[key]) { + return prefix + key; + } + } } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); + return defaultResult; + } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/delay.js -var require_delay = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/delay.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.calculateRetryDelay = calculateRetryDelay; - var createAbortablePromise_js_1 = require_createAbortablePromise(); - var random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve5) => { - token = setTimeout(resolve5, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage - }); + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - 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 }; + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } -}); - -// 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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + exports2.compare = compare2; + function compare2(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - function getErrorMessage2(e) { - if (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}`; - } + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare2(a, b, true); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + 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); } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare2(b, a, loose); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; + exports2.gt = gt; + function gt(a, b, loose) { + return compare2(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID() { - return uuidFunction(); + exports2.lt = lt; + function lt(a, b, loose) { + return compare2(a, b, loose) < 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.eq = eq; + function eq(a, b, loose) { + return compare2(a, b, loose) === 0; } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); + exports2.neq = neq; + function neq(a, b, loose) { + return compare2(a, b, loose) !== 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare2(a, b, loose) >= 0; + } + exports2.lte = lte; + function lte(a, b, loose) { + return compare2(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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); + } + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url = new URL(value); - if (!url.search) { - return value; - } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); - } + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - return url.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; + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - 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; + comp = comp.trim().split(/\s+/).join(" "); + debug5("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; + } + debug5("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); } }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug5("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; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); + } + 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; } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; + rangeTmp = new Range2(comp.value, options); + return satisfies2(this.value, rangeTmp, options); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + rangeTmp = new Range2(this.value, options); + return satisfies2(comp.semver, rangeTmp, options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); + 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; }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - 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(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + exports2.Range = Range2; + function Range2(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); + } } + if (range instanceof Comparator) { + return new Range2(range.value, options); + } + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { 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]); + Range2.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(" ").trim(); + }).join("||").trim(); + return this.range; }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } 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 (error4) { - e = { error: error4 }; - } 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); + Range2.prototype.toString = function() { + return this.range; }; - } - 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); + Range2.prototype.parseRange = function(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug5("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); }); - }; - 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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); - }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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); } + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; }; - 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); + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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); + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { + return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); }; - __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]; - } }; + 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(); } - 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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os2 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + return result; } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os2.arch()}-${os2.type()}-${os2.release()})`); + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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 parseComparator(comp, options) { + debug5("comp", comp, options); + comp = replaceCarets(comp, options); + debug5("caret", comp); + comp = replaceTildes(comp, options); + debug5("tildes", comp); + comp = replaceXRanges(comp, options); + debug5("xrange", comp); + comp = replaceStars(comp, options); + debug5("stars", comp); + return comp; } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + function isX(id) { + return !id || id.toLowerCase() === "x" || id === "*"; } - 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; + function replaceTildes(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceTilde(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); + function replaceTilde(comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("tilde", comp, _, 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) { + debug5("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - 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"); + debug5("tilde return", ret); + return ret; + }); } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); } - function isBlob(x) { - return typeof x.stream === "function"; - } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; - } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); - } - } - function createFileFromStream(stream, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + function replaceCaret(comp, options) { + debug5("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("caret", comp, _, 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) { + debug5("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 { + debug5("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"; + } } - return s; - }, [rawContent]: stream }); + debug5("caret return", ret); + return ret; + }); } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); - } + function replaceXRanges(comp, options) { + debug5("replaceXRanges", comp, options); + return comp.split(/\s+/).map(function(comp2) { + return replaceXRange(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); + 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) { + debug5("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; } - yield yield tslib_1.__await(value); } - } finally { - reader.releaseLock(); + 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; } + debug5("xRange return", ret); + return ret; }); } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } + function replaceStars(comp, options) { + debug5("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - function ensureNodeStream(stream) { - if (stream instanceof ReadableStream) { - makeAsyncIterable(stream); - return node_stream_1.Readable.fromWeb(stream); + 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 { - return stream; + from = ">=" + from; } - } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); + 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 { - return ensureNodeStream(source); + to = "<=" + to; } + return (from + " " + to).trim(); } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } + 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(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug5(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; + } + } + return false; + } + return true; } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - return result; + return range.test(version); } - 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; + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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; } - 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; + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - return total; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 && range.test(minver)) { + return minver; + } + return null; } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; } - request.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`); + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + if (satisfies2(version, range, options)) { + return false; } - } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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}`); + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.set[i2]; + var high = null; + var low = null; + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); } - 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`); + 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; } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); + }); + 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 = parse(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 match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } - }; + safeRe[t.COERCERTL].lastIndex = -1; + } + if (match === null) { + return null; + } + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { +// 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.decompressResponsePolicyName = void 0; - exports2.decompressResponsePolicy = decompressResponsePolicy; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; - } + 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); } }); -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/cache/lib/internal/cacheUtils.js +var require_cacheUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/cacheUtils.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"; + 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]; + } }; } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay(delayInMs, value, options) { - return new Promise((resolve5, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); + 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; }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); } - timer = setTimeout(() => { - removeListeners(); - resolve5(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - 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/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { - "use strict"; + }; + 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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); + }); + }; + } + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ value: v2, done: d }); + }, reject); + } + }; 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; + 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 core14 = __importStar2(require_core()); + var exec = __importStar2(require_exec()); + var glob = __importStar2(require_glob()); + var io5 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs7 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 = path7.join(baseLocation, "actions", "temp"); } - 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 (_a) { - return void 0; - } - } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + const dest = path7.join(tempDirectory, crypto2.randomUUID()); + yield io5.mkdirP(dest); + return dest; + }); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; - } - return { - retryAfterInMs - }; - } - }; + function getArchiveFileSizeInBytes(filePath) { + return fs7.statSync(filePath).size; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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 glob.create(patterns.join("\n"), { + implicitDescendants: false + }); + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path7.relative(workspace, file).replace(new RegExp(`\\${path7.sep}`, "g"), "/"); + core14.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); + } else { + paths.push(`${relativeFile}`); + } } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + return paths; + }); } - 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"; + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs7.unlink)(filePath); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.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; + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() } - } + }); + } catch (err) { + core14.debug(err.message); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + versionOutput = versionOutput.trim(); + core14.debug(versionOutput); + return versionOutput; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core14.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; + } + }); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + function getCacheFileName(compressionMethod) { + return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); - } + function getGnuTarPathOnWindows() { + return __awaiter2(this, void 0, void 0, function* () { + if (fs7.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io5.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - /** - * 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() }); + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - /** - * 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)); + components.push(versionSalt); + return crypto2.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"); } - /** - * 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); + return token; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __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 core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); - } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); - } - }; - } - 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, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); - } - } - } - request.multipartBody = { parts }; +// 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; } -}); - -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); + 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 _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.addInitializer = function(f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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; - } + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; } - 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"; + } + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return ms + " ms"; } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { 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]); + }; } -}); - -// 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 hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug5(...args) { - if (!debug5.enabled) { - return; + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) 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: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; } - const self2 = debug5; - 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"); + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug5.namespace = namespace; - debug5.useColors = createDebug.useColors(); - debug5.color = createDebug.selectColor(namespace); - debug5.extend = extend3; - debug5.destroy = createDebug.destroy; - Object.defineProperty(debug5, "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 (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug5); - } - return debug5; - } - function extend3(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); + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; } - } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } - 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(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; - } - 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; + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; } - module2.exports = setup; + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } -}); - -// 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`."); - } +} +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); + }); }; - })(); - 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+)/); + if (f) i[n] = f(i[n]); } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } + } + 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(resolve5, reject) { + v = o[n](v), settle(resolve5, reject, v.done, v.value); }); - args.splice(lastC, 0, c); + }; + } + function settle(resolve5, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve5({ 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]; } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { - } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function load2() { - let r; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + inner.call(this); + } catch (e) { + return Promise.reject(e); } - return r; - } - function localstorage() { + }; + 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 { - return localStorage; - } catch (error4) { + 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); } } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.message; + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path7, preserveJsx) { + if (typeof path7 === "string" && /^\.\.?\//.test(path7)) { + return path7.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path7; +} +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/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports2, module2) { +// 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"; - 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); + 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/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { +// 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"; - var os2 = 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; + 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}`); } - 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); - } + } +}); + +// 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); } - function translateLevel(level) { - if (level === 0) { - return false; + 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); + } } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - if (hasFlag("color=256")) { - return 2; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; + } } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; + } } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - if (process.platform === "win32") { - const osRelease = os2.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; + 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; } - 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; + 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(debug5, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug5(...args) { + if (!newDebugger.enabled) { + return; } - return min; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; } - if (env.COLORTERM === "truecolor") { - return 3; + return false; + } + function extend3(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 ("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 (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(", ")}.`); } } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; + function createLogger(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; } - if ("COLORTERM" in env) { - return 1; + function contextGetLogLevel() { + return logLevel; } - return min; + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - 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 util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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 (error4) { +// 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(); } - 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, (_, k) => { - return k.toUpperCase(); - }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - obj[prop] = val2; - 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]; + 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]); + } + } } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; + /** + * 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() }); } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; + /** + * 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; } - } - function load2() { - return process.env.DEBUG; - } - function init(debug5) { - debug5.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug5.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + /** + * 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); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); + } } }); -// 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/@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/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - async function toBuffer(stream) { - let length = 0; - const chunks = []; - for await (const chunk of stream) { - length += chunk.length; - chunks.push(chunk); - } - return Buffer.concat(chunks, length); - } - exports2.toBuffer = toBuffer; - async function json2(stream) { - const buf = await toBuffer(stream); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; - } - } - exports2.json = json2; - function req(url, opts = {}) { - const href = typeof url === "string" ? url : url.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); - const promise = new Promise((resolve5, reject) => { - req2.once("response", resolve5).once("error", reject).end(); - }); - req2.then = promise.then.bind(promise); - return req2; + } +}); + +// 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(); } - exports2.req = req; } }); -// node_modules/agent-base/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/agent-base/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); }; + 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.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = 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; + 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; } - decrementSockets(name, socket) { - if (!this.sockets[name] || socket === null) { - return; + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - const sockets = this.sockets[name]; - const index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - } - // 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); + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - return super.getName(options); + this._policies.push({ + policy, + options + }); + this._orderedPolicies = void 0; } - 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); - } + 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[INTERNAL].currentSocket = socket; - super.createSocket(req, options, cb); - }, (err) => { - this.decrementSockets(name, fakeSocket); - cb(err); }); + this._orderedPolicies = void 0; + return removedPolicies; } - 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); + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + clone() { + return new _HttpPipeline(this._policies); } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; - } + static create() { + return new _HttpPipeline(); } - }; - 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 __importDefault4 = 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 = __importDefault4(require_src()); - var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve5, 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); + orderPolicies() { + const result = []; + const policyMap = /* @__PURE__ */ new Map(); + function createPhase(name) { + return { + name, + policies: /* @__PURE__ */ new Set(), + hasRun: false, + hasAfterPolicies: false + }; } - function onend() { - cleanup(); - debug5("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + 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; + } } - function onerror(err) { - cleanup(); - debug5("onerror %o", err); - reject(err); + 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); } - 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) { - debug5("have not received end of HTTP headers yet..."); - read(); - return; + 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}`); } - 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")); + if (options.afterPolicies) { + for (const afterPolicyName of options.afterPolicies) { + const afterNode = policyMap.get(afterPolicyName); + if (afterNode) { + node.dependsOn.add(afterNode); + afterNode.dependants.add(node); + } + } } - const firstLineParts = firstLine.split(" "); - const statusCode = +firstLineParts[1]; - const statusText = firstLineParts.slice(2).join(" "); - const headers = {}; - for (const header of headerParts) { - if (!header) + 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; - 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; + 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); } } - debug5("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve5({ - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug5 = (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 HttpsProxyAgent = 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 ?? {}; - debug5("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 ? omit(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:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); - } else { - debug5("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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 -`; + 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); + } + } } - 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) { - debug5("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + 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 socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug5("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + return result; } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); - } - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + function createEmptyPipeline() { + return HttpPipeline.create(); } } }); -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug5 = (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 ?? {}; - debug5("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 ? omit(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 url = new url_1.URL(req.path, base); - if (opts.port !== 80) { - url.port = String(opts.port); - } - req.path = String(url); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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; - debug5("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug5("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); - debug5("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug5("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 omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { +// 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.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_log(); - 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; + 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; } - const httpsProxy = getEnvironmentValue(HTTPS_PROXY); - const allProxy = getEnvironmentValue(ALL_PROXY); - const httpProxy = getEnvironmentValue(HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; + return false; } - function isBypassed(uri, noProxyList, bypassedMap) { - if (noProxyList.length === 0) { - return false; - } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + } +}); + +// 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())); } - 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; - } + /** + * 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 + }; } - } else { - if (host === pattern) { - isBypassedFlag = true; + 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); } - } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 value; + }, 2); } - return []; - } - function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return void 0; + /** + * 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 parsedUrl = new URL(proxyUrl); - const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + const url = new URL(value); + if (!url.search) { + return value; } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } } - request.agent = cachedAgents.httpsProxyAgent; - } - } - function proxyPolicy(proxySettings, options) { - if (!noProxyListLoaded) { - exports2.globalNoProxyList.push(...loadNoProxy()); + return url.toString(); } - const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); - const cachedAgents = {}; - return { - name: exports2.proxyPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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 next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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 next(request); } - }; - } + return sanitized; + } + }; + exports2.Sanitizer = Sanitizer; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { +// 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.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); - } - }; + 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/@azure/core-tracing/dist/commonjs/tracingContext.js -var require_tracingContext = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js"(exports2) { +// 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.TracingContextImpl = exports2.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; + 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); } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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) { +// 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.state = void 0; - exports2.state = { - instrumenterImplementation: void 0 - }; + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; - } - exports2.getInstrumenter = getInstrumenter; - } -}); - -// 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 = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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 - }; - } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __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 core_util_1 = require_commonjs2(); - 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 { - 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 }); - Object.setPrototypeOf(this, _RestError.prototype); - } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } - }; - exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - function isRestError(e) { - if (e instanceof RestError) { - return true; - } - return (0, core_util_1.isError)(e) && e.name === "RestError"; - } - } -}); - -// 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_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.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); - } - span.setStatus({ - status: "success" - }); - 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/createPipelineFromOptions.js -var require_createPipelineFromOptions = __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_logPolicy(); - var pipeline_js_1 = require_pipeline(); - var redirectPolicy_js_1 = require_redirectPolicy(); - var userAgentPolicy_js_1 = require_userAgentPolicy(); - var multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { +// 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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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(stream) { + if (stream.readable === false) { + return Promise.resolve(); + } return new Promise((resolve5) => { const handler = () => { resolve5(); @@ -39223,6 +37898,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -39236,25 +37913,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -39263,13 +37937,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -39293,8 +37970,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -39316,7 +37996,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -39334,9 +38014,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -39345,29 +38024,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url = new URL(request.url); const isInsecure = url.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url.hostname, path: `${url.pathname}${url.search}`, port: url.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve5, reject) => { - const req = isInsecure ? http.request(options, resolve5) : https2.request(options, resolve5); + const req = isInsecure ? node_http_1.default.request(options, resolve5) : node_https_1.default.request(options, resolve5); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -39388,30 +38066,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -39434,11 +38113,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream.pipe(inflate); return inflate; } @@ -39458,7 +38137,7 @@ var require_nodeHttpClient = __commonJS({ resolve5(Buffer.concat(buffer).toString("utf8")); }); stream.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -39489,9 +38168,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -39502,1760 +38181,1368 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; - } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + logger(`Response status code: ${response.status}`); + logger(`Headers: ${sanitizer.sanitize(response.headers)}`); + return response; + } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); + } + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.throttlingRetryPolicyName = void 0; - exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; - function throttlingRetryPolicy(options = {}) { - var _a; - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; - } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + } +}); + +// 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(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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(); + return next(request); } }; - function refresh(scopes, getTokenOptions) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + } + } +}); + +// 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 = delay; + exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; + var AbortError_js_1 = require_AbortError(); + var StandardAbortMessage = "The operation was aborted."; + function delay(delayInMs, value, options) { + return new Promise((resolve5, 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(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve5(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; } - } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + return void 0; } - op = body.call(thisArg, _); - } 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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 }; + 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"; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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"; } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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]; + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); +}); + +// 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]; }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(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(); + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug5(...args) { + if (!debug5.enabled) { + return; + } + const self2 = debug5; + 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 index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; }); - } 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(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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]; + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); } - return t; - }; - return __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 - }; - } -}); - -// 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 { - /** - * 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"); + debug5.namespace = namespace; + debug5.useColors = createDebug.useColors(); + debug5.color = createDebug.selectColor(namespace); + debug5.extend = extend3; + debug5.destroy = createDebug.destroy; + Object.defineProperty(debug5, "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(debug5); } - 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_commonjs2(); - 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + return debug5; } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + function extend3(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; } - /** - * 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"); + 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); + } } - 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"); + 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; + } } - this._name = newName; - this._key = newKey; + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; } - /** - * 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"); + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } } - this._signature = signature; + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + return false; } - /** - * 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"); + function coerce3(val) { + if (val instanceof Error) { + return val.stack || val.message; } - this._signature = newSignature; + return val; } - }; - 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); + 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/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); +// 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+)/); } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); - } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; - } -}); - -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); + exports2.log = console.debug || console.log || (() => { }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { + function save(namespaces) { try { - step(generator.next(value)); - } catch (e) { - reject(e); + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { } } - function rejected(value) { + function load2() { + let r; try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + function localstorage() { + try { + return localStorage; + } catch (error3) { + } } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(thisArg, body) { - var _ = { 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]); + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; + } }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; +}); + +// 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 os2 = 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); } - op = body.call(thisArg, _); - } 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 }; + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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 = os2.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; } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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]; + function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; } - 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) { +}); + +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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 { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve5, reject) { - v = o[n](v), settle(resolve5, reject, v.done, v.value); + 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, (_, k) => { + return k.toUpperCase(); }); - }; - } - function settle(resolve5, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve5({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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]; + 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); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + 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]; + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); + function load2() { + return process.env.DEBUG; + } + function init(debug5) { + debug5.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug5.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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 __assign3.apply(this, arguments); + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; - __createBinding3 = Object.create ? (function(o, m, k, k2) { + } +}); + +// 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)) { @@ -41267,7697 +39554,15306 @@ var init_tslib_es63 = __esm({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { + })); + 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; }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 - }; - } -}); - -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + async function toBuffer(stream) { + let length = 0; + const chunks = []; + for await (const chunk of stream) { + length += chunk.length; + chunks.push(chunk); + } + return Buffer.concat(chunks, length); } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); + exports2.toBuffer = toBuffer; + async function json2(stream) { + const buf = await toBuffer(stream); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); + exports2.json = json2; + function req(url, opts = {}) { + const href = typeof url === "string" ? url : url.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); + const promise = new Promise((resolve5, reject) => { + req2.once("response", resolve5).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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 = "_"; + exports2.req = req; } }); -// node_modules/@azure/core-client/dist/commonjs/utils.js -var require_utils5 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { +// node_modules/agent-base/dist/index.js +var require_dist = __commonJS({ + "node_modules/agent-base/dist/index.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; + 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]; + } }; } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); + 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); } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, parsedHeaders), { blobBody: fullResponse.blobBody, readableStreamBody: fullResponse.readableStreamBody }); + __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] = {}; } - const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {}; - const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); - if (expectedBodyTypeName === "Sequence" || isPageableResponse) { - const arrayResponse = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; + /** + * 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:"; } } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } } - 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) - }); - } - exports2.flattenResponse = flattenResponse; - } -}); - -// 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 = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + // 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); } - /** - * @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}.`); + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options) }; - 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); + 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); + } } - 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); - } - } + this[INTERNAL].currentSocket = socket; + super.createSocket(req, options, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); } - /** - * 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, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - } - }; - let payload = {}; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = void 0; + if (!socket) { + throw new Error("No socket was returned in the `connect()` function"); } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; + return socket; + } + get defaultPort() { + return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; } - if (mapper.isConstant) { - object = mapper.defaultValue; + } + get protocol() { + return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); + } + }; + 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 debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve5, reject) => { + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once("readable", read); } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); + function cleanup() { + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("readable", read); } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + function onend() { + cleanup(); + debug5("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); } - if (object === void 0 || object === null) { - payload = object; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + function onerror(err) { + cleanup(); + debug5("onerror %o", err); + reject(err); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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) { + debug5("have not received end of HTTP headers yet..."); + read(); + return; } - 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]; - } + 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")); } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; + 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}"`)); } - } else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; - } else if (responseBody === "false") { - payload = false; + 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 { - payload = responseBody; + headers[key] = value; } - } 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); } + debug5("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve5({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - } - }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); - } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; - } - return str2.substr(0, len); + socket.on("error", onerror); + socket.on("end", onend); + read(); + }); } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + exports2.parseProxyResponse = parseProxyResponse; + } +}); + +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug5 = (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 + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port + }; } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; - } + /** + * 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'); } - } - 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.`); - } + let socket; + if (proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + } else { + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - } - 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(); + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - 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.`); + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - value = base64.encodeByteArray(value); + 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) { + debug5("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; + } + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug5("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } - return value; + }; + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - function serializeBase64UrlType(objectName, value) { - if (value !== void 0 && value !== null) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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_dist(); + var url_1 = require("url"); + var debug5 = (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 ?? {}; + debug5("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 ? omit(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 url = new url_1.URL(req.path, base); + if (opts.port !== 80) { + url.port = String(opts.port); + } + req.path = String(url); + const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - return value; + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); + } + let first; + let endOfHeaders; + debug5("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug5("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); + debug5("Output buffer: %o", req.outputData[0].data); + } + let socket; + if (this.proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug5("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 omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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()]; } - 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}.`); + return void 0; + } + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + 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 tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + 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 { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); + } else { + return stream; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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 stream of streams) { + for await (const chunk of stream) { + 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 { - 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; - } + total += partLength; } } - 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 total; + } + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); } - return instance; + request.body = await (0, concat_js_1.concat)(sources); } - 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}`); + 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 (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; + if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { + throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); } - return responseBody; } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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]; + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); + } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); + } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + }; + } + } +}); + +// 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); } - return tempArray; + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); - } - } - } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return void 0; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); - } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + } +}); + +// 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 url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; } + return next(req); } - } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; - } + exports2.ensureSecureConnection = ensureSecureConnection; + var log_js_1 = require_log2(); + var insecureConnectionWarningEmmitted = false; + function allowInsecureConnection(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url = new URL(request.url); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; } } - return value; + return false; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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]; + function emitInsecureConnectionWarning() { + const warning9 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning9); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning9); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } else { - break; + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info6 = state_js_1.state.operationRequestMap.get(request); - if (!info6) { - info6 = {}; - state_js_1.state.operationRequestMap.set(request, info6); - } - return info6; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; + } + } +}); + +// 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.deserializationPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } } - return result; + return pipeline; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); } - return result; + return cachedHttpClient; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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]; + } } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if (descriptor.contentType === null) { + return void 0; } - 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 }); - } + if (descriptor.contentType) { + return descriptor.contentType; } - return parsedResponse; + 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 isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escapeDispositionField(value) { + return JSON.stringify(value); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; - } + function getContentDisposition(descriptor) { + const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); + if (contentDispositionHeader) { + return contentDispositionHeader; } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (descriptor.dispositionType === void 0 && descriptor.name === void 0 && descriptor.filename === void 0) { + return void 0; } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + const dispositionType = descriptor.dispositionType ?? "form-data"; + let disposition = dispositionType; + if (descriptor.name) { + disposition += `; name=${escapeDispositionField(descriptor.name)}`; } - return { error: error4, shouldReturnResponse: false }; - } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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; } } - return operationResponse; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; + } + return disposition; } - } -}); - -// 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); } - return result; + 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}`); } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + 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); } - return result; + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } + 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_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + const headers = response.headers.toJSON(); + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; + if (options?.onResponse) { + options.onResponse({ ...response, request, rawHeaders: headers, parsedBody }); } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + return { + request, + 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, rawHeaders }, e); } + throw e; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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; + 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 { - if (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; } } + return "application/json"; } - exports2.serializeRequestBody = serializeRequestBody; - 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 buildPipelineRequest(method, url, 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, + 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 prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - 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_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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) }; } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; } - exports2.createClientPipeline = createClientPipeline; - } -}); - -// 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 = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; + 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 + }); } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path7 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path7.startsWith("/")) { - path7 = path7.substring(1); - } - if (isAbsoluteUrl(path7)) { - requestUrl = path7; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path7); - } + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.toString().replace(/([^:]\/)\/+/g, "$1"); + } + function getQueryParamValue(key, allowReserved, style, param) { + let separator; + if (style === "pipeDelimited") { + separator = "|"; + } else if (style === "spaceDelimited") { + separator = "%20"; + } else { + separator = ","; } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + 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]; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; } - } - return result; - } - function isAbsoluteUrl(url) { - return url.includes("://"); + 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 appendPath(url, pathToAppend) { - if (!pathToAppend) { + function appendQueryParams(url, options = {}) { + if (!options.queryParameters) { return url; } const parsedUrl = new URL(url); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path7 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path7; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } + 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)); } - if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "CSV" || queryParameter.collectionFormat === "Pipes")) { - queryParameterValue = queryParameterValue.join(delimiter); + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); } - result.set(queryParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter), queryParameterValue); + } 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)); } } - return { - queryParams: result, - sequenceParams - }; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return result; + return endpoint; } - function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url; + 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)); } - const parsedUrl = new URL(url); - 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); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - 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}`); + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path7, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path7, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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."); } - } else { - searchPieces.push(`${name}=${value}`); } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); + }; } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, options), { credentialOptions })); + 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 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; + 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/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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)(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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 getLogLevel() { + return context2.getLogLevel(); } - 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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + } +}); + +// 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 + }); } - 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) => Object.assign(Object.assign({}, a), b), {}); + } +}); + +// 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 + }; } - function requestToOptions(request) { + } +}); + +// 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 { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions + 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/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } + 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 + }); } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); + } +}); + +// 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); } - var HttpHeaders = class _HttpHeaders { - 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } + 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"; } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - exports2.toPipelineResponse = toPipelineResponse; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.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) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + 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-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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.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); } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); + 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.requestPolicyFactoryPolicyName, + name: exports2.userAgentPolicyName, async sendRequest(request, 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); + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; + 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); } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + 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/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } +// 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(); } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + 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); } - }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; + } } }); -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { +// 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"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError = class extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } + 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((resolve5, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - return i; - } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); + if (abortSignal?.aborted) { + return rejectOnAbort(); } - } - return true; - } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; - } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; - } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col + try { + buildPromise((x) => { + removeListeners(); + resolve5(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } - }; - } - function validateAttrName(attrName) { - return util.isName(attrName); + abortSignal?.addEventListener("abort", onAbort); + }); } - function validateTagName(tagname) { - return util.isName(tagname); + } +}); + +// 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 = delay; + exports2.calculateRetryDelay = calculateRetryDelay; + var createAbortablePromise_js_1 = require_createAbortablePromise(); + var util_1 = require_internal3(); + var StandardAbortMessage = "The delay was aborted."; + function delay(timeInMs, options) { + let token; + const { abortSignal, abortErrorMsg } = options ?? {}; + return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve5) => { + token = setTimeout(resolve5, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage + }); } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; + 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 }; } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; + } +}); + +// 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 { - exp += xmlData[i]; + stringified = String(e); } + } catch (err) { + stringified = "[unable to stringify input]"; } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); - } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); + return `Unknown error ${stringified}`; } - return { entities, i }; } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; + } +}); + +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } } - return [entityName2, val2, i]; + return true; } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; + } +}); + +// 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 isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; - } - } else { - return str2; - } - } + function isError(e) { + return tspRuntime.isError(e); } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; + function isObject2(input) { + return tspRuntime.isObject(input); } - module2.exports = toNumber; - } -}); - -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; - } - return () => false; + 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); } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + 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 replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); + 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"); } - return val2; }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; - } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; - } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - function findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); } else { - return closingIndex + str2.length - 1; + return blob; } } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + function createFileFromStream(stream, name, options = {}) { return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName + ...unimplementedMethods, + type: options.type ?? "", + lastModified: options.lastModified ?? (/* @__PURE__ */ new Date()).getTime(), + webkitRelativePath: options.webkitRelativePath ?? "", + size: options.size ?? -1, + name, + stream: () => { + const s = stream(); + if (isNodeReadableStream(s)) { + throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + } + return s; + }, + [rawContent]: stream }; } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } - } - } + 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 parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } + return source.map((x) => x); } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; + 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } + return tspPolicy.sendRequest(request, next); } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + }; } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; +// 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/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; +// 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); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; + } +}); + +// 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)(); } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + } +}); + +// 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 replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; - } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; - } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } + }; } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; - } - } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); + } +}); + +// 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); } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; - } + } +}); + +// 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); } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder + 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; + } + 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-xml/dist/commonjs/xml.common.js -var require_xml_common = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.common.js"(exports2) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + exports2.state = void 0; + exports2.state = { + instrumenterImplementation: void 0 + }; } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false + end: () => { + }, + isRecording: () => false, + recordException: () => { + }, + setAttribute: () => { + }, + setStatus: () => { + }, + addEvent: () => { + } }; } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + 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 getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - 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, ""); + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); + } + return state_js_1.state.instrumenterImplementation; } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); + } +}); + +// 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 + }; } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; + 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(); + } } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; - } + function parseTraceparentHeader(traceparentHeader) { + return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); } - return parsedXml; + function createRequestHeaders(tracingContext) { + return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + } + return { + startSpan, + withSpan, + withContext, + parseTraceparentHeader, + createRequestHeaders + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; + 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; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return xml_common_js_1.XML_CHARKEY; + var tracingClient_js_1 = require_tracingClient(); + Object.defineProperty(exports2, "createTracingClient", { enumerable: true, get: function() { + return tracingClient_js_1.createTracingClient; } }); } }); -// 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_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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(request, next) { + if (!tracingClient) { + return next(request); + } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; + } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); + } + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; + } } - return abortedMap.get(this); + }; + } + 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; } - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - static get none() { - return new _AbortSignal(); + } + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { + request.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; } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - listeners.push(listener); + span.end(); + } catch (e) { + log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + 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)}`); } - /** - * 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."); + } + } +}); + +// 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 }; } - }; - function abortSignal(signal) { - if (signal.aborted) { - return; + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; } - if (signal.onabort) { - signal.onabort.call(signal); + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; + } } - const listeners = listenersMap.get(signal); - if (listeners) { - listeners.slice().forEach((listener) => { - listener.call(signal, { type: "abort" }); - }); + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); } - abortedMap.set(signal, true); + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; } - 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(); - }); + } +}); + +// 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); } } - } - /** - * 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/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - throw error4; - }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return { - code, - message - }; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - 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}`; + } +}); + +// 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(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - 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, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; - } - } - return { response, status }; + } +}); + +// 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); } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); - } + } +}); + +// 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); } - function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; + } +}); + +// 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); } - function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; + } +}); + +// 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); } - function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; + } +}); + +// 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); } - function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; + } +}); + +// 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 + }); } - function findResourceLocation(inputs) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } + } +}); + +// 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; } } - } - 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; + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } + return token; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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; + }; } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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"; + } +}); + +// 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(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - 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; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true + }; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - return void 0; } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error4; + function isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { + const { scopes } = onChallengeOptions; + const accessToken = await onChallengeOptions.getAccessToken(scopes, { + enableCae: true, + claims: caeClaims + }); + if (!accessToken) { + return false; } - return void 0; + onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); + return true; } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return initOperation({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig + 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(request, next) { + if (!request.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, + getAccessToken, + logger }); - 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 - }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } + } + }; } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + } + } + return next(request); } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + }; + } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - case "Body": - default: { - return void 0; + }; + } + } +}); + +// 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); + } +}); + +// 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"); } - case "Body": { - return getProvisioningState(rawResponse); + 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + 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"; } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + } +}); + +// 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; } - return state.config.resourceLocation; - } - function isOperationError(e) { - return e.name === "RestError"; - } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); - } - var createStateProxy$1 = () => ({ /** - * 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. + * 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 */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => state.status = "canceled", - setError: (state, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } }; } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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; + } +}); + +// 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_utils6 = __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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + } + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + 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]; + } } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (parsedHeaders) { + for (const key of Object.keys(parsedHeaders)) { + arrayResponse[key] = parsedHeaders[key]; + } } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + 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_utils6(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Serializes the Poller operation. + * @deprecated Removing the constraints validation on client side. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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); + } + } } - }; - 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); + * Serialize the given object based on its metadata defined in the mapper * - * // You can assign more local properties here. - * } - * } - * ``` + * @param mapper - The mapper which defines the metadata of the serializable object * - * 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. + * @param object - A valid Javascript object to be serialized * - * 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: + * @param objectName - Name of the serialized object * - * ```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 options - additional options to serialization * - * @param operation - Must contain the basic properties of `PollOperation`. + * @returns A valid serialized Javascript object */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve5, reject) => { - this.resolve = resolve5; - 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; + serialize(mapper, object, 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; } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - } - /** - * 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) - }); + if (mapper.isConstant) { + object = mapper.defaultValue; } - this.processUpdatedState(); + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. + * Deserialize the given object based on its metadata defined in the mapper * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * @param mapper - The mapper which defines the metadata of the serializable object * - * @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. + * @param responseBody - A valid Javascript entity to be deserialized * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @param objectName - Name of the deserialized object * - * @param options - Optional properties passed to the operation's update method. + * @param options - Controls behavior of XML parser and builder. + * + * @returns A valid deserialized Javascript object */ - 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; + 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; } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + 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 (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + if (mapper.isConstant) { + payload = mapper.defaultValue; } + return payload; } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; + } + return str2.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 str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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 = ""; + } } - 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); - }; + return classes; + } + function dateToUnixTime(d) { + if (!d) { + return void 0; } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + if (typeof d.valueOf() === "string") { + d = new Date(d); } - /** - * 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")); + 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.`); } } } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + 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.`); } - /** - * 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"); + const isPresent = allowedValues.some((item) => { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); } - return this.cancelPromise; + return item === value; + }); + if (!isPresent) { + throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); } - /** - * 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; + 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); } - /** - * 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; + 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); } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); + 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}".`); + } + } } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + return value; + } + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve5) => setTimeout(() => resolve5(), this.config.intervalInMs)); + 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}.`); } - }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs7 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; + } + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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; + } } - n.default = e; - return Object.freeze(n); + return tempArray; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs7); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - /** - * 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); + 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}.`); } - /** - * 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); + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + 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; } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path7 = urlParsed.pathname; - path7 = path7 || "/"; - path7 = escape(path7); - urlParsed.pathname = path7; - return urlParsed.toString(); + return tempDictionary; } - 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]; - } - } + 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 proxyUri; + return additionalProperties; } - function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; + 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 ""; + return modelProps; } - function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - 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'"); + if (object !== void 0 && object !== null) { + const payload = {}; + const modelProps = resolveModelProperties(serializer, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); + 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) && (object[key] !== void 0 && object[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 = object[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; + } + } } - 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 escape(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 path7 = urlParsed.pathname; - path7 = path7 ? path7.endsWith("/") ? `${path7}${name}` : `${path7}/${name}` : name; - urlParsed.pathname = path7; - 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); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } } } + return payload; } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); - } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : 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}`; + return object; } - 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; + function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; } - return queries; - } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + 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; + } } - 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"; + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + function isSpecialXmlProperty(propertyName, options) { + return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + 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 res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay(timeInMs, aborter, abortError) { - return new Promise((resolve5, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve5(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== void 0) { - aborter.addEventListener("abort", abortHandler); + 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; } - }); - } - 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); + 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; + } } - return padString.slice(0, targetLength) + currentString; } - } - 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 = ""; + 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 accountName; - } catch (error4) { - throw new Error("Unable to extract accountName with provided information."); } + return instance; } - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); } + return tempDictionary; } - return tagPairs.join("&"); + return responseBody; } - function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + 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 res; + return responseBody; } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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); + } + } + } } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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 res; + return mapper; } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + 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]; } - 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 - } + 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); } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - }; - case "parquet": - return { - format: { - type: "parquet" + 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 = {}; } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + value[propertyName] = propertyValue; + } + } } + return value; } - 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); + 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 { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); + break; } } - return orProperties; + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } + let info6 = state_js_1.state.operationRequestMap.get(request); + if (!info6) { + info6 = {}; + state_js_1.state.operationRequestMap.set(request, info6); + } + return info6; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; } - 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; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } - 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 - }; - } + return result; } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return split.join("/"); + return result; } - function assertResponse(response) { - if (`_response` in response) { - return response; + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; } - throw new TypeError(`Unexpected response object ${response}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); + const operationSpec = operationInfo?.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + const responseSpec = getOperationResponseMap(parsedResponse); + const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); + if (error3) { + throw error3; + } else if (shouldReturnResponse) { + return parsedResponse; } - /** - * 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); + 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 (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); } - let response; + } + 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 parse(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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; + 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; } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw 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; } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; + 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)); } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; + } + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } 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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + } + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path7 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path7.startsWith("/")) { + path7 = path7.substring(1); + } + if (isAbsoluteUrl(path7)) { + requestUrl = path7; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path7); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + 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); } - } else { - delayTimeInMs = Math.random() * 1e3; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } - }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + return result; + } + function isAbsoluteUrl(url) { + return url.includes("://"); + } + function appendPath(url, pathToAppend) { + if (!pathToAppend) { + return url; } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + const parsedUrl = new URL(url); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path7 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path7; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + } + } else { + newPath = newPath + pathToAppend; } - }; - 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; + parsedUrl.pathname = newPath; + return parsedUrl.toString(); } - 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; + 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 pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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(url, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url; + } + const parsedUrl = new URL(url); + 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_utils6(); + 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(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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 request; + } 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") { + request.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)) { + request[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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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_util8(); + 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(request, 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)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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 = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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 = delay; + 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(url) { + const urlParsed = new URL(url); + let path7 = urlParsed.pathname; + path7 = path7 || "/"; + path7 = escape(path7); + urlParsed.pathname = path7; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path7 = urlParsed.pathname; + path7 = path7 ? path7.endsWith("/") ? `${path7}${name}` : `${path7}/${name}` : name; + urlParsed.pathname = path7; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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 delay(timeInMs, aborter, abortError) { + return new Promise((resolve5, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve5(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path7 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path7}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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((resolve5, 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(resolve5).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve5(); + } + } + }); + }); + } + /** + * 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 = delay; + 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(url) { + const urlParsed = new URL(url); + let path7 = urlParsed.pathname; + path7 = path7 || "/"; + path7 = escape(path7); + urlParsed.pathname = path7; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path7 = urlParsed.pathname; + path7 = path7 ? path7.endsWith("/") ? `${path7}${name}` : `${path7}/${name}` : name; + urlParsed.pathname = path7; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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 delay(timeInMs, aborter, abortError) { + return new Promise((resolve5, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve5(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path7 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path7}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path7 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path7}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path7 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path7}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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" + } + } + } + } } - 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; + } + }; + 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" + } + } + } + } } } - return false; - } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { - /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - - */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; + }; + 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" + } + } + } } - /** - * Signs request. - * - * @param request - - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + }; + 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" + } + } } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; } - /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; + }; + 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" + } + } } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + } + }; + 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" + } + } } - 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + }; + 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" + } } - 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(request) { - const path7 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path7}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } } - return canonicalizedResourceString; } }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); + 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" + } + } + } } }; - var StorageSharedKeyCredential = class extends Credential { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + 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" + } + } + } } }; - var AnonymousCredentialPolicy = class extends 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.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" + } + } + } } }; - var AnonymousCredential = class extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + 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" + } + } + } } }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + 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" + } } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; - } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + 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" } } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } + }; + 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" + } } } - return false; } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; + }; + 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" + } } - } else { - delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } + }; + 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" } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + }, + 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" } - attempt++; - } - if (response) { - return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; } - return value; } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); + }; + 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" + } } } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; } - function getCanonicalizedResourceString(request) { - const path7 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path7}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; - } - var StorageBrowserPolicy = class extends 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(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); - } - }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + 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" + } + } } } - return { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); + }; + 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" + } + } } - }; - } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * 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 - }; } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); - } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; - } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; + 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" + } + } } } - return void 0; - } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }; + exports2.ContainerCreateHeaders = { + serializedName: "Container_createHeaders", + type: { + name: "Composite", + className: "ContainerCreateHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } - } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }, + 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" } } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); } - pipeline._corePipeline = corePipeline; - } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); - } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; + }; + 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" + } + } } } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; - } - return factory.constructor.name === "StorageSharedKeyCredential"; - } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; - } - return factory.constructor.name === "AnonymousCredential"; - } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); - } - function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; - } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof 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 (request) => { - return { - request, - headers: request.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); - }); - } - var BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", + }; + exports2.ContainerGetPropertiesHeaders = { + serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", - className: "BlobServiceProperties", + className: "ContainerGetPropertiesHeaders", modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "Logging" + name: "Dictionary", + value: { type: { name: "String" } } } }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Composite", - className: "Metrics" + name: "String" } }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "Metrics" + name: "DateTimeRfc1123" } }, - cors: { - serializedName: "Cors", - xmlName: "Cors", - xmlIsWrapped: true, - xmlElementName: "CorsRule", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", + 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" } }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "StaticWebsite" + 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" } } } } }; - var Logging = { - serializedName: "Logging", + exports2.ContainerDeleteHeaders = { + serializedName: "Container_deleteHeaders", type: { name: "Composite", - className: "Logging", + className: "ContainerDeleteHeaders", modelProperties: { - version: { - serializedName: "Version", - required: true, - xmlName: "Version", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleteProperty: { - serializedName: "Delete", - required: true, - xmlName: "Delete", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - read: { - serializedName: "Read", - required: true, - xmlName: "Read", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - write: { - serializedName: "Write", - required: true, - xmlName: "Write", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; - var RetentionPolicy = { - serializedName: "RetentionPolicy", + exports2.ContainerDeleteExceptionHeaders = { + serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", - className: "RetentionPolicy", + className: "ContainerDeleteExceptionHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var Metrics = { - serializedName: "Metrics", + exports2.ContainerSetMetadataHeaders = { + serializedName: "Container_setMetadataHeaders", type: { name: "Composite", - className: "Metrics", + className: "ContainerSetMetadataHeaders", modelProperties: { - version: { - serializedName: "Version", - xmlName: "Version", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - } - } - } - }; - var CorsRule = { - serializedName: "CorsRule", - type: { - name: "Composite", - className: "CorsRule", - modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", - required: true, - xmlName: "AllowedOrigins", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - allowedMethods: { - serializedName: "AllowedMethods", - required: true, - xmlName: "AllowedMethods", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", + } + } + } + }; + exports2.ContainerSetMetadataExceptionHeaders = { + serializedName: "Container_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var StaticWebsite = { - serializedName: "StaticWebsite", + exports2.ContainerGetAccessPolicyHeaders = { + serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", - className: "StaticWebsite", + className: "ContainerGetAccessPolicyHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["container", "blob"] } }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } - } - } - } - }; - var StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - code: { - serializedName: "Code", - xmlName: "Code", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -48965,106 +54861,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", + exports2.ContainerGetAccessPolicyExceptionHeaders = { + serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", - className: "BlobServiceStatistics", + className: "ContainerGetAccessPolicyExceptionHeaders", modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "GeoReplication" + name: "String" } } } } }; - var GeoReplication = { - serializedName: "GeoReplication", + exports2.ContainerSetAccessPolicyHeaders = { + serializedName: "Container_setAccessPolicyHeaders", type: { name: "Composite", - className: "GeoReplication", + className: "ContainerSetAccessPolicyHeaders", modelProperties: { - status: { - serializedName: "Status", - required: true, - xmlName: "Status", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] + name: "String" } }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListContainersSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } + name: "String" } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + } + } + } + }; + 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" } @@ -49072,184 +54951,218 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", + exports2.ContainerRestoreHeaders = { + serializedName: "Container_restoreHeaders", type: { name: "Composite", - className: "ContainerItem", + className: "ContainerRestoreHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, version: { - serializedName: "Version", - xmlName: "Version", + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "ContainerProperties" + name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; - var ContainerProperties = { - serializedName: "ContainerProperties", + exports2.ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", - className: "ContainerProperties", + className: "ContainerRestoreExceptionHeaders", modelProperties: { - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + 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" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + 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" } }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "String" } }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", + 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: "Boolean" + name: "String" } - }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", + } + } + } + }; + 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: "Boolean" + name: "String" } }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", - type: { - name: "Number" - } - }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", - type: { - name: "Boolean" - } } } } }; - var KeyInfo = { - serializedName: "KeyInfo", + exports2.ContainerFilterBlobsExceptionHeaders = { + serializedName: "Container_filterBlobsExceptionHeaders", type: { name: "Composite", - className: "KeyInfo", + className: "ContainerFilterBlobsExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49257,457 +55170,429 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { - serializedName: "UserDelegationKey", + exports2.ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", - className: "UserDelegationKey", + className: "ContainerAcquireLeaseHeaders", modelProperties: { - signedObjectId: { - serializedName: "SignedOid", - required: true, - xmlName: "SignedOid", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", + exports2.ContainerAcquireLeaseExceptionHeaders = { + serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "ContainerAcquireLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - where: { - serializedName: "Where", - required: true, - xmlName: "Where", + } + } + } + }; + exports2.ContainerReleaseLeaseHeaders = { + serializedName: "Container_releaseLeaseHeaders", + type: { + name: "Composite", + className: "ContainerReleaseLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - blobs: { - serializedName: "Blobs", - required: true, - xmlName: "Blobs", - xmlIsWrapped: true, - xmlElementName: "Blob", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } - } - } - } - }; - var FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", - type: { - name: "Composite", - className: "FilterBlobItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - tags: { - serializedName: "Tags", - xmlName: "Tags", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobTags" + name: "DateTimeRfc1123" } } } } }; - var BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", + exports2.ContainerReleaseLeaseExceptionHeaders = { + serializedName: "Container_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobTags", + className: "ContainerReleaseLeaseExceptionHeaders", modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } + name: "String" } } } } }; - var BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", + exports2.ContainerRenewLeaseHeaders = { + serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", - className: "BlobTag", + className: "ContainerRenewLeaseHeaders", modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + 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" + } } } } }; - var SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", + exports2.ContainerRenewLeaseExceptionHeaders = { + serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "SignedIdentifier", + className: "ContainerRenewLeaseExceptionHeaders", modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } } } } }; - var AccessPolicy = { - serializedName: "AccessPolicy", + exports2.ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", - className: "AccessPolicy", + className: "ContainerBreakLeaseHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", + 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" } }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", + 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" + } } } } }; - var ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", + exports2.ContainerBreakLeaseExceptionHeaders = { + serializedName: "Container_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "ContainerBreakLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + exports2.ContainerChangeLeaseHeaders = { + serializedName: "Container_changeLeaseHeaders", + type: { + name: "Composite", + className: "ContainerChangeLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } } } } }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", + exports2.ContainerChangeLeaseExceptionHeaders = { + serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobFlatListSegment", + className: "ContainerChangeLeaseExceptionHeaders", modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", + exports2.ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", - className: "BlobItemInternal", + className: "ContainerListBlobFlatSegmentHeaders", 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", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", 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", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobTags" + name: "String" } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTimeRfc1123" } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49715,1017 +55600,720 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.ContainerListBlobHierarchySegmentHeaders = { + serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "ContainerListBlobHierarchySegmentHeaders", modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", - type: { - name: "DateTimeRfc1123" - } - }, - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + } + } + } + }; + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { + serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + type: { + name: "Composite", + className: "ContainerListBlobHierarchySegmentExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "ByteArray" + name: "String" } - }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + } + } + } + }; + 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" } }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { name: "Enum", - allowedValues: ["locked", "unlocked"] + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { name: "Enum", allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "Boolean" } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + } + } + } + }; + 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" } - }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + } + } + } + }; + exports2.BlobDownloadHeaders = { + serializedName: "Blob_downloadHeaders", + type: { + name: "Composite", + className: "BlobDownloadHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "DateTimeRfc1123" + name: "Dictionary", + value: { type: { name: "String" } } } }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { - name: "Boolean" + name: "Dictionary", + value: { type: { name: "String" } } } }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "Boolean" + name: "Number" } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + contentRange: { + serializedName: "content-range", + xmlName: "content-range", type: { - name: "Number" + name: "String" } }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "String" } }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Boolean" + name: "ByteArray" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "String" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { - name: "DateTimeRfc1123" + name: "String" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", 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", + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: ["High", "Standard"] - } - }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", - type: { - name: "DateTimeRfc1123" + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", - type: { - name: "Boolean" - } - } - } - } - }; - var 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, + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } - }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment", - modelProperties: { - blobPrefixes: { - serializedName: "BlobPrefixes", - xmlName: "BlobPrefixes", - xmlElementName: "BlobPrefix", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobPrefix" - } - } + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } - } - } - } - }; - var BlobPrefix = { - serializedName: "BlobPrefix", - type: { - name: "Composite", - className: "BlobPrefix", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "Composite", - className: "BlobName" + name: "Enum", + allowedValues: ["locked", "unlocked"] } - } - } - } - }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } - } - } - } - }; - var BlockList = { - serializedName: "BlockList", - type: { - name: "Composite", - className: "BlockList", - modelProperties: { - committedBlocks: { - serializedName: "CommittedBlocks", - xmlName: "CommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } }, - uncommittedBlocks: { - serializedName: "UncommittedBlocks", - xmlName: "UncommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "Boolean" } - } - } - } - }; - var Block = { - serializedName: "Block", - type: { - name: "Composite", - className: "Block", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", + 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" } - } - } - } - }; - var PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "Boolean" } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } - } - } - } - }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", - type: { - name: "Composite", - className: "PageRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Number" + name: "ByteArray" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { name: "Number" } - } - } - } - }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", - type: { - name: "Composite", - className: "ClearRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "Number" + name: "Boolean" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { - name: "Number" + name: "DateTimeRfc1123" } - } - } - } - }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + }, + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "String" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "Composite", - className: "QuerySerialization" + name: "Boolean" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "BlobDownloadExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.BlobGetPropertiesHeaders = { + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "BlobGetPropertiesHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "DateTimeRfc1123" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "Dictionary", + value: { type: { name: "String" } } } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { name: "Dictionary", - value: { type: { name: "any" } } + value: { type: { name: "String" } } } - } - } - } - }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + }, + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { - name: "String" + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { - name: "Boolean" + name: "String" } - } - } - } - }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration", - modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + }, + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } - } - } - } - }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration", - modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } - } - } - } - }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", - type: { - name: "Composite", - className: "ArrowField", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + }, + isIncrementalCopy: { + serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { - name: "String" + name: "Boolean" } }, - name: { - serializedName: "Name", - xmlName: "Name", + destinationSnapshot: { + serializedName: "x-ms-copy-destination-snapshot", + xmlName: "x-ms-copy-destination-snapshot", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Number" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "Number" + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } - } - } - } - }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "String" + name: "Enum", + allowedValues: ["locked", "unlocked"] } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } - } - } - } - }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } - } - } - } - }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -50754,210 +56342,137 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } - } - } - } - }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + 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", + accessTier: { + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { name: "String" } - } - } - } - }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + accessTierInferred: { + serializedName: "x-ms-access-tier-inferred", + xmlName: "x-ms-access-tier-inferred", type: { - name: "String" + name: "Boolean" } - } - } - } - }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + archiveStatus: { + serializedName: "x-ms-archive-status", + xmlName: "x-ms-archive-status", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + accessTierChangedOn: { + serializedName: "x-ms-access-tier-change-time", + xmlName: "x-ms-access-tier-change-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + expiresOn: { + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "String" + name: "Boolean" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + rehydratePriority: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, - date: { - serializedName: "date", - xmlName: "date", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "DateTimeRfc1123" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { name: "Boolean" } @@ -50972,11 +56487,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "BlobGetPropertiesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50988,15 +56503,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.BlobDeleteHeaders = { + serializedName: "Blob_deleteHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "BlobDeleteHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } @@ -51015,11 +56530,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, errorCode: { @@ -51032,11 +56547,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", + exports2.BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", + className: "BlobDeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51048,11 +56563,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", + exports2.BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + className: "BlobUndeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51092,11 +56607,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", + className: "BlobUndeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51108,11 +56623,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "BlobSetExpiryHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51155,22 +56670,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", + exports2.BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateExceptionHeaders", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51182,21 +56690,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", + exports2.BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "BlobSetHttpHeadersHeaders", 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", @@ -51211,34 +56710,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "Number" } }, clientRequestId: { @@ -51269,49 +56745,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51322,11 +56755,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51338,11 +56771,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.BlobSetImmutabilityPolicyHeaders = { + serializedName: "Blob_setImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + className: "BlobSetImmutabilityPolicyHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51372,21 +56805,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" + } + }, + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "BlobSetImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51398,26 +56839,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.BlobDeleteImmutabilityPolicyHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "BlobDeleteImmutabilityPolicyHeaders", 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", @@ -51445,22 +56872,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51472,34 +56892,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.BlobSetLegalHoldHeaders = { + serializedName: "Blob_setLegalHoldHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "BlobSetLegalHoldHeaders", 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", @@ -51528,21 +56926,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "String" + name: "Boolean" } } } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51554,11 +56952,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "BlobSetMetadataHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51595,6 +56993,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51602,6 +57007,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51612,11 +57038,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "BlobSetMetadataExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51628,12 +57054,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + 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", @@ -51661,22 +57108,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "BlobAcquireLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51688,12 +57128,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -51721,22 +57175,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51748,58 +57195,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "BlobRenewLeaseHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -51831,11 +57253,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51847,11 +57269,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "BlobChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51867,13 +57289,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51888,6 +57303,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51905,11 +57327,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", + className: "BlobChangeLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51921,11 +57343,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "BlobBreakLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51941,6 +57363,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51972,11 +57401,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51988,12 +57417,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "BlobCreateSnapshotHeaders", modelProperties: { + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", + type: { + name: "String" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -52008,13 +57444,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52036,21 +57465,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52062,11 +57512,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlobStartCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52082,13 +57532,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52110,21 +57553,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52132,15 +57604,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlobCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52156,13 +57642,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52184,21 +57663,71 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52206,23 +57735,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52261,11 +57797,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52277,19 +57813,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlobSetTierHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52311,13 +57840,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52328,11 +57850,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52344,11 +57866,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52416,11 +57938,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52432,11 +57954,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlobQueryHeaders", modelProperties: { lastModified: { serializedName: "last-modified", @@ -52445,13 +57967,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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-", @@ -52461,22 +57976,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52555,7 +58054,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - copyCompletedOn: { + copyCompletionTime: { serializedName: "x-ms-copy-completion-time", xmlName: "x-ms-copy-completion-time", type: { @@ -52649,20 +58148,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52712,47 +58197,71 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "ByteArray" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } - }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + } + } + } + }; + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", + type: { + name: "Composite", + className: "BlobQueryExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + 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" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, errorCode: { @@ -52761,22 +58270,75 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "ByteArray" + 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" } } } } }; - var BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52788,160 +58350,121 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesHeaders = { - serializedName: "Blob_getPropertiesHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlobGetPropertiesHeaders", + className: "PageBlobCreateHeaders", 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", + etag: { + serializedName: "etag", + xmlName: "etag", 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "DateTimeRfc1123" } }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "DateTimeRfc1123" } }, - isIncrementalCopy: { - serializedName: "x-ms-incremental-copy", - xmlName: "x-ms-incremental-copy", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - destinationSnapshot: { - serializedName: "x-ms-copy-destination-snapshot", - xmlName: "x-ms-copy-destination-snapshot", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", + } + } + } + }; + 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", @@ -52949,6 +58472,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, contentMD5: { serializedName: "content-md5", xmlName: "content-md5", @@ -52956,32 +58486,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, blobSequenceNumber: { @@ -53019,23 +58528,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -53054,106 +58549,101 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessTierInferred: { - serializedName: "x-ms-access-tier-inferred", - xmlName: "x-ms-access-tier-inferred", + } + } + } + }; + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobUploadPagesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - archiveStatus: { - serializedName: "x-ms-archive-status", - xmlName: "x-ms-archive-status", + } + } + } + }; + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", + type: { + name: "Composite", + className: "PageBlobClearPagesHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + date: { + serializedName: "date", + xmlName: "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", @@ -53164,11 +58654,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53180,19 +58670,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "BlobDeleteHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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", @@ -53214,6 +58732,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53224,11 +58763,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53236,16 +58775,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + 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", @@ -53284,11 +58858,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53300,12 +58874,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -53313,11 +58894,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -53347,15 +58928,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "BlobSetExpiryExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53367,11 +58955,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersHeaders", + className: "PageBlobResizeHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53432,11 +59020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53448,12 +59036,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", + 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", @@ -53482,29 +59091,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } } } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53516,12 +59117,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", + 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", @@ -53549,15 +59164,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53569,12 +59206,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldHeaders", + 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", @@ -53596,6 +59254,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -53603,21 +59268,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + 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" + } } } } }; - var BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53629,11 +59315,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "BlobSetMetadataHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53649,6 +59335,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53670,13 +59370,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -53684,6 +59377,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53715,11 +59422,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "BlobSetMetadataExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53731,11 +59438,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53751,18 +59458,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, requestId: { @@ -53785,15 +59492,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53801,15 +59550,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseHeaders", + className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53852,15 +59615,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } } } } }; - var BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53872,11 +59642,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "BlobRenewLeaseHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53892,11 +59662,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -53920,21 +59690,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53946,11 +59751,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "BlobChangeLeaseHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53966,6 +59771,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53980,16 +59792,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } @@ -54000,16 +59812,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", - modelProperties: { + }, + 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", @@ -54020,32 +59844,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + 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", @@ -54074,15 +59914,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54094,31 +59969,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotHeaders", + className: "BlockBlobStageBlockFromURLHeaders", modelProperties: { - snapshot: { - serializedName: "x-ms-snapshot", - xmlName: "x-ms-snapshot", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, clientRequestId: { @@ -54142,13 +60010,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54163,6 +60024,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54173,11 +60048,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54185,28 +60060,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLHeaders", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { etag: { serializedName: "etag", xmlName: "etag", type: { - name: "String" + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, clientRequestId: { @@ -54244,19 +60147,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -54269,11 +60178,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", + exports2.BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", + className: "BlockBlobCommitBlockListExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54285,12 +60194,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", + exports2.BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", type: { name: "Composite", - className: "BlobCopyFromURLHeaders", + className: "BlockBlobGetBlockListHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -54298,11 +60214,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" + } + }, + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", + type: { + name: "Number" } }, clientRequestId: { @@ -54326,13 +60249,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54340,8621 +60256,7791 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", + } + } + } + }; + 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" } - }, - 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", + } + } + } + }; + } +}); + +// 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: "String" + name: "Enum", + allowedValues: ["metadata", "deleted", "system"] } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + } + } + }, + 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: "String" + name: "Composite", + className: "SignedIdentifier" } } } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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" } } }; - var 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.sourceLeaseId = { + parameterPath: ["options", "sourceLeaseId"], + mapper: { + serializedName: "x-ms-source-lease-id", + xmlName: "x-ms-source-lease-id", + type: { + name: "String" } } }; - var 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.comp10 = { + parameterPath: "comp", + mapper: { + defaultValue: "lease", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.action = { + parameterPath: "action", + mapper: { + defaultValue: "acquire", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.duration = { + parameterPath: ["options", "duration"], + mapper: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Number" } } }; - var 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.proposedLeaseId = { + parameterPath: ["options", "proposedLeaseId"], + mapper: { + serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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.action1 = { + parameterPath: "action", + mapper: { + defaultValue: "release", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.action3 = { + parameterPath: "action", + mapper: { + defaultValue: "break", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.breakPeriod = { + parameterPath: ["options", "breakPeriod"], + mapper: { + serializedName: "x-ms-lease-break-period", + xmlName: "x-ms-lease-break-period", + type: { + name: "Number" } } }; - var 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.action4 = { + parameterPath: "action", + mapper: { + defaultValue: "change", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.proposedLeaseId1 = { + parameterPath: "proposedLeaseId", + mapper: { + serializedName: "x-ms-proposed-lease-id", + required: true, + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetTagsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + exports2.include1 = { + parameterPath: ["options", "include"], + mapper: { + serializedName: "include", + xmlName: "include", + xmlElementName: "ListBlobsIncludeItem", + type: { + name: "Sequence", + element: { type: { - name: "String" + 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" + } } }; - var 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.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" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var 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.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] } } }; - var 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.sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.sourceIfMatch = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], + mapper: { + serializedName: "x-ms-source-if-match", + xmlName: "x-ms-source-if-match", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var 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.comp15 = { + parameterPath: "comp", + mapper: { + defaultValue: "copy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", + mapper: { + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", + type: { + name: "String" } } }; - var 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.copyId = { + parameterPath: "copyId", + mapper: { + serializedName: "copyid", + required: true, + xmlName: "copyid", + type: { + name: "String" } } }; - var 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.comp16 = { + parameterPath: "comp", + mapper: { + defaultValue: "tier", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", + mapper: { + defaultValue: "query", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.blobContentLength = { + parameterPath: "blobContentLength", + mapper: { + serializedName: "x-ms-blob-content-length", + required: true, + xmlName: "x-ms-blob-content-length", + type: { + name: "Number" } } }; - var 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.blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], + mapper: { + defaultValue: 0, + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" } } }; - var 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.contentType1 = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/octet-stream", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" } } }; - var 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.body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.accept2 = { + parameterPath: "accept", + mapper: { + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" } } }; - var 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.comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "page", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.pageWrite = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" } } }; - var 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.ifSequenceNumberLessThanOrEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", + type: { + name: "Number" } } }; - var 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.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" } } }; - var 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.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], + mapper: { + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", + type: { + name: "ByteArray" } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.range1 = { + parameterPath: "range", + mapper: { + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.comp20 = { + parameterPath: "comp", + mapper: { + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], + mapper: { + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", + type: { + name: "String" } } }; - var 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.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], + mapper: { + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", + type: { + name: "String" } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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"] } } }; - var 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.comp21 = { + parameterPath: "comp", + mapper: { + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blobType1 = { + parameterPath: "blobType", + mapper: { + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" } } - }; - var 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.comp22 = { + parameterPath: "comp", + mapper: { + defaultValue: "appendblock", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], + exports2.appendPosition = { + parameterPath: [ + "options", + "appendPositionAccessConditions", + "appendPosition" + ], mapper: { - defaultValue: "application/xml", + 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: "Content-Type", + serializedName: "comp", type: { name: "String" } } }; - var blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + exports2.blobType2 = { + parameterPath: "blobType", + mapper: { + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" + } + } }; - var accept = { - parameterPath: "accept", + exports2.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - defaultValue: "application/xml", + 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: "Accept", + 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 url = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" + var deleteOperationSpec = { + path: "/{containerName}", + httpMethod: "DELETE", + responses: { + 202: { + headersMapper: Mappers.ContainerDeleteHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerDeleteExceptionHeaders } }, - skipEncoding: true + 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 restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 + var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerSetAccessPolicyHeaders }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" + 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 version = { - parameterPath: "version", - mapper: { - defaultValue: "2024-11-04", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" + 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 requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" + 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 accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" + 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 marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" + 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 maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 + var breakLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.ContainerBreakLeaseHeaders }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" + 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 include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + var changeLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerChangeLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerChangeLeaseExceptionHeaders } }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + 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 comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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 }; - var comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } + /** + * 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); } - }; - var multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } + /** + * 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); } - }; - var comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + /** + * 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); } - }; - var access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } + /** + * 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); } - }; - var defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } + /** + * 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); } - }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } + /** + * 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); } - }; - var comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } + /** + * 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); } - }; - var comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" - } + /** + * 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); } - }; - var comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } }; - var action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" + 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 proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" + 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 action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + var setMetadataOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.BlobSetMetadataHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetMetadataExceptionHeaders } - } - }; - var 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" - ] - } - } + }, + 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 } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" + 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 ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" + 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 ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" + 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 deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] + 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 }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * 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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * 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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" - } + /** + * 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); } }; - var comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" + 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 immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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 comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" + 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 comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + 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 rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + var copyIncrementalOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.PageBlobCopyIncrementalHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCopyIncrementalExceptionHeaders } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } + } +}); + +// 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; } - }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * 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); } }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" + 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 sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" + 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 legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" + 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 }; - var sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } + } +}); + +// 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; } - }; - var copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } + /** + * 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); } - }; - var 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"] - } + /** + * 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); } - }; - var comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" - } + /** + * 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); } - }; - var copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" - } + /** + * 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); } }; - var comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } - } - }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags + }, + 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 transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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 transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" + 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 }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + } +}); + +// 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(url, options) { + if (url === void 0) { + throw new Error("'url' cannot be null"); } - } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + if (!options) { + options = {}; } - } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + const defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; + super(optionsWithDefaults); + this.url = url; + 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); } }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } + 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(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + const storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = void 0; } }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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; } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + /** + * 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; } - } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.add) { + blobSASPermissions.add = true; } - } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.create) { + blobSASPermissions.create = true; } - } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + if (permissionLike.write) { + blobSASPermissions.write = true; } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" + if (permissionLike.delete) { + blobSASPermissions.delete = true; } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" + if (permissionLike.deleteVersion) { + blobSASPermissions.deleteVersion = true; } - } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.tag) { + blobSASPermissions.tag = true; } - } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + if (permissionLike.move) { + blobSASPermissions.move = true; } - } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.execute) { + blobSASPermissions.execute = true; } - } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + if (permissionLike.setImmutabilityPolicy) { + blobSASPermissions.setImmutabilityPolicy = true; } - } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + if (permissionLike.permanentDelete) { + blobSASPermissions.permanentDelete = true; } + return blobSASPermissions; } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + /** + * 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"); } - } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + 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"); } - } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - } - }; - var 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"] + if (this.permanentDelete) { + permissions.push("y"); } + return permissions.join(""); } }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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; } - }; - var blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + /** + * 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; } - } - }; - var comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.add) { + containerSASPermissions.add = true; } - } - }; - var maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + if (permissionLike.create) { + containerSASPermissions.create = true; } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + if (permissionLike.write) { + containerSASPermissions.write = true; } - } - }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.delete) { + containerSASPermissions.delete = true; } - } - }; - var comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.list) { + containerSASPermissions.list = true; } - } - }; - var blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.deleteVersion) { + containerSASPermissions.deleteVersion = true; } - } - }; - var copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + if (permissionLike.tag) { + containerSASPermissions.tag = true; } - } - }; - var comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.move) { + containerSASPermissions.move = true; } - } - }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + if (permissionLike.execute) { + containerSASPermissions.execute = true; } - } - }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList - }; - var comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.setImmutabilityPolicy) { + containerSASPermissions.setImmutabilityPolicy = true; } - } - }; - var listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + if (permissionLike.permanentDelete) { + containerSASPermissions.permanentDelete = true; + } + if (permissionLike.filterByTags) { + containerSASPermissions.filterByTags = true; } + return containerSASPermissions; } - }; - var ServiceImpl = class { /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client + * Specifies Read access granted. */ - constructor(client) { - this.client = client; - } + read = false; /** - * 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. + * Specifies Add access granted. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); - } + add = false; /** - * 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. + * Specifies Create access granted. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); - } + create = false; /** - * 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. + * Specifies Write access granted. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); - } + write = false; /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. + * Specifies Delete access granted. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); - } + deleteVersion = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Specifies List access granted. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); - } + list = false; /** - * 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. + * Specfies Tag access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); - } + tag = false; /** - * 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. + * Specifies Move access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); - } - }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + 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"); } - }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + 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(""); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * The storage API version. */ - constructor(client) { - this.client = client; - } + version; /** - * 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. + * Optional. The allowed HTTP protocol(s). */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); - } + protocol; /** - * 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. + * Optional. The start time for this SAS token. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); - } + startsOn; /** - * 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. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); - } + expiresOn; /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); - } + permissions; /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + services; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + resourceTypes; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); - } + identifier; /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Optional. Encryption scope to use when sending requests authorized with this SAS URI. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); - } + encryptionScope; /** - * 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. + * 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 */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); - } + resource; /** - * 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. + * The signature for the SAS token. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } + signature; /** - * [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. + * Value for cache-control header in Blob/File Service SAS. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); - } + cacheControl; /** - * [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. + * Value for content-disposition header in Blob/File Service SAS. */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); - } + contentDisposition; /** - * [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. + * Value for content-encoding header in Blob/File Service SAS. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); - } + contentEncoding; /** - * [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. + * Value for content-length header in Blob/File Service SAS. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); - } + contentLanguage; /** - * [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. + * Value for content-type header in Blob/File Service SAS. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); - } + contentType; /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. + * Inner value of getter ipRange. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); - } + ipRangeInner; /** - * [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. + * The Azure Active Directory object ID in GUID format. + * Property of user delegation key. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); - } + signedOid; /** - * Returns the sku name and account kind - * @param options The options parameters. + * The Azure Active Directory tenant ID in GUID format. + * Property of user delegation key. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); - } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders + 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 + }; } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders + 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; + } } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders + } + /** + * 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; + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + 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; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 + } }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + } + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + } + 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."); } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + } + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + } + 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(); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var BlobImpl = class { - /** - * 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); + 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * 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); + 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(); + } } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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, + timestamp2, + 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."); } - /** - * 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(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); + 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(); + } } - /** - * 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); + 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, + timestamp2, + 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}`); } - /** - * 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); + 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'."); } - /** - * 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(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - /** - * 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); + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - /** - * [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); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - /** - * [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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - /** - * 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); + 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."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + if (version < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - /** - * 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(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + 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; /** - * 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. + * Gets the lease Id. + * + * @readonly */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + get leaseId() { + return this._leaseId; } /** - * Returns the sku name and account kind - * @param options The options parameters. + * Gets the url. + * + * @readonly */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + get url() { + return this._url; } /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); + 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; } /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * 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. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); + 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 + })); + }); } /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. + * 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. */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); - } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders - } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + 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."); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + 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."); } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var PageBlobImpl = class { + 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 + }); + }); + } /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * 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. */ - constructor(client) { - this.client = client; + 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; /** - * 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. + * 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 - */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + 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 { /** - * 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. + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * 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. + * Returns if it was previously specified + * for the file. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * 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. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * 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. + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } /** - * 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. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get contentType() { + return this.originalResponse.contentType; } /** - * 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. + * 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 */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + 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; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get copySource() { + return this.originalResponse.copySource; } /** - * 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. + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get leaseState() { + return this.originalResponse.leaseState; } /** - * 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. + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get leaseStatus() { + return this.originalResponse.leaseStatus; } /** - * 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. + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. + * + * @readonly */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get date() { + return this.originalResponse.date; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + */ + get etag() { + return this.originalResponse.etag; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * The number of tags associated with the blob + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get tagCount() { + return this.originalResponse.tagCount; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * The error code. + * + * @readonly + */ + get errorCode() { + return this.originalResponse.errorCode; } /** - * 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. + * 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). * - * @param permissions - + * @readonly */ - 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; + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * 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. * - * @param permissionLike - + * @readonly */ - 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; + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Returns the date and time the file was last + * modified. Any operation that modifies the file or its properties updates + * the last modified time. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); + get lastModified() { + return this.originalResponse.lastModified; } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + /** + * 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; } /** - * 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. + * Returns the date and time the blob was created. * - * @param permissions - + * @readonly */ - 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; + 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; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates the versionId of the downloaded blob version. * - * @param permissionLike - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Indicates whether version of this blob is a current version. * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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 */ - 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(""); + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * 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) */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get contentCrc64() { + return this.originalResponse.contentCrc64; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Object Replication Policy Id of the destination blob. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * If this blob has been sealed. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + get isSealed() { + return this.originalResponse.isSealed; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } + /** + * Indicates if a legal hold is present on the blob. + * + * @readonly + */ + get legalHold() { + return this.originalResponse.legalHold; } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get contentAsBlob() { + return this.originalResponse.blobBody; } - if (version2 >= "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."); - } + /** + * 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; } - 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."); + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; + 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); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); + if (bytes.length !== length) { + throw new Error("Hit stream end."); } + return bytes; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * Reads a single byte from the stream. + * + * @param stream - + * @param options - + */ + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 1, options); + return buf[0]; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + // 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(stream, options = {}) { + let zigZagEncoded = 0; + let significanceInBit = 0; + let byte, haveMoreByte, significanceInFloat; + do { + byte = await _AvroParser.readByte(stream, 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(stream, 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); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readNull() { + return null; + } + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); + if (b === 1) { + return true; + } else if (b === 0) { + return false; } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat32(0, true); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat64(0, true); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); + if (size < 0) { + throw new Error("Bytes size was negative."); } + return stream.read(size, { abortSignal: options.abortSignal }); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); + return { key, value }; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readMap(stream, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } + return dict; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static async readArray(stream, readItemMethod, options = {}) { + const items = []; + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { + if (count < 0) { + await _AvroParser.readLong(stream, options); + count = -count; + } + while (count--) { + const item = await readItemMethod(stream, options); + items.push(item); + } } + return items; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + return _AvroType.fromObjectSchema(schema2); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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}`); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); + } } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { + } + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + } } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + switch (this._primitive) { + case AvroPrimitive.NULL: + return AvroParser.readNull(); + case AvroPrimitive.BOOLEAN: + return AvroParser.readBoolean(stream, options); + case AvroPrimitive.INT: + return AvroParser.readInt(stream, options); + case AvroPrimitive.LONG: + return AvroParser.readLong(stream, options); + case AvroPrimitive.FLOAT: + return AvroParser.readFloat(stream, options); + case AvroPrimitive.DOUBLE: + return AvroParser.readDouble(stream, options); + case AvroPrimitive.BYTES: + return AvroParser.readBytes(stream, options); + case AvroPrimitive.STRING: + return AvroParser.readString(stream, options); + default: + throw new Error("Unknown Avro Primitive"); + } } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); + return this._symbols[value]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } - if (version2 < "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."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + const readItemMethod = (s, opts) => { + return this._itemType.read(s, opts); + }; + return AvroParser.readMap(stream, readItemMethod, options); } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, 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(stream, options); + } + } + return record; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + }; + } +}); + +// 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; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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; + _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."); } - if (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); + 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._leaseId = leaseId2; - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + }); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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; } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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 tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); + return data; } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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; } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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((resolve5, 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(); + resolve5(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); + } }); - }); - } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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 tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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. @@ -63070,7 +68156,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -63177,14 +68263,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -63227,23 +68305,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63272,7 +68333,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.originalResponse.clientRequestId; } /** - * Indicates the version of the Blob service used + * Indicates the version of the File service used * to execute the request. * * @readonly @@ -63280,22 +68341,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63314,73 +68359,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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; + get blobBody() { + return void 0; } /** * The response body as a node.js Readable stream. * Always undefined in the browser. * - * It will automatically retry when internal read stream unexpected ends. + * It will parse avor data returned by blob query. * * @readonly */ get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** * The HTTP response. @@ -63388,1032 +68385,1289 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get _response() { return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** - * Creates an instance of BlobDownloadResponse. + * Creates an instance of BlobQueryResponse. * * @param originalResponse - - * @param getter - - * @param offset - - * @param count - * @param options - */ - constructor(originalResponse, getter, offset, count, options = {}) { + constructor(originalResponse, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + this.blobDownloadStream = new BlobQuickQueryStream_js_1.BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - 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."); + 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 + } } - return bytes; + }; + } + } +}); + +// 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}`); } - /** - * 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]; + } + 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 + "."; } - // 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 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}`; } - 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."); + 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; } - } - 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."); + case "canceled": { + stateProxy.setCanceled(state); + break; } - 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 }; + 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 + })); } - static async readMap(stream2, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; + } + function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; + } + async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 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 { 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); } - return items; + updateState === null || updateState === void 0 ? void 0 : updateState(state, response); } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); + case "DELETE": { + return void 0; } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + default: { + return getDefault(); } } - }; - var AvroPrimitiveType = class extends AvroType { - 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"); + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; + } } } - }; - var AvroEnumType = class extends AvroType { - 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 { - constructor(types) { - super(); - this._types = types; + } + 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; } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); + } + 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.`); } - }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + 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; + } } - // 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); + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; + } + 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; } - // 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; + 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; } - }; - 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; + 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 true; + return error3; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; + exports2.getErrorFromResponse = getErrorFromResponse; + function calculatePollingIntervalFromDate(retryAfterDate) { + const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; } - get objectIndex() { - return this._objectIndex; + return void 0; + } + function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } } - 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; + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return void 0; + } } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; + case "Body": { + return getProvisioningState(rawResponse); } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + } + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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, 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, + stateProxy, + processResult, + getOperationStatus: getStatusFromInitialResponse, + withOperationLocation, + setErrorAsResult: !resolveOnUnsuccessful }); - await 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; - } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); + 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 }); + } } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; + } 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; } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); + } + 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; } } - yield yield tslib.__await(result); } - }); - } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); - } - return data; - } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + }; + 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; } - get position() { - return this._position; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - async read(size, options = {}) { + async update(options) { var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.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 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 chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve5, 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(); - resolve5(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); - } + 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 }); } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; + } + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } - }; - var BlobQuickQueryStream = class extends stream.Readable { /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * Serializes the Poller operation. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); - } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); - } + toString() { + return JSON.stringify({ + state: this.state + }); } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); + }; + 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); } }; - var BlobQueryResponse = class { - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + 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 { /** - * Returns if it was previously specified - * for the file. + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @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. + * 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. * - * @readonly - */ - get contentDisposition() { - return this.originalResponse.contentDisposition; - } - /** - * Returns the value that was specified - * for the Content-Encoding request header. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @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. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @readonly - */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; - } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * // You can assign more local properties here. + * } + * } + * ``` * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. + * 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. * - * @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. + * 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: * - * @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. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get contentRange() { - return this.originalResponse.contentRange; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve5, reject) => { + this.resolve = resolve5; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get contentType() { - return this.originalResponse.contentType; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * 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. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get copyCompletedOn() { - return void 0; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get copyId() { - return this.originalResponse.copyId; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * 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. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @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. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get copySource() { - return this.originalResponse.copySource; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' - * - * @readonly + * Invokes the underlying operation's cancel method. */ - get copyStatus() { - return this.originalResponse.copyStatus; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. + * 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. * - * @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'. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + 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; } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; + 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()); + } } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get date() { - return this.originalResponse.date; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly + * Returns true if the poller has finished polling. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. - * - * @readonly + * Stops the poller from continuing to poll. */ - get etag() { - return this.originalResponse.etag; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * The error code. - * - * @readonly + * Returns true if the poller is stopped. */ - get errorCode() { - return this.originalResponse.errorCode; + isStopped() { + return this.stopped; } /** - * 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). + * Attempts to cancel the underlying operation. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @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. + * If it's called again before it finishes, it will throw an error. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get lastModified() { - return this.originalResponse.lastModified; + 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; } /** - * A name-value pair - * to associate with a file storage object. + * Returns the state of the operation. * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * 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. * - * @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. + * Example: * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the File service used - * to execute the request. + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } * - * @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. + * // 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; + * } * - * @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. + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... * - * @readonly - */ - get blobBody() { - return void 0; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * 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, * - * It will parse avor data returned by blob query. + * // The only other property needed by PublicState. + * publicProperty: state.publicProperty + * } + * } + * } + * ``` * - * @readonly + * You can see this in the tests of this repository, go to the file: + * `../test/utils/testPoller.ts` + * and look for the getOperationState implementation. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve5) => setTimeout(() => resolve5(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -64421,20 +69675,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -64442,10 +69697,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -64485,12 +69740,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + 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.`); @@ -64500,27 +69764,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -64535,8 +69833,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -64551,9 +69849,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve5, reject) => { this.emitter.on("finish", resolve5); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -64590,333 +69888,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve5, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve5).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve5(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream2, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve5, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream2.on("readable", () => { + const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); resolve5(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -64924,28 +69925,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve5(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream2, buffer2, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve5, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -64956,18 +69957,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream.on("end", () => { resolve5(pos); }); - stream2.on("error", reject); + stream.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve5, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve5(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve5, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -64978,9 +69991,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_utils7(); + 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. */ @@ -64996,49 +70048,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -65047,8 +70099,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -65057,8 +70109,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -65088,7 +70140,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -65097,76 +70149,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -65174,8 +70256,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -65183,9 +70264,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -65194,7 +70275,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -65211,9 +70295,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -65224,7 +70308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -65234,7 +70318,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -65245,17 +70329,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -65263,19 +70355,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -65285,19 +70379,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65307,13 +70409,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -65324,7 +70426,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -65336,14 +70438,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -65354,22 +70458,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65385,15 +70491,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -65403,15 +70511,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -65422,24 +70537,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65460,57 +70577,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * Example using copy cancellation: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -65518,15 +70636,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -65538,14 +70656,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -65555,36 +70673,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -65595,31 +70716,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -65627,12 +70749,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -65643,26 +70765,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -65676,8 +70801,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await streamToBuffer(stream2, buffer2, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -65685,7 +70810,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -65705,10 +70830,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -65723,7 +70851,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -65739,7 +70867,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -65751,21 +70879,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -65773,12 +70903,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -65790,18 +70920,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve5) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve5(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve5((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -65810,17 +70946,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve5) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve5((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. @@ -65828,8 +71014,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -65840,8 +71026,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -65854,8 +71040,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -65865,60 +71051,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -65929,40 +71120,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -65970,20 +71176,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65996,20 +71213,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -66018,29 +71237,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -66055,7 +71289,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -66069,74 +71303,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -66148,8 +71397,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -66158,15 +71407,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -66182,26 +71448,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -66219,7 +71487,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -66230,32 +71498,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66280,22 +71564,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -66303,10 +71602,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -66324,7 +71623,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -66341,18 +71640,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -66363,30 +71663,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66394,20 +71696,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -66436,18 +71740,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -66474,7 +71778,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -66495,23 +71799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -66521,32 +71824,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -66572,15 +71875,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -66599,27 +71905,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream2, + const scheduler = new storage_common_1.BufferScheduler( + stream, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -66637,50 +71943,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -66691,13 +72005,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -66705,23 +72019,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66730,21 +72046,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -66752,7 +72080,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -66760,19 +72088,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -66785,7 +72115,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -66796,32 +72126,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -66830,13 +72163,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -66846,7 +72181,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -66855,16 +72190,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -66872,22 +72209,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -66907,17 +72246,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -66926,94 +72263,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobs + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * 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()`: - * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67039,13 +72361,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67055,17 +72380,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -67074,7 +72401,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67082,20 +72409,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67116,17 +72445,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -67136,94 +72463,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67232,7 +72553,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -67250,13 +72573,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67264,24 +72590,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -67289,12 +72617,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -67302,22 +72632,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67327,38 +72659,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_utils7(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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."); @@ -67369,15 +72735,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -67389,18 +72755,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -67420,7 +72786,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -67435,7 +72801,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -67450,6 +72816,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -67489,6 +72865,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve5(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -67505,11 +72883,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -67533,13 +72936,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -67551,13 +72954,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; + let url; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -67566,28 +72969,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; + let url; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -67595,24 +72998,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + await new Clients_js_1.BlobClient(url, 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -67625,9 +73036,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -67636,19 +73047,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -67657,23 +73068,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path7 = getURLPath(subRequest.url); + const path7 = (0, utils_common_js_1.getURLPath)(subRequest.url); if (!path7 || path7 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } @@ -67684,7 +73095,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -67701,7 +73112,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -67712,7 +73123,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -67723,18 +73134,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url2, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path7 = getURLPath(url2); + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path7 = (0, utils_common_js_1.getURLPath)(url); if (path7 && path7 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { @@ -67746,10 +73175,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -67760,7 +73189,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -67778,11 +73207,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -67790,17 +73233,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -67809,10 +73267,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -67829,7 +73289,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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. */ @@ -67838,48 +73326,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -67887,34 +73375,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -67931,7 +73437,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -67953,7 +73459,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67961,7 +73467,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67971,15 +73477,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * const content = "Hello world!"; * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); * ``` */ getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67987,12 +73505,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -68005,14 +73523,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -68020,8 +73542,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -68032,19 +73554,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68056,24 +73585,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -68086,7 +73615,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -68094,8 +73623,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -68144,29 +73673,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -68181,7 +73710,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -68195,7 +73724,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -68205,10 +73734,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -68220,14 +73749,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -68240,18 +73769,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -68260,23 +73809,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -68292,44 +73864,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -68337,64 +73891,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -68402,41 +73955,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -68455,7 +74011,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68472,17 +74031,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -68490,35 +74047,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -68526,118 +74070,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobsByHierarchy + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -68655,7 +74219,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68676,23 +74243,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -68712,18 +74283,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -68734,27 +74303,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -68764,53 +74317,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: * - * ```js - * let i = 1; + * // 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 @@ -68818,11 +74372,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -68834,7 +74387,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -68853,7 +74408,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -68862,14 +74420,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -68881,7 +74439,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -68891,7 +74449,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -68901,18 +74459,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve5) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve5(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve5((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -68921,45 +74482,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve5) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve5((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -69063,6 +74657,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -69070,7 +74716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69117,12 +74763,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -69148,10 +74799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69168,13 +74831,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -69203,6 +74870,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -69224,44 +74907,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -69272,22 +74973,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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. @@ -69302,35 +75031,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url2, credentialOrPipeline, options) { + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url2, pipeline); + super(url, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -69341,22 +75070,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -69373,7 +75111,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -69387,47 +75125,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -69436,15 +75156,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -69454,14 +75174,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -69472,14 +75192,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -69487,7 +75207,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -69499,9 +75219,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -69522,23 +75248,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -69558,18 +75288,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -69580,27 +75308,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -69608,57 +75320,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js + * // Use for await to iterate the blobs * let i = 1; * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // 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 @@ -69670,7 +75378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -69682,7 +75390,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -69701,7 +75411,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69717,45 +75430,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -69763,45 +75458,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientListContainers + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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}`); * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -69823,7 +75514,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -69835,17 +75526,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -69864,7 +75558,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69874,16 +75571,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -69897,19 +75594,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -69917,7 +75622,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69925,21 +75630,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -69947,7 +75653,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69955,66 +75661,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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; + } }); } }); @@ -70099,7 +75863,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70112,21 +75876,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -70154,9 +75928,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core14 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core14 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { constructor(contentLength) { @@ -70239,15 +76014,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -70258,15 +76035,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -70274,7 +76050,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70287,21 +76063,31 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -70329,9 +76115,14 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -70339,14 +76130,12 @@ var require_requestUtils = __commonJS({ } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -70358,14 +76147,13 @@ var require_requestUtils = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve5) => setTimeout(resolve5, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(name_1, method_1, getStatusCode_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { let errorMessage = ""; let attempt = 1; while (attempt <= maxAttempts) { @@ -70374,12 +76162,12 @@ var require_requestUtils = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -70399,42 +76187,183 @@ var require_requestUtils = __commonJS({ yield sleep(delay); attempt++; } - throw Error(`${name} failed: ${errorMessage}`); - }); - } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3( - name, - method, - (response) => response.statusCode, - maxAttempts, - delay, - // If the error object contains the statusCode property, extract it and return - // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { - return { - statusCode: error4.statusCode, - result: null, - headers: {}, - error: error4 - }; - } else { - return void 0; - } + throw Error(`${name} failed: ${errorMessage}`); + }); + } + function retryTypedResponse(name_1, method_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { + return yield retry3( + name, + method, + (response) => response.statusCode, + maxAttempts, + delay, + // 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, delay = constants_1.DefaultRetryDelay) { + return yield retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay); + }); + } + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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(); + }); } - ); - }); - } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay); - }); - } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } + } + /** + * 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; } }); @@ -70442,7 +76371,7 @@ var require_requestUtils = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70455,21 +76384,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -70497,20 +76436,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs7 = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs7 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream.pipeline); yield pipeline(response.message, output); }); @@ -70575,5681 +76517,6855 @@ var require_downloadUtils = __commonJS({ this.displayedComplete = true; } } - /** - * Returns a function used to handle TransferProgressEvents. - */ - onProgress() { - return (progress) => { - this.setReceivedBytes(progress.loadedBytes); + /** + * 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 = fs7.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(); + core14.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 { + core14.debug("Unable to validate download, no Content-Length header"); + } + }); + } + function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const archiveDescriptor = yield fs7.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 >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 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 _a; + 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 = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; + if (contentLength < 0) { + core14.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 = fs7.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)) { + fs7.writeFileSync(fd, result); + } + } + } finally { + downloadProgress.stopDisplayTimer(); + fs7.closeSync(fd); + } + } + }); + } + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { + let timeoutHandle; + const timeoutPromise = new Promise((resolve5) => { + timeoutHandle = setTimeout(() => resolve5("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 core14 = __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; + core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core14.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core14.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; + } + core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core14.debug(`Download concurrency: ${result.downloadConcurrency}`); + core14.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core14.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core14.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core14.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.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"; + } + 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_package2 = __commonJS({ + "node_modules/@actions/cache/package.json"(exports2, module2) { + module2.exports = { + name: "@actions/cache", + version: "5.0.1", + 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.0", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "@actions/http-client": "^3.0.0", + "@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_package2(); + 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(resolve5) { + resolve5(value); + }); } - /** - * 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); + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - }; - 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(); - } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - exports2.DownloadProgress = DownloadProgress; - function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { - const writeStream = fs7.createWriteStream(archivePath); - const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.get(archiveLocation); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache3; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs7 = __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 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 url = `${baseUrl}_apis/artifactcache/${resource}`; + core14.debug(`Resource Url: ${url}`); + return url; + } + function createAcceptHeader(type2, apiVersion) { + return `${type2};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* () { + 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)); })); - downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { - downloadResponse.message.destroy(); - core14.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}`); + if (response.statusCode === 204) { + if (core14.isDebug()) { + yield printCachesListForDiagnostics(keys[0], httpClient, version); } - } else { - core14.debug("Unable to validate download, no Content-Length header"); + return null; + } + if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { + 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."); } + core14.setSecret(cacheDownloadUrl); + core14.debug(`Cache Result:`); + core14.debug(JSON.stringify(cacheResult)); + return cacheResult; }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; - function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs7.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", () => __awaiter4(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: () => __awaiter4(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 = () => __awaiter4(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 >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 10)) { - yield waitAndWrite(); + 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) { + core14.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) || []) { + core14.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}`); } } - while (actives > 0) { - yield waitAndWrite(); - } - } finally { - httpClient.dispose(); - yield archiveDescriptor.close(); } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; - function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(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 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 downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { - return yield httpClient.get(archiveLocation, { - Range: `bytes=${offset}-${offset + count - 1}` - }); + 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); })); - if (!partRes.readBodyBuffer) { - throw new Error("Expected HttpClientResponse to implement readBodyBuffer"); - } - return { - offset, - count, - buffer: yield partRes.readBodyBuffer() + 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* () { + core14.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 downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - 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 = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; - if (contentLength < 0) { - core14.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 = fs7.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)) { - fs7.writeFileSync(fd, result); - } + 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 = fs7.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()]; + core14.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, () => fs7.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 { - downloadProgress.stopDisplayTimer(); - fs7.closeSync(fd); - } + }))); + } finally { + fs7.closeSync(fd); } + return; }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { - let timeoutHandle; - const timeoutPromise = new Promise((resolve5) => { - timeoutHandle = setTimeout(() => resolve5("timeout"), timeoutMs); + 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); + })); }); - return Promise.race([promise, timeoutPromise]).then((result) => { - clearTimeout(timeoutHandle); - return result; + } + function saveCache3(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(); + core14.debug("Upload cache"); + yield uploadFile(httpClient, cacheId, archivePath, options); + core14.debug("Commiting cache"); + const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.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.`); + } + core14.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/@actions/cache/lib/options.js -var require_options = __commonJS({ - "node_modules/@actions/cache/lib/options.js"(exports2) { +// 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"; - var __createBinding4 = 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(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; + } } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + if (parts.length) { + if (i) + parts.push(fromCharCodes(chunk.slice(0, i))); + return parts.join(""); } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core14 = __importStar4(require_core()); - function getUploadOptions(copy) { - const result = { - useAzureSdk: false, - uploadConcurrency: 4, - uploadChunkSize: 32 * 1024 * 1024 + 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 }); }; - if (copy) { - if (typeof copy.useAzureSdk === "boolean") { - result.useAzureSdk = copy.useAzureSdk; + 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; } - if (typeof copy.uploadConcurrency === "number") { - result.uploadConcurrency = copy.uploadConcurrency; + 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]; } - if (typeof copy.uploadChunkSize === "number") { - result.uploadChunkSize = copy.uploadChunkSize; + } + 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]; } } - 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; - core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core14.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); - return result; + throw new Error("invalid varint"); } - exports2.getUploadOptions = getUploadOptions; - 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; + 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; } - if (typeof copy.concurrentBlobDownloads === "boolean") { - result.concurrentBlobDownloads = copy.concurrentBlobDownloads; + } + 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; } - if (typeof copy.downloadConcurrency === "number") { - result.downloadConcurrency = copy.downloadConcurrency; + } + bytes.push(hi >>> 31 & 1); + } + exports2.varint64write = varint64write; + var TWO_PWR_32_DBL = (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_DBL) { + highBits = highBits + (lowBits / TWO_PWR_32_DBL | 0); + lowBits = lowBits % TWO_PWR_32_DBL; } - if (typeof copy.timeoutInMs === "number") { - result.timeoutInMs = copy.timeoutInMs; + } + 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_DBL * 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; } - if (typeof copy.segmentTimeoutInMs === "number") { - result.segmentTimeoutInMs = copy.segmentTimeoutInMs; + 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; } - if (typeof copy.lookupOnly === "boolean") { - result.lookupOnly = copy.lookupOnly; + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push(value & 127 | 128); + value = value >> 7; } + bytes.push(1); } - const segmentDownloadTimeoutMins = process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]; - if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { - result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; + } + exports2.varint32write = varint32write; + function varint32read() { + let b = this.buf[this.pos++]; + let result = b & 127; + if ((b & 128) == 0) { + this.assertBounds(); + return result; } - core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core14.debug(`Download concurrency: ${result.downloadConcurrency}`); - core14.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core14.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core14.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core14.debug(`Lookup only: ${result.lookupOnly}`); - 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.getDownloadOptions = getDownloadOptions; + exports2.varint32read = varint32read; } }); -// node_modules/@actions/cache/lib/internal/config.js -var require_config = __commonJS({ - "node_modules/@actions/cache/lib/internal/config.js"(exports2) { +// 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.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; - 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.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.isGhes = isGhes; - function getCacheServiceVersion() { - if (isGhes()) - return "v1"; - return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; + 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"); } - exports2.getCacheServiceVersion = getCacheServiceVersion; - 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}`); + var RE_DECIMAL_STR = /^-?[0-9]+$/; + var TWO_PWR_32_DBL = 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_DBL + (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_DBL); + } + 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_DBL) : new _PbLong(-value, -value / TWO_PWR_32_DBL).negate(); + } + throw new Error("unknown value " + typeof value); } - } - exports2.getCacheServiceURL = getCacheServiceURL; - } -}); - -// node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ - "node_modules/@actions/cache/package.json"(exports2, module2) { - module2.exports = { - name: "@actions/cache", - version: "4.1.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": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", - "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", - "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", - semver: "^6.3.1" - }, - devDependencies: { - "@types/node": "^22.13.9", - "@types/semver": "^6.0.0", - "@protobuf-ts/plugin": "^2.9.4", - typescript: "^5.2.2" + /** + * 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/@actions/cache/lib/internal/shared/user-agent.js -var require_user_agent = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/user-agent.js"(exports2) { +// 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.getUserAgentString = void 0; - var packageJson = require_package2(); - function getUserAgentString() { - return `@actions/cache-${packageJson.version}`; - } - exports2.getUserAgentString = getUserAgentString; - } -}); - -// node_modules/@actions/cache/lib/internal/cacheHttpClient.js -var require_cacheHttpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; + 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) }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); + 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 }); } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var auth_1 = require_auth2(); - var fs7 = __importStar4(require("fs")); - var url_1 = require("url"); - var utils = __importStar4(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 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."); + /** + * 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]; } - const url = `${baseUrl}_apis/artifactcache/${resource}`; - core14.debug(`Resource Url: ${url}`); - return url; - } - function createAcceptHeader(type2, apiVersion) { - return `${type2};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 __awaiter4(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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.getJson(getCacheApiUrl(resource)); - })); - if (response.statusCode === 204) { - if (core14.isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version); - } - return null; - } - if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { - 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."); - } - core14.setSecret(cacheDownloadUrl); - core14.debug(`Cache Result:`); - core14.debug(JSON.stringify(cacheResult)); - return cacheResult; - }); - } - exports2.getCacheEntry = getCacheEntry; - function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { - const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(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) { - core14.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) || []) { - core14.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}`); + /** + * 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) { } - } - } - }); - } - function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(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); - } - }); - } - exports2.downloadCache = downloadCache; - function reserveCache(key, paths, options) { - return __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); - })); - return response; - }); - } - exports2.reserveCache = reserveCache; - function getContentRange(start, end) { - return `bytes ${start}-${end}/*`; - } - function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { - core14.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})`, () => __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - const fileSize = utils.getArchiveFileSizeInBytes(archivePath); - const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs7.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()]; - core14.debug("Awaiting all uploads"); - let offset = 0; - try { - yield Promise.all(parallelUploads.map(() => __awaiter4(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, () => fs7.createReadStream(archivePath, { - fd, - start, - end, - autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); - }), start, end); + 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); } - }))); - } finally { - fs7.closeSync(fd); - } - return; - }); - } - function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { - const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); - })); - }); - } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(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(); - core14.debug("Upload cache"); - yield uploadFile(httpClient, cacheId, archivePath, options); - core14.debug("Commiting cache"); - const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.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.`); - } - core14.info("Cache saved successfully"); + break; + default: + throw new Error("cant skip wire type " + wireType); } - }); - } - exports2.saveCache = saveCache3; + 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/json-typings.js -var require_json_typings = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/json-typings.js"(exports2) { +// 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.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"; + exports2.assertFloat32 = exports2.assertUInt32 = exports2.assertInt32 = exports2.assertNever = exports2.assert = void 0; + function assert(condition, msg) { + if (!condition) { + throw new Error(msg); } - return t; } - exports2.typeofJsonValue = typeofJsonValue; - function isJsonObject(value) { - return value !== null && typeof value == "object" && !Array.isArray(value); + exports2.assert = assert; + function assertNever2(value, msg) { + throw new Error(msg !== null && msg !== void 0 ? msg : "Unexpected object: " + value); } - exports2.isJsonObject = isJsonObject; + 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/base64.js -var require_base642 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/base64.js"(exports2) { +// 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.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.`); - } + 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; } - 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; + 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, type2) { + return this.uint32((fieldNo << 3 | type2) >>> 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; } - 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; + /** + * 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; } - if (groupPos) { - base64 += encTable[p]; - base64 += "="; - if (groupPos == 1) - base64 += "="; + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value) { + assert_1.assertInt32(value); + goog_varint_1.varint32write(value, this.buf); + return this; } - return base64; + /** + * 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.base64encode = base64encode; + exports2.jsonReadOptions = jsonReadOptions; + function jsonWriteOptions(options) { + return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; + } + exports2.jsonWriteOptions = jsonWriteOptions; + function mergeJsonOptions(a, b) { + var _a, _b; + let c = Object.assign(Object.assign({}, a), b); + c.typeRegistry = [...(_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : [], ...(_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/protobufjs-utf8.js -var require_protobufjs_utf8 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/protobufjs-utf8.js"(exports2) { +// 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.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; + 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); } } - if (parts.length) { - if (i) - parts.push(fromCharCodes(chunk.slice(0, i))); - return parts.join(""); - } - return fromCharCodes(chunk.slice(0, i)); + return sb.join(""); } - exports2.utf8read = utf8read; + exports2.lowerCamelCase = lowerCamelCase; } }); -// 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) { +// 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.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; - var UnknownFieldHandler; - (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = 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.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 _a, _b, _c, _d; + field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : 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.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 = {})); + exports2.normalizeFieldInfo = normalizeFieldInfo; + function readFieldOptions(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; + } + exports2.readFieldOptions = readFieldOptions; + function readFieldOption(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.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/goog-varint.js -var require_goog_varint = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/goog-varint.js"(exports2) { +// 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.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; + 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; } - 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; - } + 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; } - bytes.push(hi >>> 31 & 1); } - exports2.varint64write = varint64write; - var TWO_PWR_32_DBL = (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_DBL) { - highBits = highBits + (lowBits / TWO_PWR_32_DBL | 0); - lowBits = lowBits % TWO_PWR_32_DBL; - } - } - add1e6digit(-24, -18); - add1e6digit(-18, -12); - add1e6digit(-12, -6); - add1e6digit(-6); - return [minus, lowBits, highBits]; + exports2.isOneofGroup = isOneofGroup; + function getOneofValue(oneof, kind) { + return oneof[kind]; } - exports2.int64fromString = int64fromString; - function int64toString(bitsLow, bitsHigh) { - if (bitsHigh >>> 0 <= 2097151) { - return "" + (TWO_PWR_32_DBL * bitsHigh + (bitsLow >>> 0)); + exports2.getOneofValue = getOneofValue; + function setOneofValue(oneof, kind, value) { + if (oneof.oneofKind !== void 0) { + delete oneof[oneof.oneofKind]; } - 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; + oneof.oneofKind = kind; + if (value !== void 0) { + oneof[kind] = value; } - if (digitB >= base) { - digitC += Math.floor(digitB / base); - digitB %= base; + } + exports2.setOneofValue = setOneofValue; + function setUnknownOneofValue(oneof, kind, value) { + if (oneof.oneofKind !== void 0) { + delete oneof[oneof.oneofKind]; } - function decimalFrom1e7(digit1e7, needLeadingZeros) { - let partial = digit1e7 ? String(digit1e7) : ""; - if (needLeadingZeros) { - return "0000000".slice(partial.length) + partial; - } - return partial; + oneof.oneofKind = kind; + if (value !== void 0 && kind !== void 0) { + oneof[kind] = value; } - 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.setUnknownOneofValue = setUnknownOneofValue; + function clearOneofValue(oneof) { + if (oneof.oneofKind !== void 0) { + delete oneof[oneof.oneofKind]; } + oneof.oneofKind = void 0; } - 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; + exports2.clearOneofValue = clearOneofValue; + function getSelectedOneofValue(oneof) { + if (oneof.oneofKind === void 0) { + return void 0; } - 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; + return oneof[oneof.oneofKind]; } - exports2.varint32read = varint32read; + exports2.getSelectedOneofValue = getSelectedOneofValue; } }); -// 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) { +// 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.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_DBL = 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_DBL + (this.lo >>> 0); - if (!Number.isSafeInteger(result)) - throw new Error("cannot convert to safe number"); - return result; + exports2.ReflectionTypeCheck = void 0; + var reflection_info_1 = require_reflection_info(); + var oneof_1 = require_oneof(); + var ReflectionTypeCheck = class { + constructor(info6) { + var _a; + this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; } - }; - 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_DBL); + 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; + } } - 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); + } + this.data = { req, known, oneofs: Object.values(oneofs) }; } /** - * Convert to native bigint. + * 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. */ - toBigInt() { - assertBi(BI); - BI.V.setInt32(0, this.lo, true); - BI.V.setInt32(4, this.hi, true); - return BI.V.getBigUint64(0, true); + 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; } - }; - 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_DBL) : new _PbLong(-value, -value / TWO_PWR_32_DBL).negate(); - } - throw new Error("unknown value " + typeof value); + 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; } - /** - * Do we have a minus sign? - */ - isNegative() { - return (this.hi & HALF_2_PWR_32) !== 0; + message(arg, type2, allowExcessProperties, depth) { + if (allowExcessProperties) { + return type2.isAssignable(arg, depth); + } + return type2.is(arg, depth); } - /** - * 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); + messages(arg, type2, 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 (!type2.isAssignable(arg[i], depth - 1)) + return false; + } else { + for (let i = 0; i < arg.length && i < depth; i++) + if (!type2.is(arg[i], depth - 1)) + return false; + } + return true; } - /** - * 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); + scalar(arg, type2, longType) { + let argType = typeof arg; + switch (type2) { + 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); } - 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); + scalars(arg, type2, 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], type2, longType)) + return false; + } + return true; + } + mapKeys(map2, type2, depth) { + let keys = Object.keys(map2); + switch (type2) { + 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)), type2, depth); + case reflection_info_1.ScalarType.BOOL: + return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type2, depth); + default: + return this.scalars(keys, type2, depth, reflection_info_1.LongType.STRING); + } } }; - exports2.PbLong = PbLong; - PbLong.ZERO = new PbLong(0, 0); + exports2.ReflectionTypeCheck = ReflectionTypeCheck; } }); -// 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) { +// 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.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.reflectionLongConvert = void 0; + var reflection_info_1 = require_reflection_info(); + function reflectionLongConvert(long, type2) { + switch (type2) { + case reflection_info_1.LongType.BIGINT: + return long.toBigInt(); + case reflection_info_1.LongType.NUMBER: + return long.toNumber(); + default: + return long.toString(); + } } - 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 - }); + 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(info6) { + this.info = info6; } - /** - * 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]; + prepare() { + var _a; + if (this.fMap === void 0) { + this.fMap = {}; + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + 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}`); + } } /** - * Skip one element on the wire and return the skipped data. - * Supports WireType.StartGroup since v2.0.0-alpha.23. + * 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. */ - skip(wireType) { - let start = this.pos; - switch (wireType) { - case binary_format_contract_1.WireType.Varint: - while (this.buf[this.pos++] & 128) { + 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; } - 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); + 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; } - break; - default: - throw new Error("cant skip wire type " + wireType); + 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; + } + } } - 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. + * Returns `false` for unrecognized string representations. + * + * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). */ - bytes() { - let len = this.uint32(); - let start = this.pos; - this.pos += len; - this.assertBounds(); - return this.buf.subarray(start, start + len); + enum(type2, json2, fieldName, ignoreUnknownFields) { + if (type2[0] == "google.protobuf.NullValue") + assert_1.assert(json2 === null || json2 === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); + if (json2 === null) + return 0; + switch (typeof json2) { + case "number": + assert_1.assert(Number.isInteger(json2), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json2}.`); + return json2; + case "string": + let localEnumName = json2; + if (type2[2] && json2.substring(0, type2[2].length) === type2[2]) + localEnumName = json2.substring(type2[2].length); + let enumNumber = type2[1][localEnumName]; + if (typeof enumNumber === "undefined" && ignoreUnknownFields) { + return false; + } + assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json2}".`); + return enumNumber; + } + assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json2}".`); } - /** - * Read a `string` field, length-delimited data converted to UTF-8 text. - */ - string() { - return this.textDecoder.decode(this.bytes()); + scalar(json2, type2, longType, fieldName) { + let e; + try { + switch (type2) { + // 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 (json2 === null) + return 0; + if (json2 === "NaN") + return Number.NaN; + if (json2 === "Infinity") + return Number.POSITIVE_INFINITY; + if (json2 === "-Infinity") + return Number.NEGATIVE_INFINITY; + if (json2 === "") { + e = "empty string"; + break; + } + if (typeof json2 == "string" && json2.trim().length !== json2.length) { + e = "extra whitespace"; + break; + } + if (typeof json2 != "string" && typeof json2 != "number") { + break; + } + let float2 = Number(json2); + if (Number.isNaN(float2)) { + e = "not a number"; + break; + } + if (!Number.isFinite(float2)) { + e = "too large or small"; + break; + } + if (type2 == reflection_info_1.ScalarType.FLOAT) + assert_1.assertFloat32(float2); + return float2; + // 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 (json2 === null) + return 0; + let int32; + if (typeof json2 == "number") + int32 = json2; + else if (json2 === "") + e = "empty string"; + else if (typeof json2 == "string") { + if (json2.trim().length !== json2.length) + e = "extra whitespace"; + else + int32 = Number(json2); + } + if (int32 === void 0) + break; + if (type2 == 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 (json2 === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); + if (typeof json2 != "number" && typeof json2 != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json2), longType); + case reflection_info_1.ScalarType.FIXED64: + case reflection_info_1.ScalarType.UINT64: + if (json2 === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); + if (typeof json2 != "number" && typeof json2 != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json2), longType); + // bool: + case reflection_info_1.ScalarType.BOOL: + if (json2 === null) + return false; + if (typeof json2 !== "boolean") + break; + return json2; + // string: + case reflection_info_1.ScalarType.STRING: + if (json2 === null) + return ""; + if (typeof json2 !== "string") { + e = "extra whitespace"; + break; + } + try { + encodeURIComponent(json2); + } catch (e2) { + e2 = "invalid UTF8"; + break; + } + return json2; + // 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 (json2 === null || json2 === "") + return new Uint8Array(0); + if (typeof json2 !== "string") + break; + return base64_1.base64decode(json2); + } + } catch (error3) { + e = error3.message; + } + this.assert(false, fieldName + (e ? " - " + e : ""), json2); } }; - 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; + exports2.ReflectionJsonReader = ReflectionJsonReader; } }); -// 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) { +// 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.BinaryWriter = exports2.binaryWriteOptions = void 0; + exports2.ReflectionJsonWriter = void 0; + var base64_1 = require_base642(); var pb_long_1 = require_pb_long(); - var goog_varint_1 = require_goog_varint(); + var reflection_info_1 = require_reflection_info(); 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 = []; + var ReflectionJsonWriter = class { + constructor(info6) { + var _a; + this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; } /** - * Return all bytes written and reset this writer. + * Converts the message to a JSON object, based on the field descriptors. */ - 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; + write(message, options) { + const json2 = {}, source = message; + for (const field of this.fields) { + if (!field.oneof) { + let jsonValue2 = this.field(field, source[field.localName], options); + if (jsonValue2 !== void 0) + json2[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); + json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; } - 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, type2) { - return this.uint32((fieldNo << 3 | type2) >>> 0); + return json2; } - /** - * Write a chunk of raw bytes. - */ - raw(chunk) { - if (this.buf.length) { - this.chunks.push(new Uint8Array(this.buf)); - this.buf = []; + 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; + } } - this.chunks.push(chunk); - return this; + return jsonValue; } /** - * Write a `uint32` value, an unsigned 32 bit varint. + * Returns `null` as the default for google.protobuf.NullValue. */ - uint32(value) { - assert_1.assertUInt32(value); - while (value > 127) { - this.buf.push(value & 127 | 128); - value = value >>> 7; + enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { + if (type2[0] == "google.protobuf.NullValue") + return !emitDefaultValues && !optional ? void 0 : null; + if (value === void 0) { + assert_1.assert(optional); + return void 0; } - 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; + if (value === 0 && !emitDefaultValues && !optional) + return void 0; + assert_1.assert(typeof value == "number"); + assert_1.assert(Number.isInteger(value)); + if (enumAsInteger || !type2[1].hasOwnProperty(value)) + return value; + if (type2[2]) + return type2[2] + type2[1][value]; + return type2[1][value]; } - /** - * 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; + message(type2, value, fieldName, options) { + if (value === void 0) + return options.emitDefaultValues ? null : void 0; + return type2.internalJsonWrite(value, options); + } + scalar(type2, value, fieldName, optional, emitDefaultValues) { + if (value === void 0) { + assert_1.assert(optional); + return void 0; + } + const ed = emitDefaultValues || optional; + switch (type2) { + // 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.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 _a, _b; - let c = Object.assign(Object.assign({}, a), b); - c.typeRegistry = [...(_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : [], ...(_b = b === null || b === void 0 ? void 0 : b.typeRegistry) !== null && _b !== void 0 ? _b : []]; - return c; - } - exports2.mergeJsonOptions = mergeJsonOptions; + exports2.ReflectionJsonWriter = ReflectionJsonWriter; } }); -// 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) { +// 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.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + 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(type2, longType = reflection_info_1.LongType.STRING) { + switch (type2) { + 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/lower-camel-case.js -var require_lower_camel_case = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/lower-camel-case.js"(exports2) { +// 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.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); + 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(info6) { + this.info = info6; + } + prepare() { + var _a; + if (!this.fieldNoToField) { + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); } } - return sb.join(""); - } - exports2.lowerCamelCase = lowerCamelCase; + /** + * 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, type2, longType) { + switch (type2) { + 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-info.js -var require_reflection_info = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-info.js"(exports2) { +// 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.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 _a, _b, _c, _d; - field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : 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 _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readFieldOptions = readFieldOptions; - function readFieldOption(messageType, fieldName, extensionName, extensionType) { - var _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; - if (!options) { - return void 0; + 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(info6) { + this.info = info6; } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; + prepare() { + if (!this.fields) { + const fieldsInput = this.info.fields ? this.info.fields.concat() : []; + this.fields = fieldsInput.sort((a, b) => a.no - b.no); + } } - 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; + /** + * 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, handler, fieldNo, value) { + if (value === void 0) + return; + handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); + writer.join(); + } + /** + * Write a single scalar value. + */ + scalar(writer, type2, fieldNo, value, emitDefault) { + let [wireType, method, isDefault] = this.scalarInfo(type2, value); + if (!isDefault || emitDefault) { + writer.tag(fieldNo, wireType); + writer[method](value); + } + } + /** + * Write an array of scalar values in packed format. + */ + packed(writer, type2, fieldNo, value) { + if (!value.length) + return; + assert_1.assert(type2 !== reflection_info_1.ScalarType.BYTES && type2 !== reflection_info_1.ScalarType.STRING); + writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); + writer.fork(); + let [, method] = this.scalarInfo(type2); + 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(type2, value) { + let t = binary_format_contract_1.WireType.Varint; + let m; + let i = value === void 0; + let d = value === 0; + switch (type2) { + 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]; } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; - } - exports2.readMessageOption = readMessageOption; + }; + exports2.ReflectionBinaryWriter = ReflectionBinaryWriter; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js -var require_oneof = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js"(exports2) { +// 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.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; + exports2.reflectionCreate = void 0; + var reflection_scalar_default_1 = require_reflection_scalar_default(); + var message_type_contract_1 = require_message_type_contract(); + function reflectionCreate(type2) { + const msg = type2.messagePrototype ? Object.create(type2.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type2 }); + for (let field of type2.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 oneof[oneof.oneofKind]; + return msg; } - exports2.getSelectedOneofValue = getSelectedOneofValue; + exports2.reflectionCreate = reflectionCreate; } }); -// 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) { +// 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.ReflectionTypeCheck = void 0; - var reflection_info_1 = require_reflection_info(); - var oneof_1 = require_oneof(); - var ReflectionTypeCheck = class { - constructor(info6) { - var _a; - this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; - } - 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; - } + exports2.reflectionMergePartial = void 0; + function reflectionMergePartial(info6, target, source) { + let fieldValue, input = source, output; + for (let field of info6.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; } - } - 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) + fieldValue = group[name]; + output = target[field.oneof]; + output.oneofKind = group.oneofKind; + if (fieldValue == void 0) { + delete output[name]; 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) + } + } else { + fieldValue = input[name]; + output = target; + if (fieldValue == 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; + if (field.repeat) + output[name].length = fieldValue.length; 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); + if (field.repeat) + for (let i = 0; i < fieldValue.length; i++) + output[name][i] = fieldValue[i]; + else + output[name] = fieldValue; + break; 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); + 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": - 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); + Object.assign(output[name], fieldValue); + break; case "message": - return this.messages(Object.values(arg), field.V.T(), allowExcessProperties, depth); + let T2 = field.V.T(); + for (let k of Object.keys(fieldValue)) + output[name][k] = T2.create(fieldValue[k]); + break; } break; } - return true; - } - message(arg, type2, allowExcessProperties, depth) { - if (allowExcessProperties) { - return type2.isAssignable(arg, depth); - } - return type2.is(arg, depth); } - messages(arg, type2, 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 (!type2.isAssignable(arg[i], depth - 1)) + } + 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(info6, a, b) { + if (a === b) + return true; + if (!a || !b) + return false; + for (let field of info6.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; - } else { - for (let i = 0; i < arg.length && i < depth; i++) - if (!type2.is(arg[i], depth - 1)) + 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(type2, a, b) { + if (a === b) return true; + if (type2 !== 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(type2, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!primitiveEq(type2, a[i], b[i])) + return false; + return true; + } + function repeatedMsgEq(type2, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!type2.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); } - scalar(arg, type2, longType) { - let argType = typeof arg; - switch (type2) { - 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); + 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(json2, options) { + return this.internalJsonRead(json2, json_format_contract_1.jsonReadOptions(options)); + } + /** + * Read a new message from a JSON string. + * This is equivalent to `T.fromJson(JSON.parse(json))`. + */ + fromJsonString(json2, options) { + let value = JSON.parse(json2); + 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 _a; + let value = this.toJson(message, options); + return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 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(json2, options, target) { + if (json2 !== null && typeof json2 == "object" && !Array.isArray(json2)) { + let message = target !== null && target !== void 0 ? target : this.create(); + this.refJsonReader.read(json2, message, options); + return message; } + throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json2)}.`); } - scalars(arg, type2, 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], type2, longType)) - return false; - } - return true; + /** + * 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); } - mapKeys(map2, type2, depth) { - let keys = Object.keys(map2); - switch (type2) { - 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)), type2, depth); - case reflection_info_1.ScalarType.BOOL: - return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type2, depth); - default: - return this.scalars(keys, type2, depth, reflection_info_1.LongType.STRING); - } + /** + * 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.ReflectionTypeCheck = ReflectionTypeCheck; + exports2.MessageType = MessageType; } }); -// 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) { +// 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.reflectionLongConvert = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionLongConvert(long, type2) { - switch (type2) { - case reflection_info_1.LongType.BIGINT: - return long.toBigInt(); - case reflection_info_1.LongType.NUMBER: - return long.toNumber(); - default: - return long.toString(); - } + 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.reflectionLongConvert = reflectionLongConvert; + exports2.containsMessageType = containsMessageType; } }); -// 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) { +// 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.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(info6) { - this.info = info6; - } - prepare() { - var _a; - if (this.fMap === void 0) { - this.fMap = {}; - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - 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 val2; - switch (field.V.kind) { - case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); - break; - case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - break; - case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); - break; - } - this.assert(val2 !== 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] = val2; - } - } 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 val2; - switch (field.kind) { - case "message": - val2 = field.T().internalJsonRead(jsonItem, options); - break; - case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - break; - case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); - break; - } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); - } - } 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 val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - target[localName] = val2; - break; - case "scalar": - if (jsonValue === null) - continue; - target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); - break; - } - } - } + exports2.listEnumNumbers = exports2.listEnumNames = exports2.listEnumValues = exports2.isEnumObject = void 0; + function isEnumObject(arg) { + if (typeof arg != "object" || arg === null) { + return false; } - /** - * Returns `false` for unrecognized string representations. - * - * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). - */ - enum(type2, json2, fieldName, ignoreUnknownFields) { - if (type2[0] == "google.protobuf.NullValue") - assert_1.assert(json2 === null || json2 === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); - if (json2 === null) - return 0; - switch (typeof json2) { - case "number": - assert_1.assert(Number.isInteger(json2), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json2}.`); - return json2; - case "string": - let localEnumName = json2; - if (type2[2] && json2.substring(0, type2[2].length) === type2[2]) - localEnumName = json2.substring(type2[2].length); - let enumNumber = type2[1][localEnumName]; - if (typeof enumNumber === "undefined" && ignoreUnknownFields) { - return false; - } - assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json2}".`); - return enumNumber; - } - assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json2}".`); + if (!arg.hasOwnProperty(0)) { + return false; } - scalar(json2, type2, longType, fieldName) { - let e; - try { - switch (type2) { - // 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 (json2 === null) - return 0; - if (json2 === "NaN") - return Number.NaN; - if (json2 === "Infinity") - return Number.POSITIVE_INFINITY; - if (json2 === "-Infinity") - return Number.NEGATIVE_INFINITY; - if (json2 === "") { - e = "empty string"; - break; - } - if (typeof json2 == "string" && json2.trim().length !== json2.length) { - e = "extra whitespace"; - break; - } - if (typeof json2 != "string" && typeof json2 != "number") { - break; - } - let float2 = Number(json2); - if (Number.isNaN(float2)) { - e = "not a number"; - break; - } - if (!Number.isFinite(float2)) { - e = "too large or small"; - break; - } - if (type2 == reflection_info_1.ScalarType.FLOAT) - assert_1.assertFloat32(float2); - return float2; - // 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 (json2 === null) - return 0; - let int32; - if (typeof json2 == "number") - int32 = json2; - else if (json2 === "") - e = "empty string"; - else if (typeof json2 == "string") { - if (json2.trim().length !== json2.length) - e = "extra whitespace"; - else - int32 = Number(json2); - } - if (int32 === void 0) - break; - if (type2 == 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 (json2 === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); - if (typeof json2 != "number" && typeof json2 != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json2), longType); - case reflection_info_1.ScalarType.FIXED64: - case reflection_info_1.ScalarType.UINT64: - if (json2 === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); - if (typeof json2 != "number" && typeof json2 != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json2), longType); - // bool: - case reflection_info_1.ScalarType.BOOL: - if (json2 === null) - return false; - if (typeof json2 !== "boolean") - break; - return json2; - // string: - case reflection_info_1.ScalarType.STRING: - if (json2 === null) - return ""; - if (typeof json2 !== "string") { - e = "extra whitespace"; - break; - } - try { - encodeURIComponent(json2); - } catch (e2) { - e2 = "invalid UTF8"; - break; - } - return json2; - // 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 (json2 === null || json2 === "") - return new Uint8Array(0); - if (typeof json2 !== "string") - break; - return base64_1.base64decode(json2); - } - } catch (error4) { - e = error4.message; + 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; } - this.assert(false, fieldName + (e ? " - " + e : ""), json2); } - }; - exports2.ReflectionJsonReader = ReflectionJsonReader; + return true; + } + exports2.isEnumObject = isEnumObject; + function listEnumValues(enumObject) { + if (!isEnumObject(enumObject)) + throw new Error("not a typescript enum object"); + let values = []; + for (let [name, number] of Object.entries(enumObject)) + if (typeof number == "number") + values.push({ name, number }); + 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, index, arr) => arr.indexOf(num) == index); + } + 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/build/commonjs/reflection-json-writer.js -var require_reflection_json_writer = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-writer.js"(exports2) { +// 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.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(info6) { - var _a; - this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; + exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; + var runtime_1 = require_commonjs16(); + function normalizeMethodInfo(method, service) { + var _a, _b, _c; + let m = method; + m.service = service; + m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : 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 _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; + } + exports2.readMethodOptions = readMethodOptions; + function readMethodOption(service, methodName, extensionName, extensionType) { + var _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + if (!options) { + return void 0; } - /** - * Converts the message to a JSON object, based on the field descriptors. - */ - write(message, options) { - const json2 = {}, source = message; - for (const field of this.fields) { - if (!field.oneof) { - let jsonValue2 = this.field(field, source[field.localName], options); - if (jsonValue2 !== void 0) - json2[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); - json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; - } - return json2; + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; } - 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 val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - break; - case "message": - const messageType = field.V.T(); - for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - 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 val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - break; - case "message": - const messageType = field.T(); - for (let i = 0; i < value.length; i++) { - const val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - 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; + return extensionType ? extensionType.fromJson(optionVal) : optionVal; + } + exports2.readMethodOption = readMethodOption; + function readServiceOption(service, extensionName, extensionType) { + const options = service.options; + if (!options) { + return void 0; } - /** - * Returns `null` as the default for google.protobuf.NullValue. - */ - enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { - if (type2[0] == "google.protobuf.NullValue") - return !emitDefaultValues && !optional ? void 0 : null; - if (value === void 0) { - assert_1.assert(optional); - return void 0; - } - if (value === 0 && !emitDefaultValues && !optional) - return void 0; - assert_1.assert(typeof value == "number"); - assert_1.assert(Number.isInteger(value)); - if (enumAsInteger || !type2[1].hasOwnProperty(value)) - return value; - if (type2[2]) - return type2[2] + type2[1][value]; - return type2[1][value]; + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; } - message(type2, value, fieldName, options) { - if (value === void 0) - return options.emitDefaultValues ? null : void 0; - return type2.internalJsonWrite(value, options); + 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 : {}; } - scalar(type2, value, fieldName, optional, emitDefaultValues) { - if (value === void 0) { - assert_1.assert(optional); - return void 0; + }; + 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); } - const ed = emitDefaultValues || optional; - switch (type2) { - // 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); + 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.ReflectionJsonWriter = ReflectionJsonWriter; + exports2.RpcError = RpcError; } }); -// 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) { +// 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.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(type2, longType = reflection_info_1.LongType.STRING) { - switch (type2) { - 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.mergeRpcOptions = void 0; + var runtime_1 = require_commonjs16(); + function mergeRpcOptions(defaults, options) { + if (!options) + return defaults; + let o = {}; + copy(defaults, o); + copy(options, o); + for (let key of Object.keys(options)) { + let val = options[key]; + switch (key) { + case "jsonOptions": + o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); + break; + case "binaryOptions": + o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); + break; + case "meta": + o.meta = {}; + copy(defaults.meta, o.meta); + copy(options.meta, o.meta); + break; + case "interceptors": + o.interceptors = defaults.interceptors ? defaults.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; } } - 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) { +// 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.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(info6) { - this.info = info6; - } - prepare() { - var _a; - if (!this.fieldNoToField) { - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - 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; - } + 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((resolve5, reject) => { + this._resolve = resolve5; + this._reject = reject; + }); + if (preventUnhandledRejectionWarning) { + this._promise.catch((_) => { + }); } } /** - * Read a map field, expecting key field = 1, value field = 2 + * Get the current state of the promise. */ - mapEntry(field, reader, options) { - let length = reader.uint32(); - let end = reader.pos + length; - let key = void 0; - let val2 = 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": - val2 = this.scalar(reader, field.V.T, field.V.L); - break; - case "enum": - val2 = reader.int32(); - break; - case "message": - val2 = 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 (val2 === void 0) - switch (field.V.kind) { - case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); - break; - case "enum": - val2 = 0; - break; - case "message": - val2 = field.V.T().create(); - break; - } - return [key, val2]; + get state() { + return this._state; } - scalar(reader, type2, longType) { - switch (type2) { - 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); - } + /** + * 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.ReflectionBinaryReader = ReflectionBinaryReader; + exports2.Deferred = Deferred; } }); -// 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) { +// 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.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(info6) { - this.info = info6; + 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: [] }; } - prepare() { - if (!this.fields) { - const fieldsInput = this.info.fields ? this.info.fields.concat() : []; - this.fields = fieldsInput.sort((a, b) => a.no - b.no); - } + // --- 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 /** - * Writes the message to binary format. + * Is this stream already closed by a completion or error? */ - 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, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); - 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(); + get closed() { + return this._closed !== false; } - message(writer, options, handler, fieldNo, value) { - if (value === void 0) - return; - handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); - writer.join(); + /** + * 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(); } /** - * Write a single scalar value. + * Emits a new message. Throws if stream is closed. + * + * Triggers onNext and onMessage callbacks. */ - scalar(writer, type2, fieldNo, value, emitDefault) { - let [wireType, method, isDefault] = this.scalarInfo(type2, value); - if (!isDefault || emitDefault) { - writer.tag(fieldNo, wireType); - writer[method](value); - } + 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)); } /** - * Write an array of scalar values in packed format. + * Closes the stream with an error. Throws if stream is closed. + * + * Triggers onNext and onError callbacks. */ - packed(writer, type2, fieldNo, value) { - if (!value.length) - return; - assert_1.assert(type2 !== reflection_info_1.ScalarType.BYTES && type2 !== reflection_info_1.ScalarType.STRING); - writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); - writer.fork(); - let [, method] = this.scalarInfo(type2); - for (let i = 0; i < value.length; i++) - writer[method](value[i]); - writer.join(); + 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(); } /** - * Get information for writing a scalar value. + * Closes the stream successfully. Throws if stream is closed. * - * Returns tuple: - * [0]: appropriate WireType - * [1]: name of the appropriate method of IBinaryWriter - * [2]: whether the given value is a default value + * 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. * - * If argument `value` is omitted, [2] is always false. + * 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. */ - scalarInfo(type2, value) { - let t = binary_format_contract_1.WireType.Varint; - let m; - let i = value === void 0; - let d = value === 0; - switch (type2) { - 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; + [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); } - return [t, m, i || d]; } }; - exports2.ReflectionBinaryWriter = ReflectionBinaryWriter; + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + 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/build/commonjs/reflection-create.js -var require_reflection_create = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-create.js"(exports2) { +// 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"; - 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(type2) { - const msg = type2.messagePrototype ? Object.create(type2.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type2 }); - for (let field of type2.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; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - 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(info6, target, source) { - let fieldValue, input = source, output; - for (let field of info6.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; + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } else { - fieldValue = input[name]; - output = target; - if (fieldValue == void 0) { - continue; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - 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; + function step(result) { + result.done ? resolve5(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - } - exports2.reflectionMergePartial = reflectionMergePartial; + /** + * 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/build/commonjs/reflection-equals.js -var require_reflection_equals = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-equals.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionEquals = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionEquals(info6, a, b) { - if (a === b) - return true; - if (!a || !b) - return false; - for (let field of info6.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.response = response; + this.status = status; + this.trailers = trailers; } - return true; - } - exports2.reflectionEquals = reflectionEquals; - var objectValues = Object.values; - function primitiveEq(type2, a, b) { - if (a === b) - return true; - if (type2 !== 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(type2, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!primitiveEq(type2, a[i], b[i])) - return false; - return true; - } - function repeatedMsgEq(type2, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!type2.equals(a[i], b[i])) - return false; - return true; - } + /** + * 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/build/commonjs/message-type.js -var require_message_type = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js"(exports2) { +// 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"; - 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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - create(value) { - let message = reflection_create_1.reflectionCreate(this); - if (value !== void 0) { - reflection_merge_partial_1.reflectionMergePartial(this, message, value); + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve5(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } /** - * 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`. + * 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. */ - equals(a, b) { - return reflection_equals_1.reflectionEquals(this, a, b); + then(onfulfilled, onrejected) { + return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } - /** - * 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); + 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 + }; + }); } - /** - * 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); + }; + 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(resolve5) { + resolve5(value); + }); } + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 { /** - * Copy partial data into the target message. + * Initialize with mock data. Omitted fields have default value. */ - mergePartial(target, source) { - reflection_merge_partial_1.reflectionMergePartial(this, target, source); + 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 : {}; } /** - * Create a new message from binary format. + * Sent message(s) during the last operation. */ - fromBinary(data, options) { - let opt = binary_reader_1.binaryReadOptions(options); - return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt); + get sentMessages() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.sent; + } else if (typeof this.lastInput == "object") { + return [this.lastInput.single]; + } + return []; } /** - * Read a new message from a JSON value. + * Sending message(s) completed? */ - fromJson(json2, options) { - return this.internalJsonRead(json2, json_format_contract_1.jsonReadOptions(options)); + get sendComplete() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.completed; + } else if (typeof this.lastInput == "object") { + return true; + } + return false; } - /** - * Read a new message from a JSON string. - * This is equivalent to `T.fromJson(JSON.parse(json))`. - */ - fromJsonString(json2, options) { - let value = JSON.parse(json2); - return this.fromJson(value, options); + // Creates a promise for response headers from the mock data. + promiseHeaders() { + var _a; + const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; + return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); } - /** - * Write the message to canonical JSON value. - */ - toJson(message, options) { - return this.internalJsonWrite(message, json_format_contract_1.jsonWriteOptions(options)); + // 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); } /** - * Convert the message to canonical JSON string. - * This is equivalent to `JSON.stringify(T.toJson(t))` + * 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. */ - toJsonString(message, options) { + streamResponses(method, stream, 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 delay(this.responseDelay, abort)(void 0); + } catch (error3) { + stream.notifyError(error3); + return; + } + if (this.data.response instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.response); + return; + } + for (let msg of messages) { + stream.notifyMessage(msg); + try { + yield delay(this.betweenResponseDelay, abort)(void 0); + } catch (error3) { + stream.notifyError(error3); + return; + } + } + if (this.data.status instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.status); + return; + } + if (this.data.trailers instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.trailers); + return; + } + stream.notifyComplete(); + }); + } + // Creates a promise for response status from the mock data. + promiseStatus() { var _a; - let value = this.toJson(message, options); - return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); + const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; + return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); } - /** - * Write the message to binary format. - */ - toBinary(message, options) { - let opt = binary_writer_1.binaryWriteOptions(options); - return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish(); + // Creates a promise for response trailers from the mock data. + promiseTrailers() { + var _a; + const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; + return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); } - /** - * 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(json2, options, target) { - if (json2 !== null && typeof json2 == "object" && !Array.isArray(json2)) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refJsonReader.read(json2, message, options); - return message; + maybeSuppressUncaught(...promise) { + if (this.suppressUncaughtRejections) { + for (let p of promise) { + p.catch(() => { + }); + } } - throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json2)}.`); } - /** - * 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); + mergeOptions(options) { + return rpc_options_1.mergeRpcOptions({}, 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; + unary(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay(this.afterResponseDelay, options.abort)).then((_) => this.promiseTrailers()); + this.maybeSuppressUncaught(statusPromise, trailersPromise); + this.lastInput = { single: input }; + return new unary_call_1.UnaryCall(method, requestHeaders, input, headersPromise, responsePromise, statusPromise, trailersPromise); } - /** - * 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; + serverStreaming(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay(this.responseDelay, options.abort)).catch(() => { + }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay(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); } - }; - 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; + clientStreaming(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay(this.afterResponseDelay, options.abort)).then((_) => 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); } - if (!arg.hasOwnProperty(0)) { - return false; + duplex(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay(this.responseDelay, options.abort)).catch(() => { + }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay(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); } - 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; + }; + exports2.TestTransport = TestTransport; + TestTransport.defaultHeaders = { + responseHeader: "test" + }; + TestTransport.defaultStatus = { + code: "OK", + detail: "all good" + }; + TestTransport.defaultTrailers = { + responseTrailer: "test" + }; + function delay(ms, abort) { + return (v) => new Promise((resolve5, reject) => { + if (abort === null || abort === void 0 ? void 0 : abort.aborted) { + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); } else { - let num2 = arg[k]; - if (num2 === void 0) - return false; - if (typeof num2 !== "number") - return false; - if (arg[num2] === void 0) - return false; + const id = setTimeout(() => resolve5(v), ms); + if (abort) { + abort.addEventListener("abort", (ev) => { + clearTimeout(id); + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + }); + } } - } - return true; - } - exports2.isEnumObject = isEnumObject; - function listEnumValues(enumObject) { - if (!isEnumObject(enumObject)) - throw new Error("not a typescript enum object"); - let values = []; - for (let [name, number] of Object.entries(enumObject)) - if (typeof number == "number") - values.push({ name, number }); - return values; - } - exports2.listEnumValues = listEnumValues; - function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); - } - exports2.listEnumNames = listEnumNames; - function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); - } - exports2.listEnumNumbers = listEnumNumbers; - } -}); - -// node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __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_commonjs11(); - function normalizeMethodInfo(method, service) { - var _a, _b, _c; - let m = method; - m.service = service; - m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : 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 _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; + }); } - exports2.readMethodOptions = readMethodOptions; - function readMethodOption(service, methodName, extensionName, extensionType) { - var _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; - if (!options) { - return void 0; + var TestInputStream = class { + constructor(data, abort) { + this._completed = false; + this._sent = []; + this.data = data; + this.abort = abort; } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; + get sent() { + return this._sent; } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; - } - exports2.readMethodOption = readMethodOption; - function readServiceOption(service, extensionName, extensionType) { - const options = service.options; - if (!options) { - return void 0; + get completed() { + return this._completed; } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; + 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(delay(delayMs, this.abort)); } - 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 : {}; + 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(delay(delayMs, this.abort)); } }; - 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) { +// 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.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); + 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 _a, _b, _c, _d; + if (kind == "unary") { + let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); + for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { + const next = tail; + tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); } - if (this.serviceName && this.methodName) { - l.push("Method: " + this.serviceName + "/" + this.methodName); + 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); } - 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 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 l.join("\n"); + return tail(method, options); } - }; - 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_commonjs11(); - function mergeRpcOptions(defaults, options) { - if (!options) - return defaults; - let o = {}; - copy(defaults, o); - copy(options, o); - for (let key of Object.keys(options)) { - let val2 = options[key]; - switch (key) { - case "jsonOptions": - o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); - break; - case "binaryOptions": - o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); - break; - case "meta": - o.meta = {}; - copy(defaults.meta, o.meta); - copy(options.meta, o.meta); - break; - case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); - break; + 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); } - return o; + runtime_1.assertNever(kind); } - 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; - } + 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/deferred.js -var require_deferred = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/deferred.js"(exports2) { +// 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.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((resolve5, reject) => { - this._resolve = resolve5; - this._reject = reject; - }); - if (preventUnhandledRejectionWarning) { - this._promise.catch((_) => { - }); - } - } - /** - * Get the current state of the promise. - */ - get state() { - return this._state; - } - /** - * Get the deferred promise. - */ - get promise() { - return this._promise; + 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; } /** - * Resolve the promise. Throws if the promise is already resolved or rejected. + * Set the call cancelled. + * + * Invokes all callbacks registered with onCancel() and + * sets `cancelled = true`. */ - resolve(value) { - if (this.state !== DeferredState.PENDING) - throw new Error(`cannot resolve ${DeferredState[this.state].toLowerCase()}`); - this._resolve(value); - this._state = DeferredState.RESOLVED; + notifyCancelled() { + if (!this._cancelled) { + this._cancelled = true; + for (let l of this._listeners) { + l(); + } + } } /** - * Reject the promise. Throws if the promise is already resolved or rejected. + * Send response headers. */ - reject(reason) { - if (this.state !== DeferredState.PENDING) - throw new Error(`cannot reject ${DeferredState[this.state].toLowerCase()}`); - this._reject(reason); - this._state = DeferredState.REJECTED; + sendResponseHeaders(data) { + this._sendRH(data); } /** - * Resolve the promise. Ignore if not pending. + * 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. */ - resolvePending(val2) { - if (this._state === DeferredState.PENDING) - this.resolve(val2); + get cancelled() { + return this._cancelled; } /** - * Reject the promise. Ignore if not pending. + * Add a callback for cancellation. */ - rejectPending(reason) { - if (this._state === DeferredState.PENDING) - this.reject(reason); + onCancel(callback) { + const l = this._listeners; + l.push(callback); + return () => { + let i = l.indexOf(callback); + if (i >= 0) + l.splice(i, 1); + }; } }; - exports2.Deferred = Deferred; + exports2.ServerCallContextController = ServerCallContextController; } }); -// 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) { +// 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 }); - exports2.RpcOutputStreamController = void 0; + 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(); - var runtime_1 = require_commonjs11(); - 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, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); - if (message) - this.notifyMessage(message); - if (error4) - this.notifyError(error4); - 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(error4) { - runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, 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; + 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/@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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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*/ } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + ]); + } + 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); } } - function step(result) { - result.done ? resolve5(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - 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)); + return message; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.UnaryCall = UnaryCall; + exports2.CacheScope = new CacheScope$Type(); } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); + 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 } + ]); } - return new (P || (P = Promise))(function(resolve5, 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); + 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); } } - function step(result) { - result.done ? resolve5(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - 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)); + return message; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.ServerStreamingCall = ServerStreamingCall; + exports2.CacheMetadata = new CacheMetadata$Type(); } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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*/ } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + ]); + } + 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); } } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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; + } }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ClientStreamingCall = void 0; - var ClientStreamingCall = class { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + 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*/ + } + ]); } - /** - * 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)); + 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; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); + 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*/ + } + ]); } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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); } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } } - function step(result) { - result.done ? resolve5(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - 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)); + return message; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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); + 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*/ } - } - function step(result) { - result.done ? resolve5(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_commonjs11(); - 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 []; + 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; } - /** - * Sending message(s) completed? - */ - get sendComplete() { - if (this.lastInput instanceof TestInputStream) { - return this.lastInput.completed; - } else if (typeof this.lastInput == "object") { - return true; + 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 false; - } - // Creates a promise for response headers from the mock data. - promiseHeaders() { - var _a; - const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; - return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); + return message; } - // 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); + 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; } - /** - * 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, stream, abort) { - return __awaiter4(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 delay(this.responseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); - return; - } - if (this.data.response instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.response); - return; - } - for (let msg of messages) { - stream.notifyMessage(msg); - try { - yield delay(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); - return; - } - } - if (this.data.status instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.status); - return; - } - if (this.data.trailers instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.trailers); - return; + }; + 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*/ } - stream.notifyComplete(); - }); - } - // Creates a promise for response status from the mock data. - promiseStatus() { - var _a; - const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _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 _a; - const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; - return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); + 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; } - maybeSuppressUncaught(...promise) { - if (this.suppressUncaughtRejections) { - for (let p of promise) { - p.catch(() => { - }); + 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; } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); + 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; } - unary(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay(this.afterResponseDelay, options.abort)).then((_) => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = { single: input }; - return new unary_call_1.UnaryCall(method, requestHeaders, input, headersPromise, responsePromise, statusPromise, trailersPromise); + }; + 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); } - serverStreaming(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay(this.responseDelay, options.abort)).catch(() => { - }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay(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); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toJson(request, { + 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 + })); } - clientStreaming(method, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay(this.afterResponseDelay, options.abort)).then((_) => 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); + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { + 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 + })); } - duplex(method, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay(this.headerDelay, options.abort)), outputStream = new rpc_output_stream_1.RpcOutputStreamController(), responseStreamClosedPromise = headersPromise.then(delay(this.responseDelay, options.abort)).catch(() => { - }).then(() => this.streamResponses(method, outputStream, options.abort)).then(delay(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); + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { + 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.TestTransport = TestTransport; - TestTransport.defaultHeaders = { - responseHeader: "test" - }; - TestTransport.defaultStatus = { - code: "OK", - detail: "all good" - }; - TestTransport.defaultTrailers = { - responseTrailer: "test" - }; - function delay(ms, abort) { - return (v) => new Promise((resolve5, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - } else { - const id = setTimeout(() => resolve5(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; + exports2.CacheServiceClientJSON = CacheServiceClientJSON; + var CacheServiceClientProtobuf = class { + constructor(rpc) { + this.rpc = rpc; + this.CreateCacheEntry.bind(this); + this.FinalizeCacheEntryUpload.bind(this); + this.GetCacheEntryDownloadURL.bind(this); } - get completed() { - return this._completed; + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); + return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); } - 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(delay(delayMs, this.abort)); + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); + return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); } - 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(delay(delayMs, this.abort)); + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); + 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/@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) { +// node_modules/@actions/cache/lib/internal/shared/util.js +var require_util9 = __commonJS({ + "node_modules/@actions/cache/lib/internal/shared/util.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_commonjs11(); - function stackIntercept(kind, transport, method, options, input) { - var _a, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; + var core_1 = require_core(); + function maskSigUrl(url) { + if (!url) + return; + try { + const parsedUrl = new URL(url); + const signature = parsedUrl.searchParams.get("sig"); + if (signature) { + (0, core_1.setSecret)(signature); + (0, core_1.setSecret)(encodeURIComponent(signature)); } - return tail(method, input, options); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${error3 instanceof Error ? error3.message : String(error3)}`); } - 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); + } + function maskSecretUrls(body) { + if (typeof body !== "object" || body === null) { + (0, core_1.debug)("body is not an object or is null"); + return; } - 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 ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { + maskSigUrl(body.signed_upload_url); } - 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); + if ("signed_download_url" in body && typeof body.signed_download_url === "string") { + maskSigUrl(body.signed_download_url); } - 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) { +// 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"; - 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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve5) { + resolve5(value); + }); } - /** - * 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(); + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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_util9(); + var CacheServiceClient = class { + constructor(userAgent, 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(userAgent, [ + new auth_1.BearerCredentialHandler(token) + ]); } - /** - * Send response headers. - */ - sendResponseHeaders(data) { - this._sendRH(data); + // 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 url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; + (0, core_1.debug)(`[Request] ${method} ${url}`); + const headers = { + "Content-Type": contentType + }; + try { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { + return this.httpClient.post(url, JSON.stringify(data), headers); + })); + return body; + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); + } + }); } - /** - * 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; + 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`); + }); } - /** - * 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); - }; + 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((resolve5) => setTimeout(resolve5, 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); } }; - exports2.ServerCallContextController = ServerCallContextController; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs12 = __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; - } }); + 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/generated/results/entities/v1/cachescope.js -var require_cachescope = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/entities/v1/cachescope.js"(exports2) { +// node_modules/@actions/cache/lib/internal/tar.js +var require_tar = __commonJS({ + "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ - } - ]); + 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]; + } }; } - 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; + 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(resolve5) { + resolve5(value); + }); } - 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(); + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 = extractTar2; + exports2.createTar = createTar; + var exec_1 = require_exec(); + var io5 = __importStar2(require_io()); + var fs_1 = require("fs"); + var path7 = __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 io5.which("gtar", false); + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else { + return { + path: yield io5.which("tar", true), + type: constants_1.ArchiveToolType.BSD + }; + } + } + default: + break; + } + return { + path: yield io5.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, type2, 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 (type2) { + case "create": + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + break; + case "extract": + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path7.sep}`, "g"), "/")); + break; + case "list": + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P"); + break; + } + if (tarPath.type === constants_1.ArchiveToolType.GNU) { + switch (process.platform) { + case "win32": + args.push("--force-local"); break; - case /* int64 permission */ - 2: - message.permission = reader.int64().toString(); + case "darwin": + args.push("--delay-directory-restore"); 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(); + return args; + }); + } + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { + let args; + const tarPath = yield getTarPath(); + const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); + const compressionArgs = type2 !== "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 && type2 !== "create") { + args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + } else { + args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + } + if (BSD_TAR_ZSTD) { + return args; + } + return [args.join(" ")]; + }); + } + function getWorkingDirectory() { + var _a; + return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : 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(`\\${path7.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(`\\${path7.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(`\\${path7.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(`\\${path7.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 extractTar2(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const workingDirectory = getWorkingDirectory(); + yield io5.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)(path7.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + const commands = yield getCommands(compressionMethod, "create"); + yield execCommands(commands, archiveFolder); + }); + } } }); -// 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) { +// node_modules/@actions/cache/lib/cache.js +var require_cache4 = __commonJS({ + "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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 } - ]); + 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]; + } }; } - 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; + 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(resolve5) { + resolve5(value); + }); } - 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 new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - return message; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache3; + exports2.saveCache = saveCache3; + var core14 = __importStar2(require_core()); + var path7 = __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 ValidationError = class _ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + Object.setPrototypeOf(this, _ValidationError.prototype); } - 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.ValidationError = ValidationError; + var ReserveCacheError = class _ReserveCacheError extends Error { + constructor(message) { + super(message); + this.name = "ReserveCacheError"; + Object.setPrototypeOf(this, _ReserveCacheError.prototype); } }; - exports2.CacheMetadata = new CacheMetadata$Type(); - } -}); - -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ - } - ]); + exports2.ReserveCacheError = ReserveCacheError; + var FinalizeCacheError = class _FinalizeCacheError extends Error { + constructor(message) { + super(message); + this.name = "FinalizeCacheError"; + Object.setPrototypeOf(this, _FinalizeCacheError.prototype); } - 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; + }; + 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`); } - 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); + } + 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 restoreCache3(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)(); + core14.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + 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) { + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core14.debug("Resolved Keys:"); + core14.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 { + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + return void 0; + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core14.info("Lookup only - skipping download"); + return cacheEntry.cacheKey; + } + archivePath = path7.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core14.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) { + core14.error(`Failed to restore: ${error3.message}`); + } else { + core14.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.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) { + options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core14.debug("Resolved Keys:"); + core14.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 request = { + key: primaryKey, + restoreKeys, + version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) + }; + const response = yield twirpClient.GetCacheEntryDownloadURL(request); + if (!response.ok) { + core14.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); + return void 0; + } + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core14.info(`Cache hit for restore-key: ${response.matchedKey}`); + } else { + core14.info(`Cache hit for: ${response.matchedKey}`); + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core14.info("Lookup only - skipping download"); + return response.matchedKey; + } + archivePath = path7.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive path: ${archivePath}`); + core14.debug(`Starting download of archive to: ${archivePath}`); + yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core14.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) { + core14.error(`Failed to restore: ${error3.message}`); + } else { + core14.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + if (archivePath) { + yield utils.unlinkFile(archivePath); + } + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); + } + } + return void 0; + }); + } + function saveCache3(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + core14.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + checkKey(key); + 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 _a, _b, _c, _d, _e; + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core14.debug("Cache Paths:"); + core14.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 = path7.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.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.`); + } + core14.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - } - 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*/ + core14.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 === ReserveCacheError.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); + } else { + core14.warning(`Failed to save: ${typedError.message}`); + } } - ]); - } - 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); + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } - 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*/ + return cacheId; + }); + } + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + 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); + core14.debug("Cache Paths:"); + core14.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 = path7.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - ]); - } - 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); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core14.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core14.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); + } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core14.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - } - 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*/ + core14.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); + core14.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.`); } - ]); - } - 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); + cacheId = parseInt(finalizeResponse.entryId); + } catch (error3) { + const typedError = error3; + if (typedError.name === ValidationError.name) { + throw error3; + } else if (typedError.name === ReserveCacheError.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core14.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); + } else { + core14.warning(`Failed to save: ${typedError.message}`); + } } - } - 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*/ + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } - ]); + } + return cacheId; + }); + } + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/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; } - 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; + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - 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; + 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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - 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; + 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; }; - 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; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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; } - 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); + 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)}`; + } + } } } - 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; + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } }; - 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 } - ]); + 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/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) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); - var CacheServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); - } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toJson(request, { - 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(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { - 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 - })); + 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]; + } }; } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { - 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 - })); + 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; }; - exports2.CacheServiceClientJSON = CacheServiceClientJSON; - var CacheServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs7 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); + if (!fs7.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); + fs7.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/protobuf", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromBinary(data2)); + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - }; - exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/cache/lib/internal/shared/util.js -var require_util10 = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; - var core_1 = require_core(); - function maskSigUrl(url) { - if (!url) - return; - try { - const parsedUrl = new URL(url); - const signature = parsedUrl.searchParams.get("sig"); - if (signature) { - (0, core_1.setSecret)(signature); - (0, core_1.setSecret)(encodeURIComponent(signature)); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + } else { + return void 0; } } - 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; + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { - maskSigUrl(body.signed_upload_url); + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - if ("signed_download_url" in body && typeof body.signed_download_url === "string") { - maskSigUrl(body.signed_download_url); + 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.maskSecretUrls = maskSecretUrls; + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js -var require_cacheTwirpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -76277,426 +83393,571 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; - 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_auth2(); - var http_client_1 = require_lib4(); - var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util10(); - var CacheServiceClient = class { - constructor(userAgent, 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(userAgent, [ - new auth_1.BearerCredentialHandler(token) - ]); + exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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); } - // This function satisfies the Rpc interface. It is compatible with the JSON - // JSON generated client. - request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { - const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; - (0, core_1.debug)(`[Request] ${method} ${url}`); - const headers = { - "Content-Type": contentType - }; - try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { - return this.httpClient.post(url, JSON.stringify(data), headers); - })); - return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + }; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __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", () => { + resolve5(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve5(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(userAgent, 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 = userAgent; + 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, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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); }); } - retryableRequest(operation) { - return __awaiter4(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(); + 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; } - errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, data); + } else { + return response; } - if (error4 instanceof errors_1.UsageError) { - throw error4; + } + 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; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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."); } - isRetryable = true; - errorMessage = error4.message; + yield response.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + if (header.toLowerCase() === "authorization") { + delete headers[header]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, data); + redirectsRemaining--; } - if (!isRetryable) { - throw new Error(`Received non-retryable error: ${errorMessage}`); + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; } - if (attempt + 1 === this.maxAttempts) { - throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); } - 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`); + } while (numTries < maxTries); + return response; }); } - 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); + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; } - sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => setTimeout(resolve5, milliseconds)); + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve5(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); }); } - getExponentialRetryTimeMilliseconds(attempt) { - if (attempt < 0) { - throw new Error("attempt should be a positive integer"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - if (attempt === 0) { - return this.baseRetryIntervalMilliseconds; + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } } - 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); - } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; - } -}); - -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); + const req = info6.httpModule.request(info6.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(void 0, res); }); - } - return new (P || (P = Promise))(function(resolve5, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + let socket; + req.on("socket", (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) { + socket.end(); } + handleResult(new Error(`Request timeout: ${info6.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); } - function step(result) { - result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + /** + * 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; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; - var exec_1 = require_exec(); - var io5 = __importStar4(require_io3()); - var fs_1 = require("fs"); - var path7 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { - return __awaiter4(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 io5.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io5.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; - } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - default: - break; } - return { - path: yield io5.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); - } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - 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 (type2) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path7.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path7.sep}`, "g"), "/"), "-P"); - break; + return info6; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - 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 lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - return args; - }); - } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); - const compressionArgs = type2 !== "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 && type2 !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; - } else { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - if (BSD_TAR_ZSTD) { - return args; + if (!useProxy) { + agent = this._agent; } - return [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a; - return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(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(`\\${path7.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(`\\${path7.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; + if (agent) { + return agent; } - }); - } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(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(`\\${path7.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(`\\${path7.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - }); - } - function execCommands(commands, cwd) { - return __awaiter4(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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + 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; } - }); - } - function listTar(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - exports2.listTar = listTar; - function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io5.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - exports2.extractTar = extractTar2; - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path7.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - exports2.createTar = createTar; + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve5) => setTimeout(() => resolve5(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve5(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 { + resolve5(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -76724,380 +83985,524 @@ var require_cache3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core14 = __importStar4(require_core()); - var path7 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); - var config_1 = require_config(); - var tar_1 = require_tar(); - var http_client_1 = require_lib4(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); + exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; + var BasicCredentialHandler = class { + constructor(username, password) { + this.username = username; + this.password = password; } - }; - exports2.ValidationError = ValidationError; - var ReserveCacheError = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - }; - exports2.ReserveCacheError = ReserveCacheError; - var FinalizeCacheError = class _FinalizeCacheError extends Error { - constructor(message) { - super(message); - this.name = "FinalizeCacheError"; - Object.setPrototypeOf(this, _FinalizeCacheError.prototype); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } }; - 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`); + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - } - function checkKey(key) { - if (key.length > 512) { - throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); + // 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}`; } - const regex = /^[^,]*$/; - if (!regex.test(key)) { - throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - } - 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"]; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - switch (cacheServiceVersion) { - case "v2": - return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - case "v1": - default: - return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - } - }); - } - exports2.restoreCache = restoreCache3; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.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); + }; + 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"); } - const compressionMethod = yield utils.getCompressionMethod(); - let archivePath = ""; - try { - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path7.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); - } else { - core14.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + 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/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.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 request = { - key: primaryKey, - restoreKeys, - version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) - }; - const response = yield twirpClient.GetCacheEntryDownloadURL(request); - if (!response.ok) { - core14.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); - return void 0; - } - const isRestoreKeyMatch = request.key !== response.matchedKey; - if (isRestoreKeyMatch) { - core14.info(`Cache hit for restore-key: ${response.matchedKey}`); - } else { - core14.info(`Cache hit for: ${response.matchedKey}`); - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); - return response.matchedKey; - } - archivePath = path7.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive path: ${archivePath}`); - core14.debug(`Starting download of archive to: ${archivePath}`); - yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); - return response.matchedKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); - } else { - core14.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + function rejected(value) { try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function saveCache3(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); + function step(result) { + result.done ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - exports2.saveCache = saveCache3; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core14.debug("Cache Paths:"); - core14.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 = path7.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.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.`); - } - core14.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize - }); - if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); - } - core14.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); - } + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OidcClient = void 0; + var http_client_1 = require_lib5(); + var auth_1 = require_auth3(); + 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 cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core14.debug("Cache Paths:"); - core14.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.`); + 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"); } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path7.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core14.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter2(this, void 0, void 0, function* () { try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core14.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core14.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); - } - core14.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); - core14.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); - if (!finalizeResponse.ok) { - if (finalizeResponse.message) { - throw new FinalizeCacheError(finalizeResponse.message); + let id_token_url = _OidcClient.getIDTokenUrl(); + if (audience) { + const encodedAudience = encodeURIComponent(audience); + id_token_url = `${id_token_url}&audience=${encodedAudience}`; } - throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`); + (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}`); } - cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core14.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); - } + }); + } + }; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } finally { + } + function rejected(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return cacheId; + function step(result) { + result.done ? resolve5(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 (_a) { + 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/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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 path7 = __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, path7.sep); } + exports2.toPlatformPath = toPlatformPath; } }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ +var require_io_util3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77106,21 +84511,21 @@ var require_io_util4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -77150,14 +84555,14 @@ var require_io_util4 = __commonJS({ var _a; 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 fs7 = __importStar4(require("fs")); - var path7 = __importStar4(require("path")); + var fs7 = __importStar2(require("fs")); + var path7 = __importStar2(require("path")); _a = fs7.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs7.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -77171,7 +84576,7 @@ var require_io_util4 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -77189,7 +84594,7 @@ var require_io_util4 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -77267,10 +84672,10 @@ var require_io_util4 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ +var require_io3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77279,21 +84684,21 @@ var require_io4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -77323,10 +84728,10 @@ var require_io4 = __commonJS({ 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 path7 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); + var path7 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -77353,7 +84758,7 @@ var require_io4 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -77374,7 +84779,7 @@ var require_io4 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -77394,14 +84799,14 @@ var require_io4 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which5(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77425,7 +84830,7 @@ var require_io4 = __commonJS({ } exports2.which = which5; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77473,7 +84878,7 @@ var require_io4 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -77483,290 +84888,65 @@ var require_io4 = __commonJS({ 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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve5) { - resolve5(value); - }); - } - return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os2 = require("os"); - var cp = require("child_process"); - var fs7 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os2.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os2.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; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs7.existsSync(lsbReleaseFile)) { - contents = fs7.readFileSync(lsbReleaseFile).toString(); - } else if (fs7.existsSync(osReleaseFile)) { - contents = fs7.readFileSync(osReleaseFile).toString(); - } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/tool-cache/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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + if (srcFileStat.isDirectory()) { + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } else { + yield copyFile(srcFile, destFile, force); + } } - } else { - return void 0; - } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - 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; + function copyFile(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); } - } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -77794,598 +84974,463 @@ var require_lib5 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(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", () => { - resolve5(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve5(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(userAgent, 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 = userAgent; - 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; - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path7 = __importStar2(require("path")); + var io5 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + _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}`; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - } 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(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve5(res); - } + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info6.httpModule.request(info6.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: ${info6.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(); + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } + return cmd; } - /** - * 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; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; } } - return info6; + return this.toolPath; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + _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 lowercaseKeys(headers || {}); + return this.args; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + _endsWith(str2, end) { + return str2.endsWith(end); } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + _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 (!useProxy) { - agent = this._agent; + if (!arg) { + return '""'; } - if (agent) { - return agent; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; + } } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (!needsQuotes) { + return arg; } - 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; + 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 { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + quoteHit = false; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); } - return agent; + reverse += '"'; + return reverse.split("").reverse().join(""); } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - if (proxyAgent) { - return proxyAgent; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - 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 - }); + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; } - return proxyAgent; + 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(""); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); - }); + _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; } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve5(response); + _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 = path7.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io5.which(this.toolPath, true); + return new Promise((resolve5, 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}`); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os2.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); } - } - return value; + 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 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); + 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); } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { + 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); + } + }); + }); } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; + 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 { - msg = `Failed request: (${statusCode})`; + resolve5(exitCode); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve5(response); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } })); }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.ToolRunner = ToolRunner5; + 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/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -78413,58 +85458,63 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core14 = __importStar4(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"); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + function exec(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.`); } - } - execute(action, isRetryable) { - return __awaiter4(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; - } - core14.info(err.message); - } - const seconds = this.getSleepAmount(); - core14.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => setTimeout(resolve5, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + }; + 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 exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78477,21 +85527,21 @@ var require_tool_cache = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve5) { resolve5(value); @@ -78518,613 +85568,301 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core14 = __importStar4(require_core()); - var io5 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs7 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os2 = __importStar4(require("os")); - var path7 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver8 = __importStar4(require_semver2()); - var stream = __importStar4(require("stream")); - var util = __importStar4(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); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path7.join(_getTempDirectory(), crypto.randomUUID()); - yield io5.mkdirP(path7.dirname(dest)); - core14.debug(`Downloading ${url}`); - core14.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs7.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core14.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs7.createWriteStream(dest)); - core14.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core14.debug("download failed"); - try { - yield io5.rmRF(dest); - } catch (err) { - core14.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core14.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path7.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 io5.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core14.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() - } - }); - core14.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core14.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core14.isDebug()) { - args.push("-v"); - } - const xarPath = yield io5.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io5.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 - ]; - core14.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 io5.which("powershell", true); - core14.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io5.which("unzip", true); - const args = [file]; - if (!core14.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os2.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch}`); - core14.debug(`source dir: ${sourceDir}`); - if (!fs7.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch); - for (const itemName of fs7.readdirSync(sourceDir)) { - const s = path7.join(sourceDir, itemName); - yield io5.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch); - return destPath; - }); - } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os2.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch}`); - core14.debug(`source file: ${sourceFile}`); - if (!fs7.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch); - const destPath = path7.join(destFolder, targetFile); - core14.debug(`destination file ${destPath}`); - yield io5.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch); - return destFolder; - }); - } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch = arch || os2.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path7.join(_getCacheDirectory(), toolName, versionSpec, arch); - core14.debug(`checking cache: ${cachePath}`); - if (fs7.existsSync(cachePath) && fs7.existsSync(`${cachePath}.complete`)) { - core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); - toolPath = cachePath; - } else { - core14.debug("not found"); - } - } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch) { - const versions = []; - arch = arch || os2.arch(); - const toolPath = path7.join(_getCacheDirectory(), toolName); - if (fs7.existsSync(toolPath)) { - const children = fs7.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path7.join(toolPath, child, arch || ""); - if (fs7.existsSync(fullPath) && fs7.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } - } - return versions; - } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core14.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core14.debug("Invalid json"); - } - } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; + 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 exec = __importStar2(require_exec3()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path7.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io5.mkdirP(dest); - return dest; + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true }); - } - function _createToolPath(tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path7.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - core14.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io5.rmRF(folderPath); - yield io5.rmRF(markerPath); - yield io5.mkdirP(folderPath); - return folderPath; + return { + name: name.trim(), + version: version.trim() + }; + }); + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true }); - } - function _completeToolPath(tool, version, arch) { - const folderPath = path7.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - const markerPath = `${folderPath}.complete`; - fs7.writeFileSync(markerPath, ""); - core14.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core14.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core14.debug(`explicit? ${valid3}`); - return valid3; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core14.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; - } - return -1; + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + silent: true }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core14.debug(`matched: ${version}`); - } else { - core14.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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; - }; + 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/http-client/lib/proxy.js -var require_proxy5 = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.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; + 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]; + } }; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + 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(resolve5) { + resolve5(value); + }); + } + return new (P || (P = Promise))(function(resolve5, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } else { - return void 0; + function step(result) { + result.done ? resolve5(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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os2 = __importStar2(require("os")); + var path7 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable7(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 checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + exports2.exportVariable = exportVariable7; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + process.env["PATH"] = `${inputPath}${path7.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + if (options && options.trimWhitespace === false) { + return val; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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; } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - 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; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } + return result; + }); + } + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return false; + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - 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]"); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -79137,31 +85875,21 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve5) { resolve5(value); @@ -79189,628 +85917,780 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(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", () => { - resolve5(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve5(Buffer.concat(chunks)); + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os2 = require("os"); + var cp = require("child_process"); + var fs7 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os2.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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 (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); + } + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os2.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; + } } } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs7.existsSync(lsbReleaseFile)) { + contents = fs7.readFileSync(lsbReleaseFile).toString(); + } else if (fs7.existsSync(osReleaseFile)) { + contents = fs7.readFileSync(osReleaseFile).toString(); + } + return contents; + } + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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 || 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); } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); + __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(resolve5) { + resolve5(value); }); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(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 core14 = __importStar2(require_core3()); + 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"); + } } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); + 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; + } + core14.info(err.message); + } + const seconds = this.getSleepAmount(); + core14.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); }); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + getSleepAmount() { + return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); + sleep(seconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve5) => setTimeout(resolve5, seconds * 1e3)); }); } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + 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]; + } }; } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + 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); } - /** - * 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 __awaiter4(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); + __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(resolve5) { + resolve5(value); }); } - postJson(requestUrl_1, obj_1) { - return __awaiter4(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); - }); + return new (P || (P = Promise))(function(resolve5, 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 ? resolve5(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core14 = __importStar2(require_core3()); + var io5 = __importStar2(require_io3()); + var crypto2 = __importStar2(require("crypto")); + var fs7 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os2 = __importStar2(require("os")); + var path7 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver9 = __importStar2(require_semver2()); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + 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); } - putJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }; + exports2.HTTPError = HTTPError2; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path7.join(_getTempDirectory(), crypto2.randomUUID()); + yield io5.mkdirP(path7.dirname(dest)); + core14.debug(`Downloading ${url}`); + core14.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(url, dest || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; }); - } - patchJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }); + } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs7.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false }); - } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + if (auth) { + core14.debug("set auth"); + if (headers === void 0) { + headers = {}; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + headers.authorization = auth; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve5(res); - } + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs7.createWriteStream(dest)); + core14.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core14.debug("download failed"); + try { + yield io5.rmRF(dest); + } catch (err) { + core14.debug(`Failed to delete '${dest}'. ${err.message}`); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + }); + } + 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 = core14.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } + } else { + const escapedScript = path7.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 io5.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - const req = info6.httpModule.request(info6.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(); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core14.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() } - handleResult(new Error(`Request timeout: ${info6.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + core14.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; + } + if (core14.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 (core14.isDebug()) { + args.push("-v"); + } + const xarPath = yield io5.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io5.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 + ]; + core14.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 io5.which("powershell", true); + core14.debug(`Using powershell at path: ${powershellPath}`); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + }); + } + function extractZipNix(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + const unzipPath = yield io5.which("unzip", true); + const args = [file]; + if (!core14.isDebug()) { + args.unshift("-q"); } - } - /** - * 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; + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os2.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch}`); + core14.debug(`source dir: ${sourceDir}`); + if (!fs7.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; + const destPath = yield _createToolPath(tool, version, arch); + for (const itemName of fs7.readdirSync(sourceDir)) { + const s = path7.join(sourceDir, itemName); + yield io5.cp(s, destPath, { recursive: true }); } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } + _completeToolPath(tool, version, arch); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os2.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch}`); + core14.debug(`source file: ${sourceFile}`); + if (!fs7.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); } - return info6; + const destFolder = yield _createToolPath(tool, version, arch); + const destPath = path7.join(destFolder, targetFile); + core14.debug(`destination file ${destPath}`); + yield io5.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + arch = arch || os2.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path7.join(_getCacheDirectory(), toolName, versionSpec, arch); + core14.debug(`checking cache: ${cachePath}`); + if (fs7.existsSync(cachePath) && fs7.existsSync(`${cachePath}.complete`)) { + core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; + } else { + core14.debug("not found"); } - return _default2; } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch) { + const versions = []; + arch = arch || os2.arch(); + const toolPath = path7.join(_getCacheDirectory(), toolName); + if (fs7.existsSync(toolPath)) { + const children = fs7.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path7.join(toolPath, child, arch || ""); + if (fs7.existsSync(fullPath) && fs7.existsSync(`${fullPath}.complete`)) { + versions.push(child); } } } - 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 _default2; } - _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; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core14.debug("set auth"); + headers.authorization = auth; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; } - 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; + let manifestUrl = ""; + for (const item of response.result.tree) { + if (item.path === "versions-manifest.json") { + manifestUrl = item.url; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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 (_a) { + core14.debug("Invalid json"); + } } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path7.join(_getTempDirectory(), crypto2.randomUUID()); } - if (proxyAgent) { - return proxyAgent; + yield io5.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path7.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + core14.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io5.rmRF(folderPath); + yield io5.rmRF(markerPath); + yield io5.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch) { + const folderPath = path7.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + const markerPath = `${folderPath}.complete`; + fs7.writeFileSync(markerPath, ""); + core14.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core14.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core14.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core14.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve5) => setTimeout(() => resolve5(), ms)); - }); + if (version) { + core14.debug(`matched: ${version}`); + } else { + core14.debug("match not found"); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve5, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve5(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 { - resolve5(response); - } - })); - }); + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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; }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ +var require_debug3 = __commonJS({ "node_modules/follow-redirects/debug.js"(exports2, module2) { var debug5; module2.exports = function() { if (!debug5) { try { debug5 = require_src()("follow-redirects"); - } catch (error4) { + } catch (error3) { } if (typeof debug5 !== "function") { debug5 = function() { @@ -79831,7 +86711,7 @@ var require_follow_redirects = __commonJS({ var https2 = require("https"); var Writable = require("stream").Writable; var assert = require("assert"); - var debug5 = require_debug2(); + var debug5 = require_debug3(); (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; @@ -79843,8 +86723,8 @@ var require_follow_redirects = __commonJS({ var useNativeURL = false; try { assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; } var preservedUrlFields = [ "auth", @@ -79918,9 +86798,9 @@ var require_follow_redirects = __commonJS({ this._currentRequest.abort(); this.emit("abort"); }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); + RedirectableRequest.prototype.destroy = function(error3) { + destroyRequest(this._currentRequest, error3); + destroy.call(this, error3); return this; }; RedirectableRequest.prototype.write = function(data, encoding, callback) { @@ -80087,10 +86967,10 @@ var require_follow_redirects = __commonJS({ var i = 0; var self2 = this; var buffers = this._requestBodyBuffers; - (function writeNext(error4) { + (function writeNext(error3) { if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); + if (error3) { + self2.emit("error", error3); } else if (i < buffers.length) { var buffer = buffers[i++]; if (!request.finished) { @@ -80289,12 +87169,12 @@ var require_follow_redirects = __commonJS({ }); return CustomError; } - function destroyRequest(request, error4) { + function destroyRequest(request, error3) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); - request.destroy(error4); + request.destroy(error3); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); @@ -80326,14 +87206,13 @@ var fs = __toESM(require("fs")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -80350,14 +87229,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs7.lstat(itemPath, { bigint: true }) : await fs7.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs7.lstat(itemPath, { bigint: true }) : await fs7.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 fs7.readdir(itemPath) : await fs7.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs7.readdir(itemPath) : await fs7.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -80368,13 +87247,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -81254,6 +88133,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -81373,7 +88264,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -81413,16 +88304,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -82977,7 +89859,7 @@ var safeDump = renamed("safeDump", "dump"); var semver = __toESM(require_semver2()); // src/api-compatibility.json -var maximumVersion = "3.19"; +var maximumVersion = "3.20"; var minimumVersion = "3.14"; // src/util.ts @@ -82992,9 +89874,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -83032,7 +89914,7 @@ function parseGitHubUrl(inputUrl) { var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; var hasBeenWarnedAboutVersion = false; function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== 1 /* GHES */) { + if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { return; } const disallowedAPIVersionReason = apiVersionInRange( @@ -83122,11 +90004,11 @@ function getTestingEnvironment() { } return testingEnvironment; } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } async function checkDiskUsage(logger) { try { @@ -83149,22 +90031,22 @@ async function checkDiskUsage(logger) { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, numTotalBytes: diskUsage.blocks * blockSizeInBytes }; - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to check available disk space: ${getErrorMessage(error4)}` + `Failed to check available disk space: ${getErrorMessage(error3)}` ); return void 0; } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + 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 === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( + 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.11" + ">=3.20" )) { - core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + core3.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/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } @@ -83365,17 +90247,17 @@ function getApiClient() { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -83458,19 +90340,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -83486,9 +90368,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -83693,28 +90575,43 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); +// src/logging.ts +var core7 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup + }; +} + // src/feature-flags.ts var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.23.3"; -var cliVersion = "2.23.3"; +var bundleVersion = "codeql-bundle-v2.23.8"; +var cliVersion = "2.23.8"; // src/overlay-database-utils.ts var fs2 = __toESM(require("fs")); var path2 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core7.debug(`Running git command: git ${args.join(" ")}`); + core8.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -83729,13 +90626,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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."; } - core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error4; + core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -83845,7 +90742,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core7.debug( + core8.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -83870,22 +90767,8 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/logging.ts -var core8 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup - }; -} - // src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -83946,7 +90829,7 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { } // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); function isSupportedToolsFeature(versionInfo, feature) { return !!versionInfo.features && versionInfo.features[feature]; } @@ -83960,11 +90843,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -83976,6 +90854,16 @@ var featureConfig = { 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", @@ -84004,12 +90892,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -84110,6 +90992,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -84121,21 +91008,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -84249,7 +91137,7 @@ var GitHubFeatureFlags = class { DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length, f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length ).replace(/_/g, "."); - if (!semver4.valid(version)) { + if (!semver5.valid(version)) { this.logger.warning( `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.` ); @@ -84258,15 +91146,15 @@ var GitHubFeatureFlags = class { return version; } async getDefaultCliVersion(variant) { - if (variant === 0 /* DOTCOM */) { - return await this.getDefaultDotcomCliVersion(); + if (supportsFeatureFlags(variant)) { + return await this.getDefaultCliVersionFromFlags(); } return { cliVersion, tagName: bundleVersion }; } - async getDefaultDotcomCliVersion() { + async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( ([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : void 0 @@ -84355,7 +91243,7 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (this.gitHubVersion.type !== 0 /* DOTCOM */ && this.gitHubVersion.type !== 2 /* GHE_DOTCOM */) { + if (!supportsFeatureFlags(this.gitHubVersion.type)) { this.logger.debug( "Not running against github.com. Disabling all toggleable features." ); @@ -84408,11 +91296,17 @@ var GitHubFeatureFlags = class { } } }; +function supportsFeatureFlags(githubVariant) { + return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; +} // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -84483,20 +91377,20 @@ function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { // src/setup-codeql.ts var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // src/tar.ts var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); // src/tools-download.ts var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // src/tracer-config.ts @@ -84954,6 +91848,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -85183,9 +92094,9 @@ function isFirstPartyAnalysis(actionName) { } return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; } -function getActionsStatus(error4, otherFailureCause) { - if (error4 || otherFailureCause) { - return error4 instanceof ConfigurationError ? "user-error" : "failure"; +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; } else { return "success"; } @@ -85422,9 +92333,9 @@ async function run() { } await endTracingForCluster(codeql, config, logger); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); core13.setFailed( - `We were unable to automatically build your code. Please replace the call to the autobuild action with your custom build steps. ${error4.message}` + `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, @@ -85432,7 +92343,7 @@ async function run() { startedAt, languages ?? [], currentLanguage, - error4 + error3 ); return; } @@ -85442,8 +92353,8 @@ async function run() { async function runWrapper() { try { await run(); - } catch (error4) { - core13.setFailed(`autobuild action failed. ${getErrorMessage(error4)}`); + } catch (error3) { + core13.setFailed(`autobuild action failed. ${getErrorMessage(error3)}`); } } void runWrapper(); @@ -85456,5 +92367,5 @@ undici/lib/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) */ diff --git a/lib/defaults.json b/lib/defaults.json index 1fa392f548..6f3dc42bf8 100644 --- a/lib/defaults.json +++ b/lib/defaults.json @@ -1,6 +1,6 @@ { - "bundleVersion": "codeql-bundle-v2.23.3", - "cliVersion": "2.23.3", - "priorBundleVersion": "codeql-bundle-v2.23.2", - "priorCliVersion": "2.23.2" + "bundleVersion": "codeql-bundle-v2.23.8", + "cliVersion": "2.23.8", + "priorBundleVersion": "codeql-bundle-v2.23.7", + "priorCliVersion": "2.23.7" } diff --git a/lib/init-action-post.js b/lib/init-action-post.js index cb01600f55..d89bfb5d3b 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os3 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os4 = __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() + os3.EOL); + process.stdout.write(cmd.toString() + os4.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,41 +176,51 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs17 = __importStar4(require("fs")); - var os3 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs18 = __importStar2(require("fs")); + var os4 = __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 (!fs17.existsSync(filePath)) { + if (!fs18.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs17.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { + fs18.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -210,18 +228,18 @@ var require_file_command = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; + return `${key}<<${delimiter}${os4.EOL}${convertedValue}${os4.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug5("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -999,14 +1015,14 @@ var require_util = __commonJS({ } 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 path15 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path16 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path15 && !path15.startsWith("/")) { - path15 = `/${path15}`; + if (path16 && !path16.startsWith("/")) { + path16 = `/${path16}`; } - url2 = new URL(origin + path15); + url2 = new URL(origin + path16); } return url2; } @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -2620,20 +2636,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) { "use strict"; - module2.exports = function basename(path15) { - if (typeof path15 !== "string") { + module2.exports = function basename2(path16) { + if (typeof path16 !== "string") { return ""; } - for (var i = path15.length - 1; i >= 0; --i) { - switch (path15.charCodeAt(i)) { + for (var i = path16.length - 1; i >= 0; --i) { + switch (path16.charCodeAt(i)) { case 47: // '/' case 92: - path15 = path15.slice(i + 1); - return path15 === ".." || path15 === "." ? "" : path15; + path16 = path16.slice(i + 1); + return path16 === ".." || path16 === "." ? "" : path16; } } - return path15 === ".." || path15 === "." ? "" : path15; + return path16 === ".." || path16 === "." ? "" : path16; }; } }); @@ -2647,7 +2663,7 @@ var require_multipart = __commonJS({ var Dicer = require_Dicer(); var parseParams = require_parseParams(); var decodeText = require_decodeText(); - var basename = require_basename(); + var basename2 = require_basename(); var getLimit = require_getLimit(); var RE_BOUNDARY = /^boundary$/i; var RE_FIELD = /^form-data$/i; @@ -2764,7 +2780,7 @@ var require_multipart = __commonJS({ } else if (RE_FILENAME.test(parsed[i][0])) { filename = parsed[i][1]; if (!preservePath) { - filename = basename(filename); + filename = basename2(filename); } } } @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); + supportedHashes = crypto2.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5663,7 +5679,7 @@ var require_request = __commonJS({ } var Request = class _Request { constructor(origin, { - path: path15, + path: path16, method, body, headers, @@ -5677,11 +5693,11 @@ var require_request = __commonJS({ throwOnError, expectContinue }, handler) { - if (typeof path15 !== "string") { + if (typeof path16 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path15[0] !== "/" && !(path15.startsWith("http://") || path15.startsWith("https://")) && method !== "CONNECT") { + } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path15) !== null) { + } else if (invalidPathRegex.exec(path16) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -5744,7 +5760,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util.buildURL(path15, query) : path15; + this.path = query ? util.buildURL(path16, query) : path16; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6752,9 +6768,9 @@ var require_RedirectHandler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path15 = search ? `${pathname}${search}` : pathname; + const path16 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path15; + this.opts.path = path16; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -7994,7 +8010,7 @@ var require_client = __commonJS({ writeH2(client, client[kHTTP2Session], request); return; } - const { body, method, path: path15, host, upgrade, headers, blocking, reset } = request; + const { body, method, path: path16, host, upgrade, headers, blocking, reset } = request; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); @@ -8044,7 +8060,7 @@ var require_client = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path15} HTTP/1.1\r + let header = `${method} ${path16} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -8107,7 +8123,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request) { - const { body, method, path: path15, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + const { body, method, path: path16, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; let headers; if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -8150,7 +8166,7 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path15; + headers[HTTP2_HEADER_PATH] = path16; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable2 { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable2 { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10390,20 +10406,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path15) { - if (typeof path15 !== "string") { - return path15; + function safeUrl(path16) { + if (typeof path16 !== "string") { + return path16; } - const pathSegments = path15.split("?"); + const pathSegments = path16.split("?"); if (pathSegments.length !== 2) { - return path15; + return path16; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path15, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path15); + function matchKey(mockDispatch2, { path: path16, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path16); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10421,7 +10437,7 @@ var require_mock_utils = __commonJS({ 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: path15 }) => matchValue(safeUrl(path15), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path16 }) => matchValue(safeUrl(path16), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10458,9 +10474,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path15, method, body, headers, query } = opts; + const { path: path16, method, body, headers, query } = opts; return { - path: path15, + path: path16, method, body, headers, @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay: delay2, persist } = mockDispatch2; + 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 (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -10909,10 +10925,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path15, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path15, + Path: path16, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable2({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve8({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15532,8 +15548,8 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path15) { - for (const char of path15) { + function validateCookiePath(path16) { + for (const char of path16) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url2, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17213,11 +17229,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path15 = opts.path; + let path16 = opts.path; if (!opts.path.startsWith("/")) { - path15 = `/${path15}`; + path16 = `/${path16}`; } - url2 = new URL(util.parseOrigin(url2).origin + path15); + url2 = new URL(util.parseOrigin(url2).origin + path16); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path15 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path16 = __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, path15.sep); + return pth.replace(/[/\\]/g, path16.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs17 = __importStar4(require("fs")); - var path15 = __importStar4(require("path")); - _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs18 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + _a = fs18.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs18.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs17.constants.O_RDONLY; + exports2.READONLY = fs18.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18563,7 +18677,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path15.extname(filePath).toUpperCase(); + const upperExt = path16.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18587,11 +18701,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path15.dirname(filePath); - const upperName = path15.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + const directory = path16.dirname(filePath); + const upperName = path16.basename(filePath).toUpperCase(); + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path15.join(directory, actualName); + filePath = path16.join(directory, actualName); break; } } @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -18684,18 +18810,23 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which7; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path15 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path16 = __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 ? path15.join(dest, path15.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path16.join(dest, path16.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -18707,20 +18838,19 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path15.relative(source, newDest) === "") { + if (path16.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = path15.join(dest, path15.basename(source)); + dest = path16.join(dest, path16.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -18731,13 +18861,12 @@ var require_io = __commonJS({ } } } - yield mkdirP(path15.dirname(dest)); + yield mkdirP(path16.dirname(dest)); yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,15 +18913,14 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which7; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + 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(path15.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path16.delimiter)) { if (extension) { extensions.push(extension); } @@ -18807,12 +18933,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path15.sep)) { + if (tool.includes(path16.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path15.delimiter)) { + for (const p of process.env.PATH.split(path16.delimiter)) { if (p) { directories.push(p); } @@ -18820,7 +18946,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path15.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path16.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os3 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path15 = __importStar4(require("path")); - var io7 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os4 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner6 = class extends events.EventEmitter { @@ -18988,12 +19128,12 @@ var require_toolrunner = __commonJS({ _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); - let n = s.indexOf(os3.EOL); + let n = s.indexOf(os4.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); - s = s.substring(n + os3.EOL.length); - n = s.indexOf(os3.EOL); + s = s.substring(n + os4.EOL.length); + n = s.indexOf(os4.EOL); } return s; } catch (err) { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path15.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io7.which(this.toolPath, true); - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19162,7 +19302,7 @@ var require_toolrunner = __commonJS({ } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.EOL); + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os4.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on("debug", (message) => { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve8(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + 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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 = exportVariable9; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug5; + exports2.error = error3; + exports2.warning = warning12; + exports2.notice = notice; + exports2.info = info7; + exports2.startGroup = startGroup4; + exports2.endGroup = endGroup4; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os3 = __importStar4(require("os")); - var path15 = __importStar4(require("path")); + var os4 = __importStar2(require("os")); + var path16 = __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 exportVariable8(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable9(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable8; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19679,20 +19870,18 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path15.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,71 +19889,58 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput(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(os3.EOL); + process.stdout.write(os4.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug5(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug5; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning11(message, properties = {}) { + function warning12(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning11; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info7(message) { - process.stdout.write(message + os3.EOL); + process.stdout.write(message + os4.EOL); } - exports2.info = info7; 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup4(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19835,8 +20007,8 @@ var require_context = __commonJS({ 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 path15 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path15} does not exist${os_1.EOL}`); + const path16 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path16} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url2, opts) => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url: url2, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url: url2, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url2 = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,501 +25406,43 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs17 = __importStar4(require("fs")); - var path15 = __importStar4(require("path")); - _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs17.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs17.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path15.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 = path15.dirname(filePath); - const upperName = path15.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path15.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 = which7; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path15 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path15.join(dest, path15.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 (path15.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path15.join(dest, path15.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(path15.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which7(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 __awaiter4(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(path15.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(path15.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path15.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path15.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; module2.exports = debug5; } @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare3 = require_compare(); - var gte5 = (a, b, loose) => compare3(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare3(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises5)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run2, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } } doExpire(clearGlobalState, run2, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run2, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run2, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve8, returned, task; + var args, cb, error3, reject, resolve8, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve8, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve8(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info7) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info7) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29256,14 +28970,14 @@ var require_helpers = __commonJS({ "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path15, name, argument) { - if (Array.isArray(path15)) { - this.path = path15; - this.property = path15.reduce(function(sum, item) { + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path16, name, argument) { + if (Array.isArray(path16)) { + this.path = path16; + this.property = path16.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); - } else if (path15 !== void 0) { - this.property = path15; + } else if (path16 !== void 0) { + this.property = path16; } if (message) { this.message = message; @@ -29354,16 +29068,16 @@ var require_helpers = __commonJS({ name: { value: "SchemaError", enumerable: false } } ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path15, base, schemas) { + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path16, base, schemas) { this.schema = schema2; this.options = options; - if (Array.isArray(path15)) { - this.path = path15; - this.propertyPath = path15.reduce(function(sum, item) { + if (Array.isArray(path16)) { + this.path = path16; + this.propertyPath = path16.reduce(function(sum, item) { return sum + makeSuffix(item); }, "instance"); } else { - this.propertyPath = path15; + this.propertyPath = path16; } this.base = base; this.schemas = schemas; @@ -29372,10 +29086,10 @@ var require_helpers = __commonJS({ return uri.resolve(this.base, target); }; SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path15 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var path16 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema2.$id || schema2.id; var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path15, base, Object.create(this.schemas)); + var ctx = new SchemaContext(schema2, this.options, path16, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema2; } @@ -29565,8 +29279,8 @@ var require_helpers = __commonJS({ } return decimalPlaces; }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; }; } }); @@ -30548,1424 +30262,895 @@ var require_lib3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core18 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core18.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core18.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os4 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os4.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core18.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path15 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs18 = __importStar2(require("fs")); + var os4 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path15.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs18.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs18.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname3; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path15.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os4.EOL}${convertedValue}${os4.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path15.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path15.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; - }; - var isArray = 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 = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; - } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length) { - result = [left, right]; - } + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __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", () => { + resolve8(output.toString()); + }); + })); + }); } - parts.push.apply(parts, p); - return parts; - } - function expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve8(Buffer.concat(chunks)); + }); + })); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; + }; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; - } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; } - } - } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } + 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; } - N.push(c); } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + } + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path15 = (function() { - try { - return require("path"); - } catch (e) { + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path15.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path15.sep !== "/") { - pattern = pattern.split(path15.sep).join("/"); + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.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 set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug5() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.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; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; - } - } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * 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); + }); } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + 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); + }); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); + }); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; - } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; - } + 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); + }); } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; - } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + /** + * 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."); } - 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; - } - 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; + const parsedUrl = new URL(requestUrl); + let info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, data); + } else { + return response; + } } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, data); + redirectsRemaining--; } - 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; + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); } - re += c; + } 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; } - if (inClass) { - cs = pattern.substr(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve8(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); } - 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 = "\\"; + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; } - return $1 + $1 + $2 + "|"; + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(void 0, res); }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; - } - clearStateChar(); - if (escaping) { - re += "\\\\"; - } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = 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(/\)[+*?]?/, ""); + let socket; + req.on("socket", (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) { + socket.end(); + } + handleResult(new Error(`Request timeout: ${info7.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); } - nlAfter = cleanAfter; - var dollar = ""; - if (nlAfter === "" && isSub !== SUBPARSE) { - dollar = "$"; + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + /** + * 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); } - if (addPatternStart) { - re = patternStart + re; + 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); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + _prepareRequest(method, requestUrl, headers) { + const info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); + } + } + return info7; } - if (!hasMagic) { - return globUnescape(pattern); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path15.sep !== "/") { - f = f.split(path15.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - } - if (options.flipNegate) return false; - return this.negate; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - return false; + if (!useProxy) { + agent = this._agent; } - 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 (agent) { + return agent; } - 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 regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path15 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path15.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path15.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path15.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } - } + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path15.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; + 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 { - result += path15.sep; + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } - result += this.segments[i]; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os3 = __importStar4(require("os")); - var path15 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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}`; - } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); + this._agent = agent; } - while (pattern.startsWith("!")) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); } - pattern = _Pattern.fixupPattern(pattern, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path15.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); + return agent; } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path15.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path15.sep}`; - } - } else { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; } - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + if (proxyAgent) { + return proxyAgent; } - 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); + 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 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, "[*]"); + return proxyAgent; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path15.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path15.sep}`)) { - homedir = homedir || os3.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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); + _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((resolve8) => setTimeout(() => resolve8(), ms)); + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve8(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } } + return value; } - if (closed >= 0) { - if (set2.length > 1) { - return ""; + 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; } - if (set2) { - literal += set2; - i = closed; - continue; + 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 { + resolve8(response); } - } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path15, level) { - this.path = path15; - this.level = level; + })); + }); } }; - exports2.SearchState = SearchState; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -31992,286 +31177,84 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); - } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + 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; } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - function step(r) { - r.value instanceof __await4 ? 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); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core18 = __importStar4(require_core()); - var fs17 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path15 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - getSearchPaths() { - return this.searchPaths.slice(); + // 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}`; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - globGenerator() { - return __asyncGenerator4(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)) { - core18.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs17.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs17.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path15.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter4(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; - }); + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs17.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core18.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 fs17.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs17.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core18.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; - } - traversalChain.push(realPath); - } - return stats; - }); + // 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")}`; } - }; - exports2.DefaultGlobber = DefaultGlobber; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create3(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); - } - exports2.create = create3; + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -32298,153 +31281,78 @@ var require_io_util3 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var _a; 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 fs17 = __importStar4(require("fs")); - var path15 = __importStar4(require("path")); - _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs17.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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'); + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + 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); } - if (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); + 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; } - return p.startsWith("/"); - } - exports2.isRooted = isRooted; - function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(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}`); - } + 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"); } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path15.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - } - const originalFilePath = filePath; - for (const extension of extensions) { - filePath = originalFilePath + extension; - stats = void 0; + return id_token; + }); + } + static getIDToken(audience) { + return __awaiter2(this, void 0, void 0, function* () { 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 = path15.dirname(filePath); - const upperName = path15.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path15.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; - } + 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}`); } - } - 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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } - exports2.getCmdPath = getCmdPath; + }; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -32472,60 +31380,599 @@ var require_io3 = __commonJS({ }); }; 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 path15 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); - function cp(source, dest, options = {}) { - return __awaiter4(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 ? path15.join(dest, path15.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 (path15.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); + 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; } - yield copyFile(source, newDest, force); - } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path15.join(dest, path15.basename(source)); - destExists = yield ioUtil.exists(dest); + 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.`); } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } else { - throw new Error("Destination already exists"); - } + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + 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}>`; } - yield mkdirP(path15.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } + 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/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/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 path16 = __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, path16.sep); + } + exports2.toPlatformPath = toPlatformPath; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + 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 fs18 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + _a = fs18.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs18.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 = path16.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 = path16.dirname(filePath); + const upperName = path16.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path16.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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 path16 = __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 ? path16.join(dest, path16.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 (path16.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(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 = path16.join(dest, path16.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(path16.dirname(dest)); + yield ioUtil.rename(source, dest); + }); + } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -32545,14 +31992,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32576,13 +32023,13 @@ var require_io3 = __commonJS({ } exports2.which = which7; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + 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(path15.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path16.delimiter)) { if (extension) { extensions.push(extension); } @@ -32595,12 +32042,12 @@ var require_io3 = __commonJS({ } return []; } - if (tool.includes(path15.sep)) { + if (tool.includes(path16.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path15.delimiter)) { + for (const p of process.env.PATH.split(path16.delimiter)) { if (p) { directories.push(p); } @@ -32608,7 +32055,7 @@ var require_io3 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path15.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path16.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -32624,7 +32071,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -32644,7 +32091,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -32665,1200 +32112,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug5; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug5 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug5 = 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++) { - debug5(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + __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(resolve8) { + resolve8(value); + }); } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; - } else { - version = version.version; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } 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); - } - debug5("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; - } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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) { - debug5("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]; - debug5("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); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - SemVer.prototype.compareBuild = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os4 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - var i2 = 0; - do { - var a = this.build[i2]; - var b = other.build[i2]; - debug5("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); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); } - } 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; - } + } + _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}`; } - if (i2 === -1) { - this.prerelease.push(0); + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - } - if (identifier) { - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; - } - } else { - this.prerelease = [identifier, 0]; + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } } - 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; + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; } - try { - return new SemVer(version, loose).inc(release2, identifier).version; - } catch (er) { - return null; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os4.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os4.EOL.length); + n = s.indexOf(os4.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; + 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 defaultResult; + return this.args; } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; + _endsWith(str2, end) { + return str2.endsWith(end); } - 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 = rcompare; - function rcompare(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 = lt; - function lt(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 = gte5; - function gte5(a, b, loose) { - return compare3(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(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 - }; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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(""); } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug5("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; + _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(""); } - debug5("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); + _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; } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; + _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; } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); + /** + * 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 = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io7.which(this.toolPath, true); + return new Promise((resolve8, 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) + os4.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 { + resolve8(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug5("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; + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug5("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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); } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); - }); + __setModuleDefault2(result, mod); + return result; }; - 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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); }); - testComparator = remainingComparators.pop(); } - return result; - } - exports2.toComparators = toComparators; - function toComparators(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug5("comp", comp, options); - comp = replaceCarets(comp, options); - debug5("caret", comp); - comp = replaceTildes(comp, options); - debug5("tildes", comp); - comp = replaceXRanges(comp, options); - debug5("xrange", comp); - comp = replaceStars(comp, options); - debug5("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) { - debug5("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) { - debug5("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; - } - debug5("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) { - debug5("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_2, M, m, p, pr) { - debug5("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) { - debug5("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"; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } else { - debug5("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"; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - debug5("caret return", ret); - return ret; + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - function replaceXRanges(comp, options) { - debug5("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) { - debug5("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 = ""; + }; + 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.`); } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; - } else { - ret = "*"; - } - } else if (gtlt && anyX) { - if (xm) { - m = 0; + 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 _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - 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; - } + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - 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; - } - debug5("xRange return", ret); - return ret; + }; + 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 + }; }); } - function replaceStars(comp, options) { - debug5("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - 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; + 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); } - return (from + " " + to).trim(); - } - Range2.prototype.test = function(version) { - if (!version) { - return false; + __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(resolve8) { + resolve8(value); + }); } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve8(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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - return false; + 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; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug5(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve8(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_utils5(); + var os4 = __importStar2(require("os")); + var path16 = __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 exportVariable9(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable9; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } + 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 setOutput(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(os4.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning12(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning12; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os4.EOL); + } + exports2.info = info7; + 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; }); - return min; } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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/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]; + } }; } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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); - } - }); + 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); } - if (minver && range.test(minver)) { - return minver; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core18 = __importStar2(require_core2()); + 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; + core18.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + } + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core18.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core18.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core18.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core18.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + } } - return null; + return result; } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - } - exports2.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); - } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); - } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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); } - if (satisfies2(version, range, options)) { - return false; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path16 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname4(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + let result = path16.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname4; + 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)}`; } - }); - 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; + } 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)}`; } } - return true; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path16.sep; + } + return root + itemPath; } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(version, options); - return parsed && parsed.prerelease.length ? parsed.prerelease : null; + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); } - exports2.intersects = intersects; - function intersects(r1, r2, options) { - r1 = new Range2(r1, options); - r2 = new Range2(r2, options); - return r1.intersects(r2); + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.hasRoot = hasRoot; + function normalizeSeparators(p) { + p = p || ""; + if (IS_WINDOWS) { + p = p.replace(/\//g, "\\"); + const isUnc = /^\\\\+[^\\]/.test(p); + return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); } - if (typeof version === "number") { - version = String(version); + return p.replace(/\/\/+/g, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; } - if (typeof version !== "string") { - return null; + p = normalizeSeparators(p); + if (!p.endsWith(path16.sep)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } - safeRe[t.COERCERTL].lastIndex = -1; + if (p === path16.sep) { + return p; } - if (match === null) { - return null; + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -33871,932 +33289,1220 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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; + } + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + } + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); } + return res; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core18 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob2 = __importStar4(require_glob()); - var io7 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs17 = __importStar4(require("fs")); - var path15 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path15.join(baseLocation, "actions", "temp"); - } - const dest = path15.join(tempDirectory, crypto.randomUUID()); - yield io7.mkdirP(dest); - return dest; - }); + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs17.statSync(filePath).size; + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - 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 = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path15.relative(workspace, file).replace(new RegExp(`\\${path15.sep}`, "g"), "/"); - core18.debug(`Matched: ${relativeFile}`); - if (relativeFile === "") { - paths.push("."); - } else { - paths.push(`${relativeFile}`); + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.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 = str2.indexOf(b, i + 1); } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } + i = ai < bi && ai >= 0 ? ai : bi; } - return paths; - }); - } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs17.unlink)(filePath); - }); - } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core18.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() - } - }); - } catch (err) { - core18.debug(err.message); + if (begs.length) { + result = [left, right]; } - versionOutput = versionOutput.trim(); - core18.debug(versionOutput); - return versionOutput; - }); + } + return result; } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core18.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; - } - }); + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs17.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io7.which("tar") : ""; - }); + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - return value; + parts.push.apply(parts, p); + return parts; } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getCacheVersion = getCacheVersion; - 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; + function embrace(str2) { + return "{" + str2 + "}"; } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } 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}`); + N = concatMap(n, function(el) { + return expand(el, false); + }); } - 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; + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); } } - 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]"); + return expansions; } - 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/cache/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path16 = (function() { + try { + return require("path"); + } catch (e) { } - __setModuleDefault4(result, mod); - return result; + })() || { + sep: "/" }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + minimatch.sep = path16.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } }; - 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); } - 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); + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(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", () => { - resolve8(output.toString()); - }); - })); - }); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve8(Buffer.concat(chunks)); - }); - })); - }); + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path16.sep !== "/") { + pattern = pattern.split(path16.sep).join("/"); } + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + Minimatch.prototype.debug = function() { }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + Minimatch.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 set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug5() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; - } + Minimatch.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; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + else + pattern = "*"; } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; + } + self2.debug("clearStateChar %j %j", stateChar, re); + stateChar = false; + } } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + 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 && reSpecials[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; + } + 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 (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; + } } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); + 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 === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - /** - * 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 __awaiter4(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); - }); + clearStateChar(); + if (escaping) { + re += "\\\\"; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + if (re !== "" && hasMagic) { + re = "(?=.)" + re; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, data); - } else { - return response; - } + if (addPatternStart) { + 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; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path16.sep !== "/") { + f = f.split(path16.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; } - 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) { + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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); + this.debug("globstar swallow a segment, and continue"); + fr++; } - } 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(); + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + return false; } - this._disposed = true; + 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 regExpEscape(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 || 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.Path = void 0; + var path16 = __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 { /** - * Raw request. - * @param info - * @param data + * Constructs a Path + * @param itemPath Path or array of segments */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve8(res); - } + 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(path16.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename2 = path16.basename(remaining); + this.segments.unshift(basename2); + remaining = dir; + dir = pathHelper.dirname(remaining); } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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(path16.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } } /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * Converts the path to it's string representation */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path16.sep; } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + result += this.segments[i]; } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + 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 || 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.Pattern = void 0; + var os4 = __importStar2(require("os")); + var path16 = __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, homedir) { + 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}`; } } - const req = info7.httpModule.request(info7.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: ${info7.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path16.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(path16.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path16.sep}`; + } } else { - req.end(); + 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; } /** - * 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 + * Indicates whether the pattern may match descendants of the specified path */ - 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; + partialMatch(itemPath) { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + if (pathHelper.dirname(itemPath) === itemPath) { + return this.rootRegExp.test(itemPath); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); + /** + * 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, homedir) { + (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(`.${path16.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { + homedir = homedir || os4.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 info7; + return pathHelper.normalizeSeparators(pattern); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; - } - _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 https2.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 __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve8(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + /** + * 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; + } else { + set2 += c2; } - 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; + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - 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})`; + if (set2) { + literal += set2; + i = closed; + continue; } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve8(response); } - })); - }); + } + literal += c; + } + return literal; + } + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.Pattern = Pattern; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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(path16, level) { + this.path = path16; + 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -34823,3172 +34529,2309 @@ var require_auth2 = __commonJS({ 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; + 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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ value: v2, done: d }); + }, reject); } }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - // 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"); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - // 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")}`; + function fulfill(value) { + resume("next", value); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + function reject(value) { + resume("throw", value); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + exports2.DefaultGlobber = void 0; + var core18 = __importStar2(require_core2()); + var fs18 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path16 = __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); } - 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; + getSearchPaths() { + return this.searchPaths.slice(); } - 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; + glob() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } } + return result; }); - this._orderedPolicies = void 0; - return removedPolicies; - } - sendRequest(httpClient, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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); - } + 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("**"))); } } - if (options.beforePolicies) { - for (const beforePolicyName of options.beforePolicies) { - const beforeNode = policyMap.get(beforePolicyName); - if (beforeNode) { - beforeNode.dependsOn.add(node); - node.dependants.add(beforeNode); + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core18.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs18.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } + throw err; } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - } - function walkPhase(phase) { - phase.hasRun = true; - for (const node of phase.policies) { - if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) { + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { 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); + const stats = yield __await2( + _DefaultGlobber.stat(item, options, traversalChain) + // Broken symlink, or symlink cycle detected, or no longer exists + ); + if (!stats) { + continue; } - } - } - function walkPhases() { - for (const phase of orderedPhases) { - walkPhase(phase); - if (phase.policies.size > 0 && phase !== noPhase) { - if (!noPhase.hasRun) { - walkPhase(noPhase); + if (options.excludeHiddenFiles && path16.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await2(item.path); + } else if (!partialMatch) { + continue; } - return; + const childLevel = item.level + 1; + const childItems = (yield __await2(fs18.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path16.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); } - if (phase.hasAfterPolicies) { - walkPhase(noPhase); + } + }); + } + /** + * 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)); } } - } - 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."); + 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 fs18.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core18.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 fs18.promises.lstat(item.path); } - } - return result; + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs18.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + if (traversalChain.some((x) => x === realPath)) { + core18.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; + }); } }; - function createEmptyPipeline() { - return HttpPipeline.create(); - } + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os3 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os3.EOL}`); - } - 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 - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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]; + } }; } - } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + 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); } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + __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(resolve8) { + resolve8(value); + }); } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } - return false; - } - 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: extend3 - }); - function debug6(...args) { - if (!newDebugger.enabled) { - return; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; - } - return false; - } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; - } - var debug5 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug5("azure"); - AzureLogger.log = (...args) => { - debug5.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } - } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + 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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); + }); + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); - } + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ value: v2, done: d }); + }, reject); } - debug5.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; - } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core18 = __importStar2(require_core2()); + var fs18 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path16 = __importStar2(require("path")); + function hashFiles2(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core18.info : core18.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path16.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs18.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash2 = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(fs18.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 && !_a && (_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 ""; + } }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug5.disable(); - debug5.enable(enabledNamespaces2 + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); + exports2.hashFiles = hashFiles2; } }); -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve8, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - try { - buildPromise((x) => { - removeListeners(); - resolve8(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/delay.js -var require_delay = __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 random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve8) => { - token = setTimeout(resolve8, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage + exports2.hashFiles = exports2.create = void 0; + 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 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/@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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } + exports2.create = create3; + function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + 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); + }); } + exports2.hashFiles = hashFiles2; } }); -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@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 debug5; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug5 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug5 = function() { + }; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + 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++; } - function getErrorMessage2(e) { - if (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}`; + 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; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); - } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + 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++) { + debug5(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); + } } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return 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; } - return true; - } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID2; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID2() { - return uuidFunction(); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; + 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); + } + debug5("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; } - seen.add(value); } - return value; - }, 2); + return id; + }); } - 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(); + 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("."); } - 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; + return this.version; + }; + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug5("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - 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; + 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); }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); - } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url2 = new URL(locationHeader, request.url); - request.url = url2.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; - } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 context3 = {}; - for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; - context3.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], context3); - 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(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var i2 = 0; + do { + var a = this.prerelease[i2]; + var b = other.prerelease[i2]; + debug5("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); } - } - function step(result) { - result.done ? resolve8(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]); + var i2 = 0; + do { + var a = this.build[i2]; + var b = other.build[i2]; + debug5("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); }; - } - 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; + 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 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; + 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); } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _2.label = op[1]; - break; + this.inc("pre", identifier); + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; } - if (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; } - if (t[2]) _2.ops.pop(); - _2.trys.pop(); - continue; + 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; } - 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 }; + exports2.diff = diff; + function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(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; + } } - }; - 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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } - 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]; + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - } - 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]); + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } - 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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]; + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + exports2.compare = compare3; + function compare3(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - 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); - } + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare3(a, b, true); } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os3 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + 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); } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os3.arch()}-${os3.type()}-${os3.release()})`); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare3(b, a, loose); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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(" "); + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - 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; + exports2.gt = gt; + function gt(a, b, loose) { + return compare3(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); - } - }; + exports2.lt = lt; + function lt(a, b, loose) { + return compare3(a, b, loose) < 0; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - exports2.isReadableStream = isReadableStream; - exports2.isBlob = isBlob; - function isNodeReadableStream(x) { - return Boolean(x && typeof x["pipe"] === "function"); + exports2.eq = eq; + function eq(a, b, loose) { + return compare3(a, b, loose) === 0; } - function isWebReadableStream(x) { - return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); + exports2.neq = neq; + function neq(a, b, loose) { + return compare3(a, b, loose) !== 0; } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare3(a, b, loose) >= 0; } - function isBlob(x) { - return typeof x.stream === "function"; + exports2.lte = lte; + function lte(a, b, loose) { + return compare3(a, b, loose) <= 0; } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); + 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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function createFileFromStream(stream2, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream2(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - return s; - }, [rawContent]: stream2 }); - } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); + } + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); + } + comp = comp.trim().split(/\s+/).join(" "); + debug5("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; } else { - return new File([content], name, options); + this.value = this.operator + this.semver.version; } + debug5("comp", this); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); - } - yield yield tslib_1.__await(value); - } - } finally { - reader.releaseLock(); - } - }); - } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); + 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); } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; } - } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return node_stream_1.Readable.fromWeb(stream2); + if (!m[2]) { + this.semver = ANY; } else { - return stream2; + this.semver = new SemVer(m[2], this.options.loose); } - } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); - } else { - return ensureNodeStream(source); + }; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug5("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; } - } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream2 of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream2)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } - } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; - } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } } - 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; + 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"); } - } - function getTotalLength(sources) { - let total = 0; - for (const source of sources) { - const partLength = getLength(source); - if (partLength === void 0) { - return void 0; + 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(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; } else { - total += partLength; + return new Range2(range.raw, options); } } - return total; - } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + if (range instanceof Comparator) { + return new Range2(range.value, options); } - request.body = await (0, concat_js_1.concat)(sources); + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - 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`); + 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(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug5("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); + }); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; + }; + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); + } + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.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; } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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}`); + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); + } + function parseComparator(comp, options) { + debug5("comp", comp, options); + comp = replaceCarets(comp, options); + debug5("caret", comp); + comp = replaceTildes(comp, options); + debug5("tildes", comp); + comp = replaceXRanges(comp, options); + debug5("xrange", comp); + comp = replaceStars(comp, options); + debug5("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) { + debug5("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) { + debug5("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + } + debug5("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) { + debug5("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_2, M, m, p, pr) { + debug5("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"; } - 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`); + } else if (pr) { + debug5("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"; } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); + } else { + debug5("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 { - boundary = generateBoundary(); + ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); } - }; + debug5("caret return", ret); + return ret; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __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; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; + function replaceXRanges(comp, options) { + debug5("replaceXRanges", comp, options); + return comp.split(/\s+/).map(function(comp2) { + return replaceXRange(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve8, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); - }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); + 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) { + debug5("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 = "*"; } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); + } else if (gtlt && anyX) { + if (xm) { + m = 0; } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve8(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + 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; } + debug5("xRange return", ret); + return ret; }); } - function parseHeaderValueAsNumber(response, headerName) { - const value = response.headers.get(headerName); - if (!value) - return; - const valueAsNum = Number(value); - if (Number.isNaN(valueAsNum)) - return; - return valueAsNum; + function replaceStars(comp, options) { + debug5("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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; + 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(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug5(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } } } - 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 (_a) { - return void 0; + return false; } + return true; } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; + } + return range.test(version); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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 { - retryAfterInMs - }; } - }; + }); + return max; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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); } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + }); + return min; } - function isSystemError(err) { - if (!err) { - return false; + exports2.minVersion = minVersion; + function minVersion(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 { - 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; + compver.prerelease.push(0); } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.url = redirectTo; - continue retryRequest; + compver.raw = compver.format(); + /* fallthrough */ + case "": + case ">=": + if (!minver || gt(minver, compver)) { + minver = compver; } - } - 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; - } + break; + case "<": + case "<=": + break; + /* istanbul ignore next */ + default: + throw new Error("Unexpected operation: " + comparator.operator); } - } - }; + }); + } + if (minver && range.test(minver)) { + return minver; + } + return null; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; + } } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies2(version, range, options)) { + return false; + } + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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; } } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + return true; + } + exports2.prerelease = prerelease; + function prerelease(version, options) { + var parsed = parse(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; } - /** - * 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)); + if (typeof version === "number") { + version = String(version); } - /** - * Remove the header with the provided headerName. - * @param name - The name of the header to remove. - */ - delete(name) { - this._headersMap.delete(normalizeName(name)); + if (typeof version !== "string") { + return null; } - /** - * 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; + options = options || {}; + var match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } - return result; - } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJSON({ preserveCase: true })); + safeRe[t.COERCERTL].lastIndex = -1; } - /** - * Iterate over tuples of header [name, value] pairs. - */ - [Symbol.iterator]() { - return headerIterator(this._headersMap); + if (match === null) { + return null; } - }; - function createHttpHeaders(rawHeaders) { - return new HttpHeadersImpl(rawHeaders); + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js"(exports2) { +// 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.formDataPolicyName = void 0; - exports2.formDataPolicy = formDataPolicy; - var core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); - } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); - } - }; - } - 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, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); - } - } - } - request.multipartBody = { parts }; - } + 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); } }); -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); - }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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"); +// 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]; + } }; } - 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; + 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]); } - return createDebug.colors[Math.abs(hash2) % createDebug.colors.length]; + __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(resolve8) { + resolve8(value); + }); } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug5(...args) { - if (!debug5.enabled) { - return; - } - const self2 = debug5; - 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"); + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); } - debug5.namespace = namespace; - debug5.useColors = createDebug.useColors(); - debug5.color = createDebug.selectColor(namespace); - debug5.extend = extend3; - debug5.destroy = createDebug.destroy; - Object.defineProperty(debug5, "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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug5); } - return debug5; + function step(result) { + result.done ? resolve8(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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); + }); + }; } - function extend3(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ value: v2, done: d }); + }, reject); } - 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)); + }; + 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 core18 = __importStar2(require_core()); + var exec3 = __importStar2(require_exec()); + var glob2 = __importStar2(require_glob()); + var io7 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs18 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 { - createDebug.names.push(ns); + if (process.platform === "darwin") { + baseLocation = "/Users"; + } else { + baseLocation = "/home"; + } } + tempDirectory = path16.join(baseLocation, "actions", "temp"); } - } - 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++; + const dest = path16.join(tempDirectory, crypto2.randomUUID()); + yield io7.mkdirP(dest); + return dest; + }); + } + function getArchiveFileSizeInBytes(filePath) { + return fs18.statSync(filePath).size; + } + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path16.relative(workspace, file).replace(new RegExp(`\\${path16.sep}`, "g"), "/"); + core18.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); } else { - searchIndex++; - templateIndex++; + paths.push(`${relativeFile}`); } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; + return paths; + }); + } + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs18.unlink)(filePath); + }); + } + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core18.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) { + core18.debug(err.message); } - 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; - } + versionOutput = versionOutput.trim(); + core18.debug(versionOutput); + return versionOutput; + }); + } + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core18.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } + }); + } + 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 (fs18.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } - return false; + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io7.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - function coerce3(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - 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`."); + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - createDebug.enable(createDebug.load()); - return createDebug; + components.push(versionSalt); + return crypto2.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; } - 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+)/); +// 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]]; } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); + 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 context3 = {}; + for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; + context3.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], context3); + 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; } - exports2.log = console.debug || console.log || (() => { + } + 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(resolve8) { + resolve8(value); }); - function save(namespaces) { + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { + step(generator.next(value)); + } catch (e) { + reject(e); } } - function load2() { - let r; + function rejected(value) { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return r; } - function localstorage() { - try { - return localStorage; - } catch (error4) { - } + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.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); + 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]); }; } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os3 = 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 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; } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; + 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 }; } - 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 = os3.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; + }; + 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; } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); - return translateLevel(level); + } + 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]; } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) + } + 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); }; } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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]; + 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 { - 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 (error4) { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - 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(); + } + 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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); - } - obj[prop] = val2; - 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(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } + }; + } + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ 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]; } - function load2() { - return process.env.DEBUG; + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function init(debug5) { - debug5.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug5.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { + try { + inner.call(this); + } catch (e) { + return Promise.reject(e); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + env.stack.push({ value, dispose, async }); + } else if (async) { + env.stack.push({ async: true }); } -}); - -// 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(); + 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; } -}); - -// node_modules/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + return next(); +} +function __rewriteRelativeImportExtension(path16, preserveJsx) { + if (typeof path16 === "string" && /^\.\.?\//.test(path16)) { + return path16.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path16; +} +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)) { @@ -38000,980 +36843,760 @@ var require_helpers3 = __commonJS({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + }); + __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; }; + 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.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(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 json2(stream2) { - const buf = await toBuffer(stream2); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; + 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}`); } - exports2.json = json2; - function req(url2, opts = {}) { - const href = typeof url2 === "string" ? url2 : url2.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); - const promise = new Promise((resolve8, reject) => { - req2.once("response", resolve8).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) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + 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 }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); + } } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = Symbol("AgentBaseInternalState"); - var Agent = class extends http.Agent { - constructor(opts) { - super(opts); - this[INTERNAL] = {}; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - /** - * 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); + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - // 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] = []; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; } - 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 index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; } } - // 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); + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - 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); + 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; } } - 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"); + 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; } - return socket; } - get defaultPort() { - return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); - } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + 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(debug5, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug5(...args) { + if (!newDebugger.enabled) { + return; } - } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); - } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; } + newDebugger.log(...args); } - }; - exports2.Agent = Agent; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; + } + function extend3(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; + } + exports2.default = debugObj; } }); -// 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) { +// 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"; - var __importDefault4 = 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 = __importDefault4(require_src()); - var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve8, 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); + 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(",")}`); } - function onend() { - cleanup(); - debug5("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + logLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } } - function onerror(err) { - cleanup(); - debug5("onerror %o", err); - reject(err); + 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 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) { - debug5("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; - } - } - debug5("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve8({ - connect: { - statusCode, - statusText, - headers - }, - buffered - }); + } + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); + } + function createLogger(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); } - socket.on("error", onerror); - socket.on("end", onend); - read(); - }); + registeredLoggers.add(logger); + return logger; + } + function contextGetLogLevel() { + return logLevel; + } + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; + } + var context3 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context3.logger; + function setLogLevel(logLevel) { + context3.setLogLevel(logLevel); + } + function getLogLevel() { + return context3.getLogLevel(); + } + function createClientLogger(namespace) { + return context3.createClientLogger(namespace); } - exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/https-proxy-agent/dist/index.js -var require_dist3 = __commonJS({ - "node_modules/https-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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(exports2, "__esModule", { value: true }); + exports2.createHttpHeaders = createHttpHeaders; + function normalizeName(name) { + return name.toLowerCase(); + } + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + } + 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]); + } + } } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug5 = (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 - }; + /** + * 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() }); } - return options; - }; - var HttpsProxyAgent = 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 ?? {}; - debug5("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 ? omit(opts, "headers") : null, - host, - port - }; + /** + * 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; } /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. + * 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. */ - async connect(req, opts) { - const { proxy } = this; - if (!opts.host) { - throw new TypeError('No "host" provided'); - } - let socket; - if (proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + 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 { - debug5("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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) { - debug5("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + for (const [normalizedName, entry] of this._headersMap) { + result[normalizedName] = entry.value; } - return socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug5("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + 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); } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); } - function omit(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/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 = randomUUID2; + function randomUUID2() { + return crypto.randomUUID(); } } }); -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; }; + 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.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug5 = (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 ?? {}; - debug5("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 ? omit(opts, "headers") : null, - host, - port - }; - } - addRequest(req, opts) { - req._header = null; - this.setRequestProps(req, opts); - super.addRequest(req, opts); + 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; } - 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); + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - req.path = String(url2); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - for (const name of Object.keys(headers)) { - const value = headers[name]; - if (value) { - req.setHeader(name, value); + 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; } - async connect(req, opts) { - req._header = null; - if (!req.path.includes("://")) { - this.setRequestProps(req, opts); - } - let first; - let endOfHeaders; - debug5("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug5("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); - debug5("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug5("Creating `net.Socket`: %o", this.connectOpts); - socket = net.connect(this.connectOpts); - } - await (0, events_1.once)(socket, "connect"); - return socket; + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); } - }; - HttpProxyAgent.protocols = ["http", "https"]; - exports2.HttpProxyAgent = HttpProxyAgent; - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - return ret; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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_log(); - 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; + clone() { + return new _HttpPipeline(this._policies); } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + static create() { + return new _HttpPipeline(); } - let isBypassedFlag = false; - for (const pattern of noProxyList) { - if (pattern[0] === ".") { - if (host.endsWith(pattern)) { - isBypassedFlag = true; + 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 { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } else { - if (host === pattern) { - isBypassedFlag = true; + return noPhase; } } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url2 = new URL(request.url); - const isInsecure = url2.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + 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); } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + 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); + } + } + } } - request.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(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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); + } } - return next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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); + } } - return next(request); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __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; - exports2.tlsPolicyName = "tlsPolicy"; - function tlsPolicy(tlsSettings) { - return { - name: exports2.tlsPolicyName, - sendRequest: async (req, next) => { - if (!req.tlsSettings) { - req.tlsSettings = tlsSettings; + 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 next(req); } - }; - } - } -}); - -// 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.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context3 = new TracingContextImpl(options.parentContext); - if (options.span) { - context3 = context3.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context3 = context3.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context3; - } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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; + return result; } }; - 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 - }; + function createEmptyPipeline() { + return HttpPipeline.create(); + } } }); -// node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js -var require_instrumenter = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js"(exports2) { +// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } - exports2.getInstrumenter = getInstrumenter; } }); -// node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js -var require_tracingClient = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js"(exports2) { +// 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.createTracingClient = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context3, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context3, callback, ...callbackArgs); - } - function parseTraceparentHeader(traceparentHeader) { - return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); - } - function createRequestHeaders(tracingContext) { - return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + 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 { - startSpan, - withSpan, - withContext, - parseTraceparentHeader, - createRequestHeaders - }; + return false; } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/inspect.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.custom = void 0; @@ -38982,18 +37605,196 @@ var require_inspect = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { +// 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.RestError = void 0; - exports2.isRestError = isRestError; - var core_util_1 = require_commonjs2(); + 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"; @@ -39001,212 +37802,86 @@ var require_restError = __commonJS({ 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); } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } }; exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; function isRestError(e) { if (e instanceof RestError) { return true; } - return (0, core_util_1.isError)(e) && e.name === "RestError"; + return (0, error_js_1.isError)(e) && e.name === "RestError"; } } }); -// 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) { +// 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.tracingPolicyName = void 0; - exports2.tracingPolicy = tracingPolicy; - var core_tracing_1 = require_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.statusCode); - } - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + exports2.uint8ArrayToString = uint8ArrayToString; + exports2.stringToUint8Array = stringToUint8Array; + function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); } - 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); - } - span.setStatus({ - status: "success" - }); - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + function stringToUint8Array(value, format) { + return Buffer.from(value, format); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { +// 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.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 multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { + "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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib3 = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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((resolve8) => { const handler = () => { resolve8(); @@ -39223,6 +37898,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -39236,25 +37913,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -39263,13 +37937,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -39293,8 +37970,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -39316,7 +37996,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -39334,9 +38014,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -39345,29 +38024,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url2 = new URL(request.url); const isInsecure = url2.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url2.hostname, path: `${url2.pathname}${url2.search}`, port: url2.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve8, reject) => { - const req = isInsecure ? http.request(options, resolve8) : https2.request(options, resolve8); + const req = isInsecure ? node_http_1.default.request(options, resolve8) : node_https_1.default.request(options, resolve8); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -39388,30 +38066,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -39434,11 +38113,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream2, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib3.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream2.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib3.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream2.pipe(inflate); return inflate; } @@ -39458,7 +38137,7 @@ var require_nodeHttpClient = __commonJS({ resolve8(Buffer.concat(buffer).toString("utf8")); }); stream2.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -39489,9 +38168,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -39502,11111 +38181,19571 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url2 = new URL(locationHeader, request.url); + request.url = url2.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.systemErrorRetryPolicyName = void 0; - exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; - function systemErrorRetryPolicy(options = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; + 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.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest + name: exports2.userAgentPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } }; } } }); -// 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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + exports2.decompressResponsePolicyName = void 0; + exports2.decompressResponsePolicy = decompressResponsePolicy; + exports2.decompressResponsePolicyName = "decompressResponsePolicy"; + function decompressResponsePolicy() { + return { + name: exports2.decompressResponsePolicyName, + async sendRequest(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; + } +}); + +// 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((resolve8, 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); } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + }; + onAborted = () => { + if (timer) { + clearTimeout(timer); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + removeListeners(); + return rejectOnAbort(); + }; + if (options?.abortSignal && options.abortSignal.aborted) { + return rejectOnAbort(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve8(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 context3 = {}; - for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; - context3.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3); - 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; + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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; + } } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(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; +}); + +// 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 debug5(...args) { + if (!debug5.enabled) { + return; } - if (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + const self2 = debug5; + 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"); } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + debug5.namespace = namespace; + debug5.useColors = createDebug.useColors(); + debug5.color = createDebug.selectColor(namespace); + debug5.extend = extend3; + debug5.destroy = createDebug.destroy; + Object.defineProperty(debug5, "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 (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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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 __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); + if (typeof createDebug.init === "function") { + createDebug.init(debug5); + } + return debug5; + } + function extend3(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; } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); +}); + +// 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 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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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]; + args.splice(lastC, 0, c); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { + function load2() { + let r; try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error3) { } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + function localstorage() { 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); + return localStorage; + } catch (error3) { } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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 __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - } }; + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 }; } }); -// node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js -var require_azureKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js"(exports2) { +// node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "node_modules/has-flag/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureKeyCredential = void 0; - var AzureKeyCredential = class { - /** - * 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; - } + 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); }; - 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) { +// node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs2(); - function isKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; + var os4 = 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; } - } -}); - -// 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + 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); } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + } + function translateLevel(level) { + if (level === 0) { + return false; } - /** - * 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"); + 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 = os4.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } - this._name = name; - this._key = key; + return 1; } - /** - * 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"); + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; } - this._name = newName; - this._key = newKey; + return min; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } - /** - * 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; + if (env.COLORTERM === "truecolor") { + return 3; } - /** - * 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"); + 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; } - this._signature = newSignature; } - }; - exports2.AzureSASCredential = AzureSASCredential; - function isSASCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; + 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/@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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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(util.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 init(debug5) { + debug5.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug5.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; } }); -// node_modules/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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/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/@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) { +// 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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); - } - }; + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __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.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); + exports2.toBuffer = toBuffer; + async function json2(stream2) { + const buf = await toBuffer(stream2); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; + exports2.json = json2; + function req(url2, opts = {}) { + const href = typeof url2 === "string" ? url2 : url2.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); + const promise = new Promise((resolve8, reject) => { + req2.once("response", resolve8).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; + } + exports2.req = req; } }); -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 context3 = {}; - for (var p in contextIn) context3[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context3.access[p] = contextIn.access[p]; - context3.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// node_modules/agent-base/dist/index.js +var require_dist = __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 result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context3); - 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 __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(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]); + 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); }; - } - 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; + 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 (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + if (typeof options.protocol === "string") { + return options.protocol === "https:"; } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + } + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } - 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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 __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + // 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); }); - }; - 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 __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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 __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + 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; } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); - }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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]; + 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; } - return t; - }; - return __assign3.apply(this, arguments); - }; - __createBinding3 = 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]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 }; + exports2.Agent = Agent; } }); -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); - } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); - } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); - } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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) { +// 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.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; - } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); - } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, 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 = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; - } - } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + exports2.parseProxyResponse = void 0; + var debug_1 = __importDefault2(require_src()); + var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve8, 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(); + debug5("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); + } + function onerror(err) { + cleanup(); + debug5("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) { + debug5("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; + } } + debug5("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve8({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - 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) + socket.on("error", onerror); + socket.on("end", onend); + read(); }); } - exports2.flattenResponse = flattenResponse; + exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/@azure/core-client/dist/commonjs/serializer.js -var require_serializer = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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.MapperTypeNames = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + 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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug5 = (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 + }; } - /** - * @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}.`); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port }; - 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 + * Called when the node-core HTTP client library is creating a + * new HTTP request. */ - serialize(mapper, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : 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) { - object = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + async connect(req, opts) { + const { proxy } = this; + if (!opts.host) { + throw new TypeError('No "host" provided'); } - if (object === void 0 || object === null) { - payload = object; + let socket; + if (proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - let payload; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - 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); - } + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r +`; } - if (mapper.isConstant) { - payload = mapper.defaultValue; + 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) { + debug5("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; } - return payload; + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug5("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } } - return str2.substr(0, len); + return ret; } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var debug5 = (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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + addRequest(req, opts) { + req._header = null; + this.setRequestProps(req, opts); + super.addRequest(req, opts); } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - 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.`); - } + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); } - } - 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(); + let first; + let endOfHeaders; + debug5("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug5("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); + debug5("Output buffer: %o", req.outputData[0].data); } - 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.`); + let socket; + if (this.proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - value = base64.encodeByteArray(value); + await (0, events_1.once)(socket, "connect"); + return socket; } - 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.`); + }; + HttpProxyAgent.protocols = ["http", "https"]; + exports2.HttpProxyAgent = HttpProxyAgent; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); - } - } + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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 value; + return void 0; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - 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}.`); + 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; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + const host = new URL(uri).hostname; + if (bypassedMap?.has(host)) { + return bypassedMap.get(host); } - const tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + let isBypassedFlag = false; + for (const pattern of noProxyList) { + if (pattern[0] === ".") { + if (host.endsWith(pattern)) { + isBypassedFlag = true; } else { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url2 = new URL(request.url); + const isInsecure = url2.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream2) { + if (stream2 instanceof ReadableStream) { + makeAsyncIterable(stream2); + return stream_1.Readable.fromWeb(stream2); + } else { + return stream2; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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; } } - } 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]; - } - } + })()); + }; + } + } +}); + +// 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 instance; + return result; } - 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}`); + 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; } - if (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); + } + 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 tempDictionary; } - return responseBody; + return total; } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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 = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; - } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); - } - return tempArray; + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); } - return responseBody; + request.body = await (0, concat_js_1.concat)(sources); } - 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); - } - } - } + 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`); } - return void 0; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } } }); -// node_modules/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; + 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); } - } 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; - } + }; + } + } +}); + +// 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(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url2 = new URL(request.url); + if (url2.hostname === "localhost" || url2.hostname === "127.0.0.1") { + return true; } } - return value; + return false; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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]; + function emitInsecureConnectionWarning() { + const warning12 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning12); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning12); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } else { - break; + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info7 = state_js_1.state.operationRequestMap.get(request); - if (!info7) { - info7 = {}; - state_js_1.state.operationRequestMap.set(request, info7); - } - return info7; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; + } + } +}); + +// 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.deserializationPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } } - return result; + return pipeline; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); } - return result; + return cachedHttpClient; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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]; + } } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if (descriptor.contentType === null) { + return void 0; } - 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 }); - } + if (descriptor.contentType) { + return descriptor.contentType; } - return parsedResponse; + 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 isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escapeDispositionField(value) { + return JSON.stringify(value); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; + 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; } } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; - } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; } - return { error: error4, shouldReturnResponse: false }; + return disposition; } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; - } + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); } - 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + if ((0, typeGuards_js_1.isBinaryBody)(body)) { + return body; } - return result; + 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}`); } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + 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); } - return result; + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } + 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_multipart2(); + async function sendRequest(method, url2, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url2, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + 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, rawHeaders: headers, parsedBody }); } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + return { + request, + 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, rawHeaders }, e); } + throw e; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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; + 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 { - if (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; } } + return "application/json"; } - exports2.serializeRequestBody = serializeRequestBody; - 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 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 prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - 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_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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) }; } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; } - exports2.createClientPipeline = createClientPipeline; - } -}); - -// 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 = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; + 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 + }); } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path15 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path15.startsWith("/")) { - path15 = path15.substring(1); - } - if (isAbsoluteUrl(path15)) { - requestUrl = path15; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path15); - } + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${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 = ","; } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + 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]; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; } - } - return result; - } - function isAbsoluteUrl(url2) { - return url2.includes("://"); + 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 appendPath(url2, pathToAppend) { - if (!pathToAppend) { + function appendQueryParams(url2, options = {}) { + if (!options.queryParameters) { 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 path15 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path15; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } + 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)); } - if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "CSV" || queryParameter.collectionFormat === "Pipes")) { - queryParameterValue = queryParameterValue.join(delimiter); + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); } - result.set(queryParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter), queryParameterValue); + } 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)); } } - return { - queryParams: result, - sequenceParams - }; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return result; + return endpoint; } - function appendQueryParams(url2, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url2; + 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)); } - 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); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - 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}`); + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path16, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path16, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url2, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline, { ...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, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline, { ...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."); } - } else { - searchPieces.push(`${name}=${value}`); } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); + }; } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url: url2 - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, options), { credentialOptions })); + 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 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; + 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/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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)(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 context3 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context3.logger; + function setLogLevel(level) { + context3.setLogLevel(level); } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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 getLogLevel() { + return context3.getLogLevel(); } - 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 createClientLogger(namespace) { + return context3.createClientLogger(namespace); } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + } +}); + +// 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 + }); } - 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) => Object.assign(Object.assign({}, a), b), {}); + } +}); + +// 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 + }; } - function requestToOptions(request) { + } +}); + +// 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 { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions + 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/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } + 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 + }); } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); + } +}); + +// 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); } - var HttpHeaders = class _HttpHeaders { - 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } + 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"; } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - exports2.toPipelineResponse = toPipelineResponse; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.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) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + 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-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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.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); } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); + 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.requestPolicyFactoryPolicyName, + name: exports2.userAgentPolicyName, async sendRequest(request, 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); + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; + 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); } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + 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/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); +// 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(); } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } + 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); } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + } + } +}); + +// 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.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; + exports2.AbortError = AbortError; } }); -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { +// 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"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } - return i; - } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } + 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((resolve8, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - return true; - } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; - } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; - } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - }; - } - function validateAttrName(attrName) { - return util.isName(attrName); - } - function validateTagName(tagname) { - return util.isName(tagname); - } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; - } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } + if (abortSignal?.aborted) { + return rejectOnAbort(); } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); + try { + buildPromise((x) => { + removeListeners(); + resolve8(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); - } - return { entities, i }; - } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; - } - return [entityName2, val2, i]; - } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; - } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; - } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; - } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; - } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; - } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); + abortSignal?.addEventListener("abort", onAbort); + }); } - module2.exports = readDocType; } }); -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; +// 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)((resolve8) => { + token = setTimeout(resolve8, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage + }); } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; + 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 }; } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber2(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); + } +}); + +// 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 { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; + let stringified; + try { + if (typeof e === "object" && e) { + stringified = JSON.stringify(e); + } else { + stringified = String(e); } - } else { - return str2; + } catch (err) { + stringified = "[unable to stringify input]"; } + return `Unknown error ${stringified}`; } } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; - } - module2.exports = toNumber2; } }); -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } } - return () => false; + return true; + } + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber2 = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_2, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_2, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } + 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 = randomUUID2; + 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 parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - var replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); - } - return val2; - }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; + function isError(e) { + return tspRuntime.isError(e); } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; + function isObject2(input) { + return tspRuntime.isObject(input); } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; + function randomUUID2() { + 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 findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); } else { - return closingIndex + str2.length - 1; + return blob; } } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + function createFileFromStream(stream2, name, options = {}) { return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName + ...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 readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } - } - } + 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 parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber2(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } + return source.map((x) => x); } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; + 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } + return tspPolicy.sendRequest(request, next); } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } + }; } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } + } +}); + +// 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)(); } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + } +}); + +// 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); } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; +// 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/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); +// 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 arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; + } +}); + +// 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - } - return attrStr; - } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; - } - function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; + }; } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; - } + 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); } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; - } + } +}); + +// 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") }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); - } - } + function createTracingContext(options = {}) { + let context3 = new TracingContextImpl(options.parentContext); + if (options.span) { + context3 = context3.setValue(exports2.knownContextKeys.span, options.span); } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); + if (options.namespace) { + context3 = context3.setValue(exports2.knownContextKeys.namespace, options.namespace); } + return context3; } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; - } - } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } + getValue(key) { + return this._contextMap.get(key); } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); - } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; + deleteValue(key) { + const newContext = new _TracingContextImpl(this); + newContext._contextMap.delete(key); + return newContext; } - } - module2.exports = Builder; - } -}); - -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { - "use strict"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder }; + exports2.TracingContextImpl = TracingContextImpl; } }); -// 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) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + exports2.state = void 0; + exports2.state = { + instrumenterImplementation: void 0 + }; } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false + end: () => { + }, + isRecording: () => false, + recordException: () => { + }, + setAttribute: () => { + }, + setStatus: () => { + }, + addEvent: () => { + } }; } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + 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 getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - 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, ""); + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); + } + return state_js_1.state.instrumenterImplementation; } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); + } +}); + +// 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 + }; } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; + 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(); + } } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; + function withContext(context3, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context3, callback, ...callbackArgs); } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; - } + function parseTraceparentHeader(traceparentHeader) { + return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); } - return parsedXml; + function createRequestHeaders(tracingContext) { + return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + } + return { + startSpan, + withSpan, + withContext, + parseTraceparentHeader, + createRequestHeaders + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; + 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; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return xml_common_js_1.XML_CHARKEY; + var tracingClient_js_1 = require_tracingClient(); + Object.defineProperty(exports2, "createTracingClient", { enumerable: true, get: function() { + return tracingClient_js_1.createTracingClient; } }); } }); -// 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_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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(request, next) { + if (!tracingClient) { + return next(request); + } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; + } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); + } + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; + } } - return abortedMap.get(this); + }; + } + 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; } - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - static get none() { - return new _AbortSignal(); + } + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { + request.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; } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - listeners.push(listener); + span.end(); + } catch (e) { + log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + 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)}`); } - /** - * 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."); + } + } +}); + +// 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 }; } - }; - function abortSignal(signal) { - if (signal.aborted) { - return; + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; } - if (signal.onabort) { - signal.onabort.call(signal); + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; + } } - const listeners = listenersMap.get(signal); - if (listeners) { - listeners.slice().forEach((listener) => { - listener.call(signal, { type: "abort" }); - }); + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); } - abortedMap.set(signal, true); + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; } - 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(); - }); + } +}); + +// 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); } } - } - /** - * 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/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - throw error4; - }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return { - code, - message - }; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - 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}`; + } +}); + +// 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(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - 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, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; - } - } - return { response, status }; + } +}); + +// 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); } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); - } + } +}); + +// 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); } - function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; + } +}); + +// 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); } - function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; + } +}); + +// 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); } - function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; + } +}); + +// 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); } - function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; + } +}); + +// 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 + }); } - function findResourceLocation(inputs) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } + } +}); + +// 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; } } - } - 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; + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } + return token; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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; + }; } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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; + } +}); + +// 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(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } - return void 0; } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true + }; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - return error4; } - 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 isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case void 0: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } + async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { + const { scopes } = onChallengeOptions; + const accessToken = await onChallengeOptions.getAccessToken(scopes, { + enableCae: true, + claims: caeClaims + }); + if (!accessToken) { + return false; } - const status = helper(); - return status === "running" && operationLocation === void 0 ? "succeeded" : status; + onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); + return true; } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return initOperation({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig + 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(request, next) { + if (!request.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, + getAccessToken, + logger }); - 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 - }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } + } + }; } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + } + } + return next(request); } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + }; + } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - case "Body": - default: { - return void 0; + }; + } + } +}); + +// 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); + } +}); + +// 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"); } - case "Body": { - return getProvisioningState(rawResponse); + 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + 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"; } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + } +}); + +// 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; } - return state.config.resourceLocation; + /** + * 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"; } - function isOperationError(e) { - return e.name === "RestError"; + } +}); + +// 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"; } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); + function isPopToken(accessToken) { + return accessToken.tokenType === "pop"; } - var createStateProxy$1 = () => ({ - /** - * 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, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } }; } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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; + } +}); + +// 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_utils6 = __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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + } + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + 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]; + } } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (parsedHeaders) { + for (const key of Object.keys(parsedHeaders)) { + arrayResponse[key] = parsedHeaders[key]; + } } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + 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_utils6(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Serializes the Poller operation. + * @deprecated Removing the constraints validation on client side. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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); + } + } } - }; - 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); + * Serialize the given object based on its metadata defined in the mapper * - * // You can assign more local properties here. - * } - * } - * ``` + * @param mapper - The mapper which defines the metadata of the serializable object * - * 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. + * @param object - A valid Javascript object to be serialized * - * 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: + * @param objectName - Name of the serialized object * - * ```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 options - additional options to serialization * - * @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((resolve8, reject) => { - this.resolve = resolve8; - this.reject = reject; - }); - this.promise.catch(() => { - }); - } - /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. + * @returns A valid serialized Javascript object */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + serialize(mapper, object, 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; } - } - /** - * 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) - }); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - this.processUpdatedState(); + if (mapper.isConstant) { + object = mapper.defaultValue; + } + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. + * Deserialize the given object based on its metadata defined in the mapper * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * @param mapper - The mapper which defines the metadata of the serializable object * - * @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. + * @param responseBody - A valid Javascript entity to be deserialized * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @param objectName - Name of the deserialized object * - * @param options - Optional properties passed to the operation's update method. + * @param options - Controls behavior of XML parser and builder. + * + * @returns A valid deserialized Javascript object */ - 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; + 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; } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + 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 (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + if (mapper.isConstant) { + payload = mapper.defaultValue; } + return payload; } - /** - * 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; + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; } - /** - * 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); - }; + return str2.substr(0, len); + } + function bufferToBase64Url(buffer) { + if (!buffer) { + return void 0; } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + if (!(buffer instanceof Uint8Array)) { + throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); } - /** - * 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")); + const str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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 = ""; } } } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + return classes; + } + function dateToUnixTime(d) { + if (!d) { + return void 0; } - /** - * 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; + if (typeof d.valueOf() === "string") { + d = new Date(d); } - /** - * 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; + return Math.floor(d.getTime() / 1e3); + } + function unixTimeToDate(n) { + if (!n) { + return void 0; } - /** - * 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; + 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.`); + } + } } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); + 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.`); } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + 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)}.`); } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve8) => setTimeout(() => resolve8(), this.config.intervalInMs)); + 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); } - }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream2 = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs17 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); + 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}".`); + } + } } - n.default = e; - return Object.freeze(n); + return value; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs17); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - /** - * 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); + 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}.`); } - /** - * 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); + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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; + } } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url3) { - const urlParsed = new URL(url3); - let path15 = urlParsed.pathname; - path15 = path15 || "/"; - path15 = escape(path15); - urlParsed.pathname = path15; - 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 = 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 escape(text) { - return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); - } - function appendToURLPath(url3, name) { - const urlParsed = new URL(url3); - let path15 = urlParsed.pathname; - path15 = path15 ? path15.endsWith("/") ? `${path15}${name}` : `${path15}/${name}` : name; - urlParsed.pathname = path15; - return urlParsed.toString(); + return tempArray; } - function setURLParameter(url3, name, value) { - const urlParsed = new URL(url3); - 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); - } - } + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); + 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}.`); } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url3, name) { - var _a; - const urlParsed = new URL(url3); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : void 0; - } - function setURLHost(url3, host) { - const urlParsed = new URL(url3); - urlParsed.hostname = host; - return urlParsed.toString(); - } - function getURLPath(url3) { - try { - const urlParsed = new URL(url3); - return urlParsed.pathname; - } catch (e) { - return void 0; + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - } - function getURLScheme(url3) { - try { - const urlParsed = new URL(url3); - return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; - } catch (e) { - return void 0; + 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 getURLPathAndQuery(url3) { - const urlParsed = new URL(url3); - 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}`; + 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 `${pathString}${queryString}`; + return additionalProperties; } - function getURLQueries(url3) { - let queryString = new URL(url3).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; + 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 queries; + return serializer.modelMappers[className]; } - function appendToURLQuery(url3, queryParts) { - const urlParsed = new URL(url3); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + 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}".`); + } } - 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 !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + return modelProps; } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - const res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve8, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); + if (object !== void 0 && object !== null) { + const payload = {}; + const modelProps = resolveModelProperties(serializer, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); + 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) && (object[key] !== void 0 && object[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 = object[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; + } + } } - resolve8(); - }; - 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); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + } } - return padString.slice(0, targetLength) + currentString; + return payload; } + return object; } - function iEqual(str1, str2) { - return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); - } - function getAccountNameFromUrl(url3) { - const parsedUrl = new URL(url3); - let accountName; - try { - if (parsedUrl.hostname.split(".")[1] === "blob") { - accountName = parsedUrl.hostname.split(".")[0]; - } else if (isIpEndpointStyle(parsedUrl)) { - accountName = parsedUrl.pathname.split("/")[1]; + 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 { - accountName = ""; + const result2 = { ...serializedValue }; + result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result2; } - return accountName; - } catch (error4) { - throw new Error("Unable to extract accountName with provided information."); } + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - 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) && PathStylePorts.includes(parsedUrl.port); + function isSpecialXmlProperty(propertyName, options) { + return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + 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 tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + 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; + } } } - return tagPairs.join("&"); + 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 toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); } + return tempDictionary; } - return res; + return responseBody; } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + 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 res; + return responseBody; } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + 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); + } + } + } } - 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 - } + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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; } - }; - case "json": - return { - format: { - type: "json", - jsonTextConfiguration: { - recordSeparator: textConfiguration.recordSeparator - } + } + } + } + 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); } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - }; - case "parquet": - return { - format: { - type: "parquet" + 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 = {}; } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + value[propertyName] = propertyValue; + } + } } + return value; } - 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); + 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 { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); + break; } } - return orProperties; + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } + let info7 = state_js_1.state.operationRequestMap.get(request); + if (!info7) { + info7 = {}; + state_js_1.state.operationRequestMap.set(request, info7); + } + return info7; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; } - 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; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } - 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 - }; - } + return result; } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return split.join("/"); + return result; } - function assertResponse(response) { - if (`_response` in response) { - return response; + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; } - throw new TypeError(`Unexpected response object ${response}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); + const operationSpec = operationInfo?.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + const responseSpec = getOperationResponseMap(parsedResponse); + const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); + if (error3) { + throw error3; + } else if (shouldReturnResponse) { + return parsedResponse; } - /** - * 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); - } - if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + 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; } - let response; + 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 parse(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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; + 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; } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw 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; } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; + 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)); } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; + } + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } 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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + } + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path16 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path16.startsWith("/")) { + path16 = path16.substring(1); + } + if (isAbsoluteUrl(path16)) { + requestUrl = path16; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path16); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + 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); } - } else { - delayTimeInMs = Math.random() * 1e3; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } - }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + return result; + } + function isAbsoluteUrl(url2) { + return url2.includes("://"); + } + function appendPath(url2, pathToAppend) { + if (!pathToAppend) { + return url2; } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + const parsedUrl = new URL(url2); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path16 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path16; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + } + } else { + newPath = newPath + pathToAppend; } - }; - 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; + parsedUrl.pathname = newPath; + return parsedUrl.toString(); } - 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; + 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); + } } - 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; + } + return { + queryParams: result, + sequenceParams + }; + } + function simpleParseQueryParams(queryString) { + const result = /* @__PURE__ */ new Map(); + if (!queryString || queryString[0] !== "?") { + return result; + } + queryString = queryString.slice(1); + const pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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 { - return weight1 < weight2; + result.set(name, value); } } - return false; + 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(); } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { + } +}); + +// 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_utils6(); + 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 { /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - + * 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. */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; - } + _endpoint; /** - * Signs request. - * - * @param request - + * The default request content type for the service. + * Used if no requestContentType is present on an OperationSpec. */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; - } + _requestContentType; /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - + * Set to true if the request is sent over HTTP instead of HTTPS */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; - } - return value; - } + _allowInsecureConnection; /** - * 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { - const path15 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path15}`; - const queries = getURLQueries(request.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; - } - }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); - } - }; - var StorageSharedKeyCredential = class extends Credential { - /** - * Creates an instance of StorageSharedKeyCredential. - * @param accountName - - * @param accountKey - + * The HTTP client that will be used to send requests. */ - constructor(accountName, accountKey) { - super(); - this.accountName = accountName; - this.accountKey = Buffer.from(accountKey, "base64"); - } + _httpClient; /** - * Creates a StorageSharedKeyCredentialPolicy object. - * - * @param nextPolicy - - * @param options - + * The pipeline used by this client to make requests */ - create(nextPolicy, options) { - return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this); - } + pipeline; /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - + * The ServiceClient constructor + * @param options - The service client options that govern the behavior of the client. */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + 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 + }); + } + } } - }; - var AnonymousCredentialPolicy = class extends CredentialPolicy { /** - * Creates an instance of AnonymousCredentialPolicy. - * @param nextPolicy - - * @param options - + * Send the provided httpRequest. */ - // 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); + async sendRequest(request) { + return this.pipeline.sendRequest(this._httpClient, request); } - }; - var AnonymousCredential = class extends Credential { /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - + * 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. */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); - } - }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); + async sendOperationRequest(operationArguments, operationSpec) { + const endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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."); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; + const url2 = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url: url2 + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; } - } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - return false; - } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; - } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; - } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay2(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; } - attempt++; } - if (response) { - return response; + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; } - return value; - } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); - } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + try { + const rawResponse = await this.sendRequest(request); + const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); + if (options?.onResponse) { + options.onResponse(rawResponse, flatResponse); } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; - } - function getCanonicalizedResourceString(request) { - const path15 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path15}`; - const queries = getURLQueries(request.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); + 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); } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } + throw error3; } - return canonicalizedResourceString; } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; + }; + 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 + }); } - var StorageBrowserPolicy = class extends 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); + function getCredentialScopes(options) { + if (options.credentialScopes) { + return options.credentialScopes; } - /** - * Sends out request. - * - * @param request - - */ - async sendRequest(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); - } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); + if (options.endpoint) { + return `${options.endpoint}/.default`; } - }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); + if (options.baseUri) { + return `${options.baseUri}/.default`; } - }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } + 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 { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); - } - }; + return void 0; } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { + } +}); + +// 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 castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. - * - * @param factories - - * @param options - - */ - constructor(factories, options = {}) { - this.factories = factories; - this.options = options; + 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", /** - * Transfer Pipeline object to ServiceClientOptions object which is required by - * ServiceClient constructor. - * - * @returns The ServiceClientOptions object from this Pipeline. + * Defines constants for use with HTTP headers. */ - toServiceClientOptions() { - return { - httpClient: this.options.httpClient, - requestPolicyFactories: this.factories - }; + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization" } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); - } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; + 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); } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); + 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 (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; + 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 getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } - } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } - } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); - } - pipeline._corePipeline = corePipeline; - } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); - } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; - } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; - } + function buildScopes(challengeOptions, challengeInfo) { + if (!challengeInfo.resource_id) { + return challengeOptions.scopes; } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; + 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 factory.constructor.name === "StorageSharedKeyCredential"; + return [scope]; } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; + function getChallenge(response) { + const challenge = response.headers.get("WWW-Authenticate"); + if (response.status === 401 && challenge) { + return challenge; } - return factory.constructor.name === "AnonymousCredential"; + return; } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); + 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 isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; + function requestToOptions(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.tracingOptions + }; } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof StorageRetryPolicyFactory) { - return true; + } +}); + +// 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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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; } - 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 (request) => { - return { - request, - headers: request.headers.clone(), - status: 500 - }; - } - }; - const mockRequestPolicyOptions = { - log(_logLevel, _message) { + function toWebResourceLike(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.requestOverrides, + clone() { + throw new Error("Cannot clone a non-proxied WebResourceLike"); }, - shouldLog(_logLevel) { - return false; + prepare() { + throw new Error("WebResourceLike.prepare() is not supported by @azure/core-http-compat"); + }, + validateRequestProperties() { } }; - const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions); - const policyName = policyInstance.constructor.name; - return knownPolicies.some((knownPolicyName) => { - return policyName.startsWith(knownPolicyName); - }); - } - var 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" + if (options?.createProxy) { + return new Proxy(webResource, { + get(target, prop, receiver) { + if (prop === originalRequestSymbol) { + return request; + } else if (prop === "clone") { + return () => { + return toWebResourceLike(toPipelineRequest(webResource, { originalRequest }), { + createProxy: true, + originalRequest + }); + }; } + return Reflect.get(target, prop, receiver); }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" + set(target, prop, value, receiver) { + if (prop === "keepAlive") { + request.disableKeepAlive = !value; } - }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", - type: { - name: "Composite", - className: "StaticWebsite" + const passThroughProps = [ + "url", + "method", + "withCredentials", + "timeout", + "requestId", + "abortSignal", + "body", + "formData", + "onDownloadProgress", + "onUploadProgress", + "proxySettings", + "streamResponseStatusCodes", + "agent", + "requestOverrides" + ]; + if (typeof prop === "string" && passThroughProps.includes(prop)) { + request[prop] = value; } + return Reflect.set(target, prop, value, receiver); } - } + }); + } else { + return webResource; } - }; - var 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" - } + } + 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]); } } } - }; - var 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" - } - } + /** + * 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; } - }; - var 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" - } - } + /** + * 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; } - }; - var 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" - } + /** + * 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); } }; - var 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" + 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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } else if (prop === originalResponse) { + return response; } + return Reflect.get(target, prop, receiver); }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", - type: { - name: "String" + set(target, prop, value, receiver) { + if (prop === "headers") { + headers = value; + } else if (prop === "request") { + request = value; } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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; } }; - var StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", - type: { - name: "String" + 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_util8(); + 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(request, 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 }); } - }, - code: { - serializedName: "Code", - xmlName: "Code", - type: { - name: "String" + }; + for (const factory of orderedFactories) { + httpPipeline = factory.create(httpPipeline, mockRequestPolicyOptions); + } + const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; } - }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", - type: { - name: "String" + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; } } } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); } - }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", - type: { - name: "Composite", - className: "BlobServiceStatistics", - modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", - type: { - name: "Composite", - className: "GeoReplication" - } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; } } + return e2; } - }; - var 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" - } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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; } - }; - var 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" + const d = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _2), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; } - }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; } } + return t3; } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; } + return s2; } - }; - var 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" } } - } - } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; } } - }; - var 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" - } - } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; } + return i2; } - }; - var 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" - } - } - } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; } - }; - var 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" - } - } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); } + return t2; } - }; - var 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" - } - } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); } - }; - var 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" - } - } - } - } - } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; } - }; - var 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" - } - } - } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + if (parsedXml["?xml"]) { + delete parsedXml["?xml"]; } - }; - var 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" - } - } + 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"; + } }; - var 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.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); } }; - var 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.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" } }; - var 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.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 path16 = urlParsed.pathname; + path16 = path16 || "/"; + path16 = escape(path16); + urlParsed.pathname = path16; + 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]; } } } - }; - var 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" - } - } + 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]; } } - }; - var 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" - } + 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 }; } - }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", - type: { - name: "Composite", - className: "BlobPropertiesInternal", - modelProperties: { + } + function escape(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 path16 = urlParsed.pathname; + path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; + urlParsed.pathname = path16; + 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((resolve8, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve8(); + }; + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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((resolve8, 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(resolve8).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve8(); + } + } + }); + }); + } + /** + * 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 path16 = urlParsed.pathname; + path16 = path16 || "/"; + path16 = escape(path16); + urlParsed.pathname = path16; + 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 escape(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 path16 = urlParsed.pathname; + path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; + urlParsed.pathname = path16; + 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((resolve8, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve8(); + }; + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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: "Creation-Time", - xmlName: "Creation-Time", + 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", - required: true, - xmlName: "Last-Modified", + 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", - required: true, - xmlName: "Etag", + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + 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" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + 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" } - }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + } + } + } + }; + 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" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "String" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "DateTimeRfc1123" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "Boolean" } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + } + } + } + }; + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetLegalHoldExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + } + } + } + }; + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "DateTimeRfc1123" } }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "DateTimeRfc1123" + name: "String" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + } + } + } + }; + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "String" } - }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + } + } + } + }; + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Boolean" + name: "String" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "DateTimeRfc1123" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", + } + } + } + }; + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", + } + } + } + }; + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", + type: { + name: "Composite", + className: "BlobReleaseLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ListBlobsHierarchySegmentResponse", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", + type: { + name: "Composite", + className: "BlobRenewLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobHierarchyListSegment", + className: "BlobRenewLeaseExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobPrefix = { - serializedName: "BlobPrefix", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "BlobPrefix", + className: "BlobChangeLeaseHeaders", modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Composite", - className: "BlobName" + name: "String" } - } - } - } - }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + 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" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTimeRfc1123" } } } } }; - var BlockList = { - serializedName: "BlockList", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "BlockList", + className: "BlobChangeLeaseExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } } } } }; - var Block = { - serializedName: "Block", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "Block", + className: "BlobBreakLeaseHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { name: "Number" } - } - } - } - }; - var PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "String" } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } } } } }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "PageRange", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "ClearRange", + className: "BlobCreateSnapshotHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", type: { - name: "Number" + name: "String" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Number" + name: "String" } - } - } - } - }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + }, + 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" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "Composite", - className: "QuerySerialization" + 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" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "BlobStartCopyFromURLHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "String" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "String" } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Dictionary", - value: { type: { name: "any" } } + name: "String" } - } - } - } - }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "String" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "JsonTextConfiguration", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + 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" + } } } } }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "ArrowConfiguration", + className: "BlobCopyFromURLHeaders", modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + 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" } } } } }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ArrowField", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", - type: { - name: "String" - } - }, - name: { - serializedName: "Name", - xmlName: "Name", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { - name: "Number" + name: "String" } }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { name: "Number" } @@ -50614,11 +57753,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50641,6 +57780,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -50651,11 +57797,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50667,11 +57813,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesHeaders", + className: "BlobSetTierHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50704,11 +57850,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50720,11 +57866,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50754,21 +57900,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { - name: "String" + 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" } } } } }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50780,12 +57954,179 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentHeaders", + 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", @@ -50807,21 +58148,77 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", + className: "BlobQueryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50833,11 +58230,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", + exports2.BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", + className: "BlobGetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50877,11 +58274,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50893,11 +58290,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoHeaders", + className: "BlobSetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50927,41 +58324,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -50972,11 +58334,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50988,15 +58350,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "PageBlobCreateHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + 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" } @@ -51015,9 +58398,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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" } @@ -51032,11 +58443,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51048,12 +58459,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + 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", @@ -51082,6 +58528,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51092,11 +58559,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51108,24 +58575,45 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "PageBlobClearPagesHeaders", modelProperties: { etag: { serializedName: "etag", xmlName: "etag", type: { - name: "String" + 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" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -51166,11 +58654,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51182,21 +58670,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "PageBlobUploadPagesFromURLHeaders", 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", @@ -51211,41 +58690,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "ByteArray" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } }, requestId: { @@ -51269,47 +58732,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Boolean" + name: "String" } }, errorCode: { @@ -51322,11 +58763,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51334,16 +58775,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + 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", @@ -51382,11 +58858,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51398,12 +58874,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -51411,11 +58894,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -51456,11 +58939,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51472,20 +58955,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "PageBlobResizeHeaders", 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", @@ -51500,6 +58975,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51538,11 +59020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51554,11 +59036,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "PageBlobUpdateSequenceNumberHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51574,6 +59056,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51612,11 +59101,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51628,12 +59117,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + 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", @@ -51662,6 +59165,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51672,11 +59190,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51688,12 +59206,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -51715,6 +59254,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51722,6 +59268,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51732,11 +59299,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51748,58 +59315,40 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -51827,15 +59376,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51847,11 +59438,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51867,18 +59458,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, requestId: { @@ -51901,82 +59492,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", - type: { - name: "Composite", - className: "ContainerReleaseLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + }, + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - date: { - serializedName: "date", - xmlName: "date", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } } } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51984,15 +59550,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52008,13 +59588,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52042,15 +59615,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52062,11 +59642,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52082,11 +59662,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Number" + name: "ByteArray" } }, clientRequestId: { @@ -52110,21 +59690,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52136,11 +59751,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52156,11 +59771,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -52184,73 +59799,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var 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", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52261,11 +59844,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52273,21 +59856,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlockBlobStageBlockHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -52318,6 +59915,34 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52328,11 +59953,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52344,12 +59969,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + 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", @@ -52378,50 +60017,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "Boolean" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + name: "String" } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Boolean" + name: "String" } - } - } - } - }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", - modelProperties: { + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52432,72 +60048,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", 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", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { name: "String" } }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { - name: "String" + name: "Number" } - }, + } + } + } + }; + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobCommitBlockListHeaders", + modelProperties: { etag: { serializedName: "etag", xmlName: "etag", @@ -52505,127 +60091,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", 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", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "ByteArray" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, clientRequestId: { @@ -52656,20 +60140,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52677,16 +60147,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -52698,10263 +60161,7886 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + 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" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "ByteArray" + name: "String" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + 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" } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + } + } + } + }; + } +}); + +// 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: "ByteArray" + 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" } } } } }; - var 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.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" } } }; - var 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", + 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: [ - "available", - "leased", - "expired", - "breaking", - "broken" + "copy", + "deleted", + "metadata", + "snapshots", + "uncommittedblobs", + "versions", + "tags", + "immutabilitypolicy", + "legalhold", + "deletedwithversions" ] } - }, - 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" - } } } + }, + collectionFormat: "CSV" + }; + exports2.delimiter = { + parameterPath: "delimiter", + mapper: { + serializedName: "delimiter", + required: true, + xmlName: "delimiter", + type: { + name: "String" + } } }; - var 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.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var 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.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], + mapper: { + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", + type: { + name: "Boolean" } } }; - var 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.rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], + mapper: { + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", + type: { + name: "Boolean" } } }; - var 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.encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], + mapper: { + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", + type: { + name: "String" } } }; - var 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.encryptionKeySha256 = { + parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], + mapper: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" } } }; - var 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.encryptionAlgorithm = { + parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], + mapper: { + serializedName: "x-ms-encryption-algorithm", + xmlName: "x-ms-encryption-algorithm", + type: { + name: "String" } } }; - var 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.ifMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], + mapper: { + serializedName: "If-Match", + xmlName: "If-Match", + type: { + name: "String" } } }; - var 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.ifNoneMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], + mapper: { + serializedName: "If-None-Match", + xmlName: "If-None-Match", + type: { + name: "String" } } }; - var 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.ifTags = { + parameterPath: ["options", "modifiedAccessConditions", "ifTags"], + mapper: { + serializedName: "x-ms-if-tags", + xmlName: "x-ms-if-tags", + type: { + name: "String" } } }; - var 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.deleteSnapshots = { + parameterPath: ["options", "deleteSnapshots"], + mapper: { + serializedName: "x-ms-delete-snapshots", + xmlName: "x-ms-delete-snapshots", + type: { + name: "Enum", + allowedValues: ["include", "only"] } } }; - var 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.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" } } }; - var 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.comp12 = { + parameterPath: "comp", + mapper: { + defaultValue: "immutabilityPolicies", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.immutabilityPolicyExpiry = { + parameterPath: ["options", "immutabilityPolicyExpiry"], + mapper: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", + type: { + name: "DateTimeRfc1123" } } }; - var 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.immutabilityPolicyMode = { + parameterPath: ["options", "immutabilityPolicyMode"], + mapper: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } }; - var 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.comp13 = { + parameterPath: "comp", + mapper: { + defaultValue: "legalhold", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.legalHold = { + parameterPath: "legalHold", + mapper: { + serializedName: "x-ms-legal-hold", + required: true, + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var 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.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] } } }; - var 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.sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.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" } } }; - var 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.sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], + mapper: { + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", + type: { + name: "String" } } }; - var 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.copySource = { + parameterPath: "copySource", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.blobTagsString = { + parameterPath: ["options", "blobTagsString"], + mapper: { + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", + type: { + name: "String" } } }; - var 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.sealBlob = { + parameterPath: ["options", "sealBlob"], + mapper: { + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", + type: { + name: "Boolean" } } }; - var 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.legalHold1 = { + parameterPath: ["options", "legalHold"], + mapper: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.xMsRequiresSync = { + parameterPath: "xMsRequiresSync", + mapper: { + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", + type: { + name: "String" } } }; - var 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.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], + mapper: { + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", + type: { + name: "ByteArray" } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var 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.comp15 = { + parameterPath: "comp", + mapper: { + defaultValue: "copy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", + mapper: { + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", + type: { + name: "String" } } }; - var 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.copyId = { + parameterPath: "copyId", + mapper: { + serializedName: "copyid", + required: true, + xmlName: "copyid", + type: { + name: "String" } } }; - var 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.comp16 = { + parameterPath: "comp", + mapper: { + defaultValue: "tier", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", + mapper: { + defaultValue: "query", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.comp18 = { + parameterPath: "comp", + mapper: { + defaultValue: "tags", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], + mapper: { + defaultValue: 0, + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" } } }; - var 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.contentType1 = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/octet-stream", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" } } }; - var 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.body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" } } }; - var 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.accept2 = { + parameterPath: "accept", + mapper: { + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" } } }; - var 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.comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "page", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.pageWrite = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" } } }; - var 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.ifSequenceNumberLessThanOrEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", + type: { + name: "Number" } } }; - var 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.ifSequenceNumberLessThan = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThan" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-lt", + xmlName: "x-ms-if-sequence-number-lt", + type: { + name: "Number" } } }; - var 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.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" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.sourceUrl = { + parameterPath: "sourceUrl", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.sourceRange = { + parameterPath: "sourceRange", + mapper: { + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", + type: { + name: "String" } } }; - var 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.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], + mapper: { + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", + type: { + name: "ByteArray" } } }; - var 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.range1 = { + parameterPath: "range", + mapper: { + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.comp20 = { + parameterPath: "comp", + mapper: { + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], + mapper: { + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", + type: { + name: "String" } } }; - var 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.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], + mapper: { + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.comp21 = { + parameterPath: "comp", + mapper: { + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blobType1 = { + parameterPath: "blobType", + mapper: { + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], + mapper: { + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", + type: { + name: "Boolean" } } }; - var 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.comp24 = { + parameterPath: "comp", + mapper: { + defaultValue: "block", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blockId = { + parameterPath: "blockId", + mapper: { + serializedName: "blockid", + required: true, + xmlName: "blockid", + type: { + name: "String" } } }; - var 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.blocks = { + parameterPath: "blocks", + mapper: mappers_js_1.BlockLookupList + }; + exports2.comp25 = { + parameterPath: "comp", + mapper: { + defaultValue: "blocklist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.listType = { + parameterPath: "listType", + mapper: { + defaultValue: "committed", + serializedName: "blocklisttype", + required: true, + xmlName: "blocklisttype", + type: { + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + } +}); + +// 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); } }; - var 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.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 AppendBlobSealExceptionHeaders = { - serializedName: "AppendBlob_sealExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobSealExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } - } + 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 BlockBlobUploadExceptionHeaders = { - serializedName: "BlockBlob_uploadExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobUploadExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } - } + 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 BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } + var submitBatchOperationSpec = { + path: "/", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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); } - }; - var BlockBlobStageBlockExceptionHeaders = { - serializedName: "BlockBlob_stageBlockExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * [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); } - }; - var 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" - } - } - } + /** + * [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); } - }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * [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); } - }; - var 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" - } - } - } + /** + * [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); } - }; - var BlockBlobCommitBlockListExceptionHeaders = { - serializedName: "BlockBlob_commitBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobCommitBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var 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.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 BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + 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 blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + 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 accept = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 url2 = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" + var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerSetAccessPolicyHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerSetAccessPolicyExceptionHeaders } }, - skipEncoding: true + 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 restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 + var submitBatchOperationSpec = { + path: "/{containerName}", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: Mappers.ContainerSubmitBatchHeaders }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" + 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 version = { - parameterPath: "version", - mapper: { - defaultValue: "2024-11-04", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" + 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 requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" + 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 accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" + 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 marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" + 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 maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 + var listBlobHierarchySegmentOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListBlobsHierarchySegmentResponse, + headersMapper: Mappers.ContainerListBlobHierarchySegmentHeaders }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" + 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 include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + var getAccountInfoOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: Mappers.ContainerGetAccountInfoHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerGetAccountInfoExceptionHeaders } }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + queryParameters: [ + Parameters.comp, + Parameters.timeoutInSeconds, + Parameters.restype1 + ], + urlParameters: [Parameters.url], + headerParameters: [ + Parameters.version, + Parameters.requestId, + Parameters.accept1 + ], + isXML: true, + serializer: xmlSerializer }; - var comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } + /** + * 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); } - }; - var comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } + /** + * 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); } - }; - var comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } + /** + * 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); } - }; - var restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + /** + * 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); } - }; - var access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } + /** + * 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); } - }; - var defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } + /** + * [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); } - }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } + /** + * 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); } }; - var comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" + 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 sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" + 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 comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" + 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 proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" + 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 action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 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" - ] - } - } + var breakLeaseOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.BlobBreakLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobBreakLeaseExceptionHeaders } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 }; - var ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" - } + /** + * 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); } - }; - var ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } + /** + * 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); } - }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * 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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * 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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * 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); } }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" + 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 blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" + 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 blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" + 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 blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" + 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 comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" + 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 immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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 comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 }; - var encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } + } +}); + +// 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); } - }; - var comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var 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" - ] - } + /** + * 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); } }; - var rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + 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 } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" + 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 sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" + var appendBlockFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.AppendBlobAppendBlockFromUrlHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.AppendBlobAppendBlockFromUrlExceptionHeaders } - } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" + 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 }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } + /** + * 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); } }; - var 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.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 comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" + 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 copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" + 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 comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 }; - var comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + } +}); + +// 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"); } - } - }; - var comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (!options) { + options = {}; } + const defaults = { + 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 = { + ...defaults, + ...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; }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags - }; - var transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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); } }; - var transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } + 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, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url2); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url2); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + const storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = void 0; } }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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; } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + /** + * 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; } - } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + if (permissionLike.add) { + blobSASPermissions.add = true; } - } - }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + if (permissionLike.create) { + blobSASPermissions.create = true; } - } - }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + if (permissionLike.write) { + blobSASPermissions.write = true; } - } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + if (permissionLike.delete) { + blobSASPermissions.delete = true; } - } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.deleteVersion) { + blobSASPermissions.deleteVersion = true; } - } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.tag) { + blobSASPermissions.tag = true; } - } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + if (permissionLike.move) { + blobSASPermissions.move = true; } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" + if (permissionLike.execute) { + blobSASPermissions.execute = true; } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" + if (permissionLike.setImmutabilityPolicy) { + blobSASPermissions.setImmutabilityPolicy = true; } - } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.permanentDelete) { + blobSASPermissions.permanentDelete = true; } + return blobSASPermissions; } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + /** + * 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"); } - } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + if (this.add) { + permissions.push("a"); } - } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + if (this.create) { + permissions.push("c"); } - } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + if (this.write) { + permissions.push("w"); } - } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.delete) { + permissions.push("d"); } - } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + if (this.deleteVersion) { + permissions.push("x"); } - } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + if (this.tag) { + permissions.push("t"); } - } - }; - var 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"] + if (this.move) { + permissions.push("m"); } - } - }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.execute) { + permissions.push("e"); } - } - }; - var blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - } - }; - var comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.permanentDelete) { + permissions.push("y"); } + return permissions.join(""); } }; - var maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + 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; } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + /** + * 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; } - } - }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.add) { + containerSASPermissions.add = true; } - } - }; - var comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.create) { + containerSASPermissions.create = true; } - } - }; - var blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.write) { + containerSASPermissions.write = true; } - } - }; - var copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + if (permissionLike.delete) { + containerSASPermissions.delete = true; } - } - }; - var comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.list) { + containerSASPermissions.list = true; } - } - }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + if (permissionLike.deleteVersion) { + containerSASPermissions.deleteVersion = true; } - } - }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList - }; - var comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.tag) { + containerSASPermissions.tag = true; } - } - }; - var listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + 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; } - }; - var ServiceImpl = class { /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client + * Specifies Read access granted. */ - constructor(client) { - this.client = client; - } + read = false; /** - * 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. + * Specifies Add access granted. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); - } + add = false; /** - * 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. + * Specifies Create access granted. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); - } + create = false; /** - * 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. + * Specifies Write access granted. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); - } + write = false; /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. + * Specifies Delete access granted. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); - } + deleteVersion = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Specifies List access granted. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); - } + list = false; /** - * 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. + * Specfies Tag access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); - } + tag = false; /** - * 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. + * Specifies Move access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); - } - }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + 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"); } - }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url2], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + 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(""); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * Azure Storage account name; readonly. */ - constructor(client) { - this.client = client; - } + accountName; /** - * 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. + * Azure Storage user delegation key; readonly. */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); + 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 { /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * The storage API version. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + version; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + protocol; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); + 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; + } + } } /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Encodes all SAS query parameters into a string that can be appended to a URL. + * */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); + 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("&"); } /** - * 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. + * A private helper method used to filter and append query key/value pairs into an array. + * + * @param queries - + * @param key - + * @param value - */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); + tryAppendQueryParameter(queries, key, value) { + if (!value) { + return; + } + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); + } } - /** - * 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); + }; + 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); } - /** - * [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$1); + if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { + throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); + 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); + } + } } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); + 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); + } + } } - /** - * [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$1); + 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."); + } } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); + 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."); } - /** - * [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); + let resource = "c"; + if (blobSASSignatureValues.blobName) { + resource = "b"; } - /** - * [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(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); + 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(); + } } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); + 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."); } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders - } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url2], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + } + 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(); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var BlobImpl = class { - /** - * 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); + 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * 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); + 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(); + } } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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, + timestamp2, + 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}`); } - /** - * 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(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + 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'."); } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - /** - * 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); + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - /** - * 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); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - /** - * 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(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - /** - * 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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - /** - * [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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + 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."); } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - /** - * [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); + 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; /** - * The Create Snapshot operation creates a read-only snapshot of a blob - * @param options The options parameters. + * Gets the lease Id. + * + * @readonly */ - createSnapshot(options) { - return this.client.sendOperationRequest({ options }, createSnapshotOperationSpec); + get leaseId() { + return this._leaseId; } /** - * 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. + * Gets the url. + * + * @readonly */ - startCopyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + get url() { + return this._url; } /** - * 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. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - copyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + 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; } /** - * 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. + * 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. */ - abortCopyFromURL(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + 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 + })); + }); } /** - * 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. + * 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. */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + 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; + }); } /** - * Returns the sku name and account kind - * @param options The options parameters. + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + 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 + })); + }); } /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * 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. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); + 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 + }); + }); } /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * 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. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); + 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; /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. + * 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 - */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); + 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(); } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + _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; } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + if (!this.push(data)) { + this.source.pause(); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + }; + 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; } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 + 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); + } }; - var PageBlobImpl = class { + 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 { /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - constructor(client) { - this.client = client; + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * 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. + * Returns if it was previously specified + * for the file. + * + * @readonly */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * 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. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * 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. + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } /** - * 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. + * 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 */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * 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. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - constructor(client) { - this.client = client; + get contentType() { + return this.originalResponse.contentType; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * 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 */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get copyId() { + return this.originalResponse.copyId; } /** - * 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. + * 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 */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyProgress() { + return this.originalResponse.copyProgress; } /** - * 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. + * 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 */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + get copySource() { + return this.originalResponse.copySource; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - constructor(client) { - this.client = client; + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * 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 */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * 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. + * 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 */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } /** - * 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. + * 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 */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get lastModified() { + return this.originalResponse.lastModified; } /** - * 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. + * 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 */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get lastAccessed() { + return this.originalResponse.lastAccessed; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * Returns the date and time the blob was created. + * + * @readonly */ - constructor(url3, options) { - var _a, _b; - if (url3 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url3; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); - } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + get createdOn() { + return this.originalResponse.createdOn; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * A name-value pair + * to associate with a file storage object. + * + * @readonly */ - constructor(url3, pipeline) { - this.url = escapeURLPath(url3); - this.accountName = getAccountNameFromUrl(url3); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; - } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + get metadata() { + return this.originalResponse.metadata; } /** - * 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. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * - * @param permissions - + * @readonly */ - 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; + get requestId() { + return this.originalResponse.requestId; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. * - * @param permissionLike - + * @readonly */ - 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; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Indicates the version of the Blob service used + * to execute the request. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); - } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + get version() { + return this.originalResponse.version; } /** - * 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. + * Indicates the versionId of the downloaded blob version. * - * @param permissions - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates whether version of this blob is a current version. * - * @param permissionLike - + * @readonly */ - 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; + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * 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 */ - 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(""); + 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; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * Object Replication Policy Id of the destination blob. + * + * @readonly */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * If this blob has been sealed. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + get isSealed() { + return this.originalResponse.isSealed; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * Indicates immutability policy mode. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } - } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version2 >= "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.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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."); + /** + * Indicates if a legal hold is present on the blob. + * + * @readonly + */ + get legalHold() { + return this.originalResponse.legalHold; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get contentAsBlob() { + return this.originalResponse.blobBody; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + 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); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * 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]; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + // 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); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readLong(stream2, options = {}) { + return _AvroParser.readZigZagLong(stream2, options); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + 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 { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + 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); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + 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 }); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + 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 pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + return _AvroType.fromObjectSchema(schema2); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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}`); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); + } } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { + } + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + } } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + // 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"); + } } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + // 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]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + async read(stream2, options = {}) { + const typeIndex = await AvroParser.readInt(stream2, options); + return this._types[typeIndex].read(stream2, options); } - if (version2 < "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."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + // 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); } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + // 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; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + }; + } +}); + +// 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; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + _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; } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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."); } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + this._metadata = await AvroParser_js_1.AvroParser.readMap(this._headerStream, AvroParser_js_1.AvroParser.readString, { + abortSignal: options.abortSignal }); - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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"); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal }); - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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; + } } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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((resolve8, 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(); + resolve8(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); + } + }); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream2.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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. @@ -63070,7 +68156,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -63177,14 +68263,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -63227,23 +68305,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63272,7 +68333,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.originalResponse.clientRequestId; } /** - * Indicates the version of the Blob service used + * Indicates the version of the File service used * to execute the request. * * @readonly @@ -63280,1140 +68341,1333 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 coreUtil.isNode ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - /** - * 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(this.originalResponse.readableStreamBody, getter, offset, count, options); - } - }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - var AvroParser = class _AvroParser { - /** - * Reads a fixed number of bytes from the stream. - * - * @param stream - - * @param length - - * @param options - - */ - static async readFixedBytes(stream3, length, options = {}) { - const bytes = await stream3.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(stream3, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream3, 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(stream3, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await _AvroParser.readByte(stream3, 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(stream3, 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(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readInt(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readNull() { - return null; - } - static async readBoolean(stream3, options = {}) { - const b = await _AvroParser.readByte(stream3, options); - if (b === 1) { - return true; - } else if (b === 0) { - return false; - } else { - throw new Error("Byte was not a boolean."); - } - } - static async readFloat(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); - } - static async readDouble(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); - } - static async readBytes(stream3, options = {}) { - const size = await _AvroParser.readLong(stream3, options); - if (size < 0) { - throw new Error("Bytes size was negative."); - } - return stream3.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream3, options = {}) { - const u8arr = await _AvroParser.readBytes(stream3, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); - } - static async readMapPair(stream3, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream3, options); - const value = await readItemMethod(stream3, options); - return { key, value }; - } - static async readMap(stream3, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream3, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; - } - return dict; - } - static async readArray(stream3, readItemMethod, options = {}) { - const items = []; - for (let count = await _AvroParser.readLong(stream3, options); count !== 0; count = await _AvroParser.readLong(stream3, options)) { - if (count < 0) { - await _AvroParser.readLong(stream3, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream3, options); - items.push(item); - } - } - return items; - } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); - } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); - } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { - } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); - } - } - }; - var AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; + /** + * 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; } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream3, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream3, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream3, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream3, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream3, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream3, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream3, options); - default: - throw new Error("Unknown Avro Primitive"); - } + /** + * 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; } - }; - var AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get blobBody() { + return void 0; } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, options = {}) { - const value = await AvroParser.readInt(stream3, options); - return this._symbols[value]; + /** + * 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; } - }; - var AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - async read(stream3, options = {}) { - const typeIndex = await AvroParser.readInt(stream3, options); - return this._types[typeIndex].read(stream3, options); + 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); } }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + 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; } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - const readItemMethod = (s, opts) => { - return this._itemType.read(s, opts); - }; - return AvroParser.readMap(stream3, readItemMethod, options); + return tier; + } + function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25; } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, 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(stream3, options); + } + 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 } } - return record; + }; + } + } +}); + +// 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}`); } - }; - 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; + } + 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 true; + return message + " " + innerMessage; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; + 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); } - get objectIndex() { - return this._objectIndex; + 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; + } } - 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; + 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 + })); } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); + } + function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; + } + async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 + }; } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal + } + 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 }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + processOperationStatus({ + status, + response, + state, + stateProxy, + isDone, + processResult, + getError, + setErrorAsResult }); - await 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--; - } + 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); } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return void 0; + } + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); + } } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } - } - yield yield tslib.__await(result); + case "original-uri": { + return requestPath; } - }); + case "location": + default: { + return location; + } + } } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); + } + 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; } - return data; } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - get position() { - return this._position; + } + 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; } - async read(size, options = {}) { + 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 _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - throw ABORT_ERROR; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); + case "Body": + default: { + return void 0; } - if (size === 0) { - return new Uint8Array(); + } + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve8, 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(); - resolve8(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); - } - }); + case "Body": { + return getProvisioningState(rawResponse); } + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); } - }; - var BlobQuickQueryStream = class extends stream2.Readable { + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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 = () => ({ /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * 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. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new 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 schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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; + 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, 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, + 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 }); } } - 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 }); - } + } 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`); } - 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 }); + } + })().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; } - 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 - }); + } + 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; } - break; - default: - throw Error(`Unknown schema ${schema2} in avro progress record.`); + } } - } while (!avroNext.done && !this.avroPaused); + }; + 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; } - }; - var BlobQueryResponse = class { - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * Returns if it was previously specified - * for the file. - * - * @readonly - */ - get cacheControl() { - return this.originalResponse.cacheControl; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * 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; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly + * Serializes the Poller operation. */ - get contentEncoding() { - return this.originalResponse.contentEncoding; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + }; + 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); } - /** - * 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; + }; + 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 { /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. + * 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); * - * @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. + * // You can assign more local properties here. + * } + * } + * ``` * - * @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. + * 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. * - * @readonly - */ - get contentRange() { - return this.originalResponse.contentRange; - } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * 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: * - * @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. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get copyCompletedOn() { - return void 0; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve8, reject) => { + this.resolve = resolve8; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get copyId() { - return this.originalResponse.copyId; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * 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. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get copySource() { - return this.originalResponse.copySource; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @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. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly + * Invokes the underlying operation's cancel method. */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * 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. * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; - } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + 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; } - /** - * 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; + 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()); + } } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get etag() { - return this.originalResponse.etag; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * The error code. - * - * @readonly + * Returns true if the poller has finished polling. */ - get errorCode() { - return this.originalResponse.errorCode; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * 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 + * Stops the poller from continuing to poll. */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * 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 + * Returns true if the poller is stopped. */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; + isStopped() { + return this.stopped; } /** - * Returns the date and time the file was last - * modified. Any operation that modifies the file or its properties updates - * the last modified time. + * Attempts to cancel the underlying operation. * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * A name-value pair - * to associate with a file storage object. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * If it's called again before it finishes, it will throw an error. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get requestId() { - return this.originalResponse.requestId; + 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; } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * Returns the state of the operation. * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the File service used - * to execute the request. + * 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. * - * @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. + * Example: * - * @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. + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } * - * @readonly - */ - get blobBody() { - return void 0; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * // 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; + * } * - * It will parse avor data returned by blob query. + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... * - * @readonly + * 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. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve8) => setTimeout(() => resolve8(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -64421,20 +69675,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -64442,10 +69697,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -64485,12 +69740,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + state: { ...state }, cancel, toString: toString3, 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.`); @@ -64500,27 +69764,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -64535,8 +69833,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -64551,9 +69849,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve8, reject) => { this.emitter.on("finish", resolve8); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -64590,333 +69888,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream2.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve8, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve8).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve8(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream3, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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((resolve8, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream3.on("readable", () => { + 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); resolve8(); return; } - let chunk = stream3.read(); + let chunk = stream2.read(); if (!chunk) { return; } @@ -64924,28 +69925,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream3.on("end", () => { + stream2.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve8(); }); - stream3.on("error", (msg) => { + stream2.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream3, buffer2, encoding) { + async function streamToBuffer2(stream2, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve8, reject) => { - stream3.on("readable", () => { - let chunk = stream3.read(); + stream2.on("readable", () => { + let chunk = stream2.read(); if (!chunk) { return; } @@ -64956,18 +69957,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream3.on("end", () => { + stream2.on("end", () => { resolve8(pos); }); - stream3.on("error", reject); + stream2.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve8, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve8(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve8, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -64978,9 +69991,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_utils7(); + 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. */ @@ -64996,49 +70048,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url3; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + let url2; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; + url2 = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -65047,8 +70099,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -65057,8 +70109,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -65088,7 +70140,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -65097,76 +70149,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -65174,8 +70256,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -65183,9 +70264,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -65194,7 +70275,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -65211,9 +70295,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -65224,7 +70308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -65234,7 +70318,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -65245,17 +70329,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -65263,19 +70355,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -65285,19 +70379,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65307,13 +70409,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -65324,7 +70426,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -65336,14 +70438,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -65354,22 +70458,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65385,15 +70491,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -65403,15 +70511,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -65422,24 +70537,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65460,57 +70577,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using a changing polling interval (default 15 seconds): + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -65518,15 +70636,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -65538,14 +70656,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -65555,36 +70673,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -65595,31 +70716,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -65627,12 +70749,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -65643,26 +70765,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -65676,8 +70801,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream3 = response.readableStreamBody; - await streamToBuffer(stream3, buffer2, off - offset, chunkEnd - offset); + 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 }); @@ -65685,7 +70810,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -65705,10 +70830,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -65723,7 +70851,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -65739,7 +70867,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -65751,21 +70879,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -65773,12 +70903,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -65790,18 +70920,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve8) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve8(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve8((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -65810,17 +70946,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve8) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve8((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. @@ -65828,8 +71014,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -65840,8 +71026,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -65854,8 +71040,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -65865,60 +71051,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -65929,40 +71120,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -65970,20 +71176,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65996,20 +71213,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -66018,29 +71237,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -66055,7 +71289,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -66069,74 +71303,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; + url2 = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -66148,8 +71397,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -66158,15 +71407,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -66182,26 +71448,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -66219,7 +71487,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -66230,32 +71498,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66280,22 +71564,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -66303,10 +71602,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -66324,7 +71623,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -66341,18 +71640,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -66363,30 +71663,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66394,20 +71696,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -66436,18 +71740,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -66474,7 +71778,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -66495,23 +71799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -66521,32 +71824,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -66572,15 +71875,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -66599,27 +71905,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream3, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + 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 tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream3, + const scheduler = new storage_common_1.BufferScheduler( + stream2, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -66637,50 +71943,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -66691,13 +72005,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -66705,23 +72019,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66730,21 +72046,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -66752,7 +72080,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -66760,19 +72088,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -66785,7 +72115,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -66796,32 +72126,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -66830,13 +72163,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -66846,7 +72181,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -66855,16 +72190,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -66872,22 +72209,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -66907,17 +72246,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -66926,94 +72263,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * 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()`: - * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67039,13 +72361,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67055,17 +72380,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -67074,7 +72401,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67082,20 +72409,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67116,17 +72445,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -67136,94 +72463,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67232,7 +72553,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -67250,13 +72573,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67264,24 +72590,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -67289,12 +72617,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -67302,22 +72632,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67327,38 +72659,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_utils7(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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."); @@ -67369,15 +72735,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -67389,18 +72755,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -67420,7 +72786,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -67435,7 +72801,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -67450,6 +72816,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -67489,6 +72865,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve8(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -67505,11 +72883,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -67533,13 +72936,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -67551,13 +72954,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url3; + let url2; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url3 = urlOrBlobClient; + 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 BlobClient) { - url3 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url2 = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -67566,28 +72969,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url3, + url: url2, credential }, async () => { - await new BlobClient(url3, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url3; + let url2; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url3 = urlOrBlobClient; + 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; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url3 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url2 = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -67595,24 +72998,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url3, + url: url2, credential }, async () => { - await new BlobClient(url3, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -67625,9 +73036,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -67636,19 +73047,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -67657,24 +73068,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path15 = getURLPath(subRequest.url); - if (!path15 || path15 === "") { + const path16 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path16 || path16 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -67684,7 +73095,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -67701,7 +73112,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -67712,7 +73123,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -67723,19 +73134,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url3, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url2, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url3, getCoreClientOptions(pipeline)); - const path15 = getURLPath(url3); - if (path15 && path15 !== "/") { + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path16 = (0, utils_common_js_1.getURLPath)(url2); + if (path16 && path16 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -67746,10 +73175,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -67760,7 +73189,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -67778,11 +73207,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -67790,17 +73233,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -67809,10 +73267,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -67829,7 +73289,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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. */ @@ -67838,48 +73326,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); + super(url2, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -67887,34 +73375,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -67931,7 +73437,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -67953,7 +73459,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67961,7 +73467,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67971,15 +73477,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * 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 BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67987,12 +73505,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -68005,14 +73523,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -68020,8 +73542,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -68032,19 +73554,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68056,24 +73585,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -68086,7 +73615,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -68094,8 +73623,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -68144,29 +73673,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -68181,7 +73710,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -68195,7 +73724,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -68205,10 +73734,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -68220,14 +73749,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -68240,18 +73769,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -68260,23 +73809,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -68292,44 +73864,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -68337,64 +73891,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -68402,41 +73955,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -68455,7 +74011,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68472,17 +74031,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -68490,35 +74047,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -68526,118 +74070,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -68655,7 +74219,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68676,23 +74243,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -68712,18 +74283,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -68734,27 +74303,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -68764,53 +74317,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: - * - * ```js - * let i = 1; + * // 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 @@ -68818,11 +74372,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -68834,7 +74387,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -68853,7 +74408,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -68862,14 +74420,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -68881,7 +74439,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -68891,7 +74449,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -68901,18 +74459,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve8) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve8(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve8((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -68921,45 +74482,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve8) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve8((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -69063,6 +74657,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -69070,7 +74716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69117,12 +74763,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -69148,10 +74799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69168,13 +74831,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -69203,6 +74870,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -69224,44 +74907,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -69272,22 +74973,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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. @@ -69302,35 +75031,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url3, credentialOrPipeline, options) { + constructor(url2, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url3, pipeline); + super(url2, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -69341,22 +75070,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -69373,7 +75111,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -69387,47 +75125,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -69436,15 +75156,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -69454,14 +75174,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -69472,14 +75192,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -69487,7 +75207,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -69499,9 +75219,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -69522,23 +75248,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -69558,18 +75288,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -69580,27 +75308,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -69608,57 +75320,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // 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 @@ -69670,7 +75378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -69682,7 +75390,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -69701,7 +75411,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69717,45 +75430,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -69763,45 +75458,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js + * // Use for await to iterate the containers * let i = 1; * for await (const container of blobServiceClient.listContainers()) { * console.log(`Container ${i++}: ${container.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -69823,7 +75514,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -69835,17 +75526,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -69864,7 +75558,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69874,16 +75571,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -69897,19 +75594,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -69917,7 +75622,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69925,21 +75630,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -69947,7 +75653,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69955,66 +75661,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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; + } }); } }); @@ -70099,7 +75863,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70112,21 +75876,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -70154,9 +75928,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core18 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core18 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { constructor(contentLength) { @@ -70239,15 +76014,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -70258,15 +76035,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core18.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core18.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -70274,7 +76050,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70287,21 +76063,31 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -70329,9 +76115,14 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core18 = __importStar4(require_core()); - var http_client_1 = require_lib4(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core18 = __importStar2(require_core()); + var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -70339,14 +76130,12 @@ var require_requestUtils = __commonJS({ } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -70358,14 +76147,13 @@ var require_requestUtils = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8) => setTimeout(resolve8, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(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) { @@ -70374,12 +76162,12 @@ var require_requestUtils = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -70402,9 +76190,8 @@ var require_requestUtils = __commonJS({ throw Error(`${name} failed: ${errorMessage}`); }); } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3( name, method, @@ -70413,13 +76200,13 @@ var require_requestUtils = __commonJS({ delay2, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { + (error3) => { + if (error3 instanceof http_client_1.HttpClientError) { return { - statusCode: error4.statusCode, + statusCode: error3.statusCode, result: null, headers: {}, - error: error4 + error: error3 }; } else { return void 0; @@ -70428,13 +76215,155 @@ var require_requestUtils = __commonJS({ ); }); } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); }); } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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; } }); @@ -70442,7 +76371,7 @@ var require_requestUtils = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70455,21 +76384,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -70497,20 +76436,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core18 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs17 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core18 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs18 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream2.pipeline); yield pipeline(response.message, output); }); @@ -70612,10 +76554,10 @@ var require_downloadUtils = __commonJS({ }; exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { - const writeStream = fs17.createWriteStream(archivePath); + return __awaiter2(this, void 0, void 0, function* () { + const writeStream = fs18.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { + 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, () => { @@ -70635,17 +76577,16 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs17.promises.open(archivePath, "w"); + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const archiveDescriptor = yield fs18.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", () => __awaiter4(this, void 0, void 0, function* () { + 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"]; @@ -70662,7 +76603,7 @@ var require_downloadUtils = __commonJS({ const count = Math.min(blockSize, length - offset); downloads.push({ offset, - promiseGetter: () => __awaiter4(this, void 0, void 0, function* () { + promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); }) }); @@ -70675,7 +76616,7 @@ var require_downloadUtils = __commonJS({ const progressFn = progress.onProgress(); const activeDownloads = []; let nextDownload; - const waitAndWrite = () => __awaiter4(this, void 0, void 0, function* () { + 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--; @@ -70699,9 +76640,8 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const retries = 5; let failures = 0; while (true) { @@ -70722,8 +76662,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { + 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}` }); @@ -70739,8 +76679,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { retryOptions: { // Override the timeout used when downloading each 4 MB chunk @@ -70756,7 +76696,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs17.openSync(archivePath, "w"); + const fd = fs18.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -70774,18 +76714,17 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs17.writeFileSync(fd, result); + fs18.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs17.closeSync(fd); + fs18.closeSync(fd); } } }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; const timeoutPromise = new Promise((resolve8) => { timeoutHandle = setTimeout(() => resolve8("timeout"), timeoutMs); @@ -70802,7 +76741,7 @@ var require_downloadUtils = __commonJS({ var require_options = __commonJS({ "node_modules/@actions/cache/lib/options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70815,23 +76754,34 @@ var require_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core18 = __importStar4(require_core()); + exports2.getUploadOptions = getUploadOptions; + exports2.getDownloadOptions = getDownloadOptions; + var core18 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -70856,7 +76806,6 @@ var require_options = __commonJS({ core18.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } - exports2.getUploadOptions = getUploadOptions; function getDownloadOptions(copy) { const result = { useAzureSdk: false, @@ -70898,7 +76847,6 @@ var require_options = __commonJS({ core18.debug(`Lookup only: ${result.lookupOnly}`); return result; } - exports2.getDownloadOptions = getDownloadOptions; } }); @@ -70907,7 +76855,9 @@ var require_config = __commonJS({ "node_modules/@actions/cache/lib/internal/config.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; + exports2.isGhes = isGhes; + exports2.getCacheServiceVersion = getCacheServiceVersion; + exports2.getCacheServiceURL = getCacheServiceURL; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); @@ -70916,13 +76866,11 @@ var require_config = __commonJS({ const isLocalHost = hostname.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } - exports2.isGhes = isGhes; function getCacheServiceVersion() { if (isGhes()) return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } - exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { const version = getCacheServiceVersion(); switch (version) { @@ -70934,7 +76882,6 @@ var require_config = __commonJS({ throw new Error(`Unsupported cache service version: ${version}`); } } - exports2.getCacheServiceURL = getCacheServiceURL; } }); @@ -70943,7 +76890,7 @@ var require_package2 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", - version: "4.1.0", + version: "5.0.1", preview: true, description: "Actions cache lib", keywords: [ @@ -70980,22 +76927,26 @@ var require_package2 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", + "@azure/core-rest-pipeline": "^1.22.0", + "@azure/storage-blob": "^12.29.1", semver: "^6.3.1" }, devDependencies: { - "@types/node": "^22.13.9", + "@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" } }; } @@ -71006,12 +76957,11 @@ 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 = void 0; + exports2.getUserAgentString = getUserAgentString; var packageJson = require_package2(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } - exports2.getUserAgentString = getUserAgentString; } }); @@ -71019,7 +76969,7 @@ var require_user_agent = __commonJS({ var require_cacheHttpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -71032,21 +76982,31 @@ var require_cacheHttpClient = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -71074,13 +77034,16 @@ var require_cacheHttpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core18 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var auth_1 = require_auth2(); - var fs17 = __importStar4(require("fs")); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache4; + var core18 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs18 = __importStar2(require("fs")); var url_1 = require("url"); - var utils = __importStar4(require_cacheUtils()); + var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); var downloadUtils_1 = require_downloadUtils(); var options_1 = require_options(); @@ -71113,11 +77076,11 @@ var require_cacheHttpClient = __commonJS({ return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); } function getCacheEntry(keys, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { @@ -71140,11 +77103,10 @@ var require_cacheHttpClient = __commonJS({ return cacheResult; }); } - exports2.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { @@ -71161,7 +77123,7 @@ Other caches with similar key:`); }); } function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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")) { @@ -71177,9 +77139,8 @@ Other caches with similar key:`); } }); } - exports2.downloadCache = downloadCache; function reserveCache(key, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -71187,24 +77148,23 @@ Other caches with similar key:`); version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); })); return response; }); } - exports2.reserveCache = reserveCache; function getContentRange(start, end) { return `bytes ${start}-${end}/*`; } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { core18.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})`, () => __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -71213,10 +77173,10 @@ Other caches with similar key:`); }); } function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs17.openSync(archivePath, "r"); + const fd = fs18.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -71224,38 +77184,38 @@ Other caches with similar key:`); core18.debug("Awaiting all uploads"); let offset = 0; try { - yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () { + 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, () => fs17.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs18.createReadStream(archivePath, { fd, start, end, autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); + }).on("error", (error3) => { + throw new Error(`Cache upload failed because file read failed with ${error3.message}`); }), start, end); } }))); } finally { - fs17.closeSync(fd); + fs18.closeSync(fd); } return; }); } function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); } function saveCache4(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { if (!signedUploadURL) { @@ -71277,7 +77237,6 @@ Other caches with similar key:`); } }); } - exports2.saveCache = saveCache4; } }); @@ -71449,7 +77408,7 @@ var require_binary_format_contract = __commonJS({ exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; var UnknownFieldHandler; (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = Symbol.for("protobuf-ts/unknown"); + 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 }); @@ -72374,7 +78333,7 @@ var require_message_type_contract = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); } }); @@ -72872,26 +78831,26 @@ var require_reflection_json_reader = __commonJS({ const fieldObj = target[localName]; for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { this.assert(jsonObjValue !== null, field.name + " map value", null); - let val2; + let val; switch (field.V.kind) { case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); + val = field.V.T().internalJsonRead(jsonObjValue, options); break; case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); break; } - this.assert(val2 !== void 0, field.name + " map value", jsonObjValue); + 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] = val2; + fieldObj[key] = val; } } else if (field.repeat) { if (jsonValue === null) @@ -72900,22 +78859,22 @@ var require_reflection_json_reader = __commonJS({ const fieldArr = target[localName]; for (const jsonItem of jsonValue) { this.assert(jsonItem !== null, field.name, null); - let val2; + let val; switch (field.kind) { case "message": - val2 = field.T().internalJsonRead(jsonItem, options); + val = field.T().internalJsonRead(jsonItem, options); break; case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); + val = this.scalar(jsonItem, field.T, field.L, field.name); break; } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); + this.assert(val !== void 0, field.name, jsonValue); + fieldArr.push(val); } } else { switch (field.kind) { @@ -72929,10 +78888,10 @@ var require_reflection_json_reader = __commonJS({ case "enum": if (jsonValue === null) continue; - let val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; - target[localName] = val2; + target[localName] = val; break; case "scalar": if (jsonValue === null) @@ -73082,8 +79041,8 @@ var require_reflection_json_reader = __commonJS({ break; return base64_1.base64decode(json2); } - } catch (error4) { - e = error4.message; + } catch (error3) { + e = error3.message; } this.assert(false, fieldName + (e ? " - " + e : ""), json2); } @@ -73137,26 +79096,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== void 0); + jsonObj[entryKey.toString()] = val; } break; } @@ -73168,26 +79127,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { - const val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== void 0); + jsonArr.push(val); } break; } @@ -73437,7 +79396,7 @@ var require_reflection_binary_reader = __commonJS({ let length = reader.uint32(); let end = reader.pos + length; let key = void 0; - let val2 = void 0; + let val = void 0; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -73450,13 +79409,13 @@ var require_reflection_binary_reader = __commonJS({ case 2: switch (field.V.kind) { case "scalar": - val2 = this.scalar(reader, field.V.T, field.V.L); + val = this.scalar(reader, field.V.T, field.V.L); break; case "enum": - val2 = reader.int32(); + val = reader.int32(); break; case "message": - val2 = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); break; } break; @@ -73468,19 +79427,19 @@ var require_reflection_binary_reader = __commonJS({ let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; } - if (val2 === void 0) + if (val === void 0) switch (field.V.kind) { case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); break; case "enum": - val2 = 0; + val = 0; break; case "message": - val2 = field.V.T().create(); + val = field.V.T().create(); break; } - return [key, val2]; + return [key, val]; } scalar(reader, type2, longType) { switch (type2) { @@ -73585,8 +79544,8 @@ var require_reflection_binary_writer = __commonJS({ break; case "map": assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); break; } } @@ -74156,18 +80115,18 @@ var require_enum_object = __commonJS({ } exports2.listEnumValues = listEnumValues; function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + return listEnumValues(enumObject).map((val) => val.name); } exports2.listEnumNames = listEnumNames; function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } exports2.listEnumNumbers = listEnumNumbers; } }); // node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ +var require_commonjs16 = __commonJS({ "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -74358,7 +80317,7 @@ var require_reflection_info2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function normalizeMethodInfo(method, service) { var _a, _b, _c; let m = method; @@ -74446,1810 +80405,2967 @@ var require_rpc_error = __commonJS({ 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}`); + 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(defaults, options) { + if (!options) + return defaults; + let o = {}; + copy(defaults, o); + copy(options, o); + for (let key of Object.keys(options)) { + let val = options[key]; + switch (key) { + case "jsonOptions": + o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); + break; + case "binaryOptions": + o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); + break; + case "meta": + o.meta = {}; + copy(defaults.meta, o.meta); + copy(options.meta, o.meta); + break; + case "interceptors": + o.interceptors = defaults.interceptors ? defaults.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((resolve8, reject) => { + this._resolve = resolve8; + 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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + 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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + 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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + 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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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); } } - return l.join("\n"); - } + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - 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_commonjs11(); - function mergeRpcOptions(defaults, options) { - if (!options) - return defaults; - let o = {}; - copy(defaults, o); - copy(options, o); - for (let key of Object.keys(options)) { - let val2 = options[key]; - switch (key) { - case "jsonOptions": - o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); - break; - case "binaryOptions": - o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); - break; - case "meta": - o.meta = {}; - copy(defaults.meta, o.meta); - copy(options.meta, o.meta); - break; - case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); - break; - } + exports2.DuplexStreamingCall = void 0; + var DuplexStreamingCall = class { + constructor(method, requestHeaders, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - 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; + /** + * 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/deferred.js -var require_deferred = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/deferred.js"(exports2) { +// 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"; - 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((resolve8, reject) => { - this._resolve = resolve8; - this._reject = reject; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); }); - if (preventUnhandledRejectionWarning) { - this._promise.catch((_2) => { - }); - } } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 { /** - * Get the current state of the promise. + * Initialize with mock data. Omitted fields have default value. */ - get state() { - return this._state; + 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 : {}; } /** - * Get the deferred promise. + * Sent message(s) during the last operation. */ - get promise() { - return this._promise; + get sentMessages() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.sent; + } else if (typeof this.lastInput == "object") { + return [this.lastInput.single]; + } + return []; } /** - * Resolve the promise. Throws if the promise is already resolved or rejected. + * Sending message(s) completed? */ - resolve(value) { - if (this.state !== DeferredState.PENDING) - throw new Error(`cannot resolve ${DeferredState[this.state].toLowerCase()}`); - this._resolve(value); - this._state = DeferredState.RESOLVED; + get sendComplete() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.completed; + } else if (typeof this.lastInput == "object") { + return true; + } + return false; } - /** - * 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; + // Creates a promise for response headers from the mock data. + promiseHeaders() { + var _a; + const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; + return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); } - /** - * Resolve the promise. Ignore if not pending. - */ - resolvePending(val2) { - if (this._state === DeferredState.PENDING) - this.resolve(val2); + // 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); } /** - * Reject the promise. Ignore if not pending. + * 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. */ - 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_commonjs11(); - var RpcOutputStreamController = class { - constructor() { - this._lis = { - nxt: [], - msg: [], - err: [], - cmp: [] - }; - this._closed = false; - this._itState = { q: [] }; + 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(); + }); } - // --- RpcOutputStream callback API - onNext(callback) { - return this.addLis(callback, this._lis.nxt); + // Creates a promise for response status from the mock data. + promiseStatus() { + var _a; + const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; + return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); } - onMessage(callback) { - return this.addLis(callback, this._lis.msg); + // Creates a promise for response trailers from the mock data. + promiseTrailers() { + var _a; + const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; + return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); } - onError(callback) { - return this.addLis(callback, this._lis.err); + maybeSuppressUncaught(...promise) { + if (this.suppressUncaughtRejections) { + for (let p of promise) { + p.catch(() => { + }); + } + } } - onComplete(callback) { - return this.addLis(callback, this._lis.cmp); + mergeOptions(options) { + return rpc_options_1.mergeRpcOptions({}, options); } - addLis(callback, list) { - list.push(callback); - return () => { - let i = list.indexOf(callback); - if (i >= 0) - list.splice(i, 1); - }; + unary(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); } - // remove all listeners - clearLis() { - for (let l of Object.values(this._lis)) - l.splice(0, l.length); + serverStreaming(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); } - // --- Controller API - /** - * Is this stream already closed by a completion or error? - */ - get closed() { - return this._closed !== false; + clientStreaming(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); } - /** - * 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, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); - if (message) - this.notifyMessage(message); - if (error4) - this.notifyError(error4); - if (complete) - this.notifyComplete(); + duplex(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); } - /** - * 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)); + }; + 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((resolve8, reject) => { + if (abort === null || abort === void 0 ? void 0 : abort.aborted) { + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + } else { + const id = setTimeout(() => resolve8(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; } - /** - * Closes the stream with an error. Throws if stream is closed. - * - * Triggers onNext and onError callbacks. - */ - notifyError(error4) { - runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); - this.clearLis(); + get sent() { + return this._sent; } - /** - * 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(); + get completed() { + return this._completed; } - /** - * 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; - } - }; + 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)); } - // "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); + 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)); } }; - 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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); - } + 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 _a, _b, _c, _d; + if (kind == "unary") { + let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); + for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { + const next = tail; + tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); } - function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + 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); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UnaryCall = void 0; - var UnaryCall = class { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + return tail(method, input, options); } - /** - * 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)); + 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); } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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); } - }; - exports2.UnaryCall = UnaryCall; + 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-streaming-call.js -var require_server_streaming_call = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js"(exports2) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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, request, headers, response, status, trailers) { + 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.requestHeaders = requestHeaders; - this.request = request; this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; + this.deadline = deadline; + this.trailers = {}; + this._sendRH = sendResponseHeadersFn; + this.status = defaultStatus; } /** - * 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. + * Set the call cancelled. + * + * Invokes all callbacks registered with onCancel() and + * sets `cancelled = true`. */ - then(onfulfilled, onrejected) { - return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); + notifyCancelled() { + if (!this._cancelled) { + this._cancelled = true; + for (let l of this._listeners) { + l(); + } + } } - promiseFinished() { - return __awaiter4(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 - }; - }); + /** + * 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.ServerStreamingCall = ServerStreamingCall; + exports2.ServerCallContextController = ServerCallContextController; } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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*/ } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + ]); + } + 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); } } - function step(result) { - result.done ? resolve8(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - 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)); + return message; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.ClientStreamingCall = ClientStreamingCall; + exports2.CacheScope = new CacheScope$Type(); } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; + 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 } + ]); } - /** - * 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)); + 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; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.DuplexStreamingCall = DuplexStreamingCall; + exports2.CacheMetadata = new CacheMetadata$Type(); } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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*/ } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + ]); + } + 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); } } - function step(result) { - result.done ? resolve8(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_commonjs11(); - 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 : {}; + return message; } - /** - * 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 []; + 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; } - /** - * 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; + }; + 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*/ + } + ]); } - // Creates a promise for response headers from the mock data. - promiseHeaders() { - var _a; - const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; - return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); + 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; } - // 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(); + 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); + } } - runtime_1.assert(method.O.is(r)); - return Promise.resolve(r); + return message; } - /** - * 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 __awaiter4(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 (error4) { - stream2.notifyError(error4); - return; - } - if (this.data.response instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.response); - return; + 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*/ } - for (let msg of messages) { - stream2.notifyMessage(msg); - try { - yield delay2(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream2.notifyError(error4); - return; - } + ]); + } + 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); } - if (this.data.status instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.status); - return; + } + 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*/ } - if (this.data.trailers instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.trailers); - return; + ]); + } + 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); } - stream2.notifyComplete(); - }); + } + return message; } - // Creates a promise for response status from the mock data. - promiseStatus() { - var _a; - const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; - return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); + 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; } - // Creates a promise for response trailers from the mock data. - promiseTrailers() { - var _a; - const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; - return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); + }; + 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*/ + } + ]); } - maybeSuppressUncaught(...promise) { - if (this.suppressUncaughtRejections) { - for (let p of promise) { - p.catch(() => { - }); + 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; } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); - } - unary(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); + 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.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((resolve8, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - } else { - const id = setTimeout(() => resolve8(v), ms); - if (abort) { - abort.addEventListener("abort", (ev) => { - clearTimeout(id); - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - }); + 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*/ } - } - }); - } - 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; + 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; } - send(message) { - if (this.data.inputMessage instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.inputMessage); + 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); + } } - 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)); + return message; } - 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)); + 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/@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) { +// 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.stackDuplexStreamingInterceptors = exports2.stackClientStreamingInterceptors = exports2.stackServerStreamingInterceptors = exports2.stackUnaryInterceptors = exports2.stackIntercept = void 0; - var runtime_1 = require_commonjs11(); - function stackIntercept(kind, transport, method, options, input) { - var _a, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).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); + 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); } - 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); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toJson(request, { + 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 + })); } - 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); + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { + 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 + })); } - 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; + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { + 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 + })); } - /** - * 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(); - } - } + }; + exports2.CacheServiceClientJSON = CacheServiceClientJSON; + var CacheServiceClientProtobuf = class { + constructor(rpc) { + this.rpc = rpc; + this.CreateCacheEntry.bind(this); + this.FinalizeCacheEntryUpload.bind(this); + this.GetCacheEntryDownloadURL.bind(this); } - /** - * Send response headers. - */ - sendResponseHeaders(data) { - this._sendRH(data); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); + return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); } - /** - * 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; + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); + return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); } - /** - * 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); - }; + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); + 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.ServerCallContextController = ServerCallContextController; + exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; } }); -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs12 = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js"(exports2) { +// node_modules/@actions/cache/lib/internal/shared/util.js +var require_util9 = __commonJS({ + "node_modules/@actions/cache/lib/internal/shared/util.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; - } }); + 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/generated/results/entities/v1/cachescope.js -var require_cachescope = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/entities/v1/cachescope.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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_util9(); + var CacheServiceClient = class { + constructor(userAgent, 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(userAgent, [ + new auth_1.BearerCredentialHandler(token) ]); } - 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; + // 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}`); + } + }); } - 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); + 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++; } - } - return message; + throw new Error(`Request failed`); + }); } - 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; + 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((resolve8) => setTimeout(resolve8, 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); } }; - exports2.CacheScope = new CacheScope$Type(); + 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/generated/results/entities/v1/cachemetadata.js -var require_cachemetadata = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/entities/v1/cachemetadata.js"(exports2) { +// node_modules/@actions/cache/lib/internal/tar.js +var require_tar = __commonJS({ + "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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 } - ]); + 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]; + } }; } - 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; + 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(resolve8) { + resolve8(value); + }); } - 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(); + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 = extractTar2; + exports2.createTar = createTar; + var exec_1 = require_exec(); + var io7 = __importStar2(require_io()); + var fs_1 = require("fs"); + var path16 = __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 io7.which("gtar", false); + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else { + return { + path: yield io7.which("tar", true), + type: constants_1.ArchiveToolType.BSD + }; + } + } + default: + break; + } + return { + path: yield io7.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, type2, 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 (type2) { + case "create": + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + break; + case "extract": + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path16.sep}`, "g"), "/")); + break; + case "list": + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path16.sep}`, "g"), "/"), "-P"); + break; + } + if (tarPath.type === constants_1.ArchiveToolType.GNU) { + switch (process.platform) { + case "win32": + args.push("--force-local"); break; - case /* repeated github.actions.results.entities.v1.CacheScope scope */ - 2: - message.scope.push(cachescope_1.CacheScope.internalBinaryRead(reader, reader.uint32(), options)); + case "darwin": + args.push("--delay-directory-restore"); 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(); + return args; + }); + } + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { + let args; + const tarPath = yield getTarPath(); + const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); + const compressionArgs = type2 !== "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 && type2 !== "create") { + args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + } else { + args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + } + if (BSD_TAR_ZSTD) { + return args; + } + return [args.join(" ")]; + }); + } + function getWorkingDirectory() { + var _a; + return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : 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(`\\${path16.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(`\\${path16.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(`\\${path16.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(`\\${path16.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 extractTar2(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const workingDirectory = getWorkingDirectory(); + yield io7.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)(path16.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + const commands = yield getCommands(compressionMethod, "create"); + yield execCommands(commands, archiveFolder); + }); + } } }); -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/api/v1/cache.js"(exports2) { +// node_modules/@actions/cache/lib/cache.js +var require_cache4 = __commonJS({ + "node_modules/@actions/cache/lib/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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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; + 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]; + } }; } - 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); + 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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; + var core18 = __importStar2(require_core()); + var path16 = __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 ValidationError = class _ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + Object.setPrototypeOf(this, _ValidationError.prototype); } }; - 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*/ - } - ]); + exports2.ValidationError = ValidationError; + var ReserveCacheError2 = class _ReserveCacheError extends Error { + constructor(message) { + super(message); + this.name = "ReserveCacheError"; + Object.setPrototypeOf(this, _ReserveCacheError.prototype); } - 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; + }; + exports2.ReserveCacheError = ReserveCacheError2; + var FinalizeCacheError = class _FinalizeCacheError extends Error { + constructor(message) { + super(message); + this.name = "FinalizeCacheError"; + Object.setPrototypeOf(this, _FinalizeCacheError.prototype); } - 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; + }; + 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`); } - 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; + } + function checkKey(key) { + if (key.length > 512) { + throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); } - }; - 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*/ - } - ]); + const regex = /^[^,]*$/; + if (!regex.test(key)) { + throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); } - 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; + } + 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"]; } - 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); + } + function restoreCache4(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)(); + core18.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + 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) { + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core18.debug("Resolved Keys:"); + core18.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 { + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + return void 0; + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core18.info("Lookup only - skipping download"); + return cacheEntry.cacheKey; + } + archivePath = path16.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core18.debug(`Archive Path: ${archivePath}`); + yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); + if (core18.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core18.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core18.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) { + core18.error(`Failed to restore: ${error3.message}`); + } else { + core18.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core18.debug(`Failed to delete archive: ${error3}`); } } - 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*/ + 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) { + options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core18.debug("Resolved Keys:"); + core18.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 request = { + key: primaryKey, + restoreKeys, + version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) + }; + const response = yield twirpClient.GetCacheEntryDownloadURL(request); + if (!response.ok) { + core18.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); + return void 0; + } + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core18.info(`Cache hit for restore-key: ${response.matchedKey}`); + } else { + core18.info(`Cache hit for: ${response.matchedKey}`); + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core18.info("Lookup only - skipping download"); + return response.matchedKey; + } + archivePath = path16.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core18.debug(`Archive path: ${archivePath}`); + core18.debug(`Starting download of archive to: ${archivePath}`); + yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core18.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core18.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core18.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) { + core18.error(`Failed to restore: ${error3.message}`); + } else { + core18.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + if (archivePath) { + yield utils.unlinkFile(archivePath); + } + } catch (error3) { + core18.debug(`Failed to delete archive: ${error3}`); + } + } + return void 0; + }); + } + function saveCache4(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + core18.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + checkKey(key); + 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 _a, _b, _c, _d, _e; + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core18.debug("Cache Paths:"); + core18.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 = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core18.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core18.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core18.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.`); + } + core18.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { + throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + } + core18.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 === ReserveCacheError2.name) { + core18.info(`Failed to save: ${typedError.message}`); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core18.error(`Failed to save: ${typedError.message}`); + } else { + core18.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core18.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) { + 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); + core18.debug("Cache Paths:"); + core18.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 = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core18.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core18.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core18.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core18.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core18.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); + } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core18.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + } + core18.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); + core18.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 === ReserveCacheError2.name) { + core18.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core18.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core18.error(`Failed to save: ${typedError.message}`); + } else { + core18.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core18.debug(`Failed to delete archive: ${error3}`); } - ]); + } + return cacheId; + }); + } + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/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; } - 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; + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - 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; + 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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - 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; + 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; }; - 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; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.issue = exports2.issueCommand = void 0; + var os4 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os4.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; } - 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); + 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)}`; + } + } } } - return message; + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - 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; + }; + 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/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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; }; - 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*/ - } - ]); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs18 = __importStar2(require("fs")); + var os4 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - 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; + if (!fs18.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - 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; + fs18.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { + encoding: "utf8" + }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - 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; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - }; - 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 } - ]); + return `${key}<<${delimiter}${os4.EOL}${convertedValue}${os4.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// 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) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); - var CacheServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + exports2.checkBypass = exports2.getProxyUrl = void 0; + function getProxyUrl(reqUrl) { + const usingSsl = reqUrl.protocol === "https:"; + if (checkBypass(reqUrl)) { + return void 0; } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toJson(request, { - 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 - })); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { - 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 - })); + } + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { - 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 - })); + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - }; - exports2.CacheServiceClientJSON = CacheServiceClientJSON; - var CacheServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/protobuf", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromBinary(data2)); + 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; } }; - 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) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; - 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 (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url2} ${error4 instanceof Error ? error4.message : String(error4)}`); - } - } - 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); + 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]; + } }; } - if ("signed_download_url" in body && typeof body.signed_download_url === "string") { - maskSigUrl(body.signed_download_url); + 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); } - } - exports2.maskSecretUrls = maskSecretUrls; - } -}); - -// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + __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(resolve8) { resolve8(value); @@ -76277,183 +83393,571 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; - 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_auth2(); - var http_client_1 = require_lib4(); - var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util10(); - var CacheServiceClient = class { - constructor(userAgent, 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; + exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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((resolve8) => __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", () => { + resolve8(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve8(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(userAgent, 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 = userAgent; + 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; + } } - if (baseRetryIntervalMilliseconds) { - this.baseRetryIntervalMilliseconds = baseRetryIntervalMilliseconds; + } + 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 info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, 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(); } - if (retryMultiplier) { - this.retryMultiplier = retryMultiplier; + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve8(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; + } + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.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: ${info7.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(); } - this.httpClient = new http_client_1.HttpClient(userAgent, [ - 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 __awaiter4(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 + /** + * 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 info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); + } + } + return info7; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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 }) }; - try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { - return this.httpClient.post(url2, JSON.stringify(data), headers); - })); - return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + 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 https2.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((resolve8) => setTimeout(() => resolve8(), ms)); }); } - retryableRequest(operation) { - return __awaiter4(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(); + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve8(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; } - errorMessage = `${errorMessage}: ${body.msg}`; - } - } catch (error4) { - if (error4 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); - } - if (error4 instanceof errors_1.UsageError) { - throw error4; - } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); } - isRetryable = true; - errorMessage = error4.message; + return value; } - if (!isRetryable) { - throw new Error(`Received non-retryable error: ${errorMessage}`); + 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 (attempt + 1 === this.maxAttempts) { - throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); + 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 { + resolve8(response); } - 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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => setTimeout(resolve8, 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); - } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -76481,623 +83985,524 @@ var require_tar = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; - var exec_1 = require_exec(); - var io7 = __importStar4(require_io3()); - var fs_1 = require("fs"); - var path15 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { - return __awaiter4(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 io7.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io7.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; - } - } - default: - break; - } - return { - path: yield io7.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); - } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - 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 (type2) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path15.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path15.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path15.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, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); - const compressionArgs = type2 !== "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 && type2 !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; - } else { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; - } - if (BSD_TAR_ZSTD) { - return args; - } - return [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a; - return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(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(`\\${path15.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(`\\${path15.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; - } - }); - } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(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(`\\${path15.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(`\\${path15.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; - } - }); - } - function execCommands(commands, cwd) { - return __awaiter4(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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); - } + 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"); } - }); - } - function listTar(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - exports2.listTar = listTar; - function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io7.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - exports2.extractTar = extractTar2; - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path15.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - exports2.createTar = createTar; - } -}); - -// node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core18 = __importStar4(require_core()); - var path15 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); - var config_1 = require_config(); - var tar_1 = require_tar(); - var http_client_1 = require_lib4(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - }; - exports2.ValidationError = ValidationError; - var ReserveCacheError2 = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); + // 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}`; } - }; - exports2.ReserveCacheError = ReserveCacheError2; - var FinalizeCacheError = class _FinalizeCacheError extends Error { - constructor(message) { - super(message); - this.name = "FinalizeCacheError"; - Object.setPrototypeOf(this, _FinalizeCacheError.prototype); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } }; - 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`); + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - } - function checkKey(key) { - if (key.length > 512) { - throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); + // 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")}`; } - const regex = /^[^,]*$/; - if (!regex.test(key)) { - throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - } - 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"]; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache4(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core18.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - switch (cacheServiceVersion) { - case "v2": - return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - case "v1": - default: - return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - } - }); - } - exports2.restoreCache = restoreCache4; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core18.debug("Resolved Keys:"); - core18.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 { - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core18.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path15.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core18.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core18.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core18.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core18.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core18.error(`Failed to restore: ${error4.message}`); - } else { - core18.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + }; + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core18.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core18.debug("Resolved Keys:"); - core18.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 request = { - key: primaryKey, - restoreKeys, - version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) - }; - const response = yield twirpClient.GetCacheEntryDownloadURL(request); - if (!response.ok) { - core18.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); - return void 0; - } - const isRestoreKeyMatch = request.key !== response.matchedKey; - if (isRestoreKeyMatch) { - core18.info(`Cache hit for restore-key: ${response.matchedKey}`); - } else { - core18.info(`Cache hit for: ${response.matchedKey}`); - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core18.info("Lookup only - skipping download"); - return response.matchedKey; - } - archivePath = path15.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core18.debug(`Archive path: ${archivePath}`); - core18.debug(`Starting download of archive to: ${archivePath}`); - yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core18.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core18.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core18.info("Cache restored successfully"); - return response.matchedKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core18.error(`Failed to restore: ${error4.message}`); - } else { - core18.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + function rejected(value) { try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error4) { - core18.debug(`Failed to delete archive: ${error4}`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function saveCache4(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core18.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - exports2.saveCache = saveCache4; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core18.debug("Cache Paths:"); - core18.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.`); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OidcClient = void 0; + var http_client_1 = require_lib5(); + var auth_1 = require_auth3(); + 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"); } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path15.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core18.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core18.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core18.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.`); - } - core18.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize + 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 _a; + 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}`); }); - if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - core18.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError2.name) { - core18.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core18.error(`Failed to save: ${typedError.message}`); - } else { - core18.warning(`Failed to save: ${typedError.message}`); + 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}`); } - } finally { + }); + } + }; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core18.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core18.debug("Cache Paths:"); - core18.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 = path15.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core18.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core18.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core18.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core18.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; + function rejected(value) { try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core18.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core18.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } - core18.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); - core18.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.`); + } + function step(result) { + result.done ? resolve8(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; } - cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError2.name) { - core18.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core18.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core18.error(`Failed to save: ${typedError.message}`); - } else { - core18.warning(`Failed to save: ${typedError.message}`); - } + 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.`); } - } finally { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core18.debug(`Failed to delete archive: ${error4}`); + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + 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 cacheId; - }); + 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/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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 path16 = __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, path16.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ +var require_io_util3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77106,21 +84511,21 @@ var require_io_util4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -77150,14 +84555,14 @@ var require_io_util4 = __commonJS({ var _a; 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 fs17 = __importStar4(require("fs")); - var path15 = __importStar4(require("path")); - _a = fs17.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + var fs18 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + _a = fs18.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs17.constants.O_RDONLY; + exports2.READONLY = fs18.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -77171,7 +84576,7 @@ var require_io_util4 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -77189,7 +84594,7 @@ var require_io_util4 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -77200,7 +84605,7 @@ var require_io_util4 = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path15.extname(filePath).toUpperCase(); + const upperExt = path16.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -77224,11 +84629,11 @@ var require_io_util4 = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path15.dirname(filePath); - const upperName = path15.basename(filePath).toUpperCase(); + const directory = path16.dirname(filePath); + const upperName = path16.basename(filePath).toUpperCase(); for (const actualName of yield exports2.readdir(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path15.join(directory, actualName); + filePath = path16.join(directory, actualName); break; } } @@ -77267,10 +84672,10 @@ var require_io_util4 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ +var require_io3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77279,21 +84684,21 @@ var require_io4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -77323,16 +84728,16 @@ var require_io4 = __commonJS({ 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 path15 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); + var path16 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 ? path15.join(dest, path15.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path16.join(dest, path16.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -77344,7 +84749,7 @@ var require_io4 = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path15.relative(source, newDest) === "") { + if (path16.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); @@ -77353,11 +84758,11 @@ var require_io4 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { - dest = path15.join(dest, path15.basename(source)); + dest = path16.join(dest, path16.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -77368,13 +84773,13 @@ var require_io4 = __commonJS({ } } } - yield mkdirP(path15.dirname(dest)); + yield mkdirP(path16.dirname(dest)); yield ioUtil.rename(source, dest); }); } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -77394,14 +84799,14 @@ var require_io4 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77425,13 +84830,13 @@ var require_io4 = __commonJS({ } exports2.which = which7; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + 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(path15.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path16.delimiter)) { if (extension) { extensions.push(extension); } @@ -77444,12 +84849,12 @@ var require_io4 = __commonJS({ } return []; } - if (tool.includes(path15.sep)) { + if (tool.includes(path16.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path15.delimiter)) { + for (const p of process.env.PATH.split(path16.delimiter)) { if (p) { directories.push(p); } @@ -77457,7 +84862,7 @@ var require_io4 = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path15.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path16.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -77473,7 +84878,7 @@ var require_io4 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -77493,7 +84898,7 @@ var require_io4 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -77514,38 +84919,34 @@ var require_io4 = __commonJS({ } }); -// node_modules/@actions/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -77573,819 +84974,463 @@ var require_manifest = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os3 = require("os"); - var cp = require("child_process"); - var fs17 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os3.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os4 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = class extends events.EventEmitter { + constructor(toolPath, args, options) { + super(); + if (!toolPath) { + throw new Error("Parameter 'toolPath' cannot be null or empty."); } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; + this.toolPath = toolPath; + this.args = args || []; + this.options = options || {}; + } + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os3.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; + } + _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)}`; } } - } - } - return version; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs17.existsSync(lsbReleaseFile)) { - contents = fs17.readFileSync(lsbReleaseFile).toString(); - } else if (fs17.existsSync(osReleaseFile)) { - contents = fs17.readFileSync(osReleaseFile).toString(); - } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/tool-cache/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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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}`); + return cmd; } - 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; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os4.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os4.EOL.length); + n = s.indexOf(os4.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } } - 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/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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]; } } - function step(result) { - result.done ? resolve8(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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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; + return this.args; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(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", () => { - resolve8(output.toString()); - }); - })); - }); + _endsWith(str2, end) { + return str2.endsWith(end); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve8(Buffer.concat(chunks)); - }); - })); - }); + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + _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 (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + 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(""); } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + _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(""); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + _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; } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + _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; } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * 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 */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + exec() { + return __awaiter2(this, void 0, void 0, function* () { + if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { + this.toolPath = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; + this.toolPath = yield io7.which(this.toolPath, true); + return new Promise((resolve8, 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) + os4.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 (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, data); - } else { - return response; - } + 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 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; + 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); } - 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."); + if (errbuffer.length > 0) { + this.emit("errline", errbuffer); } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + cp.removeAllListeners(); + if (error3) { + reject(error3); + } else { + resolve8(exitCode); } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } - } 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(); + }; + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve8(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + arg += c; + escaped = false; } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + continue; } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } + if (c === "\\" && escaped) { + append(c); + continue; } - const req = info7.httpModule.request(info7.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: ${info7.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + if (c === "\\" && inQuotes) { + escaped = true; + continue; } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; } + append(c); } - /** - * 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); + if (arg.length > 0) { + args.push(arg.trim()); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; + 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"); } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - return info7; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + CheckComplete() { + if (this.done) { + return; } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } - return additionalHeaders[header] || clientHeader || _default2; } - _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; + _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`); } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.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 (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; } - if (proxyAgent) { - return proxyAgent; + this.done = true; + this.emit("done", error3, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; } - 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 - }); + 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); } - return proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve8(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 { - resolve8(response); - } - })); - }); + state._setResult(); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -78413,58 +85458,63 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core18 = __importStar4(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"); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + 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.`); } - } - execute(action, isRetryable) { - return __awaiter4(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; - } - core18.info(err.message); - } - const seconds = this.getSleepAmount(); - core18.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + 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 _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => setTimeout(resolve8, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + }; + 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/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78477,21 +85527,21 @@ var require_tool_cache = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -78518,613 +85568,546 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core18 = __importStar4(require_core()); - var io7 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs17 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os3 = __importStar4(require("os")); - var path15 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver8 = __importStar4(require_semver2()); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(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); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url2, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path15.join(_getTempDirectory(), crypto.randomUUID()); - yield io7.mkdirP(path15.dirname(dest)); - core18.debug(`Downloading ${url2}`); - core18.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url2, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); + 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_exec3()); + 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 }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url2, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs17.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false + 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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 }); - if (auth) { - core18.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url2, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core18.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream2.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs17.createWriteStream(dest)); - core18.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core18.debug("download failed"); - try { - yield io7.rmRF(dest); - } catch (err) { - core18.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } }); } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core18.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path15.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 - }; + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { try { - const powershellPath = yield io7.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core18.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() + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - }); - core18.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core18.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core18.isDebug()) { - args.push("-v"); - } - const xarPath = yield io7.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io7.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 - ]; - core18.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 io7.which("powershell", true); - core18.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io7.which("unzip", true); - const args = [file]; - if (!core18.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os3.arch(); - core18.debug(`Caching tool ${tool} ${version} ${arch2}`); - core18.debug(`source dir: ${sourceDir}`); - if (!fs17.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs17.readdirSync(sourceDir)) { - const s = path15.join(sourceDir, itemName); - yield io7.cp(s, destPath, { recursive: true }); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - _completeToolPath(tool, version, arch2); - return destPath; + 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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os4 = __importStar2(require("os")); + var path16 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable9(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.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os3.arch(); - core18.debug(`Caching tool ${tool} ${version} ${arch2}`); - core18.debug(`source file: ${sourceFile}`); - if (!fs17.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path15.join(destFolder, targetFile); - core18.debug(`destination file ${destPath}`); - yield io7.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); - return destFolder; - }); + exports2.exportVariable = exportVariable9; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch2) { - if (!toolName) { - throw new Error("toolName parameter is required"); + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); + process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - arch2 = arch2 || os3.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; + if (options && options.trimWhitespace === false) { + return val; } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path15.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core18.debug(`checking cache: ${cachePath}`); - if (fs17.existsSync(cachePath) && fs17.existsSync(`${cachePath}.complete`)) { - core18.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); - toolPath = cachePath; - } else { - core18.debug("not found"); - } + 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 toolPath; + return inputs.map((input) => input.trim()); } - exports2.find = find2; - function findAllVersions2(toolName, arch2) { - const versions = []; - arch2 = arch2 || os3.arch(); - const toolPath = path15.join(_getCacheDirectory(), toolName); - if (fs17.existsSync(toolPath)) { - const children = fs17.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path15.join(toolPath, child, arch2 || ""); - if (fs17.existsSync(fullPath) && fs17.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return versions; + process.stdout.write(os4.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core18.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core18.debug("Invalid json"); - } - } - return releases; - }); + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os3.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path15.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io7.mkdirP(dest); - return dest; - }); + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; } - function _createToolPath(tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path15.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - core18.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io7.rmRF(folderPath); - yield io7.rmRF(markerPath); - yield io7.mkdirP(folderPath); - return folderPath; - }); + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); } - function _completeToolPath(tool, version, arch2) { - const folderPath = path15.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - const markerPath = `${folderPath}.complete`; - fs17.writeFileSync(markerPath, ""); - core18.debug("finished caching tool"); + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core18.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core18.debug(`explicit? ${valid3}`); - return valid3; + exports2.error = error3; + function warning12(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core18.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; + exports2.warning = warning12; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os4.EOL); + } + exports2.info = info7; + 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 -1; + return result; }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core18.debug(`matched: ${version}`); - } else { - core18.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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; + exports2.group = group; + function saveState2(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 _getGlobal(key, defaultValue) { - const value = global[key]; - return value !== void 0 ? value : defaultValue; + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - function _unique(values) { - return Array.from(new Set(values)); + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/fast-deep-equal/index.js -var require_fast_deep_equal = __commonJS({ - "node_modules/fast-deep-equal/index.js"(exports2, module2) { +// node_modules/@actions/tool-cache/lib/manifest.js +var require_manifest = __commonJS({ + "node_modules/@actions/tool-cache/lib/manifest.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; + 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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - return true; - } - return a !== a && b !== b; + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - } -}); - -// node_modules/@actions/http-client/lib/proxy.js -var require_proxy5 = __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"]; + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os4 = require("os"); + var cp = require("child_process"); + var fs18 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os4.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; } - } else { - return void 0; - } + return result; + }); } - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os4.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; + } + } + } } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs18.existsSync(lsbReleaseFile)) { + contents = fs18.readFileSync(lsbReleaseFile).toString(); + } else if (fs18.existsSync(osReleaseFile)) { + contents = fs18.readFileSync(osReleaseFile).toString(); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + return contents; + } + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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]; + } }; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + __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(resolve8) { + resolve8(value); + }); } - 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 new (P || (P = Promise))(function(resolve8, 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 ? resolve8(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 core18 = __importStar2(require_core3()); + 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"); } } - 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; + 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; + } + core18.info(err.message); + } + const seconds = this.getSleepAmount(); + core18.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); + }); } - get password() { - return this._decodedPassword; + 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((resolve8) => setTimeout(resolve8, seconds * 1e3)); + }); } }; + exports2.RetryHelper = RetryHelper; } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -79137,31 +86120,21 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -79189,628 +86162,535 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core18 = __importStar2(require_core3()); + var io7 = __importStar2(require_io3()); + var crypto2 = __importStar2(require("crypto")); + var fs18 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os4 = __importStar2(require("os")); + var path16 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver9 = __importStar2(require_semver2()); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + 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.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(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", () => { - resolve8(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve8(Buffer.concat(chunks)); - }); - })); + exports2.HTTPError = HTTPError2; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url2, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path16.join(_getTempDirectory(), crypto2.randomUUID()); + yield io7.mkdirP(path16.dirname(dest)); + core18.debug(`Downloading ${url2}`); + core18.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 || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + }); } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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); + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url2, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs18.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false + }); + if (auth) { + core18.debug("set auth"); + if (headers === void 0) { + headers = {}; } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; + headers.authorization = auth; + } + const response = yield http.get(url2, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core18.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream2.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs18.createWriteStream(dest)); + core18.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core18.debug("download failed"); + try { + yield io7.rmRF(dest); + } catch (err) { + core18.debug(`Failed to delete '${dest}'. ${err.message}`); + } } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + } + }); + } + 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 = core18.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } else { + const escapedScript = path16.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 io7.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core18.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() } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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(); + core18.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve8(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + if (core18.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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]; } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } + args.push("-x", "-C", dest, "-f", file); + if (core18.isDebug()) { + args.push("-v"); } - const req = info7.httpModule.request(info7.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: ${info7.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + const xarPath = yield io7.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + function extractZip(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); + dest = yield _createExtractFolder(dest); + if (IS_WINDOWS) { + yield extractZipWin(file, dest); } 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; + yield extractZipNix(file, dest); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; + return dest; + }); + } + exports2.extractZip = extractZip; + 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 io7.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 + ]; + core18.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 io7.which("powershell", true); + core18.debug(`Using powershell at path: ${powershellPath}`); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } + }); + } + function extractZipNix(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + const unzipPath = yield io7.which("unzip", true); + const args = [file]; + if (!core18.isDebug()) { + args.unshift("-q"); } - return info7; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os4.arch(); + core18.debug(`Caching tool ${tool} ${version} ${arch2}`); + core18.debug(`source dir: ${sourceDir}`); + if (!fs18.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); } - return lowercaseKeys(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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; - if (headerValue) { - clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; - } + const destPath = yield _createToolPath(tool, version, arch2); + for (const itemName of fs18.readdirSync(sourceDir)) { + const s = path16.join(sourceDir, itemName); + yield io7.cp(s, destPath, { recursive: true }); } - const additionalValue = additionalHeaders[header]; - if (additionalValue !== void 0) { - return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + _completeToolPath(tool, version, arch2); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os4.arch(); + core18.debug(`Caching tool ${tool} ${version} ${arch2}`); + core18.debug(`source file: ${sourceFile}`); + if (!fs18.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); } - if (clientHeader !== void 0) { - return clientHeader; + const destFolder = yield _createToolPath(tool, version, arch2); + const destPath = path16.join(destFolder, targetFile); + core18.debug(`destination file ${destPath}`); + yield io7.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch2); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch2) { + if (!toolName) { + throw new Error("toolName parameter is required"); + } + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); + } + arch2 = arch2 || os4.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch2); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path16.join(_getCacheDirectory(), toolName, versionSpec, arch2); + core18.debug(`checking cache: ${cachePath}`); + if (fs18.existsSync(cachePath) && fs18.existsSync(`${cachePath}.complete`)) { + core18.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + toolPath = cachePath; + } else { + core18.debug("not found"); } - return _default2; } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch2) { + const versions = []; + arch2 = arch2 || os4.arch(); + const toolPath = path16.join(_getCacheDirectory(), toolName); + if (fs18.existsSync(toolPath)) { + const children = fs18.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path16.join(toolPath, child, arch2 || ""); + if (fs18.existsSync(fullPath) && fs18.existsSync(`${fullPath}.complete`)) { + versions.push(child); } } } - 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 _default2; } - _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; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core18.debug("set auth"); + headers.authorization = auth; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; } - 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; + let manifestUrl = ""; + for (const item of response.result.tree) { + if (item.path === "versions-manifest.json") { + manifestUrl = item.url; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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 (_a) { + core18.debug("Invalid json"); + } } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os4.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path16.join(_getTempDirectory(), crypto2.randomUUID()); } - if (proxyAgent) { - return proxyAgent; + yield io7.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + core18.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io7.rmRF(folderPath); + yield io7.rmRF(markerPath); + yield io7.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch2) { + const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const markerPath = `${folderPath}.complete`; + fs18.writeFileSync(markerPath, ""); + core18.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core18.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core18.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core18.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); - }); + if (version) { + core18.debug(`matched: ${version}`); + } else { + core18.debug("match not found"); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve8(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 { - resolve8(response); - } - })); - }); + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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; }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ +var require_debug3 = __commonJS({ "node_modules/follow-redirects/debug.js"(exports2, module2) { var debug5; module2.exports = function() { if (!debug5) { try { debug5 = require_src()("follow-redirects"); - } catch (error4) { + } catch (error3) { } if (typeof debug5 !== "function") { debug5 = function() { @@ -79831,7 +86711,7 @@ var require_follow_redirects = __commonJS({ var https2 = require("https"); var Writable = require("stream").Writable; var assert = require("assert"); - var debug5 = require_debug2(); + var debug5 = require_debug3(); (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; @@ -79843,8 +86723,8 @@ var require_follow_redirects = __commonJS({ var useNativeURL = false; try { assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; } var preservedUrlFields = [ "auth", @@ -79918,9 +86798,9 @@ var require_follow_redirects = __commonJS({ this._currentRequest.abort(); this.emit("abort"); }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); + RedirectableRequest.prototype.destroy = function(error3) { + destroyRequest(this._currentRequest, error3); + destroy.call(this, error3); return this; }; RedirectableRequest.prototype.write = function(data, encoding, callback) { @@ -80087,10 +86967,10 @@ var require_follow_redirects = __commonJS({ var i = 0; var self2 = this; var buffers = this._requestBodyBuffers; - (function writeNext(error4) { + (function writeNext(error3) { if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); + if (error3) { + self2.emit("error", error3); } else if (i < buffers.length) { var buffer = buffers[i++]; if (!request.finished) { @@ -80289,12 +87169,12 @@ var require_follow_redirects = __commonJS({ }); return CustomError; } - function destroyRequest(request, error4) { + function destroyRequest(request, error3) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); - request.destroy(error4); + request.destroy(error3); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); @@ -80322,7 +87202,7 @@ var require_follow_redirects = __commonJS({ var require_config2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/config.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -80334,7 +87214,7 @@ var require_config2 = __commonJS({ exports2.getConcurrency = getConcurrency; exports2.getUploadChunkTimeout = getUploadChunkTimeout; exports2.getMaxArtifactListCount = getMaxArtifactListCount; - var os_1 = __importDefault4(require("os")); + var os_1 = __importDefault2(require("os")); var core_1 = require_core(); function getUploadChunkSize() { return 8 * 1024 * 1024; @@ -80418,13 +87298,13 @@ var require_timestamp = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Timestamp = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - var runtime_6 = require_commonjs11(); - var runtime_7 = require_commonjs11(); + 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", [ @@ -80567,13 +87447,13 @@ var require_wrappers = __commonJS({ "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_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - var runtime_6 = require_commonjs11(); - var runtime_7 = require_commonjs11(); + 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", [ @@ -80834,433 +87714,34 @@ var require_wrappers = __commonJS({ 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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", + no: 1, + name: "value", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 5, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, signedUploadUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: 0 }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81268,13 +87749,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* int32 value */ 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); + message.value = reader.int32(); break; default: let u = options.readUnknownField; @@ -81282,54 +87759,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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.value !== 0) + writer.tag(1, runtime_3.WireType.Varint).int32(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.MigrateArtifactResponse = new MigrateArtifactResponse$Type(); - var FinalizeMigratedArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.Int32Value = new Int32Value$Type(); + var UInt32Value$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [ + super("google.protobuf.UInt32Value", [ { 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", + name: "value", kind: "scalar", - T: 3 - /*ScalarType.INT64*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 13, void 0, "value"); + return target; + } create(value) { - const message = { workflowRunBackendId: "", name: "", size: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: 0 }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81337,17 +87813,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* uint32 value */ 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string name */ - 2: - message.name = reader.string(); - break; - case /* int64 size */ - 3: - message.size = reader.int64().toString(); + message.value = reader.uint32(); break; default: let u = options.readUnknownField; @@ -81355,49 +87823,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== 0) + writer.tag(1, runtime_3.WireType.Varint).uint32(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type(); - var FinalizeMigratedArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.UInt32Value = new UInt32Value$Type(); + var BoolValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [ + super("google.protobuf.BoolValue", [ { no: 1, - name: "ok", + name: "value", kind: "scalar", T: 8 /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "artifact_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ } ]); } + /** + * Encode `BoolValue` to JSON bool. + */ + internalJsonWrite(message, options) { + return message.value; + } + /** + * Decode `BoolValue` from JSON bool. + */ + internalJsonRead(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 8, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, artifactId: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: false }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81405,13 +87877,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* bool value */ 1: - message.ok = reader.bool(); - break; - case /* int64 artifact_id */ - 2: - message.artifactId = reader.int64().toString(); + message.value = reader.bool(); break; default: let u = options.readUnknownField; @@ -81419,62 +87887,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== false) + writer.tag(1, runtime_3.WireType.Varint).bool(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type(); - var CreateArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.BoolValue = new BoolValue$Type(); + var StringValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.CreateArtifactRequest", [ + super("google.protobuf.StringValue", [ { 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", + name: "value", 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*/ } ]); } + /** + * Encode `StringValue` to JSON string. + */ + internalJsonWrite(message, options) { + return message.value; + } + /** + * Decode `StringValue` from JSON string. + */ + internalJsonRead(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 9, void 0, "value"); + return target; + } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", version: 0 }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: "" }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81482,25 +87941,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* string value */ 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(); + message.value = reader.string(); break; default: let u = options.readUnknownField; @@ -81508,53 +87951,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== "") + writer.tag(1, runtime_3.WireType.LengthDelimited).string(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.CreateArtifactRequest = new CreateArtifactRequest$Type(); - var CreateArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.StringValue = new StringValue$Type(); + var BytesValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.CreateArtifactResponse", [ + super("google.protobuf.BytesValue", [ { no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "signed_upload_url", + name: "value", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 12, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, signedUploadUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -81562,13 +88005,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* bytes value */ 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); + message.value = reader.bytes(); break; default: let u = options.readUnknownField; @@ -81576,26 +88015,42 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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.value.length) + writer.tag(1, runtime_3.WireType.LengthDelimited).bytes(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.CreateArtifactResponse = new CreateArtifactResponse$Type(); - var FinalizeArtifactRequest$Type = class extends runtime_5.MessageType { + 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.FinalizeArtifactRequest", [ + super("github.actions.results.api.v1.MigrateArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -81605,30 +88060,16 @@ var require_artifact = __commonJS({ }, { 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 } + { no: 3, name: "expires_at", kind: "message", T: () => timestamp_1.Timestamp } ]); } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", size: "0" }; + 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); @@ -81643,21 +88084,13 @@ var require_artifact = __commonJS({ 1: message.workflowRunBackendId = reader.string(); break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; case /* string name */ - 3: + 2: 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); + 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; @@ -81673,24 +88106,20 @@ var require_artifact = __commonJS({ 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(); + 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.FinalizeArtifactRequest = new FinalizeArtifactRequest$Type(); - var FinalizeArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.MigrateArtifactRequest = new MigrateArtifactRequest$Type(); + var MigrateArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeArtifactResponse", [ + super("github.actions.results.api.v1.MigrateArtifactResponse", [ { no: 1, name: "ok", @@ -81700,15 +88129,15 @@ var require_artifact = __commonJS({ }, { no: 2, - name: "artifact_id", + name: "signed_upload_url", kind: "scalar", - T: 3 - /*ScalarType.INT64*/ + T: 9 + /*ScalarType.STRING*/ } ]); } create(value) { - const message = { ok: false, artifactId: "0" }; + 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); @@ -81723,9 +88152,9 @@ var require_artifact = __commonJS({ 1: message.ok = reader.bool(); break; - case /* int64 artifact_id */ + case /* string signed_upload_url */ 2: - message.artifactId = reader.int64().toString(); + message.signedUploadUrl = reader.string(); break; default: let u = options.readUnknownField; @@ -81741,18 +88170,18 @@ var require_artifact = __commonJS({ 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); + 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.FinalizeArtifactResponse = new FinalizeArtifactResponse$Type(); - var ListArtifactsRequest$Type = class extends runtime_5.MessageType { + exports2.MigrateArtifactResponse = new MigrateArtifactResponse$Type(); + var FinalizeMigratedArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.ListArtifactsRequest", [ + super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -81762,17 +88191,22 @@ var require_artifact = __commonJS({ }, { no: 2, - name: "workflow_job_run_backend_id", + name: "name", 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 } + { + no: 3, + name: "size", + kind: "scalar", + T: 3 + /*ScalarType.INT64*/ + } ]); } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "" }; + 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); @@ -81787,17 +88221,13 @@ var require_artifact = __commonJS({ 1: message.workflowRunBackendId = reader.string(); break; - case /* string workflow_job_run_backend_id */ + case /* string name */ 2: - message.workflowJobRunBackendId = reader.string(); + message.name = reader.string(); break; - case /* google.protobuf.StringValue name_filter */ + case /* int64 size */ 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); + message.size = reader.int64().toString(); break; default: let u = options.readUnknownField; @@ -81813,106 +88243,38 @@ var require_artifact = __commonJS({ 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(); + 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.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*/ - }, + } + }; + exports2.FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type(); + var FinalizeMigratedArtifactResponse$Type = class extends runtime_5.MessageType { + constructor() { + super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [ { - no: 4, - name: "name", + no: 1, + name: "ok", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + T: 8 + /*ScalarType.BOOL*/ }, { - no: 5, - name: "size", + no: 2, + name: "artifact_id", 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" }; + 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); @@ -81923,33 +88285,13 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* bool ok */ 1: - message.workflowRunBackendId = reader.string(); + message.ok = reader.bool(); break; - case /* string workflow_job_run_backend_id */ + case /* int64 artifact_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); + message.artifactId = reader.int64().toString(); break; default: let u = options.readUnknownField; @@ -81963,30 +88305,20 @@ var require_artifact = __commonJS({ 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(); + 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.ListArtifactsResponse_MonolithArtifact = new ListArtifactsResponse_MonolithArtifact$Type(); - var GetSignedArtifactURLRequest$Type = class extends runtime_5.MessageType { + exports2.FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type(); + var CreateArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.GetSignedArtifactURLRequest", [ + super("github.actions.results.api.v1.CreateArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -82007,11 +88339,19 @@ var require_artifact = __commonJS({ 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: "" }; + 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); @@ -82034,6 +88374,14 @@ var require_artifact = __commonJS({ 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") @@ -82052,19 +88400,30 @@ var require_artifact = __commonJS({ 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.GetSignedArtifactURLRequest = new GetSignedArtifactURLRequest$Type(); - var GetSignedArtifactURLResponse$Type = class extends runtime_5.MessageType { + exports2.CreateArtifactRequest = new CreateArtifactRequest$Type(); + var CreateArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.GetSignedArtifactURLResponse", [ + super("github.actions.results.api.v1.CreateArtifactResponse", [ { no: 1, - name: "signed_url", + name: "ok", + kind: "scalar", + T: 8 + /*ScalarType.BOOL*/ + }, + { + no: 2, + name: "signed_upload_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ @@ -82072,7 +88431,7 @@ var require_artifact = __commonJS({ ]); } create(value) { - const message = { signedUrl: "" }; + 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); @@ -82083,9 +88442,13 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string signed_url */ + case /* bool ok */ 1: - message.signedUrl = reader.string(); + message.ok = reader.bool(); + break; + case /* string signed_upload_url */ + 2: + message.signedUploadUrl = reader.string(); break; default: let u = options.readUnknownField; @@ -82099,18 +88462,20 @@ var require_artifact = __commonJS({ return message; } internalBinaryWrite(message, writer, options) { - if (message.signedUrl !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.signedUrl); + 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.GetSignedArtifactURLResponse = new GetSignedArtifactURLResponse$Type(); - var DeleteArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.CreateArtifactResponse = new CreateArtifactResponse$Type(); + var FinalizeArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.DeleteArtifactRequest", [ + super("github.actions.results.api.v1.FinalizeArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -82131,11 +88496,19 @@ var require_artifact = __commonJS({ 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: "" }; + 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); @@ -82158,6 +88531,14 @@ var require_artifact = __commonJS({ 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") @@ -82176,16 +88557,20 @@ var require_artifact = __commonJS({ 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.DeleteArtifactRequest = new DeleteArtifactRequest$Type(); - var DeleteArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.FinalizeArtifactRequest = new FinalizeArtifactRequest$Type(); + var FinalizeArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.DeleteArtifactResponse", [ + super("github.actions.results.api.v1.FinalizeArtifactResponse", [ { no: 1, name: "ok", @@ -82198,1129 +88583,819 @@ var require_artifact = __commonJS({ 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(request) { - const data = artifact_1.CreateArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.FinalizeArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.ListArtifactsRequest.toJson(request, { - 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(request) { - const data = artifact_1.GetSignedArtifactURLRequest.toJson(request, { - 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(request) { - const data = artifact_1.DeleteArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.CreateArtifactRequest.toBinary(request); - 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(request) { - const data = artifact_1.FinalizeArtifactRequest.toBinary(request); - 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(request) { - const data = artifact_1.ListArtifactsRequest.toBinary(request); - 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(request) { - const data = artifact_1.GetSignedArtifactURLRequest.toBinary(request); - 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(request) { - const data = artifact_1.DeleteArtifactRequest.toBinary(request); - 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 __createBinding4 = 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 __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar4(require_timestamp(), exports2); - __exportStar4(require_wrappers(), exports2); - __exportStar4(require_artifact(), exports2); - __exportStar4(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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getExpiration = getExpiration; - var generated_1 = require_generated(); - var core18 = __importStar4(require_core()); - function getExpiration(retentionDays) { - if (!retentionDays) { - return void 0; - } - const maxRetentionDays = getRetentionDays(); - if (maxRetentionDays && maxRetentionDays < retentionDays) { - core18.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); - } - 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.validateArtifactName = validateArtifactName; - exports2.validateFilePath = validateFilePath; - 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!`); - } - function validateFilePath(path15) { - if (!path15) { - throw new Error(`Provided file path input during validation is empty`); - } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path15.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path15}. 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. - `); - } - } - } - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/http-client/lib/proxy.js -var require_proxy6 = __commonJS({ - "node_modules/@actions/artifact/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 (_a) { - 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; + /*ScalarType.INT64*/ + } + ]); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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; } - 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; + 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; } - 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); + 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; } - get username() { - return this._decodedUsername; + }; + 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 } + ]); } - get password() { - return this._decodedPassword; + 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; } - }; - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/http-client/lib/index.js -var require_lib7 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + 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; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + 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 } + ]); } - return new (P || (P = Promise))(function(resolve8, 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); + 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); } } - function step(result) { - result.done ? resolve8(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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy6()); - var tunnel = __importStar4(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); + 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.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + 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 } + ]); } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(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", () => { - resolve8(output.toString()); - }); - })); - }); + 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; } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve8(Buffer.concat(chunks)); - }); - })); - }); + 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.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + 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*/ } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + ]); + } + 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; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + 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; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + 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*/ + } + ]); } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + 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; } - /** - * 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 __awaiter4(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); - }); + 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; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + }; + 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*/ + } + ]); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + 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); } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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; + return message; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve8(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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; } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info7.httpModule.request(info7.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(); + }; + 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*/ } - handleResult(new Error(`Request timeout: ${info7.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); + 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; } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); + 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 info7; + return message; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + 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; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + }; + 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); } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + CreateArtifact(request) { + const data = artifact_1.CreateArtifactRequest.toJson(request, { + 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 + })); } - _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")}` + FinalizeArtifact(request) { + const data = artifact_1.FinalizeArtifactRequest.toJson(request, { + 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 })); - this._proxyAgentDispatcher = proxyAgent; - if (usingSsl && this._ignoreSslError) { - proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { - rejectUnauthorized: false - }); - } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); + ListArtifacts(request) { + const data = artifact_1.ListArtifactsRequest.toJson(request, { + 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 })); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve8(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 { - resolve8(response); - } - })); + GetSignedArtifactURL(request) { + const data = artifact_1.GetSignedArtifactURLRequest.toJson(request, { + 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(request) { + const data = artifact_1.DeleteArtifactRequest.toJson(request, { + 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.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + 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(request) { + const data = artifact_1.CreateArtifactRequest.toBinary(request); + 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(request) { + const data = artifact_1.FinalizeArtifactRequest.toBinary(request); + 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(request) { + const data = artifact_1.ListArtifactsRequest.toBinary(request); + 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(request) { + const data = artifact_1.GetSignedArtifactURLRequest.toBinary(request); + 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(request) { + const data = artifact_1.DeleteArtifactRequest.toBinary(request); + 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/node_modules/@actions/http-client/lib/auth.js -var require_auth3 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// node_modules/@actions/artifact/lib/generated/index.js +var require_generated = __commonJS({ + "node_modules/@actions/artifact/lib/generated/index.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }); - exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; + __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]; + } }; } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + 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]); } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + __setModuleDefault2(result, mod); + return result; + }; + })(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getExpiration = getExpiration; + var generated_1 = require_generated(); + var core18 = __importStar2(require_core()); + function getExpiration(retentionDays) { + if (!retentionDays) { + return void 0; } - // 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}`; + const maxRetentionDays = getRetentionDays(); + if (maxRetentionDays && maxRetentionDays < retentionDays) { + core18.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`); + retentionDays = maxRetentionDays; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + const expirationDate = /* @__PURE__ */ new Date(); + expirationDate.setDate(expirationDate.getDate() + retentionDays); + return generated_1.Timestamp.fromDate(expirationDate); + } + function getRetentionDays() { + const retentionDays = process.env["GITHUB_RETENTION_DAYS"]; + if (!retentionDays) { + return void 0; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + const days = parseInt(retentionDays); + if (isNaN(days)) { + return void 0; } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + 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.validateArtifactName = validateArtifactName; + exports2.validateFilePath = validateFilePath; + 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`); } - // 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"); + 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.`); } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + (0, core_1.info)(`Artifact name is valid!`); + } + function validateFilePath(path16) { + if (!path16) { + throw new Error(`Provided file path input during validation is empty`); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { + if (path16.includes(invalidCharacterKey)) { + throw new Error(`The path for one of the files in artifact is not valid: ${path16}. 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.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + } } }); @@ -83329,7 +89404,7 @@ var require_package3 = __commonJS({ "node_modules/@actions/artifact/package.json"(exports2, module2) { module2.exports = { name: "@actions/artifact", - version: "4.0.0", + version: "5.0.1", preview: true, description: "Actions artifact lib", keywords: [ @@ -83369,11 +89444,10 @@ var require_package3 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.10.0", + "@actions/core": "^2.0.0", "@actions/github": "^6.0.1", - "@actions/http-client": "^2.1.0", - "@azure/core-http": "^3.0.5", - "@azure/storage-blob": "^12.15.0", + "@actions/http-client": "^3.0.0", + "@azure/storage-blob": "^12.29.1", "@octokit/core": "^5.2.1", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-retry": "^3.0.9", @@ -83547,10 +89621,10 @@ var require_jwt_decode_cjs = __commonJS({ }); // node_modules/@actions/artifact/lib/internal/shared/util.js -var require_util11 = __commonJS({ +var require_util10 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -83563,40 +89637,40 @@ var require_util11 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getBackendIdsFromToken = getBackendIdsFromToken; exports2.maskSigUrl = maskSigUrl; exports2.maskSecretUrls = maskSecretUrls; - var core18 = __importStar4(require_core()); + var core18 = __importStar2(require_core()); var config_1 = require_config2(); - var jwt_decode_1 = __importDefault4(require_jwt_decode_cjs()); + 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() { @@ -83637,8 +89711,8 @@ var require_util11 = __commonJS({ (0, core_1.setSecret)(signature); (0, core_1.setSecret)(encodeURIComponent(signature)); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url2} ${error4 instanceof Error ? error4.message : String(error4)}`); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url2} ${error3 instanceof Error ? error3.message : String(error3)}`); } } function maskSecretUrls(body) { @@ -83660,7 +89734,7 @@ var require_util11 = __commonJS({ var require_artifact_twirp_client2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -83689,14 +89763,14 @@ var require_artifact_twirp_client2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.internalArtifactTwirpClient = internalArtifactTwirpClient; - var http_client_1 = require_lib7(); - var auth_1 = require_auth3(); + 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 util_1 = require_util10(); var ArtifactHttpClient = class { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -83720,24 +89794,24 @@ var require_artifact_twirp_client2 = __commonJS({ // This function satisfies the Rpc interface. It is compatible with the JSON // JSON generated client. request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { + 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(() => __awaiter4(this, void 0, void 0, function* () { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { return this.httpClient.post(url2, JSON.stringify(data), headers); })); return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); } }); } retryableRequest(operation) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let attempt = 0; let errorMessage = ""; let rawBody = ""; @@ -83763,18 +89837,18 @@ var require_artifact_twirp_client2 = __commonJS({ } errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { + } catch (error3) { + if (error3 instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); } - if (error4 instanceof errors_1.UsageError) { - throw error4; + if (error3 instanceof errors_1.UsageError) { + throw error3; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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 = error4.message; + errorMessage = error3.message; } if (!isRetryable) { throw new Error(`Received non-retryable error: ${errorMessage}`); @@ -83808,7 +89882,7 @@ var require_artifact_twirp_client2 = __commonJS({ return retryableStatusCodes.includes(statusCode); } sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8) => setTimeout(resolve8, milliseconds)); }); } @@ -83835,7 +89909,7 @@ var require_artifact_twirp_client2 = __commonJS({ var require_upload_zip_specification = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/upload-zip-specification.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -83848,42 +89922,42 @@ var require_upload_zip_specification = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateRootDirectory = validateRootDirectory; exports2.getUploadZipSpecification = getUploadZipSpecification; - var fs17 = __importStar4(require("fs")); + var fs18 = __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 (!fs17.existsSync(rootDirectory)) { + if (!fs18.existsSync(rootDirectory)) { throw new Error(`The provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs17.statSync(rootDirectory).isDirectory()) { + if (!fs18.statSync(rootDirectory).isDirectory()) { throw new Error(`The provided rootDirectory ${rootDirectory} is not a valid directory`); } (0, core_1.info)(`Root directory input is valid!`); @@ -83893,7 +89967,7 @@ var require_upload_zip_specification = __commonJS({ rootDirectory = (0, path_1.normalize)(rootDirectory); rootDirectory = (0, path_1.resolve)(rootDirectory); for (let file of filesToZip) { - const stats = fs17.lstatSync(file, { throwIfNoEntry: false }); + const stats = fs18.lstatSync(file, { throwIfNoEntry: false }); if (!stats) { throw new Error(`File ${file} does not exist`); } @@ -83929,7 +90003,7 @@ var require_upload_zip_specification = __commonJS({ var require_blob_upload = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/blob-upload.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -83942,31 +90016,31 @@ var require_blob_upload = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -83995,18 +90069,18 @@ var require_blob_upload = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadZipToBlobStorage = uploadZipToBlobStorage; - var storage_blob_1 = require_dist7(); + var storage_blob_1 = require_commonjs15(); var config_1 = require_config2(); - var core18 = __importStar4(require_core()); - var crypto = __importStar4(require("crypto")); - var stream2 = __importStar4(require("stream")); + var core18 = __importStar2(require_core()); + var crypto2 = __importStar2(require("crypto")); + var stream2 = __importStar2(require("stream")); var errors_1 = require_errors3(); function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let uploadByteCount = 0; let lastProgressTime = Date.now(); const abortController = new AbortController(); - const chunkTimer = (interval) => __awaiter4(this, void 0, void 0, function* () { + const chunkTimer = (interval) => __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve8, reject) => { const timer = setInterval(() => { if (Date.now() - lastProgressTime > interval) { @@ -84036,7 +90110,7 @@ var require_blob_upload = __commonJS({ }; let sha256Hash = void 0; const uploadStream = new stream2.PassThrough(); - const hashStream = crypto.createHash("sha256"); + const hashStream = crypto2.createHash("sha256"); zipUploadStream.pipe(uploadStream); zipUploadStream.pipe(hashStream).setEncoding("hex"); core18.info("Beginning upload of artifact content to blob storage"); @@ -84045,11 +90119,11 @@ var require_blob_upload = __commonJS({ blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options), chunkTimer((0, config_1.getUploadChunkTimeout)()) ]); - } catch (error4) { - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + } 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 error4; + throw error3; } finally { abortController.abort(); } @@ -84133,7 +90207,7 @@ var require_brace_expansion2 = __commonJS({ function lte(i, y) { return i <= y; } - function gte5(i, y) { + function gte6(i, y) { return i >= y; } function expand(str2, isTop) { @@ -84183,7 +90257,7 @@ var require_brace_expansion2 = __commonJS({ var reverse = y < x; if (reverse) { incr *= -1; - test = gte5; + test = gte6; } var pad = n.some(isPadded); N = []; @@ -84238,9 +90312,9 @@ var require_minimatch2 = __commonJS({ return new Minimatch(pattern, options).match(p); }; module2.exports = minimatch; - var path15 = require_path(); - minimatch.sep = path15.sep; - var GLOBSTAR = Symbol("globstar **"); + var path16 = require_path(); + minimatch.sep = path16.sep; + var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; var expand = require_brace_expansion2(); var plTypes = { @@ -84304,7 +90378,7 @@ var require_minimatch2 = __commonJS({ throw new TypeError("pattern is too long"); } }; - var SUBPARSE = Symbol("subparse"); + var SUBPARSE = /* @__PURE__ */ Symbol("subparse"); minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe(); minimatch.match = (list, pattern, options = {}) => { const mm = new Minimatch(pattern, options); @@ -84748,8 +90822,8 @@ var require_minimatch2 = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; const options = this.options; - if (path15.sep !== "/") { - f = f.split(path15.sep).join("/"); + if (path16.sep !== "/") { + f = f.split(path16.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -84787,13 +90861,13 @@ var require_minimatch2 = __commonJS({ var require_readdir_glob = __commonJS({ "node_modules/readdir-glob/index.js"(exports2, module2) { module2.exports = readdirGlob; - var fs17 = require("fs"); + var fs18 = require("fs"); var { EventEmitter } = require("events"); var { Minimatch } = require_minimatch2(); var { resolve: resolve8 } = require("path"); function readdir(dir, strict) { return new Promise((resolve9, reject) => { - fs17.readdir(dir, { withFileTypes: true }, (err, files) => { + fs18.readdir(dir, { withFileTypes: true }, (err, files) => { if (err) { switch (err.code) { case "ENOTDIR": @@ -84826,7 +90900,7 @@ var require_readdir_glob = __commonJS({ } function stat(file, followSymlinks) { return new Promise((resolve9, reject) => { - const statFunc = followSymlinks ? fs17.stat : fs17.lstat; + const statFunc = followSymlinks ? fs18.stat : fs18.lstat; statFunc(file, (err, stats) => { if (err) { switch (err.code) { @@ -84847,8 +90921,8 @@ var require_readdir_glob = __commonJS({ }); }); } - async function* exploreWalkAsync(dir, path15, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir(path15 + dir, strict); + async function* exploreWalkAsync(dir, path16, followSymlinks, useStat, shouldSkip, strict) { + let files = await readdir(path16 + dir, strict); for (const file of files) { let name = file.name; if (name === void 0) { @@ -84857,7 +90931,7 @@ var require_readdir_glob = __commonJS({ } const filename = dir + "/" + name; const relative2 = filename.slice(1); - const absolute = path15 + "/" + relative2; + const absolute = path16 + "/" + relative2; let stats = null; if (useStat || followSymlinks) { stats = await stat(absolute, followSymlinks); @@ -84871,15 +90945,15 @@ var require_readdir_glob = __commonJS({ if (stats.isDirectory()) { if (!shouldSkip(relative2)) { yield { relative: relative2, absolute, stats }; - yield* exploreWalkAsync(filename, path15, followSymlinks, useStat, shouldSkip, false); + yield* exploreWalkAsync(filename, path16, followSymlinks, useStat, shouldSkip, false); } } else { yield { relative: relative2, absolute, stats }; } } } - async function* explore(path15, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync("", path15, followSymlinks, useStat, shouldSkip, true); + async function* explore(path16, followSymlinks, useStat, shouldSkip) { + yield* exploreWalkAsync("", path16, followSymlinks, useStat, shouldSkip, true); } function readOptions(options) { return { @@ -85070,9 +91144,9 @@ var require_async = __commonJS({ invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); }); } - function invokeCallback(callback, error4, value) { + function invokeCallback(callback, error3, value) { try { - callback(error4, value); + callback(error3, value); } catch (err) { setImmediate$1((e) => { throw e; @@ -85346,7 +91420,7 @@ var require_async = __commonJS({ } var mapSeries$1 = awaitify(mapSeries, 3); var applyEachSeries = applyEach$1(mapSeries$1); - const PROMISE_SYMBOL = Symbol("promiseCallback"); + const PROMISE_SYMBOL = /* @__PURE__ */ Symbol("promiseCallback"); function promiseCallback() { let resolve8, reject2; function callback(err, ...args) { @@ -85926,8 +92000,8 @@ var require_async = __commonJS({ var mapLimit$1 = awaitify(mapLimit, 4); function concatLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val2, iterCb) => { - _iteratee(val2, (err, ...args) => { + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { if (err) return iterCb(err); return iterCb(err, args); }); @@ -86133,10 +92207,10 @@ var require_async = __commonJS({ var forever$1 = awaitify(forever, 2); function groupByLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val2, iterCb) => { - _iteratee(val2, (err, key) => { + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { if (err) return iterCb(err); - return iterCb(err, { key, val: val2 }); + return iterCb(err, { key, val }); }); }, (err, mapResults) => { var result = {}; @@ -86144,11 +92218,11 @@ var require_async = __commonJS({ for (var i = 0; i < mapResults.length; i++) { if (mapResults[i]) { var { key } = mapResults[i]; - var { val: val2 } = mapResults[i]; + var { val } = mapResults[i]; if (hasOwnProperty.call(result, key)) { - result[key].push(val2); + result[key].push(val); } else { - result[key] = [val2]; + result[key] = [val]; } } } @@ -86167,8 +92241,8 @@ var require_async = __commonJS({ callback = once(callback); var newObj = {}; var _iteratee = wrapAsync(iteratee); - return eachOfLimit$2(limit)(obj, (val2, key, next) => { - _iteratee(val2, key, (err, result) => { + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { if (err) return next(err); newObj[key] = result; next(err); @@ -86378,10 +92452,10 @@ var require_async = __commonJS({ function reflect(fn) { var _fn = wrapAsync(fn); return initialParams(function reflectOn(args, reflectCallback) { - args.push((error4, ...cbArgs) => { + args.push((error3, ...cbArgs) => { let retVal = {}; - if (error4) { - retVal.error = error4; + if (error3) { + retVal.error = error3; } if (cbArgs.length > 0) { var value = cbArgs; @@ -86537,13 +92611,13 @@ var require_async = __commonJS({ var timer; function timeoutCallback() { var name = asyncFn.name || "anonymous"; - var error4 = new Error('Callback function "' + name + '" timed out.'); - error4.code = "ETIMEDOUT"; + var error3 = new Error('Callback function "' + name + '" timed out.'); + error3.code = "ETIMEDOUT"; if (info7) { - error4.info = info7; + error3.info = info7; } timedOut = true; - callback(error4); + callback(error3); } args.push((...cbArgs) => { if (!timedOut) { @@ -86586,7 +92660,7 @@ var require_async = __commonJS({ return callback[PROMISE_SYMBOL]; } function tryEach(tasks, callback) { - var error4 = null; + var error3 = null; var result; return eachSeries$1(tasks, (task, taskCb) => { wrapAsync(task)((err, ...args) => { @@ -86596,10 +92670,10 @@ var require_async = __commonJS({ } else { result = args; } - error4 = err; + error3 = err; taskCb(err ? null : {}); }); - }, () => callback(error4, result)); + }, () => callback(error3, result)); } var tryEach$1 = awaitify(tryEach); function unmemoize(fn) { @@ -86891,54 +92965,54 @@ var require_polyfills = __commonJS({ } var chdir; module2.exports = patch; - function patch(fs17) { + function patch(fs18) { if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs17); - } - if (!fs17.lutimes) { - patchLutimes(fs17); - } - fs17.chown = chownFix(fs17.chown); - fs17.fchown = chownFix(fs17.fchown); - fs17.lchown = chownFix(fs17.lchown); - fs17.chmod = chmodFix(fs17.chmod); - fs17.fchmod = chmodFix(fs17.fchmod); - fs17.lchmod = chmodFix(fs17.lchmod); - fs17.chownSync = chownFixSync(fs17.chownSync); - fs17.fchownSync = chownFixSync(fs17.fchownSync); - fs17.lchownSync = chownFixSync(fs17.lchownSync); - fs17.chmodSync = chmodFixSync(fs17.chmodSync); - fs17.fchmodSync = chmodFixSync(fs17.fchmodSync); - fs17.lchmodSync = chmodFixSync(fs17.lchmodSync); - fs17.stat = statFix(fs17.stat); - fs17.fstat = statFix(fs17.fstat); - fs17.lstat = statFix(fs17.lstat); - fs17.statSync = statFixSync(fs17.statSync); - fs17.fstatSync = statFixSync(fs17.fstatSync); - fs17.lstatSync = statFixSync(fs17.lstatSync); - if (fs17.chmod && !fs17.lchmod) { - fs17.lchmod = function(path15, mode, cb) { + patchLchmod(fs18); + } + if (!fs18.lutimes) { + patchLutimes(fs18); + } + fs18.chown = chownFix(fs18.chown); + fs18.fchown = chownFix(fs18.fchown); + fs18.lchown = chownFix(fs18.lchown); + fs18.chmod = chmodFix(fs18.chmod); + fs18.fchmod = chmodFix(fs18.fchmod); + fs18.lchmod = chmodFix(fs18.lchmod); + fs18.chownSync = chownFixSync(fs18.chownSync); + fs18.fchownSync = chownFixSync(fs18.fchownSync); + fs18.lchownSync = chownFixSync(fs18.lchownSync); + fs18.chmodSync = chmodFixSync(fs18.chmodSync); + fs18.fchmodSync = chmodFixSync(fs18.fchmodSync); + fs18.lchmodSync = chmodFixSync(fs18.lchmodSync); + fs18.stat = statFix(fs18.stat); + fs18.fstat = statFix(fs18.fstat); + fs18.lstat = statFix(fs18.lstat); + fs18.statSync = statFixSync(fs18.statSync); + fs18.fstatSync = statFixSync(fs18.fstatSync); + fs18.lstatSync = statFixSync(fs18.lstatSync); + if (fs18.chmod && !fs18.lchmod) { + fs18.lchmod = function(path16, mode, cb) { if (cb) process.nextTick(cb); }; - fs17.lchmodSync = function() { + fs18.lchmodSync = function() { }; } - if (fs17.chown && !fs17.lchown) { - fs17.lchown = function(path15, uid, gid, cb) { + if (fs18.chown && !fs18.lchown) { + fs18.lchown = function(path16, uid, gid, cb) { if (cb) process.nextTick(cb); }; - fs17.lchownSync = function() { + fs18.lchownSync = function() { }; } if (platform === "win32") { - fs17.rename = typeof fs17.rename !== "function" ? fs17.rename : (function(fs$rename) { + fs18.rename = typeof fs18.rename !== "function" ? fs18.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() { - fs17.stat(to, function(stater, st) { + fs18.stat(to, function(stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else @@ -86954,9 +93028,9 @@ var require_polyfills = __commonJS({ } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); return rename; - })(fs17.rename); + })(fs18.rename); } - fs17.read = typeof fs17.read !== "function" ? fs17.read : (function(fs$read) { + fs18.read = typeof fs18.read !== "function" ? fs18.read : (function(fs$read) { function read(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { @@ -86964,22 +93038,22 @@ var require_polyfills = __commonJS({ callback = function(er, _2, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; - return fs$read.call(fs17, fd, buffer, offset, length, position, callback); + return fs$read.call(fs18, fd, buffer, offset, length, position, callback); } callback_.apply(this, arguments); }; } - return fs$read.call(fs17, fd, buffer, offset, length, position, callback); + return fs$read.call(fs18, fd, buffer, offset, length, position, callback); } if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); return read; - })(fs17.read); - fs17.readSync = typeof fs17.readSync !== "function" ? fs17.readSync : /* @__PURE__ */ (function(fs$readSync) { + })(fs18.read); + fs18.readSync = typeof fs18.readSync !== "function" ? fs18.readSync : /* @__PURE__ */ (function(fs$readSync) { return function(fd, buffer, offset, length, position) { var eagCounter = 0; while (true) { try { - return fs$readSync.call(fs17, fd, buffer, offset, length, position); + return fs$readSync.call(fs18, fd, buffer, offset, length, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; @@ -86989,11 +93063,11 @@ var require_polyfills = __commonJS({ } } }; - })(fs17.readSync); - function patchLchmod(fs18) { - fs18.lchmod = function(path15, mode, callback) { - fs18.open( - path15, + })(fs18.readSync); + function patchLchmod(fs19) { + fs19.lchmod = function(path16, mode, callback) { + fs19.open( + path16, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { @@ -87001,80 +93075,80 @@ var require_polyfills = __commonJS({ if (callback) callback(err); return; } - fs18.fchmod(fd, mode, function(err2) { - fs18.close(fd, function(err22) { + fs19.fchmod(fd, mode, function(err2) { + fs19.close(fd, function(err22) { if (callback) callback(err2 || err22); }); }); } ); }; - fs18.lchmodSync = function(path15, mode) { - var fd = fs18.openSync(path15, constants.O_WRONLY | constants.O_SYMLINK, mode); + fs19.lchmodSync = function(path16, mode) { + var fd = fs19.openSync(path16, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret; try { - ret = fs18.fchmodSync(fd, mode); + ret = fs19.fchmodSync(fd, mode); threw = false; } finally { if (threw) { try { - fs18.closeSync(fd); + fs19.closeSync(fd); } catch (er) { } } else { - fs18.closeSync(fd); + fs19.closeSync(fd); } } return ret; }; } - function patchLutimes(fs18) { - if (constants.hasOwnProperty("O_SYMLINK") && fs18.futimes) { - fs18.lutimes = function(path15, at, mt, cb) { - fs18.open(path15, constants.O_SYMLINK, function(er, fd) { + function patchLutimes(fs19) { + if (constants.hasOwnProperty("O_SYMLINK") && fs19.futimes) { + fs19.lutimes = function(path16, at, mt, cb) { + fs19.open(path16, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; } - fs18.futimes(fd, at, mt, function(er2) { - fs18.close(fd, function(er22) { + fs19.futimes(fd, at, mt, function(er2) { + fs19.close(fd, function(er22) { if (cb) cb(er2 || er22); }); }); }); }; - fs18.lutimesSync = function(path15, at, mt) { - var fd = fs18.openSync(path15, constants.O_SYMLINK); + fs19.lutimesSync = function(path16, at, mt) { + var fd = fs19.openSync(path16, constants.O_SYMLINK); var ret; var threw = true; try { - ret = fs18.futimesSync(fd, at, mt); + ret = fs19.futimesSync(fd, at, mt); threw = false; } finally { if (threw) { try { - fs18.closeSync(fd); + fs19.closeSync(fd); } catch (er) { } } else { - fs18.closeSync(fd); + fs19.closeSync(fd); } } return ret; }; - } else if (fs18.futimes) { - fs18.lutimes = function(_a, _b, _c, cb) { + } else if (fs19.futimes) { + fs19.lutimes = function(_a, _b, _c, cb) { if (cb) process.nextTick(cb); }; - fs18.lutimesSync = function() { + fs19.lutimesSync = function() { }; } } function chmodFix(orig) { if (!orig) return orig; return function(target, mode, cb) { - return orig.call(fs17, target, mode, function(er) { + return orig.call(fs18, target, mode, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -87084,7 +93158,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, mode) { try { - return orig.call(fs17, target, mode); + return orig.call(fs18, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } @@ -87093,7 +93167,7 @@ var require_polyfills = __commonJS({ function chownFix(orig) { if (!orig) return orig; return function(target, uid, gid, cb) { - return orig.call(fs17, target, uid, gid, function(er) { + return orig.call(fs18, target, uid, gid, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -87103,7 +93177,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, uid, gid) { try { - return orig.call(fs17, target, uid, gid); + return orig.call(fs18, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } @@ -87123,13 +93197,13 @@ var require_polyfills = __commonJS({ } if (cb) cb.apply(this, arguments); } - return options ? orig.call(fs17, target, options, callback) : orig.call(fs17, target, callback); + return options ? orig.call(fs18, target, options, callback) : orig.call(fs18, target, callback); }; } function statFixSync(orig) { if (!orig) return orig; return function(target, options) { - var stats = options ? orig.call(fs17, target, options) : orig.call(fs17, target); + var stats = options ? orig.call(fs18, target, options) : orig.call(fs18, target); if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; @@ -87158,16 +93232,16 @@ var require_legacy_streams = __commonJS({ "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { var Stream = require("stream").Stream; module2.exports = legacy; - function legacy(fs17) { + function legacy(fs18) { return { ReadStream, WriteStream }; - function ReadStream(path15, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path15, options); + function ReadStream(path16, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path16, options); Stream.call(this); var self2 = this; - this.path = path15; + this.path = path16; this.fd = null; this.readable = true; this.paused = false; @@ -87201,7 +93275,7 @@ var require_legacy_streams = __commonJS({ }); return; } - fs17.open(this.path, this.flags, this.mode, function(err, fd) { + fs18.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self2.emit("error", err); self2.readable = false; @@ -87212,10 +93286,10 @@ var require_legacy_streams = __commonJS({ self2._read(); }); } - function WriteStream(path15, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path15, options); + function WriteStream(path16, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path16, options); Stream.call(this); - this.path = path15; + this.path = path16; this.fd = null; this.writable = true; this.flags = "w"; @@ -87240,7 +93314,7 @@ var require_legacy_streams = __commonJS({ this.busy = false; this._queue = []; if (this.fd === null) { - this._open = fs17.open; + this._open = fs18.open; this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); this.flush(); } @@ -87275,7 +93349,7 @@ var require_clone = __commonJS({ // node_modules/graceful-fs/graceful-fs.js var require_graceful_fs = __commonJS({ "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - var fs17 = require("fs"); + var fs18 = require("fs"); var polyfills = require_polyfills(); var legacy = require_legacy_streams(); var clone = require_clone(); @@ -87283,8 +93357,8 @@ var require_graceful_fs = __commonJS({ var gracefulQueue; var previousSymbol; if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = Symbol.for("graceful-fs.queue"); - previousSymbol = Symbol.for("graceful-fs.previous"); + gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"); + previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous"); } else { gracefulQueue = "___graceful-fs.queue"; previousSymbol = "___graceful-fs.previous"; @@ -87307,12 +93381,12 @@ var require_graceful_fs = __commonJS({ m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; - if (!fs17[gracefulQueue]) { + if (!fs18[gracefulQueue]) { queue = global[gracefulQueue] || []; - publishQueue(fs17, queue); - fs17.close = (function(fs$close) { + publishQueue(fs18, queue); + fs18.close = (function(fs$close) { function close(fd, cb) { - return fs$close.call(fs17, fd, function(err) { + return fs$close.call(fs18, fd, function(err) { if (!err) { resetQueue(); } @@ -87324,48 +93398,48 @@ var require_graceful_fs = __commonJS({ value: fs$close }); return close; - })(fs17.close); - fs17.closeSync = (function(fs$closeSync) { + })(fs18.close); + fs18.closeSync = (function(fs$closeSync) { function closeSync(fd) { - fs$closeSync.apply(fs17, arguments); + fs$closeSync.apply(fs18, arguments); resetQueue(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }); return closeSync; - })(fs17.closeSync); + })(fs18.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function() { - debug5(fs17[gracefulQueue]); - require("assert").equal(fs17[gracefulQueue].length, 0); + debug5(fs18[gracefulQueue]); + require("assert").equal(fs18[gracefulQueue].length, 0); }); } } var queue; if (!global[gracefulQueue]) { - publishQueue(global, fs17[gracefulQueue]); - } - module2.exports = patch(clone(fs17)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs17.__patched) { - module2.exports = patch(fs17); - fs17.__patched = true; - } - function patch(fs18) { - polyfills(fs18); - fs18.gracefulify = patch; - fs18.createReadStream = createReadStream2; - fs18.createWriteStream = createWriteStream2; - var fs$readFile = fs18.readFile; - fs18.readFile = readFile; - function readFile(path15, options, cb) { + publishQueue(global, fs18[gracefulQueue]); + } + module2.exports = patch(clone(fs18)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs18.__patched) { + module2.exports = patch(fs18); + fs18.__patched = true; + } + function patch(fs19) { + polyfills(fs19); + fs19.gracefulify = patch; + fs19.createReadStream = createReadStream2; + fs19.createWriteStream = createWriteStream3; + var fs$readFile = fs19.readFile; + fs19.readFile = readFile; + function readFile(path16, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$readFile(path15, options, cb); - function go$readFile(path16, options2, cb2, startTime) { - return fs$readFile(path16, options2, function(err) { + return go$readFile(path16, options, cb); + function go$readFile(path17, options2, cb2, startTime) { + return fs$readFile(path17, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path16, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$readFile, [path17, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -87373,16 +93447,16 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$writeFile = fs18.writeFile; - fs18.writeFile = writeFile; - function writeFile(path15, data, options, cb) { + var fs$writeFile = fs19.writeFile; + fs19.writeFile = writeFile; + function writeFile(path16, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$writeFile(path15, data, options, cb); - function go$writeFile(path16, data2, options2, cb2, startTime) { - return fs$writeFile(path16, data2, options2, function(err) { + return go$writeFile(path16, data, options, cb); + function go$writeFile(path17, data2, options2, cb2, startTime) { + return fs$writeFile(path17, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path16, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$writeFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -87390,17 +93464,17 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$appendFile = fs18.appendFile; + var fs$appendFile = fs19.appendFile; if (fs$appendFile) - fs18.appendFile = appendFile; - function appendFile(path15, data, options, cb) { + fs19.appendFile = appendFile; + function appendFile(path16, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$appendFile(path15, data, options, cb); - function go$appendFile(path16, data2, options2, cb2, startTime) { - return fs$appendFile(path16, data2, options2, function(err) { + return go$appendFile(path16, data, options, cb); + function go$appendFile(path17, data2, options2, cb2, startTime) { + return fs$appendFile(path17, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path16, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$appendFile, [path17, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -87408,9 +93482,9 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$copyFile = fs18.copyFile; + var fs$copyFile = fs19.copyFile; if (fs$copyFile) - fs18.copyFile = copyFile; + fs19.copyFile = copyFile; function copyFile(src, dest, flags, cb) { if (typeof flags === "function") { cb = flags; @@ -87428,34 +93502,34 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$readdir = fs18.readdir; - fs18.readdir = readdir; + var fs$readdir = fs19.readdir; + fs19.readdir = readdir; var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path15, options, cb) { + function readdir(path16, options, cb) { if (typeof options === "function") cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path16, options2, cb2, startTime) { - return fs$readdir(path16, fs$readdirCallback( - path16, + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path17, options2, cb2, startTime) { + return fs$readdir(path17, fs$readdirCallback( + path17, options2, cb2, startTime )); - } : function go$readdir2(path16, options2, cb2, startTime) { - return fs$readdir(path16, options2, fs$readdirCallback( - path16, + } : function go$readdir2(path17, options2, cb2, startTime) { + return fs$readdir(path17, options2, fs$readdirCallback( + path17, options2, cb2, startTime )); }; - return go$readdir(path15, options, cb); - function fs$readdirCallback(path16, options2, cb2, startTime) { + return go$readdir(path16, options, cb); + function fs$readdirCallback(path17, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, - [path16, options2, cb2], + [path17, options2, cb2], err, startTime || Date.now(), Date.now() @@ -87470,63 +93544,63 @@ var require_graceful_fs = __commonJS({ } } if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs18); + var legStreams = legacy(fs19); ReadStream = legStreams.ReadStream; WriteStream = legStreams.WriteStream; } - var fs$ReadStream = fs18.ReadStream; + var fs$ReadStream = fs19.ReadStream; if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype); ReadStream.prototype.open = ReadStream$open; } - var fs$WriteStream = fs18.WriteStream; + var fs$WriteStream = fs19.WriteStream; if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype); WriteStream.prototype.open = WriteStream$open; } - Object.defineProperty(fs18, "ReadStream", { + Object.defineProperty(fs19, "ReadStream", { get: function() { return ReadStream; }, - set: function(val2) { - ReadStream = val2; + set: function(val) { + ReadStream = val; }, enumerable: true, configurable: true }); - Object.defineProperty(fs18, "WriteStream", { + Object.defineProperty(fs19, "WriteStream", { get: function() { return WriteStream; }, - set: function(val2) { - WriteStream = val2; + set: function(val) { + WriteStream = val; }, enumerable: true, configurable: true }); var FileReadStream = ReadStream; - Object.defineProperty(fs18, "FileReadStream", { + Object.defineProperty(fs19, "FileReadStream", { get: function() { return FileReadStream; }, - set: function(val2) { - FileReadStream = val2; + set: function(val) { + FileReadStream = val; }, enumerable: true, configurable: true }); var FileWriteStream = WriteStream; - Object.defineProperty(fs18, "FileWriteStream", { + Object.defineProperty(fs19, "FileWriteStream", { get: function() { return FileWriteStream; }, - set: function(val2) { - FileWriteStream = val2; + set: function(val) { + FileWriteStream = val; }, enumerable: true, configurable: true }); - function ReadStream(path15, options) { + function ReadStream(path16, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else @@ -87546,7 +93620,7 @@ var require_graceful_fs = __commonJS({ } }); } - function WriteStream(path15, options) { + function WriteStream(path16, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else @@ -87564,22 +93638,22 @@ var require_graceful_fs = __commonJS({ } }); } - function createReadStream2(path15, options) { - return new fs18.ReadStream(path15, options); + function createReadStream2(path16, options) { + return new fs19.ReadStream(path16, options); } - function createWriteStream2(path15, options) { - return new fs18.WriteStream(path15, options); + function createWriteStream3(path16, options) { + return new fs19.WriteStream(path16, options); } - var fs$open = fs18.open; - fs18.open = open; - function open(path15, flags, mode, cb) { + var fs$open = fs19.open; + fs19.open = open; + function open(path16, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; - return go$open(path15, flags, mode, cb); - function go$open(path16, flags2, mode2, cb2, startTime) { - return fs$open(path16, flags2, mode2, function(err, fd) { + return go$open(path16, flags, mode, cb); + function go$open(path17, flags2, mode2, cb2, startTime) { + return fs$open(path17, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path16, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$open, [path17, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -87587,20 +93661,20 @@ var require_graceful_fs = __commonJS({ }); } } - return fs18; + return fs19; } function enqueue(elem) { debug5("ENQUEUE", elem[0].name, elem[1]); - fs17[gracefulQueue].push(elem); + fs18[gracefulQueue].push(elem); retry3(); } var retryTimer; function resetQueue() { var now = Date.now(); - for (var i = 0; i < fs17[gracefulQueue].length; ++i) { - if (fs17[gracefulQueue][i].length > 2) { - fs17[gracefulQueue][i][3] = now; - fs17[gracefulQueue][i][4] = now; + for (var i = 0; i < fs18[gracefulQueue].length; ++i) { + if (fs18[gracefulQueue][i].length > 2) { + fs18[gracefulQueue][i][3] = now; + fs18[gracefulQueue][i][4] = now; } } retry3(); @@ -87608,9 +93682,9 @@ var require_graceful_fs = __commonJS({ function retry3() { clearTimeout(retryTimer); retryTimer = void 0; - if (fs17[gracefulQueue].length === 0) + if (fs18[gracefulQueue].length === 0) return; - var elem = fs17[gracefulQueue].shift(); + var elem = fs18[gracefulQueue].shift(); var fn = elem[0]; var args = elem[1]; var err = elem[2]; @@ -87632,7 +93706,7 @@ var require_graceful_fs = __commonJS({ debug5("RETRY", fn.name, args); fn.apply(null, args.concat([startTime])); } else { - fs17[gracefulQueue].push(elem); + fs18[gracefulQueue].push(elem); } } if (retryTimer === void 0) { @@ -87775,7 +93849,7 @@ var require_safe_buffer = __commonJS({ }); // node_modules/core-util-is/lib/util.js -var require_util12 = __commonJS({ +var require_util11 = __commonJS({ "node_modules/core-util-is/lib/util.js"(exports2) { function isArray(arg) { if (Array.isArray) { @@ -87932,7 +94006,7 @@ var require_BufferList = __commonJS({ this.head = this.tail = null; this.length = 0; }; - BufferList.prototype.join = function join14(s) { + BufferList.prototype.join = function join15(s) { if (this.length === 0) return ""; var p = this.head; var ret = "" + p.data; @@ -88057,7 +94131,7 @@ var require_stream_writable = __commonJS({ var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; var Duplex; Writable.WritableState = WritableState; - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var internalUtil = { deprecate: require_node2() @@ -88493,7 +94567,7 @@ var require_stream_duplex = __commonJS({ return keys2; }; module2.exports = Duplex; - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var Readable2 = require_stream_readable(); var Writable = require_stream_writable(); @@ -88818,7 +94892,7 @@ var require_stream_readable = __commonJS({ function _isUint8Array(obj) { return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; } - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var debugUtil = require("util"); var debug5 = void 0; @@ -89487,7 +95561,7 @@ var require_stream_transform = __commonJS({ "use strict"; module2.exports = Transform; var Duplex = require_stream_duplex(); - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); util.inherits(Transform, Duplex); function afterTransform(er, data) { @@ -89587,7 +95661,7 @@ var require_stream_passthrough = __commonJS({ "use strict"; module2.exports = PassThrough; var Transform = require_stream_transform(); - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); util.inherits(PassThrough, Transform); function PassThrough(options) { @@ -89680,22 +95754,22 @@ var require_lazystream = __commonJS({ // node_modules/normalize-path/index.js var require_normalize_path = __commonJS({ "node_modules/normalize-path/index.js"(exports2, module2) { - module2.exports = function(path15, stripTrailing) { - if (typeof path15 !== "string") { + module2.exports = function(path16, stripTrailing) { + if (typeof path16 !== "string") { throw new TypeError("expected path to be a string"); } - if (path15 === "\\" || path15 === "/") return "/"; - var len = path15.length; - if (len <= 1) return path15; + if (path16 === "\\" || path16 === "/") return "/"; + var len = path16.length; + if (len <= 1) return path16; var prefix = ""; - if (len > 4 && path15[3] === "\\") { - var ch = path15[2]; - if ((ch === "?" || ch === ".") && path15.slice(0, 2) === "\\\\") { - path15 = path15.slice(2); + if (len > 4 && path16[3] === "\\") { + var ch = path16[2]; + if ((ch === "?" || ch === ".") && path16.slice(0, 2) === "\\\\") { + path16 = path16.slice(2); prefix = "//"; } } - var segs = path15.split(/[/\\]+/); + var segs = path16.split(/[/\\]+/); if (stripTrailing !== false && segs[segs.length - 1] === "") { segs.pop(); } @@ -90505,8 +96579,8 @@ var require_primordials = __commonJS({ PromiseReject(err) { return Promise.reject(err); }, - PromiseResolve(val2) { - return Promise.resolve(val2); + PromiseResolve(val) { + return Promise.resolve(val); }, ReflectApply: Reflect.apply, RegExpPrototypeTest(self2, value) { @@ -90531,8 +96605,8 @@ var require_primordials = __commonJS({ SymbolAsyncIterator: Symbol.asyncIterator, SymbolHasInstance: Symbol.hasInstance, SymbolIterator: Symbol.iterator, - SymbolDispose: Symbol.dispose || Symbol("Symbol.dispose"), - SymbolAsyncDispose: Symbol.asyncDispose || Symbol("Symbol.asyncDispose"), + SymbolDispose: Symbol.dispose || /* @__PURE__ */ Symbol("Symbol.dispose"), + SymbolAsyncDispose: Symbol.asyncDispose || /* @__PURE__ */ Symbol("Symbol.asyncDispose"), TypedArrayPrototypeSet(self2, buf, len) { return self2.set(buf, len); }, @@ -91211,7 +97285,7 @@ var require_abort_controller = __commonJS({ }); // node_modules/readable-stream/lib/ours/util.js -var require_util13 = __commonJS({ +var require_util12 = __commonJS({ "node_modules/readable-stream/lib/ours/util.js"(exports2, module2) { "use strict"; var bufferModule = require("buffer"); @@ -91394,7 +97468,7 @@ var require_util13 = __commonJS({ return ac.signal; } }; - module2.exports.promisify.custom = Symbol.for("nodejs.util.promisify.custom"); + module2.exports.promisify.custom = /* @__PURE__ */ Symbol.for("nodejs.util.promisify.custom"); } }); @@ -91402,9 +97476,9 @@ var require_util13 = __commonJS({ var require_errors4 = __commonJS({ "node_modules/readable-stream/lib/ours/errors.js"(exports2, module2) { "use strict"; - var { format, inspect, AggregateError: CustomAggregateError } = require_util13(); + var { format, inspect, AggregateError: CustomAggregateError } = require_util12(); var AggregateError = globalThis.AggregateError || CustomAggregateError; - var kIsNodeError = Symbol("kIsNodeError"); + var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); var kTypes = [ "string", "function", @@ -91425,14 +97499,14 @@ var require_errors4 = __commonJS({ throw new codes.ERR_INTERNAL_ASSERTION(message); } } - function addNumericalSeparator(val2) { + function addNumericalSeparator(val) { let res = ""; - let i = val2.length; - const start = val2[0] === "-" ? 1 : 0; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; for (; i >= start + 4; i -= 3) { - res = `_${val2.slice(i - 3, i)}${res}`; + res = `_${val.slice(i - 3, i)}${res}`; } - return `${val2.slice(0, i)}${res}`; + return `${val.slice(0, i)}${res}`; } function getMessage(key, msg, args) { if (typeof msg === "function") { @@ -91738,8 +97812,8 @@ var require_validators = __commonJS({ hideStackFrames, codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL } } = require_errors4(); - var { normalizeEncoding } = require_util13(); - var { isAsyncFunction, isArrayBufferView } = require_util13().types; + var { normalizeEncoding } = require_util12(); + var { isAsyncFunction, isArrayBufferView } = require_util12().types; var signals = {}; function isInt32(value) { return value === (value | 0); @@ -91986,7 +98060,7 @@ var require_process = __commonJS({ }); // node_modules/readable-stream/lib/internal/streams/utils.js -var require_utils6 = __commonJS({ +var require_utils9 = __commonJS({ "node_modules/readable-stream/lib/internal/streams/utils.js"(exports2, module2) { "use strict"; var { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require_primordials(); @@ -92200,7 +98274,7 @@ var require_end_of_stream = __commonJS({ var process2 = require_process(); var { AbortError, codes } = require_errors4(); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes; - var { kEmptyObject, once } = require_util13(); + var { kEmptyObject, once } = require_util12(); var { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require_validators(); var { Promise: Promise2, PromisePrototypeThen, SymbolDispose } = require_primordials(); var { @@ -92218,7 +98292,7 @@ var require_end_of_stream = __commonJS({ isNodeStream, willEmitClose: _willEmitClose, kIsClosedPromise - } = require_utils6(); + } = require_utils9(); var addAbortListener; function isRequest(stream2) { return stream2.setHeader && typeof stream2.abort === "function"; @@ -92373,7 +98447,7 @@ var require_end_of_stream = __commonJS({ if (options.signal.aborted) { process2.nextTick(abort); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(options.signal, abort); const originalCallback = callback; callback = once((...args) => { @@ -92400,7 +98474,7 @@ var require_end_of_stream = __commonJS({ if (options.signal.aborted) { process2.nextTick(abort); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(options.signal, abort); const originalCallback = callback; callback = once((...args) => { @@ -92456,7 +98530,7 @@ var require_destroy2 = __commonJS({ AbortError } = require_errors4(); var { Symbol: Symbol2 } = require_primordials(); - var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils6(); + var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils9(); var kDestroy = Symbol2("kDestroy"); var kConstruct = Symbol2("kConstruct"); function checkError(err, w, r) { @@ -92794,7 +98868,7 @@ var require_add_abort_signal = __commonJS({ "use strict"; var { SymbolDispose } = require_primordials(); var { AbortError, codes } = require_errors4(); - var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils6(); + var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils9(); var eos = require_end_of_stream(); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes; var addAbortListener; @@ -92830,7 +98904,7 @@ var require_add_abort_signal = __commonJS({ if (signal.aborted) { onAbort(); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(signal, onAbort); eos(stream2, disposable[SymbolDispose]); } @@ -92845,7 +98919,7 @@ var require_buffer_list = __commonJS({ "use strict"; var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials(); var { Buffer: Buffer2 } = require("buffer"); - var { inspect } = require_util13(); + var { inspect } = require_util12(); module2.exports = class BufferList { constructor() { this.head = null; @@ -92981,7 +99055,7 @@ var require_buffer_list = __commonJS({ return ret; } // Make sure the linked list only shows the minimal necessary information. - [Symbol.for("nodejs.util.inspect.custom")](_2, options) { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_2, options) { return inspect(this, { ...options, // Only inspect one level. @@ -93079,19 +99153,19 @@ var require_from = __commonJS({ next(); } }; - readable._destroy = function(error4, cb) { + readable._destroy = function(error3, cb) { PromisePrototypeThen( - close(error4), - () => process2.nextTick(cb, error4), + close(error3), + () => process2.nextTick(cb, error3), // nextTick is here in case cb throws - (e) => process2.nextTick(cb, e || error4) + (e) => process2.nextTick(cb, e || error3) ); }; - async function close(error4) { - const hadError = error4 !== void 0 && error4 !== null; + async function close(error3) { + const hadError = error3 !== void 0 && error3 !== null; const hasThrow = typeof iterator.throw === "function"; if (hadError && hasThrow) { - const { value, done } = await iterator.throw(error4); + const { value, done } = await iterator.throw(error3); await value; if (done) { return; @@ -93156,7 +99230,7 @@ var require_readable3 = __commonJS({ var { Buffer: Buffer2 } = require("buffer"); var { addAbortSignal } = require_add_abort_signal(); var eos = require_end_of_stream(); - var debug5 = require_util13().debuglog("stream", (fn) => { + var debug5 = require_util12().debuglog("stream", (fn) => { debug5 = fn; }); var BufferList = require_buffer_list(); @@ -93299,12 +99373,12 @@ var require_readable3 = __commonJS({ this.destroy(err); }; Readable2.prototype[SymbolAsyncDispose] = function() { - let error4; + let error3; if (!this.destroyed) { - error4 = this.readableEnded ? null : new AbortError(); - this.destroy(error4); + error3 = this.readableEnded ? null : new AbortError(); + this.destroy(error3); } - return new Promise2((resolve8, reject) => eos(this, (err) => err && err !== error4 ? reject(err) : resolve8(null))); + return new Promise2((resolve8, reject) => eos(this, (err) => err && err !== error3 ? reject(err) : resolve8(null))); }; Readable2.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); @@ -93857,14 +99931,14 @@ var require_readable3 = __commonJS({ } } stream2.on("readable", next); - let error4; + let error3; const cleanup = eos( stream2, { writable: false }, (err) => { - error4 = err ? aggregateTwoErrors(error4, err) : null; + error3 = err ? aggregateTwoErrors(error3, err) : null; callback(); callback = nop; } @@ -93874,19 +99948,19 @@ var require_readable3 = __commonJS({ const chunk = stream2.destroyed ? null : stream2.read(); if (chunk !== null) { yield chunk; - } else if (error4) { - throw error4; - } else if (error4 === null) { + } else if (error3) { + throw error3; + } else if (error3 === null) { return; } else { await new Promise2(next); } } } catch (err) { - error4 = aggregateTwoErrors(error4, err); - throw error4; + error3 = aggregateTwoErrors(error3, err); + throw error3; } finally { - if ((error4 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error4 === void 0 || stream2._readableState.autoDestroy)) { + 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); @@ -93901,9 +99975,9 @@ var require_readable3 = __commonJS({ const r = this._readableState; return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted; }, - set(val2) { + set(val) { if (this._readableState) { - this._readableState.readable = !!val2; + this._readableState.readable = !!val; } } }, @@ -94615,9 +100689,9 @@ var require_writable = __commonJS({ const w = this._writableState; return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; }, - set(val2) { + set(val) { if (this._writableState) { - this._writableState.writable = !!val2; + this._writableState.writable = !!val; } } }, @@ -94731,7 +100805,7 @@ var require_duplexify = __commonJS({ isDuplexNodeStream, isReadableStream, isWritableStream - } = require_utils6(); + } = require_utils9(); var eos = require_end_of_stream(); var { AbortError, @@ -94741,7 +100815,7 @@ var require_duplexify = __commonJS({ var Duplex = require_duplex(); var Readable2 = require_readable3(); var Writable = require_writable(); - var { createDeferredPromise } = require_util13(); + var { createDeferredPromise } = require_util12(); var from = require_from(); var Blob2 = globalThis.Blob || bufferModule.Blob; var isBlob = typeof Blob2 !== "undefined" ? function isBlob2(b) { @@ -94814,9 +100888,9 @@ var require_duplexify = __commonJS({ const promise = FunctionPrototypeCall( then2, value, - (val2) => { - if (val2 != null) { - throw new ERR_INVALID_RETURN_VALUE("nully", "body", val2); + (val) => { + if (val != null) { + throw new ERR_INVALID_RETURN_VALUE("nully", "body", val); } }, (err) => { @@ -94870,9 +100944,9 @@ var require_duplexify = __commonJS({ FunctionPrototypeCall( then, body, - (val2) => { - if (val2 != null) { - d.push(val2); + (val) => { + if (val != null) { + d.push(val); } d.push(null); }, @@ -95255,13 +101329,13 @@ var require_transform = __commonJS({ const rState = this._readableState; const wState = this._writableState; const length = rState.length; - this._transform(chunk, encoding, (err, val2) => { + this._transform(chunk, encoding, (err, val) => { if (err) { callback(err); return; } - if (val2 != null) { - this.push(val2); + if (val != null) { + this.push(val); } if (wState.ended || // Backwards compat. length === rState.length || // Backwards compat. @@ -95302,12 +101376,12 @@ var require_passthrough2 = __commonJS({ }); // node_modules/readable-stream/lib/internal/streams/pipeline.js -var require_pipeline3 = __commonJS({ +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 { once } = require_util12(); var destroyImpl = require_destroy2(); var Duplex = require_duplex(); var { @@ -95331,7 +101405,7 @@ var require_pipeline3 = __commonJS({ isWebStream, isReadableStream, isReadableFinished - } = require_utils6(); + } = require_utils9(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough; var Readable2; @@ -95364,26 +101438,26 @@ var require_pipeline3 = __commonJS({ validateFunction(streams[streams.length - 1], "streams[stream.length - 1]"); return streams.pop(); } - function makeAsyncIterable(val2) { - if (isIterable(val2)) { - return val2; - } else if (isReadableNodeStream(val2)) { - return fromReadable(val2); + function makeAsyncIterable(val) { + if (isIterable(val)) { + return val; + } else if (isReadableNodeStream(val)) { + return fromReadable(val); } - throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val2); + throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val); } - async function* fromReadable(val2) { + async function* fromReadable(val) { if (!Readable2) { Readable2 = require_readable3(); } - yield* Readable2.prototype[SymbolAsyncIterator].call(val2); + yield* Readable2.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { - let error4; + let error3; let onresolve = null; const resume = (err) => { if (err) { - error4 = err; + error3 = err; } if (onresolve) { const callback = onresolve; @@ -95392,12 +101466,12 @@ var require_pipeline3 = __commonJS({ } }; const wait = () => new Promise2((resolve8, reject) => { - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { onresolve = () => { - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve8(); } @@ -95427,7 +101501,7 @@ var require_pipeline3 = __commonJS({ } finish(); } catch (err) { - finish(error4 !== err ? aggregateTwoErrors(error4, err) : err); + finish(error3 !== err ? aggregateTwoErrors(error3, err) : err); } finally { cleanup(); writable.off("drain", resume); @@ -95476,12 +101550,12 @@ var require_pipeline3 = __commonJS({ function abort() { finishImpl(new AbortError()); } - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; let disposable; if (outerSignal) { disposable = addAbortListener(outerSignal, abort); } - let error4; + let error3; let value; const destroys = []; let finishCount = 0; @@ -95490,23 +101564,23 @@ var require_pipeline3 = __commonJS({ } function finishImpl(err, final) { var _disposable; - if (err && (!error4 || error4.code === "ERR_STREAM_PREMATURE_CLOSE")) { - error4 = err; + if (err && (!error3 || error3.code === "ERR_STREAM_PREMATURE_CLOSE")) { + error3 = err; } - if (!error4 && !final) { + if (!error3 && !final) { return; } while (destroys.length) { - destroys.shift()(error4); + destroys.shift()(error3); } ; (_disposable = disposable) === null || _disposable === void 0 ? void 0 : _disposable[SymbolDispose](); ac.abort(); if (final) { - if (!error4) { + if (!error3) { lastStreamCleanup.forEach((fn) => fn()); } - process2.nextTick(callback, error4, value); + process2.nextTick(callback, error3, value); } } let ret; @@ -95577,10 +101651,10 @@ var require_pipeline3 = __commonJS({ finishCount++; then.call( ret, - (val2) => { - value = val2; - if (val2 != null) { - pt.write(val2); + (val) => { + value = val; + if (val != null) { + pt.write(val); } if (end) { pt.end(); @@ -95733,7 +101807,7 @@ var require_pipeline3 = __commonJS({ var require_compose = __commonJS({ "node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) { "use strict"; - var { pipeline } = require_pipeline3(); + var { pipeline } = require_pipeline4(); var Duplex = require_duplex(); var { destroyer } = require_destroy2(); var { @@ -95744,7 +101818,7 @@ var require_compose = __commonJS({ isTransformStream, isWritableStream, isReadableStream - } = require_utils6(); + } = require_utils9(); var { AbortError, codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS } @@ -95937,8 +102011,8 @@ var require_operators = __commonJS({ var { finished } = require_end_of_stream(); var staticCompose = require_compose(); var { addAbortSignalNoValidate } = require_add_abort_signal(); - var { isWritable, isNodeStream } = require_utils6(); - var { deprecate } = require_util13(); + var { isWritable, isNodeStream } = require_utils9(); + var { deprecate } = require_util12(); var { ArrayPrototypePush, Boolean: Boolean2, @@ -95991,7 +102065,7 @@ var require_operators = __commonJS({ validateInteger(highWaterMark, "options.highWaterMark", 0); highWaterMark += concurrency; return async function* map3() { - const signal = require_util13().AbortSignalAny( + const signal = require_util12().AbortSignalAny( [options === null || options === void 0 ? void 0 : options.signal].filter(Boolean2) ); const stream2 = this; @@ -96019,7 +102093,7 @@ var require_operators = __commonJS({ } async function pump() { try { - for await (let val2 of stream2) { + for await (let val of stream2) { if (done) { return; } @@ -96027,17 +102101,17 @@ var require_operators = __commonJS({ throw new AbortError(); } try { - val2 = fn(val2, signalOpt); - if (val2 === kEmpty) { + val = fn(val, signalOpt); + if (val === kEmpty) { continue; } - val2 = PromiseResolve(val2); + val = PromiseResolve(val); } catch (err) { - val2 = PromiseReject(err); + val = PromiseReject(err); } cnt += 1; - PromisePrototypeThen(val2, afterItemProcessed, onCatch); - queue.push(val2); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue.push(val); if (next) { next(); next = null; @@ -96050,9 +102124,9 @@ var require_operators = __commonJS({ } queue.push(kEof); } catch (err) { - const val2 = PromiseReject(err); - PromisePrototypeThen(val2, afterItemProcessed, onCatch); - queue.push(val2); + const val = PromiseReject(err); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue.push(val); } finally { done = true; if (next) { @@ -96065,15 +102139,15 @@ var require_operators = __commonJS({ try { while (true) { while (queue.length > 0) { - const val2 = await queue[0]; - if (val2 === kEof) { + const val = await queue[0]; + if (val === kEof) { return; } if (signal.aborted) { throw new AbortError(); } - if (val2 !== kEmpty) { - yield val2; + if (val !== kEmpty) { + yield val; } queue.shift(); maybeResume(); @@ -96100,14 +102174,14 @@ var require_operators = __commonJS({ } return async function* asIndexedPairs2() { let index = 0; - for await (const val2 of this) { + 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 [index++, val2]; + yield [index++, val]; } }.call(this); } @@ -96227,22 +102301,22 @@ var require_operators = __commonJS({ validateAbortSignal(options.signal, "options.signal"); } const result = []; - for await (const val2 of this) { + 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, val2); + ArrayPrototypePush(result, val); } return result; } function flatMap(fn, options) { const values = map2.call(this, fn, options); return async function* flatMap2() { - for await (const val2 of values) { - yield* val2; + for await (const val of values) { + yield* val; } }.call(this); } @@ -96269,13 +102343,13 @@ var require_operators = __commonJS({ if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) { throw new AbortError(); } - for await (const val2 of this) { + 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 (number-- <= 0) { - yield val2; + yield val; } } }.call(this); @@ -96293,13 +102367,13 @@ var require_operators = __commonJS({ if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted) { throw new AbortError(); } - for await (const val2 of this) { + 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 (number-- > 0) { - yield val2; + yield val; } if (number <= 0) { return; @@ -96332,8 +102406,8 @@ 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_utils6(); - var { pipelineImpl: pl } = require_pipeline3(); + var { isIterable, isNodeStream, isWebStream } = require_utils9(); + var { pipelineImpl: pl } = require_pipeline4(); var { finished } = require_end_of_stream(); require_stream2(); function pipeline(...streams) { @@ -96376,18 +102450,18 @@ var require_stream2 = __commonJS({ var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(); var { promisify: { custom: customPromisify } - } = require_util13(); + } = require_util12(); var { streamReturningOperators, promiseReturningOperators } = require_operators(); var { codes: { ERR_ILLEGAL_CONSTRUCTOR } } = require_errors4(); var compose = require_compose(); var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state3(); - var { pipeline } = require_pipeline3(); + var { pipeline } = require_pipeline4(); var { destroyer } = require_destroy2(); var eos = require_end_of_stream(); var promises5 = require_promises(); - var utils = require_utils6(); + var utils = require_utils9(); var Stream = module2.exports = require_legacy().Stream; Stream.isDestroyed = utils.isDestroyed; Stream.isDisturbed = utils.isDisturbed; @@ -97356,52 +103430,128 @@ var require_isPlainObject = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/brace-expansion/index.js -var require_brace_expansion3 = __commonJS({ - "node_modules/archiver-utils/node_modules/brace-expansion/index.js"(exports2, module2) { - var balanced = require_balanced_match(); - module2.exports = expandTop; +// node_modules/@isaacs/balanced-match/dist/commonjs/index.js +var require_commonjs18 = __commonJS({ + "node_modules/@isaacs/balanced-match/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.range = exports2.balanced = void 0; + var balanced = (a, b, str2) => { + const ma = a instanceof RegExp ? maybeMatch(a, str2) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str2) : b; + const r = ma !== null && mb != null && (0, exports2.range)(ma, mb, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + ma.length, r[1]), + post: str2.slice(r[1] + mb.length) + }; + }; + exports2.balanced = balanced; + var maybeMatch = (reg, str2) => { + const m = str2.match(reg); + return m ? m[0] : null; + }; + var range = (a, b, str2) => { + let begs, beg, left, right = void 0, result; + let ai = str2.indexOf(a); + let bi = str2.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str2.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 = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== void 0) { + result = [left, right]; + } + } + return result; + }; + exports2.range = range; + } +}); + +// node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +var require_commonjs19 = __commonJS({ + "node_modules/@isaacs/brace-expansion/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.expand = expand; + var balanced_match_1 = require_commonjs18(); 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; function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + return !isNaN(str2) ? parseInt(str2, 10) : str2.charCodeAt(0); } function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + return str2.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod); } function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + return str2.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, "."); } function parseCommaParts(str2) { - if (!str2) + if (!str2) { return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) + } + const parts = []; + const m = (0, balanced_match_1.balanced)("{", "}", str2); + if (!m) { return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); + } + const { pre, body, post } = m; + const p = pre.split(","); p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); + 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 expandTop(str2) { - if (!str2) + function expand(str2) { + if (!str2) { return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); } - return expand(escapeBraces(str2), true).map(unescapeBraces); + if (str2.slice(0, 2) === "{}") { + str2 = "\\{\\}" + str2.slice(2); + } + return expand_(escapeBraces(str2), true).map(unescapeBraces); } function embrace(str2) { return "{" + str2 + "}"; @@ -97412,76 +103562,77 @@ var require_brace_expansion3 = __commonJS({ function lte(i, y) { return i <= y; } - function gte5(i, y) { + function gte6(i, y) { return i >= y; } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m) return [str2]; - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; + function expand_(str2, isTop) { + const expansions = []; + const m = (0, balanced_match_1.balanced)("{", "}", str2); + if (!m) + return [str2]; + const pre = m.pre; + const post = m.post.length ? expand_(m.post, false) : [""]; if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + "{" + m.body + "}" + post[k]; + for (let k = 0; k < post.length; k++) { + const expansion = pre + "{" + m.body + "}" + post[k]; expansions.push(expansion); } } else { - 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; + 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(/,(?!,).*\}/)) { str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); + return expand_(str2); } return [str2]; } - var n; + let n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); + if (n.length === 1 && n[0] !== void 0) { + n = expand_(n[0], false).map(embrace); if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); + return post.map((p) => m.pre + n[0] + p); } } } - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; + let N; + if (isSequence && n[0] !== void 0 && n[1] !== void 0) { + 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.abs(numeric(n[2])) : 1; + let test = lte; + const reverse = y < x; if (reverse) { incr *= -1; - test = gte5; + test = gte6; } - var pad = n.some(isPadded); + const pad = n.some(isPadded); N = []; - for (var i = x; test(i, y); i += incr) { - var c; + for (let i = x; test(i, y); i += incr) { + let c; if (isAlphaSequence) { c = String.fromCharCode(i); - if (c === "\\") + if (c === "\\") { c = ""; + } } else { c = String(i); if (pad) { - var need = width - c.length; + const need = width - c.length; if (need > 0) { - var z = new Array(need + 1).join("0"); - if (i < 0) + const z = new Array(need + 1).join("0"); + if (i < 0) { c = "-" + z + c.slice(1); - else + } else { c = z + c; + } } } } @@ -97489,15 +103640,16 @@ var require_brace_expansion3 = __commonJS({ } } else { N = []; - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], false)); } } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { expansions.push(expansion); + } } } } @@ -97506,9 +103658,9 @@ var require_brace_expansion3 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js var require_assert_valid_pattern = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.assertValidPattern = void 0; @@ -97525,9 +103677,9 @@ var require_assert_valid_pattern = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/brace-expressions.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js var require_brace_expressions = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseClass = void 0; @@ -97642,22 +103794,25 @@ var require_brace_expressions = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/unescape.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js var require_unescape = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/unescape.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = void 0; - var unescape = (s, { windowsPathsNoEscape = false } = {}) => { - return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"); + var unescape = (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"); }; exports2.unescape = unescape; } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/ast.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js var require_ast = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; @@ -98013,7 +104168,7 @@ var require_ast = __commonJS({ if (this.#root === this) this.#fillNegs(); if (!this.type) { - const noEmpty = this.isStart() && this.isEnd(); + 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" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; @@ -98123,10 +104278,7 @@ var require_ast = __commonJS({ } } if (c === "*") { - if (noEmpty && glob2 === "*") - re += starNoEmpty; - else - re += star; + re += noEmpty && glob2 === "*" ? starNoEmpty : star; hasMagic = true; continue; } @@ -98144,29 +104296,29 @@ var require_ast = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/escape.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js var require_escape = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/escape.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.escape = void 0; - var escape = (s, { windowsPathsNoEscape = false } = {}) => { + var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { + if (magicalBraces) { + return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&"); + } return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); }; exports2.escape = escape; } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/index.js -var require_commonjs13 = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/index.js"(exports2) { +// node_modules/glob/node_modules/minimatch/dist/commonjs/index.js +var require_commonjs20 = __commonJS({ + "node_modules/glob/node_modules/minimatch/dist/commonjs/index.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = exports2.escape = exports2.AST = exports2.Minimatch = exports2.match = exports2.makeRe = exports2.braceExpand = exports2.defaults = exports2.filter = exports2.GLOBSTAR = exports2.sep = exports2.minimatch = void 0; - var brace_expansion_1 = __importDefault4(require_brace_expansion3()); + var brace_expansion_1 = require_commonjs19(); var assert_valid_pattern_js_1 = require_assert_valid_pattern(); var ast_js_1 = require_ast(); var escape_js_1 = require_escape(); @@ -98230,13 +104382,13 @@ var require_commonjs13 = __commonJS({ 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 path15 = { + var path16 = { win32: { sep: "\\" }, posix: { sep: "/" } }; - exports2.sep = defaultPlatform === "win32" ? path15.win32.sep : path15.posix.sep; + exports2.sep = defaultPlatform === "win32" ? path16.win32.sep : path16.posix.sep; exports2.minimatch.sep = exports2.sep; - exports2.GLOBSTAR = Symbol("globstar **"); + exports2.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); exports2.minimatch.GLOBSTAR = exports2.GLOBSTAR; var qmark = "[^/]"; var star = qmark + "*?"; @@ -98289,7 +104441,7 @@ var require_commonjs13 = __commonJS({ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } - return (0, brace_expansion_1.default)(pattern); + return (0, brace_expansion_1.expand)(pattern); }; exports2.braceExpand = braceExpand; exports2.minimatch.braceExpand = exports2.braceExpand; @@ -98813,16 +104965,27 @@ var require_commonjs13 = __commonJS({ pp[i] = twoStar; } } else if (next === void 0) { - pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?"; + pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?"; } else if (next !== exports2.GLOBSTAR) { pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next; pp[i + 1] = exports2.GLOBSTAR; } }); - return pp.filter((p) => p !== exports2.GLOBSTAR).join("/"); + const filtered = pp.filter((p) => p !== exports2.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] = set2.length > 1 ? ["(?:", ")"] : ["", ""]; re = "^" + open + re + close + "$"; + if (this.partial) { + re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$"; + } if (this.negate) re = "^(?!" + re + ").+$"; try { @@ -98909,9 +105072,9 @@ var require_commonjs13 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/lru-cache/dist/commonjs/index.js -var require_commonjs14 = __commonJS({ - "node_modules/archiver-utils/node_modules/lru-cache/dist/commonjs/index.js"(exports2) { +// node_modules/lru-cache/dist/commonjs/index.js +var require_commonjs21 = __commonJS({ + "node_modules/lru-cache/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.LRUCache = void 0; @@ -98958,7 +105121,6 @@ var require_commonjs14 = __commonJS({ }; } var shouldWarn = (code) => !warned.has(code); - var TYPE = Symbol("type"); var isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; var ZeroArray = class extends Array { @@ -99000,6 +105162,7 @@ var require_commonjs14 = __commonJS({ #max; #maxSize; #dispose; + #onInsert; #disposeAfter; #fetchMethod; #memoMethod; @@ -99081,6 +105244,7 @@ var require_commonjs14 = __commonJS({ #hasDispose; #hasFetchMethod; #hasDisposeAfter; + #hasOnInsert; /** * Do not call this method unless you need to inspect the * inner workings of the cache. If anything returned by this @@ -99157,6 +105321,12 @@ var require_commonjs14 = __commonJS({ get dispose() { return this.#dispose; } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } /** * {@link LRUCache.OptionsBase.disposeAfter} (read-only) */ @@ -99164,7 +105334,7 @@ var require_commonjs14 = __commonJS({ return this.#disposeAfter; } constructor(options) { - const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; if (max !== 0 && !isPosInt(max)) { throw new TypeError("max option must be a nonnegative integer"); } @@ -99206,6 +105376,9 @@ var require_commonjs14 = __commonJS({ if (typeof dispose === "function") { this.#dispose = dispose; } + if (typeof onInsert === "function") { + this.#onInsert = onInsert; + } if (typeof disposeAfter === "function") { this.#disposeAfter = disposeAfter; this.#disposed = []; @@ -99214,6 +105387,7 @@ var require_commonjs14 = __commonJS({ this.#disposed = void 0; } this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; this.#hasDisposeAfter = !!this.#disposeAfter; this.noDisposeOnSet = !!noDisposeOnSet; this.noUpdateTTL = !!noUpdateTTL; @@ -99616,7 +105790,7 @@ var require_commonjs14 = __commonJS({ } /** * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to {@link LRLUCache#load}. + * passed to {@link LRUCache#load}. * * The `start` fields are calculated relative to a portable `Date.now()` * timestamp, even if `performance.now()` is available. @@ -99727,6 +105901,9 @@ var require_commonjs14 = __commonJS({ if (status) status.set = "add"; noUpdateTTL = false; + if (this.#hasOnInsert) { + this.#onInsert?.(v, k, "add"); + } } else { this.#moveToTail(index); const oldVal = this.#valList[index]; @@ -99762,6 +105939,9 @@ var require_commonjs14 = __commonJS({ } else if (status) { status.set = "update"; } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, v === oldVal ? "update" : "replace"); + } } if (ttl !== 0 && !this.#ttls) { this.#initializeTTLTracking(); @@ -99789,14 +105969,14 @@ var require_commonjs14 = __commonJS({ pop() { try { while (this.#size) { - const val2 = this.#valList[this.#head]; + const val = this.#valList[this.#head]; this.#evict(true); - if (this.#isBackgroundFetch(val2)) { - if (val2.__staleWhileFetching) { - return val2.__staleWhileFetching; + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; } - } else if (val2 !== void 0) { - return val2; + } else if (val !== void 0) { + return val; } } } finally { @@ -100287,10 +106467,10 @@ var require_commonjs14 = __commonJS({ }); // node_modules/minipass/dist/commonjs/index.js -var require_commonjs15 = __commonJS({ +var require_commonjs22 = __commonJS({ "node_modules/minipass/dist/commonjs/index.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -100300,7 +106480,7 @@ var require_commonjs15 = __commonJS({ stderr: null }; var node_events_1 = require("node:events"); - var node_stream_1 = __importDefault4(require("node:stream")); + var node_stream_1 = __importDefault2(require("node:stream")); var node_string_decoder_1 = require("node:string_decoder"); var isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass || s instanceof node_stream_1.default || (0, exports2.isReadable)(s) || (0, exports2.isWritable)(s)); exports2.isStream = isStream; @@ -100309,37 +106489,37 @@ var require_commonjs15 = __commonJS({ exports2.isReadable = isReadable; var isWritable = (s) => !!s && typeof s === "object" && s instanceof node_events_1.EventEmitter && typeof s.write === "function" && typeof s.end === "function"; exports2.isWritable = isWritable; - var EOF2 = Symbol("EOF"); - var MAYBE_EMIT_END = Symbol("maybeEmitEnd"); - var EMITTED_END = Symbol("emittedEnd"); - var EMITTING_END = Symbol("emittingEnd"); - var EMITTED_ERROR = Symbol("emittedError"); - var CLOSED = Symbol("closed"); - var READ = Symbol("read"); - var FLUSH = Symbol("flush"); - var FLUSHCHUNK = Symbol("flushChunk"); - var ENCODING = Symbol("encoding"); - var DECODER = Symbol("decoder"); - var FLOWING = Symbol("flowing"); - var PAUSED = Symbol("paused"); - var RESUME = Symbol("resume"); - var BUFFER = Symbol("buffer"); - var PIPES = Symbol("pipes"); - var BUFFERLENGTH = Symbol("bufferLength"); - var BUFFERPUSH = Symbol("bufferPush"); - var BUFFERSHIFT = Symbol("bufferShift"); - var OBJECTMODE = Symbol("objectMode"); - var DESTROYED = Symbol("destroyed"); - var ERROR = Symbol("error"); - var EMITDATA = Symbol("emitData"); - var EMITEND = Symbol("emitEnd"); - var EMITEND2 = Symbol("emitEnd2"); - var ASYNC = Symbol("async"); - var ABORT = Symbol("abort"); - var ABORTED = Symbol("aborted"); - var SIGNAL = Symbol("signal"); - var DATALISTENERS = Symbol("dataListeners"); - var DISCARDED = Symbol("discarded"); + var EOF2 = /* @__PURE__ */ Symbol("EOF"); + var MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd"); + var EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd"); + var EMITTING_END = /* @__PURE__ */ Symbol("emittingEnd"); + var EMITTED_ERROR = /* @__PURE__ */ Symbol("emittedError"); + var CLOSED = /* @__PURE__ */ Symbol("closed"); + var READ = /* @__PURE__ */ Symbol("read"); + var FLUSH = /* @__PURE__ */ Symbol("flush"); + var FLUSHCHUNK = /* @__PURE__ */ Symbol("flushChunk"); + var ENCODING = /* @__PURE__ */ Symbol("encoding"); + var DECODER = /* @__PURE__ */ Symbol("decoder"); + var FLOWING = /* @__PURE__ */ Symbol("flowing"); + var PAUSED = /* @__PURE__ */ Symbol("paused"); + var RESUME = /* @__PURE__ */ Symbol("resume"); + var BUFFER = /* @__PURE__ */ Symbol("buffer"); + var PIPES = /* @__PURE__ */ Symbol("pipes"); + var BUFFERLENGTH = /* @__PURE__ */ Symbol("bufferLength"); + var BUFFERPUSH = /* @__PURE__ */ Symbol("bufferPush"); + var BUFFERSHIFT = /* @__PURE__ */ Symbol("bufferShift"); + var OBJECTMODE = /* @__PURE__ */ Symbol("objectMode"); + var DESTROYED = /* @__PURE__ */ Symbol("destroyed"); + var ERROR = /* @__PURE__ */ Symbol("error"); + var EMITDATA = /* @__PURE__ */ Symbol("emitData"); + var EMITEND = /* @__PURE__ */ Symbol("emitEnd"); + var EMITEND2 = /* @__PURE__ */ Symbol("emitEnd2"); + var ASYNC = /* @__PURE__ */ Symbol("async"); + var ABORT = /* @__PURE__ */ Symbol("abort"); + var ABORTED = /* @__PURE__ */ Symbol("aborted"); + var SIGNAL = /* @__PURE__ */ Symbol("signal"); + var DATALISTENERS = /* @__PURE__ */ Symbol("dataListeners"); + var DISCARDED = /* @__PURE__ */ Symbol("discarded"); var defer = (fn) => Promise.resolve().then(fn); var nodefer = (fn) => fn(); var isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; @@ -101178,11 +107358,11 @@ var require_commonjs15 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js -var require_commonjs16 = __commonJS({ - "node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js"(exports2) { +// node_modules/path-scurry/dist/commonjs/index.js +var require_commonjs23 = __commonJS({ + "node_modules/path-scurry/dist/commonjs/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -101195,30 +107375,30 @@ var require_commonjs16 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.PathScurry = exports2.Path = exports2.PathScurryDarwin = exports2.PathScurryPosix = exports2.PathScurryWin32 = exports2.PathScurryBase = exports2.PathPosix = exports2.PathWin32 = exports2.PathBase = exports2.ChildrenCache = exports2.ResolveCache = void 0; - var lru_cache_1 = require_commonjs14(); + var lru_cache_1 = require_commonjs21(); var node_path_1 = require("node:path"); var node_url_1 = require("node:url"); var fs_1 = require("fs"); - var actualFS = __importStar4(require("node:fs")); + var actualFS = __importStar2(require("node:fs")); var realpathSync = fs_1.realpathSync.native; var promises_1 = require("node:fs/promises"); - var minipass_1 = require_commonjs15(); + var minipass_1 = require_commonjs22(); var defaultFS = { lstatSync: fs_1.lstatSync, readdir: fs_1.readdir, @@ -101296,7 +107476,7 @@ var require_commonjs16 = __commonJS({ } }; exports2.ChildrenCache = ChildrenCache; - var setAsCwd = Symbol("PathScurry setAsCwd"); + var setAsCwd = /* @__PURE__ */ Symbol("PathScurry setAsCwd"); var PathBase = class { /** * the basename of this path @@ -101433,6 +107613,8 @@ var require_commonjs16 = __commonJS({ /** * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, * this property refers to the *parent* path, not the path object itself. + * + * @deprecated */ get path() { return this.parentPath; @@ -101482,12 +107664,12 @@ var require_commonjs16 = __commonJS({ /** * Get the Path object referenced by the string path, resolved from this Path */ - resolve(path15) { - if (!path15) { + resolve(path16) { + if (!path16) { return this; } - const rootPath = this.getRootString(path15); - const dir = path15.substring(rootPath.length); + const rootPath = this.getRootString(path16); + const dir = path16.substring(rootPath.length); const dirParts = dir.split(this.splitSep); const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts); return result; @@ -102240,8 +108422,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - getRootString(path15) { - return node_path_1.win32.parse(path15).root; + getRootString(path16) { + return node_path_1.win32.parse(path16).root; } /** * @internal @@ -102288,8 +108470,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - getRootString(path15) { - return path15.startsWith("/") ? "/" : ""; + getRootString(path16) { + return path16.startsWith("/") ? "/" : ""; } /** * @internal @@ -102339,8 +108521,8 @@ var require_commonjs16 = __commonJS({ * * @internal */ - constructor(cwd = process.cwd(), pathImpl, sep4, { nocase, childrenCacheSize = 16 * 1024, fs: fs17 = defaultFS } = {}) { - this.#fs = fsFromOption(fs17); + constructor(cwd = process.cwd(), pathImpl, sep4, { nocase, childrenCacheSize = 16 * 1024, fs: fs18 = defaultFS } = {}) { + this.#fs = fsFromOption(fs18); if (cwd instanceof URL || cwd.startsWith("file://")) { cwd = (0, node_url_1.fileURLToPath)(cwd); } @@ -102379,11 +108561,11 @@ var require_commonjs16 = __commonJS({ /** * Get the depth of a provided path, string, or the cwd */ - depth(path15 = this.cwd) { - if (typeof path15 === "string") { - path15 = this.cwd.resolve(path15); + depth(path16 = this.cwd) { + if (typeof path16 === "string") { + path16 = this.cwd.resolve(path16); } - return path15.depth(); + return path16.depth(); } /** * Return the cache of child entries. Exposed so subclasses can create @@ -102870,9 +109052,9 @@ var require_commonjs16 = __commonJS({ process2(); return results; } - chdir(path15 = this.cwd) { + chdir(path16 = this.cwd) { const oldCwd = this.cwd; - this.cwd = typeof path15 === "string" ? this.cwd.resolve(path15) : path15; + this.cwd = typeof path16 === "string" ? this.cwd.resolve(path16) : path16; this.cwd[setAsCwd](oldCwd); } }; @@ -102899,8 +109081,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - newRoot(fs17) { - return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs17 }); + newRoot(fs18) { + return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs18 }); } /** * Return true if the provided path string is an absolute path @@ -102929,8 +109111,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - newRoot(fs17) { - return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs17 }); + newRoot(fs18) { + return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs18 }); } /** * Return true if the provided path string is an absolute path @@ -102952,13 +109134,13 @@ var require_commonjs16 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/pattern.js +// node_modules/glob/dist/commonjs/pattern.js var require_pattern = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/pattern.js"(exports2) { + "node_modules/glob/dist/commonjs/pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var isPatternList = (pl) => pl.length >= 1; var isGlobList = (gl) => gl.length >= 1; var Pattern = class _Pattern { @@ -103126,13 +109308,13 @@ var require_pattern = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/ignore.js +// node_modules/glob/dist/commonjs/ignore.js var require_ignore = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/ignore.js"(exports2) { + "node_modules/glob/dist/commonjs/ignore.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Ignore = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var pattern_js_1 = require_pattern(); var defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux"; var Ignore = class { @@ -103223,13 +109405,13 @@ var require_ignore = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/processor.js +// node_modules/glob/dist/commonjs/processor.js var require_processor = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/processor.js"(exports2) { + "node_modules/glob/dist/commonjs/processor.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Processor = exports2.SubWalks = exports2.MatchRecord = exports2.HasWalkedCache = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var HasWalkedCache = class _HasWalkedCache { store; constructor(store = /* @__PURE__ */ new Map()) { @@ -103260,8 +109442,8 @@ var require_processor = __commonJS({ } // match, absolute, ifdir entries() { - return [...this.store.entries()].map(([path15, n]) => [ - path15, + return [...this.store.entries()].map(([path16, n]) => [ + path16, !!(n & 2), !!(n & 1) ]); @@ -103456,13 +109638,13 @@ var require_processor = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/walker.js +// node_modules/glob/dist/commonjs/walker.js var require_walker = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/walker.js"(exports2) { + "node_modules/glob/dist/commonjs/walker.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.GlobStream = exports2.GlobWalker = exports2.GlobUtil = void 0; - var minipass_1 = require_commonjs15(); + var minipass_1 = require_commonjs22(); var ignore_js_1 = require_ignore(); var processor_js_1 = require_processor(); var makeIgnore = (ignore, opts) => typeof ignore === "string" ? new ignore_js_1.Ignore([ignore], opts) : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore; @@ -103479,9 +109661,9 @@ var require_walker = __commonJS({ signal; maxDepth; includeChildMatches; - constructor(patterns, path15, opts) { + constructor(patterns, path16, opts) { this.patterns = patterns; - this.path = path15; + this.path = path16; this.opts = opts; this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/"; this.includeChildMatches = opts.includeChildMatches !== false; @@ -103500,11 +109682,11 @@ var require_walker = __commonJS({ }); } } - #ignored(path15) { - return this.seen.has(path15) || !!this.#ignore?.ignored?.(path15); + #ignored(path16) { + return this.seen.has(path16) || !!this.#ignore?.ignored?.(path16); } - #childrenIgnored(path15) { - return !!this.#ignore?.childrenIgnored?.(path15); + #childrenIgnored(path16) { + return !!this.#ignore?.childrenIgnored?.(path16); } // backpressure mechanism pause() { @@ -103720,8 +109902,8 @@ var require_walker = __commonJS({ exports2.GlobUtil = GlobUtil; var GlobWalker = class extends GlobUtil { matches = /* @__PURE__ */ new Set(); - constructor(patterns, path15, opts) { - super(patterns, path15, opts); + constructor(patterns, path16, opts) { + super(patterns, path16, opts); } matchEmit(e) { this.matches.add(e); @@ -103759,8 +109941,8 @@ var require_walker = __commonJS({ exports2.GlobWalker = GlobWalker; var GlobStream = class extends GlobUtil { results; - constructor(patterns, path15, opts) { - super(patterns, path15, opts); + constructor(patterns, path16, opts) { + super(patterns, path16, opts); this.results = new minipass_1.Minipass({ signal: this.signal, objectMode: true @@ -103796,15 +109978,15 @@ var require_walker = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/glob.js +// node_modules/glob/dist/commonjs/glob.js var require_glob2 = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/glob.js"(exports2) { + "node_modules/glob/dist/commonjs/glob.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Glob = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var node_url_1 = require("node:url"); - var path_scurry_1 = require_commonjs16(); + var path_scurry_1 = require_commonjs23(); var pattern_js_1 = require_pattern(); var walker_js_1 = require_walker(); var defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux"; @@ -104009,13 +110191,13 @@ var require_glob2 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/has-magic.js +// node_modules/glob/dist/commonjs/has-magic.js var require_has_magic = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/has-magic.js"(exports2) { + "node_modules/glob/dist/commonjs/has-magic.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hasMagic = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var hasMagic = (pattern, options = {}) => { if (!Array.isArray(pattern)) { pattern = [pattern]; @@ -104030,9 +110212,9 @@ var require_has_magic = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/index.js -var require_commonjs17 = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/index.js"(exports2) { +// node_modules/glob/dist/commonjs/index.js +var require_commonjs24 = __commonJS({ + "node_modules/glob/dist/commonjs/index.js"(exports2) { "use strict"; 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; @@ -104041,10 +110223,10 @@ var require_commonjs17 = __commonJS({ exports2.globSync = globSync; exports2.globIterateSync = globIterateSync; exports2.globIterate = globIterate; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var glob_js_1 = require_glob2(); var has_magic_js_1 = require_has_magic(); - var minimatch_2 = require_commonjs13(); + var minimatch_2 = require_commonjs20(); Object.defineProperty(exports2, "escape", { enumerable: true, get: function() { return minimatch_2.escape; } }); @@ -104115,13 +110297,13 @@ var require_commonjs17 = __commonJS({ // node_modules/archiver-utils/file.js var require_file3 = __commonJS({ "node_modules/archiver-utils/file.js"(exports2, module2) { - var fs17 = require_graceful_fs(); - var path15 = require("path"); + var fs18 = require_graceful_fs(); + var path16 = require("path"); var flatten = require_flatten(); var difference = require_difference(); var union = require_union(); var isPlainObject = require_isPlainObject(); - var glob2 = require_commonjs17(); + var glob2 = require_commonjs24(); var file = module2.exports = {}; var pathSeparatorRe = /[\/\\]/g; var processPatterns = function(patterns, fn) { @@ -104141,8 +110323,8 @@ var require_file3 = __commonJS({ return result; }; file.exists = function() { - var filepath = path15.join.apply(path15, arguments); - return fs17.existsSync(filepath); + var filepath = path16.join.apply(path16, arguments); + return fs18.existsSync(filepath); }; file.expand = function(...args) { var options = isPlainObject(args[0]) ? args.shift() : {}; @@ -104155,12 +110337,12 @@ var require_file3 = __commonJS({ }); if (options.filter) { matches = matches.filter(function(filepath) { - filepath = path15.join(options.cwd || "", filepath); + filepath = path16.join(options.cwd || "", filepath); try { if (typeof options.filter === "function") { return options.filter(filepath); } else { - return fs17.statSync(filepath)[options.filter](); + return fs18.statSync(filepath)[options.filter](); } } catch (e) { return false; @@ -104172,7 +110354,7 @@ var require_file3 = __commonJS({ file.expandMapping = function(patterns, destBase, options) { options = Object.assign({ rename: function(destBase2, destPath) { - return path15.join(destBase2 || "", destPath); + return path16.join(destBase2 || "", destPath); } }, options); var files = []; @@ -104180,14 +110362,14 @@ var require_file3 = __commonJS({ file.expand(options, patterns).forEach(function(src) { var destPath = src; if (options.flatten) { - destPath = path15.basename(destPath); + destPath = path16.basename(destPath); } if (options.ext) { destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); } var dest = options.rename(destBase, destPath, options); if (options.cwd) { - src = path15.join(options.cwd, src); + src = path16.join(options.cwd, src); } dest = dest.replace(pathSeparatorRe, "/"); src = src.replace(pathSeparatorRe, "/"); @@ -104268,8 +110450,8 @@ var require_file3 = __commonJS({ // node_modules/archiver-utils/index.js var require_archiver_utils = __commonJS({ "node_modules/archiver-utils/index.js"(exports2, module2) { - var fs17 = require_graceful_fs(); - var path15 = require("path"); + var fs18 = require_graceful_fs(); + var path16 = require("path"); var isStream = require_is_stream(); var lazystream = require_lazystream(); var normalizePath = require_normalize_path(); @@ -104317,7 +110499,7 @@ var require_archiver_utils = __commonJS({ }; utils.lazyReadStream = function(filepath) { return new lazystream.Readable(function() { - return fs17.createReadStream(filepath); + return fs18.createReadStream(filepath); }); }; utils.normalizeInputSource = function(source) { @@ -104345,7 +110527,7 @@ var require_archiver_utils = __commonJS({ callback = base; base = dirpath; } - fs17.readdir(dirpath, function(err, list) { + fs18.readdir(dirpath, function(err, list) { var i = 0; var file; var filepath; @@ -104357,11 +110539,11 @@ var require_archiver_utils = __commonJS({ if (!file) { return callback(null, results); } - filepath = path15.join(dirpath, file); - fs17.stat(filepath, function(err2, stats) { + filepath = path16.join(dirpath, file); + fs18.stat(filepath, function(err2, stats) { results.push({ path: filepath, - relative: path15.relative(base, filepath).replace(/\\/g, "/"), + relative: path16.relative(base, filepath).replace(/\\/g, "/"), stats }); if (stats && stats.isDirectory()) { @@ -104385,7 +110567,7 @@ var require_archiver_utils = __commonJS({ }); // node_modules/archiver/lib/error.js -var require_error2 = __commonJS({ +var require_error3 = __commonJS({ "node_modules/archiver/lib/error.js"(exports2, module2) { var util = require("util"); var ERROR_CODES = { @@ -104418,15 +110600,15 @@ var require_error2 = __commonJS({ }); // node_modules/archiver/lib/core.js -var require_core2 = __commonJS({ +var require_core4 = __commonJS({ "node_modules/archiver/lib/core.js"(exports2, module2) { - var fs17 = require("fs"); + var fs18 = require("fs"); var glob2 = require_readdir_glob(); var async = require_async(); - var path15 = require("path"); + var path16 = require("path"); var util = require_archiver_utils(); var inherits = require("util").inherits; - var ArchiverError = require_error2(); + var ArchiverError = require_error3(); var Transform = require_ours().Transform; var win32 = process.platform === "win32"; var Archiver = function(format, options) { @@ -104484,7 +110666,7 @@ var require_core2 = __commonJS({ data.sourcePath = filepath; task.data = data; this._entriesCount++; - if (data.stats && data.stats instanceof fs17.Stats) { + if (data.stats && data.stats instanceof fs18.Stats) { task = this._updateQueueTaskWithStats(task, data.stats); if (task) { if (data.stats.size) { @@ -104655,7 +110837,7 @@ var require_core2 = __commonJS({ callback(); return; } - fs17.lstat(task.filepath, function(err, stats) { + fs18.lstat(task.filepath, function(err, stats) { if (this._state.aborted) { setImmediate(callback); return; @@ -104698,10 +110880,10 @@ var require_core2 = __commonJS({ task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) { - var linkPath = fs17.readlinkSync(task.filepath); - var dirName = path15.dirname(task.filepath); + var linkPath = fs18.readlinkSync(task.filepath); + var dirName = path16.dirname(task.filepath); task.data.type = "symlink"; - task.data.linkname = path15.relative(dirName, path15.resolve(dirName, linkPath)); + task.data.linkname = path16.relative(dirName, path16.resolve(dirName, linkPath)); task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else { @@ -104969,7 +111151,7 @@ var require_archive_entry = __commonJS({ }); // node_modules/compress-commons/lib/archivers/zip/util.js -var require_util14 = __commonJS({ +var require_util13 = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/util.js"(exports2, module2) { var util = module2.exports = {}; util.dateToDos = function(d, forceLocalTime) { @@ -104980,7 +111162,7 @@ var require_util14 = __commonJS({ } else if (year >= 2044) { return 2141175677; } - var val2 = { + var val = { year, month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), date: forceLocalTime ? d.getDate() : d.getUTCDate(), @@ -104988,7 +111170,7 @@ var require_util14 = __commonJS({ minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() }; - return val2.year - 1980 << 25 | val2.month + 1 << 21 | val2.date << 16 | val2.hours << 11 | val2.minutes << 5 | val2.seconds / 2; + return val.year - 1980 << 25 | val.month + 1 << 21 | val.date << 16 | val.hours << 11 | val.minutes << 5 | val.seconds / 2; }; util.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); @@ -105027,7 +111209,7 @@ var require_util14 = __commonJS({ // node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js var require_general_purpose_bit = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js"(exports2, module2) { - var zipUtil = require_util14(); + var zipUtil = require_util13(); var DATA_DESCRIPTOR_FLAG = 1 << 3; var ENCRYPTION_FLAG = 1 << 0; var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2; @@ -105154,7 +111336,7 @@ var require_unix_stat = __commonJS({ }); // node_modules/compress-commons/lib/archivers/zip/constants.js -var require_constants9 = __commonJS({ +var require_constants13 = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/constants.js"(exports2, module2) { module2.exports = { WORD: 4, @@ -105238,8 +111420,8 @@ var require_zip_archive_entry = __commonJS({ var ArchiveEntry = require_archive_entry(); var GeneralPurposeBit = require_general_purpose_bit(); var UnixStat = require_unix_stat(); - var constants = require_constants9(); - var zipUtil = require_util14(); + var constants = require_constants13(); + var zipUtil = require_util13(); var ZipArchiveEntry = module2.exports = function(name) { if (!(this instanceof ZipArchiveEntry)) { return new ZipArchiveEntry(name); @@ -105419,7 +111601,7 @@ var require_is_stream2 = __commonJS({ }); // node_modules/compress-commons/lib/util/index.js -var require_util15 = __commonJS({ +var require_util14 = __commonJS({ "node_modules/compress-commons/lib/util/index.js"(exports2, module2) { var Stream = require("stream").Stream; var PassThrough = require_ours().PassThrough; @@ -105447,7 +111629,7 @@ var require_archive_output_stream = __commonJS({ var isStream = require_is_stream2(); var Transform = require_ours().Transform; var ArchiveEntry = require_archive_entry(); - var util = require_util15(); + var util = require_util14(); var ArchiveOutputStream = module2.exports = function(options) { if (!(this instanceof ArchiveOutputStream)) { return new ArchiveOutputStream(options); @@ -105710,7 +111892,7 @@ var require_deflate_crc32_stream = __commonJS({ }); // node_modules/crc32-stream/lib/index.js -var require_lib8 = __commonJS({ +var require_lib6 = __commonJS({ "node_modules/crc32-stream/lib/index.js"(exports2, module2) { "use strict"; module2.exports = { @@ -105725,14 +111907,14 @@ var require_zip_archive_output_stream = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js"(exports2, module2) { var inherits = require("util").inherits; var crc32 = require_crc32(); - var { CRC32Stream } = require_lib8(); - var { DeflateCRC32Stream } = require_lib8(); + var { CRC32Stream } = require_lib6(); + var { DeflateCRC32Stream } = require_lib6(); var ArchiveOutputStream = require_archive_output_stream(); var ZipArchiveEntry = require_zip_archive_entry(); var GeneralPurposeBit = require_general_purpose_bit(); - var constants = require_constants9(); - var util = require_util15(); - var zipUtil = require_util14(); + var constants = require_constants13(); + var util = require_util14(); + var zipUtil = require_util13(); var ZipArchiveOutputStream = module2.exports = function(options) { if (!(this instanceof ZipArchiveOutputStream)) { return new ZipArchiveOutputStream(options); @@ -105848,18 +112030,18 @@ var require_zip_archive_output_stream = __commonJS({ ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { var deflate = ae.getMethod() === constants.METHOD_DEFLATED; var process2 = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream(); - var error4 = null; + 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(error4, ae); + callback(error3, ae); } process2.once("end", handleStuff.bind(this)); process2.once("error", function(err) { - error4 = err; + error3 = err; }); process2.pipe(this, { end: false }); return process2; @@ -106230,29 +112412,29 @@ var require_fast_fifo = __commonJS({ this.head.clear(); this.length = 0; } - push(val2) { + push(val) { this.length++; - if (!this.head.push(val2)) { + if (!this.head.push(val)) { const prev = this.head; this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length); - this.head.push(val2); + this.head.push(val); } } shift() { if (this.length !== 0) this.length--; - const val2 = this.tail.shift(); - if (val2 === void 0 && this.tail.next) { + 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 val2; + return val; } peek() { - const val2 = this.tail.peek(); - if (val2 === void 0 && this.tail.next) return this.tail.next.peek(); - return val2; + const val = this.tail.peek(); + if (val === void 0 && this.tail.next) return this.tail.next.peek(); + return val; } isEmpty() { return this.length === 0; @@ -106678,7 +112860,7 @@ var require_streamx = __commonJS({ 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 || Symbol("asyncIterator"); + var asyncIterator = Symbol.asyncIterator || /* @__PURE__ */ Symbol("asyncIterator"); var WritableState = class { constructor(stream2, { highWaterMark = 16384, map: map2 = null, mapWritable, byteLength, byteLengthWritable } = {}) { this.stream = stream2; @@ -107225,11 +113407,11 @@ var require_streamx = __commonJS({ } [asyncIterator]() { const stream2 = this; - let error4 = null; + let error3 = null; let promiseResolve = null; let promiseReject = null; this.on("error", (err) => { - error4 = err; + error3 = err; }); this.on("readable", onreadable); this.on("close", onclose); @@ -107261,7 +113443,7 @@ var require_streamx = __commonJS({ } function ondata(data) { if (promiseReject === null) return; - if (error4) promiseReject(error4); + 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; @@ -107435,7 +113617,7 @@ var require_streamx = __commonJS({ if (all.length < 2) throw new Error("Pipeline requires at least 2 streams"); let src = all[0]; let dest = null; - let error4 = null; + let error3 = null; for (let i = 1; i < all.length; i++) { dest = all[i]; if (isStreamx(src)) { @@ -107450,14 +113632,14 @@ var require_streamx = __commonJS({ let fin = false; const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy); dest.on("error", (err) => { - if (error4 === null) error4 = err; + if (error3 === null) error3 = err; }); dest.on("finish", () => { fin = true; - if (!autoDestroy) done(error4); + if (!autoDestroy) done(error3); }); if (autoDestroy) { - dest.on("close", () => done(error4 || (fin ? null : PREMATURE_CLOSE))); + dest.on("close", () => done(error3 || (fin ? null : PREMATURE_CLOSE))); } } return dest; @@ -107470,8 +113652,8 @@ var require_streamx = __commonJS({ } } function onerror(err) { - if (!err || error4) return; - error4 = err; + if (!err || error3) return; + error3 = err; for (const s of all) { s.destroy(err); } @@ -107730,10 +113912,10 @@ var require_headers2 = __commonJS({ for (let j = 156; j < 512; j++) sum += block[j]; return sum; } - function encodeOct(val2, n) { - val2 = val2.toString(8); - if (val2.length > n) return SEVENS.slice(0, n) + " "; - return ZEROS.slice(0, n - val2.length) + val2 + " "; + 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; @@ -107768,21 +113950,21 @@ var require_headers2 = __commonJS({ } return positive ? sum : -1 * sum; } - function decodeOct(val2, offset, length) { - val2 = val2.subarray(offset, offset + length); + function decodeOct(val, offset, length) { + val = val.subarray(offset, offset + length); offset = 0; - if (val2[offset] & 128) { - return parse256(val2); + if (val[offset] & 128) { + return parse256(val); } else { - while (offset < val2.length && val2[offset] === 32) offset++; - const end = clamp(indexOf(val2, 32, offset, val2.length), val2.length, val2.length); - while (offset < end && val2[offset] === 0) offset++; + 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(val2.subarray(offset, end)), 8); + return parseInt(b4a.toString(val.subarray(offset, end)), 8); } } - function decodeStr(val2, offset, length, encoding) { - return b4a.toString(val2.subarray(offset, indexOf(val2, 0, offset, offset + length)), encoding); + function decodeStr(val, offset, length, encoding) { + return b4a.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding); } function addLength(str2) { const len = b4a.byteLength(str2); @@ -108037,7 +114219,7 @@ var require_extract = __commonJS({ cb(null); } [Symbol.asyncIterator]() { - let error4 = null; + let error3 = null; let promiseResolve = null; let promiseReject = null; let entryStream = null; @@ -108045,7 +114227,7 @@ var require_extract = __commonJS({ const extract2 = this; this.on("entry", onentry); this.on("error", (err) => { - error4 = err; + error3 = err; }); this.on("close", onclose); return { @@ -108069,8 +114251,8 @@ var require_extract = __commonJS({ cb(err); } function onnext(resolve8, reject) { - if (error4) { - return reject(error4); + if (error3) { + return reject(error3); } if (entryStream) { resolve8({ value: entryStream, done: false }); @@ -108096,9 +114278,9 @@ var require_extract = __commonJS({ } } function onclose() { - consumeCallback(error4); + consumeCallback(error3); if (!promiseResolve) return; - if (error4) promiseReject(error4); + if (error3) promiseReject(error3); else promiseResolve({ value: void 0, done: true }); promiseResolve = promiseReject = null; } @@ -108128,7 +114310,7 @@ var require_extract = __commonJS({ }); // node_modules/tar-stream/constants.js -var require_constants10 = __commonJS({ +var require_constants14 = __commonJS({ "node_modules/tar-stream/constants.js"(exports2, module2) { var constants = { // just for envs without fs @@ -108152,7 +114334,7 @@ var require_pack = __commonJS({ "node_modules/tar-stream/pack.js"(exports2, module2) { var { Readable: Readable2, Writable, getStreamError } = require_streamx(); var b4a = require_b4a(); - var constants = require_constants10(); + var constants = require_constants14(); var headers = require_headers2(); var DMODE = 493; var FMODE = 420; @@ -108468,7 +114650,7 @@ var require_tar2 = __commonJS({ }); // node_modules/buffer-crc32/dist/index.cjs -var require_dist8 = __commonJS({ +var require_dist5 = __commonJS({ "node_modules/buffer-crc32/dist/index.cjs"(exports2, module2) { "use strict"; function getDefaultExportFromCjs(x) { @@ -108780,7 +114962,7 @@ var require_json = __commonJS({ "node_modules/archiver/lib/plugins/json.js"(exports2, module2) { var inherits = require("util").inherits; var Transform = require_ours().Transform; - var crc32 = require_dist8(); + var crc32 = require_dist5(); var util = require_archiver_utils(); var Json = function(options) { if (!(this instanceof Json)) { @@ -108832,7 +115014,7 @@ var require_json = __commonJS({ // node_modules/archiver/index.js var require_archiver = __commonJS({ "node_modules/archiver/index.js"(exports2, module2) { - var Archiver = require_core2(); + var Archiver = require_core4(); var formats = {}; var vending = function(format, options) { return vending.create(format, options); @@ -108876,7 +115058,7 @@ var require_archiver = __commonJS({ var require_zip2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/zip.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -108889,31 +115071,31 @@ var require_zip2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -108943,10 +115125,10 @@ var require_zip2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ZipUploadStream = exports2.DEFAULT_COMPRESSION_LEVEL = void 0; exports2.createZipUploadStream = createZipUploadStream; - var stream2 = __importStar4(require("stream")); + var stream2 = __importStar2(require("stream")); var promises_1 = require("fs/promises"); - var archiver2 = __importStar4(require_archiver()); - var core18 = __importStar4(require_core()); + var archiver2 = __importStar2(require_archiver()); + var core18 = __importStar2(require_core()); var config_1 = require_config2(); exports2.DEFAULT_COMPRESSION_LEVEL = 6; var ZipUploadStream = class extends stream2.Transform { @@ -108962,7 +115144,7 @@ var require_zip2 = __commonJS({ }; exports2.ZipUploadStream = ZipUploadStream; function createZipUploadStream(uploadSpecification_1) { - return __awaiter4(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { + return __awaiter2(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { core18.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); const zip = archiver2.create("zip", { highWaterMark: (0, config_1.getUploadChunkSize)(), @@ -108994,18 +115176,18 @@ var require_zip2 = __commonJS({ return zipUploadStream; }); } - var zipErrorCallback = (error4) => { + var zipErrorCallback = (error3) => { core18.error("An error has occurred while creating the zip file for upload"); - core18.info(error4); + core18.info(error3); throw new Error("An error has occurred during zip creation for the artifact"); }; - var zipWarningCallback = (error4) => { - if (error4.code === "ENOENT") { + var zipWarningCallback = (error3) => { + if (error3.code === "ENOENT") { core18.warning("ENOENT warning during artifact zip creation. No such file or directory"); - core18.info(error4); + core18.info(error3); } else { - core18.warning(`A non-blocking warning has occurred during artifact zip creation: ${error4.code}`); - core18.info(error4); + core18.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); + core18.info(error3); } }; var zipFinishCallback = () => { @@ -109021,7 +115203,7 @@ var require_zip2 = __commonJS({ var require_upload_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/upload-artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -109034,31 +115216,31 @@ var require_upload_artifact = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -109087,18 +115269,18 @@ var require_upload_artifact = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadArtifact = uploadArtifact; - var core18 = __importStar4(require_core()); + var core18 = __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 util_1 = require_util10(); 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -109297,7 +115479,7 @@ var require_traverse = __commonJS({ })(this.value); }; function walk(root, cb, immutable) { - var path15 = []; + var path16 = []; var parents = []; var alive = true; return (function walker(node_) { @@ -109306,11 +115488,11 @@ var require_traverse = __commonJS({ var state = { node, node_, - path: [].concat(path15), + path: [].concat(path16), parent: parents.slice(-1)[0], - key: path15.slice(-1)[0], - isRoot: path15.length === 0, - level: path15.length, + key: path16.slice(-1)[0], + isRoot: path16.length === 0, + level: path16.length, circular: null, update: function(x) { if (!state.isRoot) { @@ -109365,7 +115547,7 @@ var require_traverse = __commonJS({ parents.push(state); var keys = Object.keys(state.node); keys.forEach(function(key, i2) { - path15.push(key); + path16.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)) { @@ -109374,7 +115556,7 @@ var require_traverse = __commonJS({ child.isLast = i2 == keys.length - 1; child.isFirst = i2 == 0; if (modifiers.post) modifiers.post.call(state, child); - path15.pop(); + path16.pop(); }); parents.pop(); } @@ -110070,18 +116252,18 @@ var require_binary = __commonJS({ return acc; } function decodeBEs(bytes) { - var val2 = decodeBEu(bytes); + var val = decodeBEu(bytes); if ((bytes[0] & 128) == 128) { - val2 -= Math.pow(256, bytes.length); + val -= Math.pow(256, bytes.length); } - return val2; + return val; } function decodeLEs(bytes) { - var val2 = decodeLEu(bytes); + var val = decodeLEu(bytes); if ((bytes[bytes.length - 1] & 128) == 128) { - val2 -= Math.pow(256, bytes.length); + val -= Math.pow(256, bytes.length); } - return val2; + return val; } function words(decode) { var self2 = {}; @@ -110395,11 +116577,11 @@ var require_unzip_stream = __commonJS({ return requiredLength; case states.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX: var isUtf8 = (this.parsedEntity.flags & 2048) !== 0; - var path15 = this._decodeString(chunk.slice(0, this.parsedEntity.fileNameLength), isUtf8); + var path16 = 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) { - path15 = extra.parsed.path; + path16 = extra.parsed.path; } this.parsedEntity.extra = extra.parsed; var isUnix = (this.parsedEntity.versionMadeBy & 65280) >> 8 === 3; @@ -110411,7 +116593,7 @@ var require_unzip_stream = __commonJS({ } if (this.options.debug) { const debugObj = Object.assign({}, this.parsedEntity, { - path: path15, + path: path16, flags: "0x" + this.parsedEntity.flags.toString(16), unixAttrs: unixAttrs && "0" + unixAttrs.toString(8), isSymlink, @@ -110812,8 +116994,8 @@ var require_parser_stream = __commonJS({ this.unzipStream.on("entry", function(entry) { self2.push(entry); }); - this.unzipStream.on("error", function(error4) { - self2.emit("error", error4); + this.unzipStream.on("error", function(error3) { + self2.emit("error", error3); }); } util.inherits(ParserStream, Transform); @@ -110848,8 +117030,8 @@ var require_parser_stream = __commonJS({ // node_modules/mkdirp/index.js var require_mkdirp = __commonJS({ "node_modules/mkdirp/index.js"(exports2, module2) { - var path15 = require("path"); - var fs17 = require("fs"); + var path16 = require("path"); + var fs18 = require("fs"); var _0777 = parseInt("0777", 8); module2.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; function mkdirP(p, opts, f, made) { @@ -110860,7 +117042,7 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs17; + var xfs = opts.fs || fs18; if (mode === void 0) { mode = _0777; } @@ -110868,7 +117050,7 @@ var require_mkdirp = __commonJS({ var cb = f || /* istanbul ignore next */ function() { }; - p = path15.resolve(p); + p = path16.resolve(p); xfs.mkdir(p, mode, function(er) { if (!er) { made = made || p; @@ -110876,8 +117058,8 @@ var require_mkdirp = __commonJS({ } switch (er.code) { case "ENOENT": - if (path15.dirname(p) === p) return cb(er); - mkdirP(path15.dirname(p), opts, function(er2, made2) { + if (path16.dirname(p) === p) return cb(er); + mkdirP(path16.dirname(p), opts, function(er2, made2) { if (er2) cb(er2, made2); else mkdirP(p, opts, cb, made2); }); @@ -110899,19 +117081,19 @@ var require_mkdirp = __commonJS({ opts = { mode: opts }; } var mode = opts.mode; - var xfs = opts.fs || fs17; + var xfs = opts.fs || fs18; if (mode === void 0) { mode = _0777; } if (!made) made = null; - p = path15.resolve(p); + p = path16.resolve(p); try { xfs.mkdirSync(p, mode); made = made || p; } catch (err0) { switch (err0.code) { case "ENOENT": - made = sync(path15.dirname(p), opts, made); + made = sync(path16.dirname(p), opts, made); sync(p, opts, made); break; // In the case of any other error, just see if there's a dir @@ -110936,8 +117118,8 @@ var require_mkdirp = __commonJS({ // node_modules/unzip-stream/lib/extract.js var require_extract2 = __commonJS({ "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { - var fs17 = require("fs"); - var path15 = require("path"); + var fs18 = require("fs"); + var path16 = require("path"); var util = require("util"); var mkdirp = require_mkdirp(); var Transform = require("stream").Transform; @@ -110953,8 +117135,8 @@ var require_extract2 = __commonJS({ this.createdDirectories = {}; var self2 = this; this.unzipStream.on("entry", this._processEntry.bind(this)); - this.unzipStream.on("error", function(error4) { - self2.emit("error", error4); + this.unzipStream.on("error", function(error3) { + self2.emit("error", error3); }); } util.inherits(Extract, Transform); @@ -110979,17 +117161,17 @@ var require_extract2 = __commonJS({ }; Extract.prototype._processEntry = function(entry) { var self2 = this; - var destPath = path15.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path15.dirname(destPath); + var destPath = path16.join(this.opts.path, entry.path); + var directory = entry.isDirectory ? destPath : path16.dirname(destPath); this.unfinishedEntries++; var writeFileFn = function() { - var pipedStream = fs17.createWriteStream(destPath); + var pipedStream = fs18.createWriteStream(destPath); pipedStream.on("close", function() { self2.unfinishedEntries--; self2._notifyAwaiter(); }); - pipedStream.on("error", function(error4) { - self2.emit("error", error4); + pipedStream.on("error", function(error3) { + self2.emit("error", error3); }); entry.pipe(pipedStream); }; @@ -111030,7 +117212,7 @@ var require_unzip = __commonJS({ var require_download_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/download/download-artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111043,31 +117225,31 @@ var require_download_artifact = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -111094,54 +117276,54 @@ var require_download_artifact = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.streamExtractExternal = streamExtractExternal; exports2.downloadArtifactPublic = downloadArtifactPublic; exports2.downloadArtifactInternal = downloadArtifactInternal; - var promises_1 = __importDefault4(require("fs/promises")); - var crypto = __importStar4(require("crypto")); - var stream2 = __importStar4(require("stream")); - var github3 = __importStar4(require_github()); - var core18 = __importStar4(require_core()); - var httpClient = __importStar4(require_lib7()); - var unzip_stream_1 = __importDefault4(require_unzip()); + var promises_1 = __importDefault2(require("fs/promises")); + var crypto2 = __importStar2(require("crypto")); + var stream2 = __importStar2(require("stream")); + var github3 = __importStar2(require_github()); + var core18 = __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 util_1 = require_util10(); var errors_1 = require_errors3(); var scrubQueryParameters = (url2) => { const parsed = new URL(url2); parsed.search = ""; return parsed.toString(); }; - function exists(path15) { - return __awaiter4(this, void 0, void 0, function* () { + function exists(path16) { + return __awaiter2(this, void 0, void 0, function* () { try { - yield promises_1.default.access(path15); + yield promises_1.default.access(path16); return true; - } catch (error4) { - if (error4.code === "ENOENT") { + } catch (error3) { + if (error3.code === "ENOENT") { return false; } else { - throw error4; + throw error3; } } }); } function streamExtract(url2, directory) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let retryCount = 0; while (retryCount < 5) { try { return yield streamExtractExternal(url2, directory); - } catch (error4) { + } catch (error3) { retryCount++; - core18.debug(`Failed to download artifact after ${retryCount} retries due to ${error4.message}. Retrying in 5 seconds...`); + core18.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); yield new Promise((resolve8) => setTimeout(resolve8, 5e3)); } } @@ -111149,7 +117331,7 @@ var require_download_artifact = __commonJS({ }); } function streamExtractExternal(url_1, directory_1) { - return __awaiter4(this, arguments, void 0, function* (url2, directory, opts = { timeout: 30 * 1e3 }) { + 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) { @@ -111163,17 +117345,17 @@ var require_download_artifact = __commonJS({ reject(timeoutError); }; const timer = setTimeout(timerFn, opts.timeout); - const hashStream = crypto.createHash("sha256").setEncoding("hex"); + const hashStream = crypto2.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", (error4) => { - core18.debug(`response.message: Artifact download failed: ${error4.message}`); + }).on("error", (error3) => { + core18.debug(`response.message: Artifact download failed: ${error3.message}`); clearTimeout(timer); - reject(error4); + reject(error3); }).pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", () => { clearTimeout(timer); if (hashStream) { @@ -111182,14 +117364,14 @@ var require_download_artifact = __commonJS({ core18.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); } resolve8({ sha256Digest: `sha256:${sha256Digest}` }); - }).on("error", (error4) => { - reject(error4); + }).on("error", (error3) => { + reject(error3); }); }); }); } function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); const api = github3.getOctokit(token); let digestMismatch = false; @@ -111222,14 +117404,14 @@ var require_download_artifact = __commonJS({ core18.debug(`Expected digest: ${options.expectedHash}`); } } - } catch (error4) { - throw new Error(`Unable to download and extract artifact: ${error4.message}`); + } catch (error3) { + throw new Error(`Unable to download and extract artifact: ${error3.message}`); } return { downloadPath, digestMismatch }; }); } function downloadArtifactInternal(artifactId, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -111265,14 +117447,14 @@ Are you trying to download from a different run? Try specifying a github-token w core18.debug(`Expected digest: ${options.expectedHash}`); } } - } catch (error4) { - throw new Error(`Unable to download and extract artifact: ${error4.message}`); + } catch (error3) { + throw new Error(`Unable to download and extract artifact: ${error3.message}`); } return { downloadPath, digestMismatch }; }); } function resolveOrCreateDirectory() { - return __awaiter4(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { + return __awaiter2(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { if (!(yield exists(downloadPath))) { core18.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); yield promises_1.default.mkdir(downloadPath, { recursive: true }); @@ -111289,7 +117471,7 @@ Are you trying to download from a different run? Try specifying a github-token w var require_retry_options = __commonJS({ "node_modules/@actions/artifact/lib/internal/find/retry-options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111302,33 +117484,33 @@ var require_retry_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getRetryOptions = getRetryOptions; - var core18 = __importStar4(require_core()); + var core18 = __importStar2(require_core()); var defaultMaxRetryNumber = 5; var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { @@ -111360,13 +117542,13 @@ var require_dist_node16 = __commonJS({ octokit.log.debug("request", options); const start = Date.now(); const requestOptions = octokit.request.endpoint.parse(options); - const path15 = requestOptions.url.replace(options.baseUrl, ""); + const path16 = requestOptions.url.replace(options.baseUrl, ""); return request(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path15} - ${response.status} in ${Date.now() - start}ms`); + octokit.log.info(`${requestOptions.method} ${path16} - ${response.status} in ${Date.now() - start}ms`); return response; - }).catch((error4) => { - octokit.log.info(`${requestOptions.method} ${path15} - ${error4.status} in ${Date.now() - start}ms`); - throw error4; + }).catch((error3) => { + octokit.log.info(`${requestOptions.method} ${path16} - ${error3.status} in ${Date.now() - start}ms`); + throw error3; }); }); } @@ -111384,22 +117566,22 @@ var require_dist_node17 = __commonJS({ return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; } var Bottleneck = _interopDefault(require_light()); - async function errorRequest(octokit, state, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(octokit, state, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } async function wrapRequest(state, request, options) { const limiter = new Bottleneck(); - limiter.on("failed", function(error4, info7) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info7) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -111421,12 +117603,12 @@ var require_dist_node17 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -111441,7 +117623,7 @@ var require_dist_node17 = __commonJS({ var require_get_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/find/get-artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111454,31 +117636,31 @@ var require_get_artifact = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -111510,17 +117692,17 @@ var require_get_artifact = __commonJS({ exports2.getArtifactInternal = getArtifactInternal; var github_1 = require_github(); var plugin_retry_1 = require_dist_node17(); - var core18 = __importStar4(require_core()); + var core18 = __importStar2(require_core()); var utils_1 = require_utils4(); var retry_options_1 = require_retry_options(); var plugin_request_log_1 = require_dist_node16(); - var util_1 = require_util11(); + var util_1 = require_util10(); 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { var _a; const [retryOpts, requestOpts] = (0, retry_options_1.getRetryOptions)(utils_1.defaults); const opts = { @@ -111562,7 +117744,7 @@ var require_get_artifact = __commonJS({ }); } function getArtifactInternal(artifactName) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { var _a; const artifactClient = (0, artifact_twirp_client_1.internalArtifactTwirpClient)(); const { workflowRunBackendId, workflowJobRunBackendId } = (0, util_1.getBackendIdsFromToken)(); @@ -111600,7 +117782,7 @@ var require_get_artifact = __commonJS({ var require_delete_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/delete/delete-artifact.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -111638,12 +117820,12 @@ var require_delete_artifact = __commonJS({ var plugin_request_log_1 = require_dist_node16(); var plugin_retry_1 = require_dist_node17(); var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var util_1 = require_util11(); + var util_1 = require_util10(); 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { var _a; const [retryOpts, requestOpts] = (0, retry_options_1.getRetryOptions)(utils_1.defaults); const opts = { @@ -111669,7 +117851,7 @@ var require_delete_artifact = __commonJS({ }); } function deleteArtifactInternal(artifactName) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -111705,7 +117887,7 @@ var require_delete_artifact = __commonJS({ var require_list_artifacts = __commonJS({ "node_modules/@actions/artifact/lib/internal/find/list-artifacts.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -111743,14 +117925,14 @@ var require_list_artifacts = __commonJS({ var plugin_request_log_1 = require_dist_node16(); var plugin_retry_1 = require_dist_node17(); var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var util_1 = require_util11(); + var util_1 = require_util10(); 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 __awaiter4(this, arguments, void 0, function* (workflowRunId, repositoryOwner, repositoryName, token, latest = false) { + 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); @@ -111815,7 +117997,7 @@ var require_list_artifacts = __commonJS({ }); } function listArtifactsInternal() { - return __awaiter4(this, arguments, void 0, function* (latest = false) { + 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 = { @@ -111861,7 +118043,7 @@ var require_list_artifacts = __commonJS({ var require_client2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/client.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -111888,7 +118070,7 @@ var require_client2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __rest4 = exports2 && exports2.__rest || function(s, e) { + 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]; @@ -111911,45 +118093,45 @@ var require_client2 = __commonJS({ var errors_1 = require_errors3(); var DefaultArtifactClient2 = class { uploadArtifact(name, files, rootDirectory, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 (error4) { - (0, core_1.warning)(`Artifact upload failed with error: ${error4}. + } 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 error4; + throw error3; } }); } downloadArtifact(artifactId, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = __rest4(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 (error4) { - (0, core_1.warning)(`Download Artifact failed with error: ${error4}. + } 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 error4; + throw error3; } }); } listArtifacts(options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { if ((0, config_1.isGhes)()) { throw new errors_1.GHESNotSupportedError(); @@ -111959,18 +118141,18 @@ If the error persists, please check whether Actions and API requests are operati 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 (error4) { - (0, core_1.warning)(`Listing Artifacts failed with error: ${error4}. + } 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 error4; + throw error3; } }); } getArtifact(artifactName, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { if ((0, config_1.isGhes)()) { throw new errors_1.GHESNotSupportedError(); @@ -111980,18 +118162,18 @@ If the error persists, please check whether Actions and API requests are operati return (0, get_artifact_1.getArtifactPublic)(artifactName, workflowRunId, repositoryOwner, repositoryName, token); } return (0, get_artifact_1.getArtifactInternal)(artifactName); - } catch (error4) { - (0, core_1.warning)(`Get Artifact failed with error: ${error4}. + } 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 error4; + throw error3; } }); } deleteArtifact(artifactName, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { if ((0, config_1.isGhes)()) { throw new errors_1.GHESNotSupportedError(); @@ -112001,13 +118183,13 @@ If the error persists, please check whether Actions and API requests are operati return (0, delete_artifact_1.deleteArtifactPublic)(artifactName, workflowRunId, repositoryOwner, repositoryName, token); } return (0, delete_artifact_1.deleteArtifactInternal)(artifactName); - } catch (error4) { - (0, core_1.warning)(`Delete Artifact failed with error: ${error4}. + } 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 error4; + throw error3; } }); } @@ -112028,7 +118210,7 @@ var require_interfaces2 = __commonJS({ var require_artifact2 = __commonJS({ "node_modules/@actions/artifact/lib/artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -112041,82 +118223,142 @@ var require_artifact2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); + 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(); - __exportStar4(require_interfaces2(), exports2); - __exportStar4(require_errors3(), exports2); - __exportStar4(require_client2(), exports2); + __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/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) { +// 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.checkArtifactFilePath = exports2.checkArtifactName = 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 checkArtifactName(name) { - if (!name) { - throw new Error(`Artifact name: ${name}, is incorrectly provided`); + 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; } - 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.`); - } + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - (0, core_1.info)(`Artifact name is valid!`); + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; } - exports2.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path15) { - if (!path15) { - throw new Error(`Artifact path: ${path15}, is incorrectly provided`); + exports2.toCommandProperties = toCommandProperties; + } +}); + +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/command.js +var require_command4 = __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]; + } }; } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path15.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path15}. 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. - `); + 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 os4 = __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() + os4.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"); } - 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/file-command.js +var require_file_command4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -112129,579 +118371,864 @@ var require_upload_specification = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUploadSpecification = void 0; - var fs17 = __importStar4(require("fs")); - var core_1 = require_core(); - 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 (!fs17.existsSync(rootDirectory)) { - throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs18 = __importStar2(require("fs")); + var os4 = __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 (!fs17.statSync(rootDirectory).isDirectory()) { - throw new Error(`Provided rootDirectory ${rootDirectory} is not a valid directory`); + if (!fs18.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - rootDirectory = (0, path_1.normalize)(rootDirectory); - rootDirectory = (0, path_1.resolve)(rootDirectory); - for (let file of artifactFiles) { - if (!fs17.existsSync(file)) { - throw new Error(`File ${file} does not exist`); - } - if (!fs17.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`); - } + fs18.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os4.EOL}`, { + encoding: "utf8" + }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - return specifications; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os4.EOL}${convertedValue}${os4.EOL}${delimiter}`; } - exports2.getUploadSpecification = getUploadSpecification; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/tmp/lib/tmp.js -var require_tmp = __commonJS({ - "node_modules/tmp/lib/tmp.js"(exports2, module2) { - var fs17 = require("fs"); - var os3 = require("os"); - var path15 = require("path"); - var crypto = require("crypto"); - var _c = { fs: fs17.constants, os: os3.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 = os3.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 = fs17.rmdirSync.bind(fs17); - var _gracefulCleanup = false; - function rimraf(dirPath, callback) { - return fs17.rm(dirPath, { recursive: true }, callback); +// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js +var require_proxy5 = __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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; + } } - function FN_RIMRAF_SYNC(dirPath) { - return fs17.rmSync(dirPath, { recursive: true }); + 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; } - 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() { + 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_lib7 = __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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { try { - const name = _generateTmpName(sanitizedOptions); - fs17.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); + step(generator.next(value)); + } catch (e) { + reject(e); } - })(); - }); - } - function tmpNameSync(options) { - const args = _parseArguments(options), opts = args[0]; - const sanitizedOptions = _assertAndSanitizeOptionsSync(opts); - let tries = sanitizedOptions.tries; - do { - const name = _generateTmpName(sanitizedOptions); - try { - fs17.statSync(name); - } catch (e) { - return name; } - } while (tries-- > 0); - throw new Error("Could not get a unique tmp filename, max tries reached"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve8(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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy5()); + 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 : ""; } - 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); - fs17.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { - if (err2) return cb(err2); - if (opts.discardDescriptor) { - return fs17.close(fd, function _discardCallback(possibleErr) { - return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false)); + 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((resolve8) => __awaiter2(this, void 0, void 0, function* () { + let output = Buffer.alloc(0); + this.message.on("data", (chunk) => { + output = Buffer.concat([output, chunk]); }); - } else { - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false)); + this.message.on("end", () => { + resolve8(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve8(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(userAgent, 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 = userAgent; + 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 || {}); }); - }); - } - function fileSync(options) { - const args = _parseArguments(options), opts = args[0]; - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - const name = tmpNameSync(opts); - let fd = fs17.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); - if (opts.discardDescriptor) { - fs17.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); - fs17.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { - if (err2) return cb(err2); - cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); }); - }); - } - function dirSync(options) { - const args = _parseArguments(options), opts = args[0]; - const name = tmpNameSync(opts); - fs17.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]) - fs17.close(fdPath[0], function() { - fs17.unlink(fdPath[1], _handler); + } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); - else fs17.unlink(fdPath[1], _handler); - } - function _removeFileSync(fdPath) { - let rethrownException = null; - try { - if (0 <= fdPath[0]) fs17.closeSync(fdPath[0]); - } catch (e) { - if (!_isEBADF(e) && !_isENOENT(e)) throw e; - } finally { - try { - fs17.unlinkSync(fdPath[1]); - } catch (e) { - if (!_isENOENT(e)) rethrownException = e; - } } - if (rethrownException !== null) { - throw rethrownException; + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); } - } - 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 : fs17.rmdir.bind(fs17); - 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 index = _removeObjects.indexOf(toRemove); - if (index >= 0) _removeObjects.splice(index, 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) { - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - } - function _randomChars(howMany) { - let value = [], rnd = null; - try { - rnd = crypto.randomBytes(howMany); - } catch (e) { - rnd = crypto.pseudoRandomBytes(howMany); + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - for (let i = 0; i < howMany; i++) { - value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - return value.join(""); - } - function _isUndefined(obj) { - return typeof obj === "undefined"; - } - function _parseArguments(options, callback) { - if (typeof options === "function") { - return [{}, options]; + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); } - if (_isUndefined(options)) { - return [{}, callback]; + /** + * 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); + }); } - const actualOptions = {}; - for (const key of Object.getOwnPropertyNames(options)) { - actualOptions[key] = options[key]; + 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); + }); } - return [actualOptions, callback]; - } - function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path15.isAbsolute(name) ? name : path15.join(tmpDir, name); - fs17.stat(pathToResolve, function(err) { - if (err) { - fs17.realpath(path15.dirname(pathToResolve), function(err2, parentDir) { - if (err2) return cb(err2); - cb(null, path15.join(parentDir, path15.basename(pathToResolve))); + 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 info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, 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(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve8(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; + } + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.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: ${info7.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 { - fs17.realpath(path15, cb); + req.end(); } - }); - } - function _resolvePathSync(name, tmpDir) { - const pathToResolve = path15.isAbsolute(name) ? name : path15.join(tmpDir, name); - try { - fs17.statSync(pathToResolve); - return fs17.realpathSync(pathToResolve); - } catch (_err) { - const parentDir = fs17.realpathSync(path15.dirname(pathToResolve)); - return path15.join(parentDir, path15.basename(pathToResolve)); - } - } - function _generateTmpName(opts) { - const tmpDir = opts.tmpdir; - if (!_isUndefined(opts.name)) { - return path15.join(tmpDir, opts.dir, opts.name); } - if (!_isUndefined(opts.template)) { - return path15.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + /** + * 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); } - const name = [ - opts.prefix ? opts.prefix : "tmp", - "-", - process.pid, - "-", - _randomChars(12), - opts.postfix ? "-" + opts.postfix : "" - ].join(""); - return path15.join(tmpDir, opts.dir, name); - } - function _assertOptionsBase(options) { - if (!_isUndefined(options.name)) { - const name = options.name; - if (path15.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename = path15.basename(name); - if (basename === ".." || basename === "." || basename !== name) - throw new Error(`name option must not contain a path, found "${name}".`); + 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); } - if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) { - throw new Error(`Invalid template, found "${options.template}".`); + _prepareRequest(method, requestUrl, headers) { + const info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); + } + } + return info7; } - if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) { - throw new Error(`Invalid tries, found "${options.tries}".`); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - 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) ? "" : options.prefix; - options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; - } - function _getRelativePath(option, name, tmpDir, cb) { - if (_isUndefined(name)) return cb(null); - _resolvePath(name, tmpDir, function(err, resolvedPath) { - if (err) return cb(err); - const relativePath = path15.relative(tmpDir, resolvedPath); - if (!resolvedPath.startsWith(tmpDir)) { - return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - cb(null, relativePath); - }); - } - function _getRelativePathSync(option, name, tmpDir) { - if (_isUndefined(name)) return; - const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath = path15.relative(tmpDir, resolvedPath); - if (!resolvedPath.startsWith(tmpDir)) { - throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); + return additionalHeaders[header] || clientHeader || _default2; } - return relativePath; - } - 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); + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - _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(error4) { - return _isExpectedError(error4, -EBADF, "EBADF"); - } - function _isENOENT(error4) { - return _isExpectedError(error4, -ENOENT, "ENOENT"); - } - function _isExpectedError(error4, errno, code) { - return IS_WIN32 ? error4.code === code : error4.code === code && error4.errno === errno; - } - function setGracefulCleanup() { - _gracefulCleanup = true; - } - function _getTmpDir(options, cb) { - return fs17.realpath(options && options.tmpdir || os3.tmpdir(), cb); - } - function _getTmpDirSync(options) { - return fs17.realpathSync(options && options.tmpdir || os3.tmpdir()); - } - process.addListener(EXIT, _garbageCollector); - Object.defineProperty(module2.exports, "tmpdir", { - enumerable: true, - configurable: false, - get: function() { - return _getTmpDirSync(); + 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 https2.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; } - }); - 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, path15, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path15, fd, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.file = async (options) => fileWithOptions(options); - module2.exports.withFile = async function withFile(fn, options) { - const { path: path15, fd, cleanup } = await module2.exports.file(options); - try { - return await fn({ path: path15, fd }); - } finally { - await cleanup(); + _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; } - }; - module2.exports.dirSync = tmp.dirSync; - var dirWithOptions = promisify( - (options, cb) => tmp.dir( - options, - (err, path15, cleanup) => err ? cb(err) : cb(void 0, { path: path15, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.dir = async (options) => dirWithOptions(options); - module2.exports.withDir = async function withDir(fn, options) { - const { path: path15, cleanup } = await module2.exports.dir(options); - try { - return await fn({ path: path15 }); - } finally { - await cleanup(); + _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((resolve8) => setTimeout(() => resolve8(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve8(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 { + resolve8(response); + } + })); + }); } }; - module2.exports.tmpNameSync = tmp.tmpNameSync; - module2.exports.tmpName = promisify(tmp.tmpName); - module2.exports.tmpdir = tmp.tmpdir; - module2.exports.setGracefulCleanup = tmp.setGracefulCleanup; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js -var require_proxy7 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js +var require_auth4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } else { - return void 0; + function step(result) { + result.done ? resolve8(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; } - } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { + 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; } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { + }; + 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; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - 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; + // 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")}`; } - 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; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - get password() { - return this._decodedPassword; + 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/http-client/lib/index.js -var require_lib9 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -112729,571 +119256,616 @@ var require_lib9 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy7()); - var tunnel = __importStar4(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.OidcClient = void 0; + var http_client_1 = require_lib7(); + var auth_1 = require_auth4(); + var core_1 = require_core5(); + 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); } - }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + 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; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(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", () => { - resolve8(output.toString()); - }); - })); + 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 _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); + } + return id_token; }); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve8(Buffer.concat(chunks)); - }); - })); + 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.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/summary.js +var require_summary4 = __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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; + } + function step(result) { + result.done ? resolve8(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; } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + 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.`); } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); + this._filePath = pathFromEnv; + return this._filePath; }); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + /** + * 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}`; } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); + /** + * 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(); }); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + /** + * 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 }); }); } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + * 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 */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(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); - }); + addRaw(text, addEOL = false) { + this._buffer += text; + return addEOL ? this.addEOL() : this; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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(); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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(); } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * Adds an HTML table to the summary buffer + * + * @param {SummaryTableCell[]} rows table rows + * + * @returns {Summary} summary instance */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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); + addTable(rows) { + const tableBody = rows.map((row) => { + const cells = row.map((cell) => { + if (typeof cell === "string") { + return this.wrap("td", cell); } - } while (numTries < maxTries); - return response; - }); + 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(); } /** - * Needs to be called if keepAlive is set to true in request options. + * 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 */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; + addDetails(label, content) { + const element = this.wrap("details", this.wrap("summary", label) + content); + return this.addRaw(element).addEOL(); } /** - * Raw request. - * @param info - * @param data + * 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 */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve8(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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(); } /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * 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 */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info7.httpModule.request(info7.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: ${info7.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(); - } + 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(); } /** - * 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 + * Adds an HTML thematic break (
) to the summary buffer + * + * @returns {Summary} summary instance */ - getAgent(serverUrl) { - const parsedUrl = new URL(serverUrl); - return this._getAgent(parsedUrl); + addSeparator() { + const element = this.wrap("hr", null); + return this.addRaw(element).addEOL(); } - 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); + /** + * 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(); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } - } - return info7; + /** + * 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(); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + /** + * 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(); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + }; + 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_utils4 = __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]; + } }; } - _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; + 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 path16 = __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, path16.sep); + } + exports2.toPlatformPath = toPlatformPath; + } +}); + +// node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io-util.js +var require_io_util4 = __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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (proxyAgent) { - return proxyAgent; + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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 - }); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + 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 fs18 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + _a = fs18.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs18.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 proxyAgent; + 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'); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve8) => setTimeout(() => resolve8(), ms)); - }); + if (exports2.IS_WINDOWS) { + return p.startsWith("\\") || /^[A-Z]:/i.test(p); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve8(response); + 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 = path16.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { + return filePath; } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; + } else { + if (isUnixExecutable(stats)) { + return filePath; } - 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) { + } + } + 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 (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; - } else { - msg = `Failed request: (${statusCode})`; + } + if (stats && stats.isFile()) { + if (exports2.IS_WINDOWS) { + try { + const directory = path16.dirname(filePath); + const upperName = path16.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path16.join(directory, actualName); + break; + } + } + } catch (err) { + console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); + return filePath; } else { - resolve8(response); + 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, "\\"); } - }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js -var require_auth4 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io.js +var require_io4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -113321,793 +119893,795 @@ var require_auth4 = __commonJS({ }); }; 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"); + exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + var assert_1 = require("assert"); + var path16 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util4()); + 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; } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path16.join(dest, path16.basename(source)) : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + 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 (path16.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// 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.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 = path16.join(dest, path16.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(path16.dirname(dest)); + yield ioUtil.rename(source, dest); + }); } - exports2.getInitialRetryIntervalInMilliseconds = getInitialRetryIntervalInMilliseconds; - function getDownloadFileConcurrency() { - return 2; + 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.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.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.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.mkdirP = mkdirP; + function which7(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + if (check) { + const result = yield which7(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.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.which = which7; + 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(path16.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(path16.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path16.delimiter)) { + if (p) { + directories.push(p); + } + } + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path16.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); } - 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.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 }; } - exports2.getWorkSpaceDirectory = getWorkSpaceDirectory; - function getRetentionDays() { - return process.env["GITHUB_RETENTION_DAYS"]; + 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 copyFile(srcFile, destFile, force); + } + } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - exports2.getRetentionDays = getRetentionDays; - function isGhes() { - const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); - return ghUrl.hostname.toUpperCase() !== "GITHUB.COM"; + function copyFile(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); + } + }); } - 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner4 = __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(resolve8) { + resolve8(value); + }); + } + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; 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); + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os4 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io4()); + var ioUtil = __importStar2(require_io_util4()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - 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); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); } - 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(); + _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(os4.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os4.EOL.length); + n = s.indexOf(os4.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(str2, end) { + return str2.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; } - toBuffer() { - return Buffer.from([0, 8, 16, 24, 32, 40, 48, 56].map((s) => Number(this._crc >> BigInt(s) & BigInt(255)))); + _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; } - static flip64Bits(n) { - return (BigInt(1) << BigInt(64)) - BigInt(1) - n; + /** + * 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 = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io7.which(this.toolPath, true); + return new Promise((resolve8, 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) + os4.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 { + resolve8(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - exports2.default = CRC64; - } -}); - -// node_modules/@actions/artifact-legacy/lib/internal/utils.js -var require_utils7 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/utils.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; + } + arg += c; + escaped = false; } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); } + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + if (c === "\\" && escaped) { + append(c); + continue; } - function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + if (c === "\\" && inQuotes) { + escaped = true; + continue; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("crypto")); - var fs_1 = require("fs"); - var core_1 = require_core(); - var http_client_1 = require_lib9(); - var auth_1 = require_auth4(); - var config_variables_1 = require_config_variables(); - var crc64_1 = __importDefault4(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; + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; } - (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; + append(c); } - if (digest) { - requestOptions["x-actions-results-crc64"] = digest.crc64; - requestOptions["x-actions-results-md5"] = digest.md5; + if (arg.length > 0) { + args.push(arg.trim()); } - return requestOptions; - } - exports2.getUploadHeaders = getUploadHeaders; - function createHttpClient(userAgent) { - return new http_client_1.HttpClient(userAgent, [ - 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 ######`); + return args; } - exports2.displayHttpDiagnostics = displayHttpDiagnostics; - function createDirectoriesForArtifact(directories) { - return __awaiter4(this, void 0, void 0, function* () { - for (const directory of directories) { - yield fs_1.promises.mkdir(directory, { - recursive: true - }); + 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"); } - }); - } - exports2.createDirectoriesForArtifact = createDirectoriesForArtifact; - function createEmptyFilesForArtifact(emptyFilesToCreate) { - return __awaiter4(this, void 0, void 0, function* () { - for (const filePath of emptyFilesToCreate) { - yield (yield fs_1.promises.open(filePath, "w")).close(); + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - }); - } - exports2.createEmptyFilesForArtifact = createEmptyFilesForArtifact; - function getFileSize(filePath) { - return __awaiter4(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 __awaiter4(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; + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - return retention; - } - exports2.getProperRetention = getProperRetention; - function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => setTimeout(resolve8, milliseconds)); - }); - } - exports2.sleep = sleep; - function digestForStream(stream2) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8, 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", () => resolve8({ - 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_core(); - 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}`); + _debug(message) { + this.emit("debug", message); } - stop() { - if (this.totalFileStatus) { - clearInterval(this.totalFileStatus); + _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); } - incrementProcessedCount() { - this.processedCount++; - } - formatPercentage(numerator, denominator) { - return (numerator / denominator * 100).toFixed(4).toString(); + 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(); } }; - 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/exec.js +var require_exec4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpManager = void 0; - var utils_1 = require_utils7(); - var HttpManager = class { - constructor(clientCount, userAgent) { - if (clientCount < 1) { - throw new Error("There must be at least one client"); - } - this.userAgent = userAgent; - this.clients = new Array(clientCount).fill((0, utils_1.createHttpClient)(userAgent)); - } - getClient(index) { - return this.clients[index]; + 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); } - // 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(index) { - this.clients[index].dispose(); - this.clients[index] = (0, utils_1.createHttpClient)(this.userAgent); + __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(resolve8) { + resolve8(value); + }); } - disposeAndReplaceAllClients() { - for (const [index] of this.clients.entries()) { - this.disposeAndReplaceClient(index); + return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - exports2.HttpManager = HttpManager; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner4()); + 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 _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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/lib/internal/upload-gzip.js -var require_upload_gzip = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/upload-gzip.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/platform.js +var require_platform4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -114120,21 +120694,21 @@ var require_upload_gzip = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -114161,120 +120735,72 @@ var require_upload_gzip = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; - var fs17 = __importStar4(require("fs")); - var zlib3 = __importStar4(require("zlib")); - var util_1 = require("util"); - var stat = (0, util_1.promisify)(fs17.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 __awaiter4(this, void 0, void 0, function* () { - for (const gzipExemptExtension of gzipExemptFileExtensions) { - if (originalFilePath.endsWith(gzipExemptExtension)) { - return Number.MAX_SAFE_INTEGER; - } - } - return new Promise((resolve8, reject) => { - const inputStream = fs17.createReadStream(originalFilePath); - const gzip = zlib3.createGzip(); - const outputStream = fs17.createWriteStream(tempFilePath); - inputStream.pipe(gzip).pipe(outputStream); - outputStream.on("finish", () => __awaiter4(this, void 0, void 0, function* () { - const size = (yield stat(tempFilePath)).size; - resolve8(size); - })); - outputStream.on("error", (error4) => { - console.log(error4); - reject(error4); - }); - }); + exports2.getDetails = exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; + var os_1 = __importDefault2(require("os")); + var exec3 = __importStar2(require_exec4()); + 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 }); - } - exports2.createGZipFileOnDisk = createGZipFileOnDisk; - function createGZipFileInBuffer(originalFilePath) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve8) => __awaiter4(this, void 0, void 0, function* () { - var _a, e_1, _b, _c; - const inputStream = fs17.createReadStream(originalFilePath); - const gzip = zlib3.createGzip(); - inputStream.pipe(gzip); - const chunks = []; - try { - for (var _d = true, gzip_1 = __asyncValues4(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), _a = gzip_1_1.done, !_a; ) { - _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 && !_a && (_b = gzip_1.return)) yield _b.call(gzip_1); - } finally { - if (e_1) throw e_1.error; - } - } - resolve8(Buffer.concat(chunks)); - })); + 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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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.createGZipFileInBuffer = createGZipFileInBuffer; + exports2.getDetails = getDetails; } }); -// node_modules/@actions/artifact-legacy/lib/internal/requestUtils.js -var require_requestUtils2 = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/requestUtils.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/core.js +var require_core5 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/core.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -114287,21 +120813,21 @@ var require_requestUtils2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -114329,488 +120855,1086 @@ var require_requestUtils2 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientRequest = exports2.retry = void 0; - var utils_1 = require_utils7(); - var core18 = __importStar4(require_core()); - var config_variables_1 = require_config_variables(); - function retry3(name, operation, customErrorMessages, maxAttempts) { - return __awaiter4(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 (error4) { - isRetryable = true; - errorMessage = error4.message; + 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_command4(); + var file_command_1 = require_file_command4(); + var utils_1 = require_utils10(); + var os4 = __importStar2(require("os")); + var path16 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils4(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable9(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 = exportVariable9; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(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}${path16.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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 setOutput(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(os4.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning12(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning12; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os4.EOL); + } + exports2.info = info7; + 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 saveState2(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 = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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_summary4(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary4(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils4(); + 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_platform4()); + } +}); + +// 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_core5(); + 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(path16) { + if (!path16) { + throw new Error(`Artifact path: ${path16}, is incorrectly provided`); + } + for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { + if (path16.includes(invalidCharacterKey)) { + throw new Error(`Artifact path is not valid: ${path16}. 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 fs18 = __importStar2(require("fs")); + var core_1 = require_core5(); + 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 (!fs18.existsSync(rootDirectory)) { + throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); + } + if (!fs18.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 (!fs18.existsSync(file)) { + throw new Error(`File ${file} does not exist`); + } + if (!fs18.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}`); } - if (!isRetryable) { - core18.info(`${name} - Error is not retryable`); - if (response) { - (0, utils_1.displayHttpDiagnostics)(response); - } - break; + 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 fs18 = require("fs"); + var os4 = require("os"); + var path16 = require("path"); + var crypto2 = require("crypto"); + var _c = { fs: fs18.constants, os: os4.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 = os4.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 = fs18.rmdirSync.bind(fs18); + var _gracefulCleanup = false; + function rimraf(dirPath, callback) { + return fs18.rm(dirPath, { recursive: true }, callback); + } + function FN_RIMRAF_SYNC(dirPath) { + return fs18.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); + fs18.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); } - core18.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 = retry3; - function retryHttpClientRequest(name, method, customErrorMessages = /* @__PURE__ */ new Map(), maxAttempts = (0, config_variables_1.getRetryLimit)()) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3(name, method, customErrorMessages, maxAttempts); + function tmpNameSync(options) { + const args = _parseArguments(options), opts = args[0]; + const sanitizedOptions = _assertAndSanitizeOptionsSync(opts); + let tries = sanitizedOptions.tries; + do { + const name = _generateTmpName(sanitizedOptions); + try { + fs18.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); + fs18.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { + if (err2) return cb(err2); + if (opts.discardDescriptor) { + return fs18.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)); + } + }); }); } - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + function fileSync(options) { + const args = _parseArguments(options), opts = args[0]; + const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; + const name = tmpNameSync(opts); + let fd = fs18.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + if (opts.discardDescriptor) { + fs18.closeSync(fd); + fd = void 0; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); + 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); + fs18.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); + fs18.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]) + fs18.close(fdPath[0], function() { + fs18.unlink(fdPath[1], _handler); }); + else fs18.unlink(fdPath[1], _handler); + } + function _removeFileSync(fdPath) { + let rethrownException = null; + try { + if (0 <= fdPath[0]) fs18.closeSync(fdPath[0]); + } catch (e) { + if (!_isEBADF(e) && !_isENOENT(e)) throw e; + } finally { + try { + fs18.unlinkSync(fdPath[1]); + } catch (e) { + if (!_isENOENT(e)) rethrownException = e; + } } - return new (P || (P = Promise))(function(resolve8, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(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 : fs18.rmdir.bind(fs18); + 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 index = _removeObjects.indexOf(toRemove); + if (index >= 0) _removeObjects.splice(index, 1); + called = true; + if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { + return removeFunction(fileOrDirName); + } else { + return removeFunction(fileOrDirName, next || function() { + }); } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + }; + } + function _garbageCollector() { + if (!_gracefulCleanup) return; + while (_removeObjects.length) { + try { + _removeObjects[0](); + } catch (e) { } - function step(result) { - result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + } + function _randomChars(howMany) { + let value = [], rnd = null; + try { + rnd = crypto2.randomBytes(howMany); + } catch (e) { + rnd = crypto2.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 = path16.isAbsolute(name) ? name : path16.join(tmpDir, name); + fs18.stat(pathToResolve, function(err) { + if (err) { + fs18.realpath(path16.dirname(pathToResolve), function(err2, parentDir) { + if (err2) return cb(err2); + cb(null, path16.join(parentDir, path16.basename(pathToResolve))); + }); + } else { + fs18.realpath(path16, cb); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UploadHttpClient = void 0; - var fs17 = __importStar4(require("fs")); - var core18 = __importStar4(require_core()); - var tmp = __importStar4(require_tmp_promise()); - var stream2 = __importStar4(require("stream")); - var utils_1 = require_utils7(); - 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_lib9(); - var http_manager_1 = require_http_manager(); - var upload_gzip_1 = require_upload_gzip(); - var requestUtils_1 = require_requestUtils2(); - var stat = (0, util_1.promisify)(fs17.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); + } + function _resolvePathSync(name, tmpDir) { + const pathToResolve = path16.isAbsolute(name) ? name : path16.join(tmpDir, name); + try { + fs18.statSync(pathToResolve); + return fs18.realpathSync(pathToResolve); + } catch (_err) { + const parentDir = fs18.realpathSync(path16.dirname(pathToResolve)); + return path16.join(parentDir, path16.basename(pathToResolve)); } - /** - * 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 __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return client.post(artifactUrl, data, headers); - }), customErrorMessages); - const body = yield response.readBody(); - return JSON.parse(body); - }); + } + function _generateTmpName(opts) { + const tmpDir = opts.tmpdir; + if (!_isUndefined(opts.name)) { + return path16.join(tmpDir, opts.dir, opts.name); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - const FILE_CONCURRENCY = (0, config_variables_1.getUploadFileConcurrency)(); - const MAX_CHUNK_SIZE = (0, config_variables_1.getUploadChunkSize)(); - core18.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((index) => __awaiter4(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(index, currentFileParameters); - if (core18.isDebug()) { - core18.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) { - core18.error(`aborting artifact upload`); - abortPendingFileUploads = true; - } - } - this.statusReporter.incrementProcessedCount(); - } - }))); - this.statusReporter.stop(); - this.uploadHttpManager.disposeAndReplaceAllClients(); - core18.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); - return { - uploadSize: uploadFileSize, - totalSize: totalFileSize, - failedItems: failedItemsToReport - }; - }); + if (!_isUndefined(opts.template)) { + return path16.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - const fileStat = yield stat(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) { - core18.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) { - core18.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 = () => fs17.createReadStream(parameters.file); - isGzip = false; - uploadFileSize = totalFileSize; - } else { - core18.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; - core18.warning(`Aborting upload for ${parameters.file} due to failure`); - } - return { - isSuccess: isUploadSuccessful, - successfulUploadSize: uploadFileSize - failedChunkSizes, - totalSize: totalFileSize - }; - } else { - const tempFile = yield tmp.file(); - core18.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) { - core18.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 { - core18.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, () => fs17.createReadStream(uploadFilePath, { - start: startChunkIndex, - end: endChunkIndex, - autoClose: false - }), startChunkIndex, endChunkIndex, uploadFileSize, isGzip, totalFileSize); - if (!result) { - isUploadSuccessful = false; - failedChunkSizes += chunkSize; - core18.warning(`Aborting upload for ${parameters.file} due to failure`); - abortFileUpload = true; - } else { - if (uploadFileSize > 8388608) { - this.statusReporter.updateLargeFileStatus(parameters.file, startChunkIndex, endChunkIndex, uploadFileSize); - } - } - } - core18.debug(`deleting temporary gzip file ${tempFile.path}`); - yield tempFile.cleanup(); - return { - isSuccess: isUploadSuccessful, - successfulUploadSize: uploadFileSize - failedChunkSizes, - totalSize: totalFileSize - }; - } - }); + const name = [ + opts.prefix ? opts.prefix : "tmp", + "-", + process.pid, + "-", + _randomChars(12), + opts.postfix ? "-" + opts.postfix : "" + ].join(""); + return path16.join(tmpDir, opts.dir, name); + } + function _assertOptionsBase(options) { + if (!_isUndefined(options.name)) { + const name = options.name; + if (path16.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); + const basename2 = path16.basename(name); + if (basename2 === ".." || basename2 === "." || basename2 !== name) + throw new Error(`name option must not contain a path, found "${name}".`); } - /** - * 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 __awaiter4(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 = () => __awaiter4(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); - } - core18.info(`Retry limit has been reached for chunk at offset ${start} to ${resourceUrl}`); - return true; - } - return false; - }; - const backOff = (retryAfterValue) => __awaiter4(this, void 0, void 0, function* () { - this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); - if (retryAfterValue) { - core18.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); - core18.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); - yield (0, utils_1.sleep)(backoffTime); - } - core18.info(`Finished backoff for retry #${retryCount}, continuing with upload`); - return; + if (!_isUndefined(options.template) && !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) ? "" : options.prefix; + options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; + } + function _getRelativePath(option, name, tmpDir, cb) { + if (_isUndefined(name)) return cb(null); + _resolvePath(name, tmpDir, function(err, resolvedPath) { + if (err) return cb(err); + const relativePath = path16.relative(tmpDir, resolvedPath); + if (!resolvedPath.startsWith(tmpDir)) { + return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); + } + cb(null, relativePath); + }); + } + function _getRelativePathSync(option, name, tmpDir) { + if (_isUndefined(name)) return; + const resolvedPath = _resolvePathSync(name, tmpDir); + const relativePath = path16.relative(tmpDir, resolvedPath); + if (!resolvedPath.startsWith(tmpDir)) { + throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); + } + return relativePath; + } + 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); }); - while (retryCount <= retryLimit) { - let response; - try { - response = yield uploadChunkRequest(); - } catch (error4) { - core18.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); - console.log(error4); - 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)) { - core18.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 { - core18.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); - (0, utils_1.displayHttpDiagnostics)(response); - return false; - } - } - return false; }); + }); + } + 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 fs18.realpath(options && options.tmpdir || os4.tmpdir(), cb); + } + function _getTmpDirSync(options) { + return fs18.realpathSync(options && options.tmpdir || os4.tmpdir()); + } + process.addListener(EXIT, _garbageCollector); + Object.defineProperty(module2.exports, "tmpdir", { + enumerable: true, + configurable: false, + get: function() { + return _getTmpDirSync(); } - /** - * 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 __awaiter4(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); - core18.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", () => __awaiter4(this, void 0, void 0, function* () { - return client.patch(resourceUrl.toString(), data, headers); - }), customErrorMessages); - yield response.readBody(); - core18.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); - }); + }); + 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, path16, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path16, fd, cleanup: promisify(cleanup) }) + ) + ); + module2.exports.file = async (options) => fileWithOptions(options); + module2.exports.withFile = async function withFile(fn, options) { + const { path: path16, fd, cleanup } = await module2.exports.file(options); + try { + return await fn({ path: path16, fd }); + } finally { + await cleanup(); } }; - exports2.UploadHttpClient = UploadHttpClient; + module2.exports.dirSync = tmp.dirSync; + var dirWithOptions = promisify( + (options, cb) => tmp.dir( + options, + (err, path16, cleanup) => err ? cb(err) : cb(void 0, { path: path16, cleanup: promisify(cleanup) }) + ) + ); + module2.exports.dir = async (options) => dirWithOptions(options); + module2.exports.withDir = async function withDir(fn, options) { + const { path: path16, cleanup } = await module2.exports.dir(options); + try { + return await fn({ path: path16 }); + } 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/download-http-client.js -var require_download_http_client = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/download-http-client.js"(exports2) { +// 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"; - var __createBinding4 = 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(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(); + } } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -114837,296 +121961,319 @@ var require_download_http_client = __commonJS({ 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.DownloadHttpClient = void 0; - var fs17 = __importStar4(require("fs")); - var core18 = __importStar4(require_core()); - var zlib3 = __importStar4(require("zlib")); - var utils_1 = require_utils7(); - 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(); + 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_core5(); + var http_client_1 = require_lib7(); + var auth_1 = require_auth4(); 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); + 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)(); } - /** - * Gets a list of all artifacts that are in a specific container - */ - listArtifacts() { - return __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return client.get(artifactUrl, headers); - })); - const body = yield response.readBody(); - return JSON.parse(body); - }); + 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; } - /** - * 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 __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return client.get(resourceUrl.toString(), headers); - })); - const body = yield response.readBody(); - return JSON.parse(body); - }); + return value; + } + exports2.parseEnvNumber = parseEnvNumber; + function getApiVersion() { + return "6.0-preview"; + } + exports2.getApiVersion = getApiVersion; + function isSuccessStatusCode(statusCode) { + if (!statusCode) { + return false; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - const DOWNLOAD_CONCURRENCY = (0, config_variables_1.getDownloadFileConcurrency)(); - core18.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); - const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; - let currentFile = 0; - let downloadedFiles = 0; - core18.info(`Total number of files that will be downloaded: ${downloadItems.length}`); - this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); - this.statusReporter.start(); - yield Promise.all(parallelDownloads.map((index) => __awaiter4(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(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); - if (core18.isDebug()) { - core18.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); - } - this.statusReporter.incrementProcessedCount(); - } - }))).catch((error4) => { - throw new Error(`Unable to download the artifact: ${error4}`); - }).finally(() => { - this.statusReporter.stop(); - this.downloadHttpManager.disposeAndReplaceAllClients(); - }); - }); + return statusCode >= 200 && statusCode < 300; + } + exports2.isSuccessStatusCode = isSuccessStatusCode; + function isForbiddenStatusCode(statusCode) { + if (!statusCode) { + return false; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - let retryCount = 0; - const retryLimit = (0, config_variables_1.getRetryLimit)(); - let destinationStream = fs17.createWriteStream(downloadPath); - const headers = (0, utils_1.getDownloadHeaders)("application/json", true, true); - const makeDownloadRequest = () => __awaiter4(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) => __awaiter4(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) { - core18.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); - core18.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); - yield (0, utils_1.sleep)(backoffTime); - } - core18.info(`Finished backoff for retry #${retryCount}, continuing with download`); - } - }); - const isAllBytesReceived = (expected, received) => { - if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { - core18.info("Skipping download validation."); - return true; - } - return parseInt(expected) === received; - }; - const resetDestinationStream = (fileDownloadPath) => __awaiter4(this, void 0, void 0, function* () { - destinationStream.close(); - yield new Promise((resolve8) => { - destinationStream.on("close", resolve8); - if (destinationStream.writableFinished) { - resolve8(); - } - }); - yield (0, utils_1.rmFile)(fileDownloadPath); - destinationStream = fs17.createWriteStream(fileDownloadPath); - }); - while (retryCount <= retryLimit) { - let response; - try { - response = yield makeDownloadRequest(); - } catch (error4) { - core18.info("An error occurred while attempting to download a file"); - console.log(error4); - 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 (error4) { - forceRetry = true; - } - } - if (forceRetry || (0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core18.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}`)); - } - } - }); + return statusCode === http_client_1.HttpCodes.Forbidden; + } + exports2.isForbiddenStatusCode = isForbiddenStatusCode; + function isRetryableStatusCode(statusCode) { + if (!statusCode) { + return false; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - yield new Promise((resolve8, reject) => { - if (isGzip) { - const gunzip = zlib3.createGunzip(); - response.message.on("error", (error4) => { - core18.info(`An error occurred while attempting to read the response stream`); - gunzip.close(); - destinationStream.close(); - reject(error4); - }).pipe(gunzip).on("error", (error4) => { - core18.info(`An error occurred while attempting to decompress the response stream`); - destinationStream.close(); - reject(error4); - }).pipe(destinationStream).on("close", () => { - resolve8(); - }).on("error", (error4) => { - core18.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error4); - }); - } else { - response.message.on("error", (error4) => { - core18.info(`An error occurred while attempting to read the response stream`); - destinationStream.close(); - reject(error4); - }).pipe(destinationStream).on("close", () => { - resolve8(); - }).on("error", (error4) => { - core18.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error4); - }); - } + 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(userAgent) { + return new http_client_1.HttpClient(userAgent, [ + 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 }); - return; - }); + } + }); + } + 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."); } - }; - exports2.DownloadHttpClient = DownloadHttpClient; + 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((resolve8) => setTimeout(resolve8, milliseconds)); + }); + } + exports2.sleep = sleep; + function digestForStream(stream2) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8, 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", () => resolve8({ + crc64: crc64.digest("base64"), + md5: md5.digest("base64") + })).on("error", reject); + }); + }); + } + exports2.digestForStream = digestForStream; } }); -// 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) { +// 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"; - var __createBinding4 = 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(exports2, "__esModule", { value: true }); + exports2.StatusReporter = void 0; + var core_1 = require_core5(); + var StatusReporter = class { + constructor(displayFrequencyInMilliseconds) { + this.totalNumberOfFilesToProcess = 0; + this.processedCount = 0; + this.largeFiles = /* @__PURE__ */ new Map(); + this.totalFileStatus = void 0; + this.displayFrequencyInMilliseconds = displayFrequencyInMilliseconds; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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(); } - __setModuleDefault4(result, mod); - return result; }; + 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.getDownloadSpecification = void 0; - var path15 = __importStar4(require("path")); - function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { - const directories = /* @__PURE__ */ new Set(); - const specifications = { - rootDownloadLocation: includeRootDirectory ? path15.join(downloadPath, artifactName) : downloadPath, - directoryStructure: [], - emptyFilesToCreate: [], - filesToDownload: [] - }; - for (const entry of artifactEntries) { - if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { - const normalizedPathEntry = path15.normalize(entry.path); - const filePath = path15.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); - if (entry.itemType === "file") { - directories.add(path15.dirname(filePath)); - if (entry.fileLength === 0) { - specifications.emptyFilesToCreate.push(filePath); - } else { - specifications.filesToDownload.push({ - sourceLocation: entry.contentLocation, - targetPath: filePath - }); - } - } + exports2.HttpManager = void 0; + var utils_1 = require_utils11(); + var HttpManager = class { + constructor(clientCount, userAgent) { + if (clientCount < 1) { + throw new Error("There must be at least one client"); + } + this.userAgent = userAgent; + this.clients = new Array(clientCount).fill((0, utils_1.createHttpClient)(userAgent)); + } + getClient(index) { + return this.clients[index]; + } + // 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(index) { + this.clients[index].dispose(); + this.clients[index] = (0, utils_1.createHttpClient)(this.userAgent); + } + disposeAndReplaceAllClients() { + for (const [index] of this.clients.entries()) { + this.disposeAndReplaceClient(index); } } - specifications.directoryStructure = Array.from(directories); - return specifications; - } - exports2.getDownloadSpecification = getDownloadSpecification; + }; + exports2.HttpManager = HttpManager; } }); -// 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) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115139,21 +122286,21 @@ var require_artifact_client = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -115180,386 +122327,120 @@ var require_artifact_client = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultArtifactClient = void 0; - var core18 = __importStar4(require_core()); - var upload_specification_1 = require_upload_specification(); - var upload_http_client_1 = require_upload_http_client(); - var utils_1 = require_utils7(); - 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 __awaiter4(this, void 0, void 0, function* () { - core18.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) { - core18.warning(`No files found that can be uploaded`); - } else { - const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); - if (!response.fileContainerResourceUrl) { - core18.debug(response.toString()); - throw new Error("No URL provided by the Artifact Service to upload an artifact to"); - } - core18.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); - core18.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); - const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); - core18.info(`File upload process has finished. Finalizing the artifact upload`); - yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); - if (uploadResult.failedItems.length > 0) { - core18.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); - } else { - core18.info(`Artifact has been finalized. All files have been successfully uploaded!`); - } - core18.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, path15, options) { - return __awaiter4(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; + 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(resolve8, reject) { + v = o[n](v), settle(resolve8, reject, v.done, v.value); }); - if (!artifactToDownload) { - throw new Error(`Unable to find an artifact with the name: ${name}`); - } - const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl); - if (!path15) { - path15 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path15 = (0, path_1.normalize)(path15); - path15 = (0, path_1.resolve)(path15); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path15, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); - if (downloadSpecification.filesToDownload.length === 0) { - core18.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); - } else { - yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); - core18.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(path15) { - return __awaiter4(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) { - core18.info("Unable to find any artifacts for the associated workflow"); - return response; - } - if (!path15) { - path15 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path15 = (0, path_1.normalize)(path15); - path15 = (0, path_1.resolve)(path15); - let downloadedArtifacts = 0; - while (downloadedArtifacts < artifacts.count) { - const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; - downloadedArtifacts += 1; - core18.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, path15, true); - if (downloadSpecification.filesToDownload.length === 0) { - core18.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/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + function settle(resolve8, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve8({ value: v2, done: d }); + }, reject); } - __setModuleDefault4(result, mod); - return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core18 = __importStar4(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; - core18.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core18.debug(`implicitDescendants '${result.implicitDescendants}'`); - } - if (typeof copy.matchDirectories === "boolean") { - result.matchDirectories = copy.matchDirectories; - core18.debug(`matchDirectories '${result.matchDirectories}'`); - } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core18.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); - } - if (typeof copy.excludeHiddenFiles === "boolean") { - result.excludeHiddenFiles = copy.excludeHiddenFiles; - core18.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; + var fs18 = __importStar2(require("fs")); + var zlib3 = __importStar2(require("zlib")); + var util_1 = require("util"); + var stat = (0, util_1.promisify)(fs18.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 result; - } - exports2.getOptions = getOptions; - } -}); - -// node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path15 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - let result = path15.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; + return new Promise((resolve8, reject) => { + const inputStream = fs18.createReadStream(originalFilePath); + const gzip = zlib3.createGzip(); + const outputStream = fs18.createWriteStream(tempFilePath); + inputStream.pipe(gzip).pipe(outputStream); + outputStream.on("finish", () => __awaiter2(this, void 0, void 0, function* () { + const size = (yield stat(tempFilePath)).size; + resolve8(size); + })); + outputStream.on("error", (error3) => { + console.log(error3); + reject(error3); + }); + }); + }); } - exports2.dirname = dirname3; - 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 += "\\"; + exports2.createGZipFileOnDisk = createGZipFileOnDisk; + function createGZipFileInBuffer(originalFilePath) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve8) => __awaiter2(this, void 0, void 0, function* () { + var _a, e_1, _b, _c; + const inputStream = fs18.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(), _a = gzip_1_1.done, !_a; ) { + _c = gzip_1_1.value; + _d = false; + try { + const chunk = _c; + chunks.push(chunk); + } finally { + _d = true; } - return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; } - } else { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_d && !_a && (_b = gzip_1.return)) yield _b.call(gzip_1); + } finally { + if (e_1) throw e_1.error; + } } - } 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 += path15.sep; - } - return root + itemPath; - } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - 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("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - 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("/"); - } - exports2.hasRoot = hasRoot; - 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, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; - } - p = normalizeSeparators(p); - if (!p.endsWith(path15.sep)) { - return p; - } - if (p === path15.sep) { - return p; - } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; - } - return p.substr(0, p.length - 1); + resolve8(Buffer.concat(chunks)); + })); + }); } - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind2 = __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 = {})); + exports2.createGZipFileInBuffer = createGZipFileInBuffer; } }); -// node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115572,182 +122453,111 @@ var require_internal_pattern_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(require_internal_path_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - 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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); - } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; - } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); - } - exports2.partialMatch = partialMatch; - } -}); - -// node_modules/@actions/glob/lib/internal-path.js -var require_internal_path2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path15 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(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(path15.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path15.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); + exports2.retryHttpClientRequest = exports2.retry = void 0; + var utils_1 = require_utils11(); + var core18 = __importStar2(require_core5()); + var config_variables_1 = require_config_variables(); + function retry3(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; } - this.segments.unshift(remaining); + 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; } - } 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(path15.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); + if (!isRetryable) { + core18.info(`${name} - Error is not retryable`); + if (response) { + (0, utils_1.displayHttpDiagnostics)(response); } + break; } + core18.info(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + yield (0, utils_1.sleep)((0, utils_1.getExponentialRetryTimeInMilliseconds)(attempt)); + attempt++; } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path15.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path15.sep; - } - result += this.segments[i]; + if (response) { + (0, utils_1.displayHttpDiagnostics)(response); } - return result; - } - }; - exports2.Path = Path; + if (customErrorInformation) { + throw Error(`${name} failed: ${customErrorInformation}`); + } + throw Error(`${name} failed: ${errorMessage}`); + }); + } + exports2.retry = retry3; + function retryHttpClientRequest(name, method, customErrorMessages = /* @__PURE__ */ new Map(), maxAttempts = (0, config_variables_1.getRetryLimit)()) { + return __awaiter2(this, void 0, void 0, function* () { + return yield retry3(name, method, customErrorMessages, maxAttempts); + }); + } + exports2.retryHttpClientRequest = retryHttpClientRequest; } }); -// node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115760,215 +122570,386 @@ var require_internal_pattern2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os3 = __importStar4(require("os")); - var path15 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(require("assert")); - var minimatch_1 = require_minimatch(); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_path_1 = require_internal_path2(); - var IS_WINDOWS = process.platform === "win32"; - var Pattern = class _Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { - 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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path15.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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve8) { + resolve8(value); + }); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path15.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path15.sep}`; + return new (P || (P = Promise))(function(resolve8, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - 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); + function step(result) { + result.done ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); } - return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.UploadHttpClient = void 0; + var fs18 = __importStar2(require("fs")); + var core18 = __importStar2(require_core5()); + 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_lib7(); + var http_manager_1 = require_http_manager(); + var upload_gzip_1 = require_upload_gzip(); + var requestUtils_1 = require_requestUtils2(); + var stat = (0, util_1.promisify)(fs18.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); } /** - * Escapes glob patterns within a path + * 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 */ - static globEscape(s) { - return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); + 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); + }); } /** - * Normalizes slashes and ensures absolute root + * 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 */ - static fixupPattern(pattern, homedir) { - (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(`.${path15.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path15.sep}`)) { - homedir = homedir || os3.homedir(); - (0, assert_1.default)(homedir, "Unable to determine HOME directory"); - (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 += "\\"; + 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)(); + core18.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); + const parameters = []; + let continueOnError = true; + if (options) { + if (options.continueOnError === false) { + continueOnError = false; + } } - 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 += "\\"; + 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 + }); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + 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((index) => __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(index, currentFileParameters); + if (core18.isDebug()) { + core18.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) { + core18.error(`aborting artifact upload`); + abortPendingFileUploads = true; + } + } + this.statusReporter.incrementProcessedCount(); + } + }))); + this.statusReporter.stop(); + this.uploadHttpManager.disposeAndReplaceAllClients(); + core18.info(`Total size of all the files uploaded is ${uploadFileSize} bytes`); + return { + uploadSize: uploadFileSize, + totalSize: totalFileSize, + failedItems: failedItemsToReport + }; + }); } /** - * Attempts to unescape a pattern segment to create a literal path segment. - * Otherwise returns empty string. + * 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 */ - 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; + uploadFileAsync(httpClientIndex, parameters) { + return __awaiter2(this, void 0, void 0, function* () { + const fileStat = yield stat(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) { + core18.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) { + core18.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 = () => fs18.createReadStream(parameters.file); + isGzip = false; + uploadFileSize = totalFileSize; + } else { + core18.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; + core18.warning(`Aborting upload for ${parameters.file} due to failure`); + } + return { + isSuccess: isUploadSuccessful, + successfulUploadSize: uploadFileSize - failedChunkSizes, + totalSize: totalFileSize + }; + } else { + const tempFile = yield tmp.file(); + core18.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) { + core18.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 { + core18.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; - } else if (c2 === "]") { - closed = i2; - break; + } + const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs18.createReadStream(uploadFilePath, { + start: startChunkIndex, + end: endChunkIndex, + autoClose: false + }), startChunkIndex, endChunkIndex, uploadFileSize, isGzip, totalFileSize); + if (!result) { + isUploadSuccessful = false; + failedChunkSizes += chunkSize; + core18.warning(`Aborting upload for ${parameters.file} due to failure`); + abortFileUpload = true; } else { - set2 += c2; + if (uploadFileSize > 8388608) { + this.statusReporter.updateLargeFileStatus(parameters.file, startChunkIndex, endChunkIndex, uploadFileSize); + } } } - if (closed >= 0) { - if (set2.length > 1) { - return ""; + core18.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); } - if (set2) { - literal += set2; - i = closed; - continue; + core18.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) { + core18.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); + core18.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the upload at offset ${start}`); + yield (0, utils_1.sleep)(backoffTime); + } + core18.info(`Finished backoff for retry #${retryCount}, continuing with upload`); + return; + }); + while (retryCount <= retryLimit) { + let response; + try { + response = yield uploadChunkRequest(); + } catch (error3) { + core18.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); + console.log(error3); + if (incrementAndCheckRetryLimit()) { + return false; } + yield backOff(); + continue; } - } - literal += c; - } - return literal; + yield response.readBody(); + if ((0, utils_1.isSuccessStatusCode)(response.message.statusCode)) { + return true; + } else if ((0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { + core18.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 { + core18.error(`Unexpected response. Unable to upload chunk to ${resourceUrl}`); + (0, utils_1.displayHttpDiagnostics)(response); + return false; + } + } + return false; + }); } /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping + * 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 */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); - } - }; - exports2.Pattern = Pattern; - } -}); - -// node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state2 = __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(path15, level) { - this.path = path15; - this.level = level; + 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); + core18.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(); + core18.debug(`Artifact ${artifactName} has been successfully uploaded, total size in bytes: ${size}`); + }); } }; - exports2.SearchState = SearchState; + exports2.UploadHttpClient = UploadHttpClient; } }); -// node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115981,21 +122962,21 @@ var require_internal_globber2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve8) { resolve8(value); @@ -116022,225 +123003,230 @@ var require_internal_globber2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); - } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await4 ? 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 core18 = __importStar4(require_core()); - var fs17 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper2()); - var path15 = __importStar4(require("path")); - var patternHelper = __importStar4(require_internal_pattern_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_pattern_1 = require_internal_pattern2(); - var internal_search_state_1 = require_internal_search_state2(); - var IS_WINDOWS = process.platform === "win32"; - var DefaultGlobber = class _DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); + exports2.DownloadHttpClient = void 0; + var fs18 = __importStar2(require("fs")); + var core18 = __importStar2(require_core5()); + 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); } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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); + }); } - glob() { - var _a, e_1, _b, _c; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _d = true, _e = __asyncValues4(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); - } finally { - if (e_1) throw e_1.error; - } - } - return result; + /** + * 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); }); } - globGenerator() { - return __asyncGenerator4(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)) { - core18.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs17.promises.lstat(searchPath)); - } catch (err) { - if (err.code === "ENOENT") { - continue; + /** + * 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)(); + core18.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); + const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; + let currentFile = 0; + let downloadedFiles = 0; + core18.info(`Total number of files that will be downloaded: ${downloadItems.length}`); + this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); + this.statusReporter.start(); + yield Promise.all(parallelDownloads.map((index) => __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(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); + if (core18.isDebug()) { + core18.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); } - throw err; + this.statusReporter.incrementProcessedCount(); } - stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); - } - const traversalChain = []; - while (stack.length) { - const item = stack.pop(); - const match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; + }))).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 = fs18.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) { + core18.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); + core18.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); + yield (0, utils_1.sleep)(backoffTime); + } + core18.info(`Finished backoff for retry #${retryCount}, continuing with download`); } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; + }); + const isAllBytesReceived = (expected, received) => { + if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { + core18.info("Skipping download validation."); + return true; } - if (options.excludeHiddenFiles && path15.basename(item.path).match(/^\./)) { + return parseInt(expected) === received; + }; + const resetDestinationStream = (fileDownloadPath) => __awaiter2(this, void 0, void 0, function* () { + destinationStream.close(); + yield new Promise((resolve8) => { + destinationStream.on("close", resolve8); + if (destinationStream.writableFinished) { + resolve8(); + } + }); + yield (0, utils_1.rmFile)(fileDownloadPath); + destinationStream = fs18.createWriteStream(fileDownloadPath); + }); + while (retryCount <= retryLimit) { + let response; + try { + response = yield makeDownloadRequest(); + } catch (error3) { + core18.info("An error occurred while attempting to download a file"); + console.log(error3); + yield backOff(); continue; } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { - yield yield __await4(item.path); - } else if (!partialMatch) { - 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; } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs17.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path15.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); + } + if (forceRetry || (0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { + core18.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}`)); } } }); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; + pipeResponseToFile(response, destinationStream, isGzip) { + return __awaiter2(this, void 0, void 0, function* () { + yield new Promise((resolve8, reject) => { + if (isGzip) { + const gunzip = zlib3.createGunzip(); + response.message.on("error", (error3) => { + core18.info(`An error occurred while attempting to read the response stream`); + gunzip.close(); + destinationStream.close(); + reject(error3); + }).pipe(gunzip).on("error", (error3) => { + core18.info(`An error occurred while attempting to decompress the response stream`); + destinationStream.close(); + reject(error3); + }).pipe(destinationStream).on("close", () => { + resolve8(); + }).on("error", (error3) => { + core18.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + reject(error3); + }); } 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 __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs17.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core18.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 fs17.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs17.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core18.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + response.message.on("error", (error3) => { + core18.info(`An error occurred while attempting to read the response stream`); + destinationStream.close(); + reject(error3); + }).pipe(destinationStream).on("close", () => { + resolve8(); + }).on("error", (error3) => { + core18.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + reject(error3); + }); } - traversalChain.push(realPath); - } - return stats; + }); + return; }); } }; - exports2.DefaultGlobber = DefaultGlobber; + exports2.DownloadHttpClient = DownloadHttpClient; } }); -// 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) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -116253,134 +123239,87 @@ var require_internal_hash_files = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve8) { - resolve8(value); - }); - } - return new (P || (P = Promise))(function(resolve8, 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 ? resolve8(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve8, reject) { - v = o[n](v), settle(resolve8, reject, v.done, v.value); - }); - }; - } - function settle(resolve8, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve8({ value: v2, done: d }); - }, reject); - } - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = void 0; - var crypto = __importStar4(require("crypto")); - var core18 = __importStar4(require_core()); - var fs17 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var path15 = __importStar4(require("path")); - function hashFiles2(globber, currentWorkspace, verbose = false) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const writeDelegate = verbose ? core18.info : core18.debug; - let hasMatch = false; - const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const result = crypto.createHash("sha256"); - let count = 0; - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path15.sep}`)) { - writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); - continue; - } - if (fs17.statSync(file).isDirectory()) { - writeDelegate(`Skip directory '${file}'.`); - continue; - } - const hash2 = crypto.createHash("sha256"); - const pipeline = util.promisify(stream2.pipeline); - yield pipeline(fs17.createReadStream(file), hash2); - result.write(hash2.digest()); - count++; - if (!hasMatch) { - hasMatch = true; + exports2.getDownloadSpecification = void 0; + var path16 = __importStar2(require("path")); + function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { + const directories = /* @__PURE__ */ new Set(); + const specifications = { + rootDownloadLocation: includeRootDirectory ? path16.join(downloadPath, artifactName) : downloadPath, + directoryStructure: [], + emptyFilesToCreate: [], + filesToDownload: [] + }; + for (const entry of artifactEntries) { + if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { + const normalizedPathEntry = path16.normalize(entry.path); + const filePath = path16.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); + if (entry.itemType === "file") { + directories.add(path16.dirname(filePath)); + if (entry.fileLength === 0) { + specifications.emptyFilesToCreate.push(filePath); + } else { + specifications.filesToDownload.push({ + sourceLocation: entry.contentLocation, + targetPath: filePath + }); } } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a && (_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 ""; } - }); + } + specifications.directoryStructure = Array.from(directories); + return specifications; } - exports2.hashFiles = hashFiles2; + exports2.getDownloadSpecification = getDownloadSpecification; } }); -// node_modules/@actions/glob/lib/glob.js -var require_glob3 = __commonJS({ - "node_modules/@actions/glob/lib/glob.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve8) { resolve8(value); @@ -116408,26 +123347,156 @@ var require_glob3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = exports2.create = void 0; - var internal_globber_1 = require_internal_globber2(); - var internal_hash_files_1 = require_internal_hash_files(); - function create3(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.DefaultArtifactClient = void 0; + var core18 = __importStar2(require_core5()); + 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* () { + core18.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) { + core18.warning(`No files found that can be uploaded`); + } else { + const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); + if (!response.fileContainerResourceUrl) { + core18.debug(response.toString()); + throw new Error("No URL provided by the Artifact Service to upload an artifact to"); + } + core18.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); + core18.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); + const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); + core18.info(`File upload process has finished. Finalizing the artifact upload`); + yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); + if (uploadResult.failedItems.length > 0) { + core18.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); + } else { + core18.info(`Artifact has been finalized. All files have been successfully uploaded!`); + } + core18.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, path16, 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 (!path16) { + path16 = (0, config_variables_1.getWorkSpaceDirectory)(); + } + path16 = (0, path_1.normalize)(path16); + path16 = (0, path_1.resolve)(path16); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path16, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); + if (downloadSpecification.filesToDownload.length === 0) { + core18.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); + } else { + yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); + core18.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(path16) { + 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) { + core18.info("Unable to find any artifacts for the associated workflow"); + return response; + } + if (!path16) { + path16 = (0, config_variables_1.getWorkSpaceDirectory)(); + } + path16 = (0, path_1.normalize)(path16); + path16 = (0, path_1.resolve)(path16); + let downloadedArtifacts = 0; + while (downloadedArtifacts < artifacts.count) { + const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; + downloadedArtifacts += 1; + core18.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, path16, true); + if (downloadSpecification.filesToDownload.length === 0) { + core18.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; - function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - }); - } - exports2.hashFiles = hashFiles2; } }); @@ -119336,15 +126405,14 @@ var path2 = __toESM(require("path")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var fs = __toESM(require("fs")); var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -119354,21 +126422,21 @@ async function getFolderSize(itemPath, options) { 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 fs17 = options.fs || await import("node:fs/promises"); + const fs18 = 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 fs17.lstat(itemPath, { bigint: true }) : await fs17.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs18.lstat(itemPath, { bigint: true }) : await fs18.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 fs17.readdir(itemPath) : await fs17.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs18.readdir(itemPath) : await fs18.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -119379,13 +126447,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -120265,6 +127333,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -120384,7 +127464,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -120424,16 +127504,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -121988,7 +129059,7 @@ var safeDump = renamed("safeDump", "dump"); var semver = __toESM(require_semver2()); // src/api-compatibility.json -var maximumVersion = "3.19"; +var maximumVersion = "3.20"; var minimumVersion = "3.14"; // src/util.ts @@ -122004,9 +129075,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -122055,7 +129126,7 @@ function parseGitHubUrl(inputUrl) { var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; var hasBeenWarnedAboutVersion = false; function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== 1 /* GHES */) { + if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { return; } const disallowedAPIVersionReason = apiVersionInRange( @@ -122200,11 +129271,11 @@ function parseMatrixInput(matrixInput) { } return JSON.parse(matrixInput); } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } async function checkDiskUsage(logger) { try { @@ -122227,9 +129298,9 @@ async function checkDiskUsage(logger) { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, numTotalBytes: diskUsage.blocks * blockSizeInBytes }; - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to check available disk space: ${getErrorMessage(error4)}` + `Failed to check available disk space: ${getErrorMessage(error3)}` ); return void 0; } @@ -122557,17 +129628,17 @@ function getAuthorizationHeaderFor(logger, apiDetails, url2) { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -122713,19 +129784,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -122741,9 +129812,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -122963,6 +130034,39 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); +// src/logging.ts +var core7 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup + }; +} +function withGroup(groupName, f) { + core7.startGroup(groupName); + try { + return f(); + } finally { + core7.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/diff-informed-analysis-utils.ts var fs5 = __toESM(require("fs")); var path5 = __toESM(require("path")); @@ -122970,25 +130074,26 @@ var path5 = __toESM(require("path")); // src/feature-flags.ts var fs4 = __toESM(require("fs")); var path4 = __toESM(require("path")); -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.23.3"; -var cliVersion = "2.23.3"; +var bundleVersion = "codeql-bundle-v2.23.8"; +var cliVersion = "2.23.8"; // src/overlay-database-utils.ts var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core7.debug(`Running git command: git ${args.join(" ")}`); + core8.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -123003,13 +130108,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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."; } - core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error4; + core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -123104,8 +130209,8 @@ var getFileOidsUnderPath = async function(basePath) { const match = line.match(regex); if (match) { const oid = match[1]; - const path15 = decodeGitFilePath(match[2]); - fileOidMap[path15] = oid; + const path16 = decodeGitFilePath(match[2]); + fileOidMap[path16] = oid; } else { throw new Error(`Unexpected "git ls-files" output: ${line}`); } @@ -123153,7 +130258,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core7.debug( + core8.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -123178,41 +130283,8 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/logging.ts -var core8 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup - }; -} -function withGroup(groupName, f) { - core8.startGroup(groupName); - try { - return f(); - } finally { - core8.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/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -123273,13 +130345,13 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { } // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __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); + return !codeQlVersion ? true : semver4.gte(codeQlVersion, SafeArtifactUploadVersion); } // src/feature-flags.ts @@ -123292,11 +130364,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -123308,6 +130375,16 @@ var featureConfig = { 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", @@ -123336,12 +130413,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -123442,6 +130513,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -123453,21 +130529,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -123581,7 +130658,7 @@ var GitHubFeatureFlags = class { DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length, f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length ).replace(/_/g, "."); - if (!semver4.valid(version)) { + if (!semver5.valid(version)) { this.logger.warning( `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.` ); @@ -123590,15 +130667,15 @@ var GitHubFeatureFlags = class { return version; } async getDefaultCliVersion(variant) { - if (variant === 0 /* DOTCOM */) { - return await this.getDefaultDotcomCliVersion(); + if (supportsFeatureFlags(variant)) { + return await this.getDefaultCliVersionFromFlags(); } return { cliVersion, tagName: bundleVersion }; } - async getDefaultDotcomCliVersion() { + async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( ([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : void 0 @@ -123687,7 +130764,7 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (this.gitHubVersion.type !== 0 /* DOTCOM */ && this.gitHubVersion.type !== 2 /* GHE_DOTCOM */) { + if (!supportsFeatureFlags(this.gitHubVersion.type)) { this.logger.debug( "Not running against github.com. Disabling all toggleable features." ); @@ -123740,6 +130817,9 @@ var GitHubFeatureFlags = class { } } }; +function supportsFeatureFlags(githubVariant) { + return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; +} // src/diff-informed-analysis-utils.ts function getDiffRangesJsonFilePath() { @@ -123760,9 +130840,12 @@ ${jsonContents}` } // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -123838,7 +130921,7 @@ var fs9 = __toESM(require("fs")); var path8 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // node_modules/uuid/dist-node/stringify.js var byteToHex = []; @@ -123899,9 +130982,9 @@ var import_child_process = require("child_process"); var fs7 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; async function getTarVersion() { @@ -123943,9 +131026,9 @@ async function isZstdAvailable(logger) { case "gnu": return { available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver5.gte( - semver5.coerce(version), - semver5.coerce(MIN_REQUIRED_GNU_TAR_VERSION) + semver6.gte( + semver6.coerce(version), + semver6.coerce(MIN_REQUIRED_GNU_TAR_VERSION) ), foundZstdBinary, version: tarVersion @@ -123954,7 +131037,7 @@ async function isZstdAvailable(logger) { return { available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain // a patch version number. - semver5.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), + semver6.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), foundZstdBinary, version: tarVersion }; @@ -124058,10 +131141,10 @@ var os = __toESM(require("os")); var path7 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; var TOOLCACHE_TOOL_NAME = "CodeQL"; function makeDownloadFirstToolsDownloadDurations(downloadDurationMs, extractionDurationMs) { @@ -124191,7 +131274,7 @@ function getToolcacheDirectory(version) { return path7.join( getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, - semver6.clean(version) || version, + semver7.clean(version) || version, os.arch() || "" ); } @@ -124316,13 +131399,13 @@ function tryGetTagNameFromUrl(url2, logger) { return match[1]; } function convertToSemVer(version, logger) { - if (!semver7.valid(version)) { + if (!semver8.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 = semver7.clean(version); + const s = semver8.clean(version); if (!s) { throw new Error(`Bundle version ${version} is not in SemVer format.`); } @@ -124430,7 +131513,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian url2 = toolsInput; if (tagName) { const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver7.valid(bundleVersion3)) { + if (bundleVersion3 && semver8.valid(bundleVersion3)) { cliVersion2 = convertToSemVer(bundleVersion3, logger); } } @@ -124513,7 +131596,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: cliVersion2 ?? humanReadableVersion }; } - if (variant !== 0 /* DOTCOM */ && !forceShippedTools && !toolsInput) { + if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { const result = await findOverridingToolsInCache( humanReadableVersion, logger @@ -124701,7 +131784,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau async function useZstdBundle(cliVersion2, tarSupportsZstd) { return ( // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver7.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) + process.platform !== "win32" && tarSupportsZstd && semver8.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) ); } function getTempExtractionDir(tempDir) { @@ -124733,7 +131816,7 @@ async function getNightlyToolsUrl(logger) { } } function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver7.compare(b, a)); + const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver8.compare(b, a)); logger.debug( `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( allVersions @@ -125222,6 +132305,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -125358,8 +132458,8 @@ async function getJobRunUuidSarifOptions(codeql) { } // src/debug-artifacts.ts -var fs12 = __toESM(require("fs")); -var path11 = __toESM(require("path")); +var fs13 = __toESM(require("fs")); +var path12 = __toESM(require("path")); var artifact = __toESM(require_artifact2()); var artifactLegacy = __toESM(require_artifact_client2()); var core12 = __toESM(require_core()); @@ -125368,14 +132468,14 @@ var import_archiver = __toESM(require_archiver()); // src/analyze.ts var fs11 = __toESM(require("fs")); var path10 = __toESM(require("path")); -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); // src/autobuild.ts var core11 = __toESM(require_core()); // src/dependency-caching.ts -var actionsCache3 = __toESM(require_cache3()); -var glob = __toESM(require_glob3()); +var actionsCache3 = __toESM(require_cache4()); +var glob = __toESM(require_glob()); var CODEQL_DEPENDENCY_CACHE_PREFIX = "codeql-dependencies"; async function getDependencyCacheUsage(logger) { try { @@ -125409,6 +132509,245 @@ function dbIsFinalized(config, language, logger) { } } +// src/artifact-scanner.ts +var fs12 = __toESM(require("fs")); +var os2 = __toESM(require("os")); +var path11 = __toESM(require("path")); +var exec = __toESM(require_exec()); +var GITHUB_TOKEN_PATTERNS = [ + { + name: "Personal Access Token", + pattern: /\bghp_[a-zA-Z0-9]{36}\b/g + }, + { + name: "OAuth Access Token", + pattern: /\bgho_[a-zA-Z0-9]{36}\b/g + }, + { + name: "User-to-Server Token", + pattern: /\bghu_[a-zA-Z0-9]{36}\b/g + }, + { + name: "Server-to-Server Token", + pattern: /\bghs_[a-zA-Z0-9]{36}\b/g + }, + { + name: "Refresh Token", + pattern: /\bghr_[a-zA-Z0-9]{36}\b/g + }, + { + name: "App Installation Access Token", + pattern: /\bghs_[a-zA-Z0-9]{255}\b/g + } +]; +function scanFileForTokens(filePath, relativePath, logger) { + const findings = []; + try { + const content = fs12.readFileSync(filePath, "utf8"); + for (const { name, pattern } of GITHUB_TOKEN_PATTERNS) { + const matches = content.match(pattern); + if (matches) { + for (let i = 0; i < matches.length; i++) { + findings.push({ tokenType: name, filePath: relativePath }); + } + logger.debug(`Found ${matches.length} ${name}(s) in ${relativePath}`); + } + } + 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}` + ); + } + const result = { + scannedFiles: 0, + findings: [] + }; + try { + const tempExtractDir = fs12.mkdtempSync( + path11.join(extractDir, `extract-${depth}-`) + ); + const fileName = path11.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 = path11.join( + tempExtractDir, + path11.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 = path11.join( + tempExtractDir, + path11.basename(archivePath, ".gz") + ); + await exec.exec("gunzip", ["-c", archivePath], { + outStream: fs12.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); + fs12.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, relativePath, extractDir, logger, depth = 0) { + const result = { + scannedFiles: 1, + findings: [] + }; + const fileName = path11.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); + } + const fileFindings = scanFileForTokens(fullPath, relativePath, logger); + result.findings.push(...fileFindings); + return result; +} +async function scanDirectory(dirPath, baseRelativePath, logger, depth = 0) { + const result = { + scannedFiles: 0, + findings: [] + }; + const entries = fs12.readdirSync(dirPath, { withFileTypes: true }); + for (const entry of entries) { + const fullPath = path11.join(dirPath, entry.name); + const relativePath = path11.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, + path11.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 = fs12.mkdtempSync(path11.join(os2.tmpdir(), "artifact-scan-")); + try { + for (const filePath of filesToScan) { + const stats = fs12.statSync(filePath); + const fileName = path11.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(([type2, count]) => `${count} ${type2}${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 { + fs12.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, ""); @@ -125416,17 +132755,17 @@ function sanitizeArtifactName(name) { function tryPrepareSarifDebugArtifact(config, language, logger) { try { const analyzeActionOutputDir = process.env["CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR" /* SARIF_RESULTS_OUTPUT_DIR */]; - if (analyzeActionOutputDir !== void 0 && fs12.existsSync(analyzeActionOutputDir) && fs12.lstatSync(analyzeActionOutputDir).isDirectory()) { - const sarifFile = path11.resolve( + if (analyzeActionOutputDir !== void 0 && fs13.existsSync(analyzeActionOutputDir) && fs13.lstatSync(analyzeActionOutputDir).isDirectory()) { + const sarifFile = path12.resolve( analyzeActionOutputDir, `${language}.sarif` ); - if (fs12.existsSync(sarifFile)) { - const sarifInDbLocation = path11.resolve( + if (fs13.existsSync(sarifFile)) { + const sarifInDbLocation = path12.resolve( config.dbLocation, `${language}.sarif` ); - fs12.copyFileSync(sarifFile, sarifInDbLocation); + fs13.copyFileSync(sarifFile, sarifInDbLocation); return sarifInDbLocation; } } @@ -125477,13 +132816,13 @@ async function tryUploadAllAvailableDebugArtifacts(codeql, config, logger, codeQ } logger.info("Preparing database logs debug artifact..."); const databaseDirectory = getCodeQLDatabasePath(config, language); - const logsDirectory = path11.resolve(databaseDirectory, "log"); + const logsDirectory = path12.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 = path11.resolve( + const multiLanguageTracingLogsDirectory = path12.resolve( config.dbLocation, "log" ); @@ -125539,6 +132878,10 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV ); return "upload-not-supported"; } + if (isInTestMode()) { + await scanArtifactsForTokens(toUpload, logger); + core12.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true"); + } let suffix = ""; const matrix = getOptionalInput("matrix"); if (matrix) { @@ -125557,8 +132900,8 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV try { await artifactUploader.uploadArtifact( sanitizeArtifactName(`${artifactName}${suffix}`), - toUpload.map((file) => path11.normalize(file)), - path11.normalize(rootDir), + toUpload.map((file) => path12.normalize(file)), + path12.normalize(rootDir), { // ensure we don't keep the debug artifacts around for too long since they can be large. retentionDays: 7 @@ -125571,7 +132914,7 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV } } async function getArtifactUploaderClient(logger, ghVariant) { - if (ghVariant === 1 /* GHES */) { + 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." ); @@ -125585,17 +132928,17 @@ async function getArtifactUploaderClient(logger, ghVariant) { } async function createPartialDatabaseBundle(config, language) { const databasePath = getCodeQLDatabasePath(config, language); - const databaseBundlePath = path11.resolve( + const databaseBundlePath = path12.resolve( config.dbLocation, `${config.debugDatabaseName}-${language}-partial.zip` ); core12.info( `${config.debugDatabaseName}-${language} is not finalized. Uploading partial database bundle at ${databaseBundlePath}...` ); - if (fs12.existsSync(databaseBundlePath)) { - await fs12.promises.rm(databaseBundlePath, { force: true }); + if (fs13.existsSync(databaseBundlePath)) { + await fs13.promises.rm(databaseBundlePath, { force: true }); } - const output = fs12.createWriteStream(databaseBundlePath); + const output = fs13.createWriteStream(databaseBundlePath); const zip = (0, import_archiver.default)("zip"); zip.on("error", (err) => { throw err; @@ -125621,12 +132964,12 @@ async function createDatabaseBundleCli(codeql, config, language) { } // src/init-action-post-helper.ts -var fs16 = __toESM(require("fs")); +var fs17 = __toESM(require("fs")); var core16 = __toESM(require_core()); var github2 = __toESM(require_github()); // src/status-report.ts -var os2 = __toESM(require("os")); +var os3 = __toESM(require("os")); var core13 = __toESM(require_core()); function isFirstPartyAnalysis(actionName) { if (actionName !== "upload-sarif" /* UploadSarif */) { @@ -125641,9 +132984,9 @@ var JobStatus = /* @__PURE__ */ ((JobStatus2) => { JobStatus2["ConfigErrorStatus"] = "JOB_STATUS_CONFIGURATION_ERROR"; return JobStatus2; })(JobStatus || {}); -function getActionsStatus(error4, otherFailureCause) { - if (error4 || otherFailureCause) { - return error4 instanceof ConfigurationError ? "user-error" : "failure"; +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; } else { return "success"; } @@ -125751,7 +133094,7 @@ async function createStatusReportBase(actionName, status, actionStartedAt, confi statusReport.runner_arch = process.env["RUNNER_ARCH"]; } if (!(runnerOs === "Linux" && isSelfHostedRunner())) { - statusReport.runner_os_release = os2.release(); + statusReport.runner_os_release = os3.release(); } if (codeQlCliVersion !== void 0) { statusReport.codeql_version = codeQlCliVersion.version; @@ -125828,15 +133171,15 @@ async function sendStatusReport(statusReport) { } // src/upload-lib.ts -var fs14 = __toESM(require("fs")); -var path13 = __toESM(require("path")); +var fs15 = __toESM(require("fs")); +var path14 = __toESM(require("path")); var url = __toESM(require("url")); var import_zlib = __toESM(require("zlib")); var core14 = __toESM(require_core()); var jsonschema2 = __toESM(require_lib3()); // src/fingerprints.ts -var fs13 = __toESM(require("fs")); +var fs14 = __toESM(require("fs")); var import_path = __toESM(require("path")); // node_modules/long/index.js @@ -126260,13 +133603,13 @@ function fromString(str2, unsigned, radix) { return result; } Long.fromString = fromString; -function fromValue(val2, unsigned) { - if (typeof val2 === "number") return fromNumber(val2, unsigned); - if (typeof val2 === "string") return fromString(val2, unsigned); +function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); return fromBits( - val2.low, - val2.high, - typeof unsigned === "boolean" ? unsigned : val2.unsigned + val.low, + val.high, + typeof unsigned === "boolean" ? unsigned : val.unsigned ); } Long.fromValue = fromValue; @@ -126338,8 +133681,8 @@ LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { LongPrototype.getNumBitsAbs = function getNumBitsAbs() { if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val2 = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) if ((val2 & 1 << bit) != 0) break; + 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() { @@ -126824,7 +134167,7 @@ async function hash(callback, filepath) { } updateHash(current); }; - const readStream = fs13.createReadStream(filepath, "utf8"); + const readStream = fs14.createReadStream(filepath, "utf8"); for await (const data of readStream) { for (let i = 0; i < data.length; ++i) { processCharacter(data.charCodeAt(i)); @@ -126899,11 +134242,11 @@ function resolveUriToFile(location, artifacts, sourceRoot, logger) { if (!import_path.default.isAbsolute(uri)) { uri = srcRootPrefix + uri; } - if (!fs13.existsSync(uri)) { + if (!fs14.existsSync(uri)) { logger.debug(`Unable to compute fingerprint for non-existent file: ${uri}`); return void 0; } - if (fs13.statSync(uri).isDirectory()) { + if (fs14.statSync(uri).isDirectory()) { logger.debug(`Unable to compute fingerprint for directory: ${uri}`); return void 0; } @@ -126959,7 +134302,7 @@ async function addFingerprints(sarif, sourceRoot, logger) { // src/init.ts var toolrunner4 = __toESM(require_toolrunner()); -var io6 = __toESM(require_io2()); +var io6 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); const { @@ -127001,7 +134344,7 @@ function combineSarifFiles(sarifFiles, logger) { for (const sarifFile of sarifFiles) { logger.debug(`Loading SARIF file: ${sarifFile}`); const sarifObject = JSON.parse( - fs14.readFileSync(sarifFile, "utf8") + fs15.readFileSync(sarifFile, "utf8") ); if (combinedSarif.version === null) { combinedSarif.version = sarifObject.version; @@ -127045,7 +134388,7 @@ function areAllRunsUnique(sarifObjects) { return true; } async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) { - if (githubVersion.type === 1 /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { + if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { return false; } return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; @@ -127060,7 +134403,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { ); } async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) { - if (githubVersion.type === 1 /* GHES */) { + if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) { if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) { return false; } @@ -127073,9 +134416,9 @@ async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) { async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, logger) { logger.info("Combining SARIF files using the CodeQL CLI"); const sarifObjects = sarifFiles.map((sarifFile) => { - return JSON.parse(fs14.readFileSync(sarifFile, "utf8")); + return JSON.parse(fs15.readFileSync(sarifFile, "utf8")); }); - const deprecationWarningMessage = gitHubVersion.type === 1 /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025"; + 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); @@ -127126,14 +134469,14 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo ); codeQL = initCodeQLResult.codeql; } - const baseTempDir = path13.resolve(tempDir, "combined-sarif"); - fs14.mkdirSync(baseTempDir, { recursive: true }); - const outputDirectory = fs14.mkdtempSync(path13.resolve(baseTempDir, "output-")); - const outputFile = path13.resolve(outputDirectory, "combined-sarif.sarif"); + const baseTempDir = path14.resolve(tempDir, "combined-sarif"); + fs15.mkdirSync(baseTempDir, { recursive: true }); + const outputDirectory = fs15.mkdtempSync(path14.resolve(baseTempDir, "output-")); + const outputFile = path14.resolve(outputDirectory, "combined-sarif.sarif"); await codeQL.mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory: true }); - return JSON.parse(fs14.readFileSync(outputFile, "utf8")); + return JSON.parse(fs15.readFileSync(outputFile, "utf8")); } function populateRunAutomationDetails(sarif, category, analysis_key, environment) { const automationID = getAutomationID2(category, analysis_key, environment); @@ -127162,7 +134505,7 @@ function getAutomationID2(category, analysis_key, environment) { async function uploadPayload(payload, repositoryNwo, logger, analysis) { logger.info("Uploading results"); if (shouldSkipSarifUpload()) { - const payloadSaveFile = path13.join( + const payloadSaveFile = path14.join( getTemporaryDirectory(), `payload-${analysis.kind}.json` ); @@ -127170,7 +134513,7 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { `SARIF upload disabled by an environment variable. Saving to ${payloadSaveFile}` ); logger.info(`Payload: ${JSON.stringify(payload, null, 2)}`); - fs14.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); + fs15.writeFileSync(payloadSaveFile, JSON.stringify(payload, null, 2)); return "dummy-sarif-id"; } const client = getApiClient(); @@ -127204,12 +134547,12 @@ async function uploadPayload(payload, repositoryNwo, logger, analysis) { function findSarifFilesInDir(sarifPath, isSarif) { const sarifFiles = []; const walkSarifFiles = (dir) => { - const entries = fs14.readdirSync(dir, { withFileTypes: true }); + const entries = fs15.readdirSync(dir, { withFileTypes: true }); for (const entry of entries) { if (entry.isFile() && isSarif(entry.name)) { - sarifFiles.push(path13.resolve(dir, entry.name)); + sarifFiles.push(path14.resolve(dir, entry.name)); } else if (entry.isDirectory()) { - walkSarifFiles(path13.resolve(dir, entry.name)); + walkSarifFiles(path14.resolve(dir, entry.name)); } } }; @@ -127217,11 +134560,11 @@ function findSarifFilesInDir(sarifPath, isSarif) { return sarifFiles; } function getSarifFilePaths(sarifPath, isSarif) { - if (!fs14.existsSync(sarifPath)) { + if (!fs15.existsSync(sarifPath)) { throw new ConfigurationError(`Path does not exist: ${sarifPath}`); } let sarifFiles; - if (fs14.lstatSync(sarifPath).isDirectory()) { + if (fs15.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath, isSarif); if (sarifFiles.length === 0) { throw new ConfigurationError( @@ -127251,7 +134594,7 @@ function countResultsInSarif(sarif) { } function readSarifFile(sarifFilePath) { try { - return JSON.parse(fs14.readFileSync(sarifFilePath, "utf8")); + return JSON.parse(fs15.readFileSync(sarifFilePath, "utf8")); } catch (e) { throw new InvalidSarifUploadError( `Invalid SARIF. JSON syntax error: ${getErrorMessage(e)}` @@ -127276,15 +134619,15 @@ function validateSarifFileSchema(sarif, sarifFilePath, logger) { const warnings = (result.errors ?? []).filter( (err) => err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument) ); - for (const warning11 of warnings) { + for (const warning12 of warnings) { logger.info( - `Warning: '${warning11.instance}' is not a valid URI in '${warning11.property}'.` + `Warning: '${warning12.instance}' is not a valid URI in '${warning12.property}'.` ); } if (errors.length > 0) { - for (const error4 of errors) { - logger.startGroup(`Error details: ${error4.stack}`); - logger.info(JSON.stringify(error4, null, 2)); + 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}`); @@ -127320,7 +134663,7 @@ function buildPayload(commitOid, ref, analysisKey, analysisName, zippedSarif, wo payloadObj.base_sha = mergeBaseCommitOid; } else if (process.env.GITHUB_EVENT_PATH) { const githubEvent = JSON.parse( - fs14.readFileSync(process.env.GITHUB_EVENT_PATH, "utf8") + fs15.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; @@ -127509,10 +134852,10 @@ function shouldConsiderConfigurationError(processingErrors) { } function shouldConsiderInvalidRequest(processingErrors) { return processingErrors.every( - (error4) => error4.startsWith("rejecting SARIF") || error4.startsWith("an invalid URI was provided as a SARIF location") || error4.startsWith("locationFromSarifResult: expected artifact location") || error4.startsWith( + (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( - error4 + error3 ) ); } @@ -127579,7 +134922,7 @@ function filterAlertsByDiffRange(logger, sarif) { if (!locationUri || locationStartLine === void 0) { return false; } - const locationPath = path13.join(checkoutPath, locationUri).replaceAll(path13.sep, "/"); + const locationPath = path14.join(checkoutPath, locationUri).replaceAll(path14.sep, "/"); return diffRanges.some( (range) => range.path === locationPath && (range.startLine <= locationStartLine && range.endLine >= locationStartLine || range.startLine === 0 && range.endLine === 0) ); @@ -127591,8 +134934,8 @@ function filterAlertsByDiffRange(logger, sarif) { } // src/workflow.ts -var fs15 = __toESM(require("fs")); -var path14 = __toESM(require("path")); +var fs16 = __toESM(require("fs")); +var path15 = __toESM(require("path")); var import_zlib2 = __toESM(require("zlib")); var core15 = __toESM(require_core()); function toCodedErrors(errors) { @@ -127620,15 +134963,15 @@ async function getWorkflow(logger) { ); } const workflowPath = await getWorkflowAbsolutePath(logger); - return load(fs15.readFileSync(workflowPath, "utf-8")); + return load(fs16.readFileSync(workflowPath, "utf-8")); } async function getWorkflowAbsolutePath(logger) { const relativePath = await getWorkflowRelativePath(); - const absolutePath = path14.join( + const absolutePath = path15.join( getRequiredEnvParam("GITHUB_WORKSPACE"), relativePath ); - if (fs15.existsSync(absolutePath)) { + if (fs16.existsSync(absolutePath)) { logger.debug( `Derived the following absolute path for the currently executing workflow: ${absolutePath}.` ); @@ -127723,8 +135066,8 @@ function getCheckoutPathInputOrThrow(workflow, jobName, matrixVars) { } // src/init-action-post-helper.ts -function createFailedUploadFailedSarifResult(error4) { - const wrappedError = wrapError(error4); +function createFailedUploadFailedSarifResult(error3) { + const wrappedError = wrapError(error3); return { upload_failed_run_error: wrappedError.message, upload_failed_run_stack_trace: wrappedError.stack @@ -127817,9 +135160,9 @@ async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, co ); } if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" && !uploadFailedSarifResult.raw_upload_size_bytes) { - const error4 = JSON.stringify(uploadFailedSarifResult); + 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 ${error4}.` + `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") { @@ -127846,7 +135189,7 @@ async function run(uploadAllAvailableDebugArtifacts, printDebugLogs2, codeql, co } if (isSelfHostedRunner()) { try { - fs16.rmSync(config.dbLocation, { + fs17.rmSync(config.dbLocation, { recursive: true, force: true, maxRetries: 3 @@ -127972,17 +135315,17 @@ async function runWrapper() { } } } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); - core17.setFailed(error4.message); + const error3 = wrapError(unwrappedError); + core17.setFailed(error3.message); const statusReportBase2 = await createStatusReportBase( "init-post" /* InitPost */, - getActionsStatus(error4), + getActionsStatus(error3), startedAt, config, await checkDiskUsage(logger), logger, - error4.message, - error4.stack + error3.message, + error3.stack ); if (statusReportBase2 !== void 0) { await sendStatusReport(statusReportBase2); @@ -128096,7 +135439,7 @@ tmp/lib/tmp.js: *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) long/index.js: (** diff --git a/lib/init-action.js b/lib/init-action.js index a3b4cf1f56..5cf78ad20c 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os5 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os5 = __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() + os5.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto2 = __importStar4(require("crypto")); - var fs15 = __importStar4(require("fs")); - var os5 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto3 = __importStar2(require("crypto")); + var fs15 = __importStar2(require("fs")); + var os5 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + 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}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug5("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto2; + var crypto3; try { - crypto2 = require("crypto"); + crypto3 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto3.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto2 === void 0) { + if (crypto3 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto3.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto2 = require("node:crypto"); - random = (max) => crypto2.randomInt(0, max); + const crypto3 = require("node:crypto"); + random = (max) => crypto3.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable2 { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable2 { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay: delay2, persist } = mockDispatch2; + 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 (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable2({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve9({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto2; + var crypto3; try { - crypto2 = require("crypto"); + crypto3 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto2.randomBytes(16).toString("base64"); + const keyValue = crypto3.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto3.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto2; + var crypto3; try { - crypto2 = require("crypto"); + crypto3 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto2.randomBytes(4); + this.maskKey = crypto3.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve9, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve9) => setTimeout(() => resolve9(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path16 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path16 = __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, path16.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs15 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); - _a = fs15.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs15 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + _a = fs15.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs15.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs15.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path16.dirname(filePath); const upperName = path16.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path16.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which7; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path16 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path16 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which7; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os5 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path16 = __importStar4(require("path")); - var io7 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os5 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner6 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io7.which(this.toolPath, true); - return new Promise((resolve9, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve9, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve9(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + exports2.exec = exec; + exports2.getExecOutput = getExecOutput; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner()); + function exec(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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(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(resolve9) { + resolve9(value); + }); + } + return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(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 exec = __importStar2(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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(resolve9) { + resolve9(value); + }); + } + return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(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 = exportVariable6; + exports2.setSecret = setSecret; + exports2.addPath = addPath2; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput2; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug3; + exports2.debug = debug5; + exports2.error = error3; + exports2.warning = warning11; + exports2.notice = notice; + exports2.info = info6; + exports2.startGroup = startGroup4; + exports2.endGroup = endGroup4; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os5 = __importStar4(require("os")); - var path16 = __importStar4(require("path")); + var os5 = __importStar2(require("os")); + var path16 = __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 exportVariable6(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable6(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable6; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath2(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19681,18 +19872,16 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath2; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,19 +19889,17 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput2(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { @@ -19721,50 +19908,39 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.stdout.write(os5.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput2; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug3() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug3; function debug5(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug5; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning10(message, properties = {}) { + function warning11(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning10; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info6(message) { process.stdout.write(message + os5.EOL); } - exports2.info = info6; 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup4(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,536 +19984,78 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs15 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); - _a = fs15.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs15.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs15.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path16.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 = path16.dirname(filePath); - const upperName = path16.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path16.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(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 = which7; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path16 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path16.join(dest, path16.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 (path16.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path16.join(dest, path16.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(path16.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which7(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 __awaiter4(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(path16.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(path16.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path16.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path16.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug5; - } -}); - -// 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 debug5 = 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}}`); + var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug5; + } +}); + +// 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 debug5 = 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; }; @@ -20995,8 +20709,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare2 = require_compare(); - var gte5 = (a, b, loose) => compare2(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare2(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -21017,7 +20731,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt2 = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -21047,7 +20761,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt2(a, b, loose); case "<=": @@ -21525,7 +21239,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -21806,7 +21520,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt2 = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -21821,7 +21535,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt2; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -22136,7 +21850,7 @@ var require_semver2 = __commonJS({ var lt2 = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -22174,7 +21888,7 @@ var require_semver2 = __commonJS({ lt: lt2, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -22349,7 +22063,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -22362,21 +22076,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -22405,10 +22119,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -22483,8 +22197,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -22496,8 +22210,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -22554,42 +22268,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -22598,14 +22312,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -22614,7 +22328,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -22623,7 +22337,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -22637,7 +22351,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -22711,7 +22425,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve9, reject) => { function callbackForResult(err, res) { if (err) { @@ -22898,15 +22612,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve9) => setTimeout(() => resolve9(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -22968,7 +22682,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -22981,21 +22695,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -23024,7 +22738,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -23047,7 +22761,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter4(this, void 0, void 0, function* () { + const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; @@ -23133,8 +22847,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -23866,7 +23580,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -23875,7 +23589,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -23885,17 +23599,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24514,7 +24228,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -24523,7 +24237,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -24533,17 +24247,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -27215,9 +26929,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url = ""; return { value: { @@ -27522,7 +27236,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -27535,24 +27249,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -27582,7 +27296,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -27595,23 +27309,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises3)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run2, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } } doExpire(clearGlobalState, run2, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run2, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run2, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve9, returned, task; + var args, cb, error3, reject, resolve9, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve9, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve9(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info6) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info6) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29565,8 +29279,8 @@ var require_helpers = __commonJS({ } return decimalPlaces; }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; }; } }); @@ -30699,1424 +30413,1097 @@ var require_db_config_schema = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os5 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os5.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path16 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto3 = __importStar2(require("crypto")); + var fs15 = __importStar2(require("fs")); + var os5 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path16.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs15.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs15.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os5.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname3; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + 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}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path16.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path16.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path16.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve9) { + resolve9(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9) => __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", () => { + resolve9(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve9(Buffer.concat(chunks)); + }); + })); + }); + } }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var 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 expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path16 = (function() { - try { - return require("path"); - } catch (e) { + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path16.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + /** + * 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); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path16.sep !== "/") { - pattern = pattern.split(path16.sep).join("/"); + 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); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + 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); + }); } - if (!pattern) { - this.empty = true; - return; + 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); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug5() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = 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++) { - negate = !negate; - negateOffset++; + /** + * 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve9(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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(); + } } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + /** + * 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); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; } + return info6; } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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; } - 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; - } - 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve9) => setTimeout(() => resolve9(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve9(response); } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } - var cs = pattern.substring(classStart + 1, i); + let obj; + let contents; 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; + 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) { } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + 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 { + resolve9(response); } - 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]; + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/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(resolve9) { + resolve9(value); + }); } - 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(_, $1, $2) { - if (!$2) { - $2 = "\\"; + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve9(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; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - 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 = "$"; + 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"); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + options.headers["Authorization"] = `Bearer ${this.token}`; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - if (addPatternStart) { - re = patternStart + re; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - if (!hasMagic) { - return globUnescape(pattern); + // 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")}`; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path16.sep !== "/") { - f = f.split(path16.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - 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] === ""; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - throw new Error("wtf?"); }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve9) { + resolve9(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path16 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path16.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path16.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path16.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path16.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function step(result) { + result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os5 = __importStar4(require("os")); - var path16 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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 || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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(path16.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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path16.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path16.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; + 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 internal_match_kind_1.MatchKind.None; + return token; } - /** - * 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); + 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 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, "[*]"); + return runtimeUrl; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir2) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path16.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { - homedir2 = homedir2 || os5.homedir(); - assert_1.default(homedir2, "Unable to determine HOME directory"); - 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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path16, level) { - this.path = path16; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -32143,263 +31530,323 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve9, reject) { - v = o[n](v), settle(resolve9, reject, v.done, v.value); - }); - }; - } - function settle(resolve9, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve9({ value: v2, done: d }); - }, reject); + 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 = ""; } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + /** + * 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}`; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * 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(); + }); } - function fulfill(value) { - resume("next", value); + /** + * 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 }); + }); } - function reject(value) { - resume("throw", value); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core14 = __importStar4(require_core()); - var fs15 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path16 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs15.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs15.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path16.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; - }); + 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(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs15.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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 fs15.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs15.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + /** + * 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); } - traversalChain.push(realPath); - } - return stats; - }); + 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create2(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path16 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.create = create2; + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path16.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32408,21 +31855,21 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -32452,14 +31899,14 @@ var require_io_util3 = __commonJS({ var _a; 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 fs15 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); + var fs15 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); _a = fs15.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs15.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -32473,7 +31920,7 @@ var require_io_util3 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -32491,7 +31938,7 @@ var require_io_util3 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -32568,11 +32015,11 @@ var require_io_util3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32581,21 +32028,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -32625,10 +32072,10 @@ var require_io3 = __commonJS({ 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 path16 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); + var path16 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -32655,7 +32102,7 @@ var require_io3 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -32676,7 +32123,7 @@ var require_io3 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -32696,14 +32143,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32727,7 +32174,7 @@ var require_io3 = __commonJS({ } exports2.which = which7; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32775,7 +32222,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -32795,7 +32242,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -32816,1200 +32263,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug5; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug5 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug5 = 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 + "}"); +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - 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++) { - debug5(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; + __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(resolve9) { + resolve9(value); + }); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(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 os5 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + _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 { - version = version.version; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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); - } - debug5("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"); + return cmd; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os5.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os5.EOL.length); + n = s.indexOf(os5.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - 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; + _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 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) { - debug5("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 this.args; } - 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug5("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); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } 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]; - debug5("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); + if (!arg) { + return '""'; } - } 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++; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - 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]; + } + 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 { - 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]; - } + quoteHit = false; } - 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; + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.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 = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(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 = rcompare; - function rcompare(a, b, loose) { - return compare2(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 compare2(a, b, loose) > 0; - } - exports2.lt = lt2; - function lt2(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports2.gte = gte5; - function gte5(a, b, loose) { - return compare2(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(a, b, loose) { - return compare2(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 gte5(a, b, loose); - case "<": - return lt2(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + 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(""); } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _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; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug5("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; - } - debug5("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); + /** + * 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 = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io7.which(this.toolPath, true); + return new Promise((resolve9, 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) + os5.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 { + resolve9(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug5("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; + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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; }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug5("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve9) { + resolve9(value); }); } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - 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(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug5("comp", comp, options); - comp = replaceCarets(comp, options); - debug5("caret", comp); - comp = replaceTildes(comp, options); - debug5("tildes", comp); - comp = replaceXRanges(comp, options); - debug5("xrange", comp); - comp = replaceStars(comp, options); - debug5("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(_, M, m, p, pr) { - debug5("tilde", comp, _, 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) { - debug5("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + 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 exec(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.`); } - debug5("tilde return", ret); - return ret; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug5("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug5("caret", comp, _, 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) { - debug5("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"; + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } else { - debug5("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"; + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - debug5("caret return", ret); - return ret; + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; }); } - function replaceXRanges(comp, options) { - debug5("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) { - debug5("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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(resolve9) { + resolve9(value); + }); + } + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; } - debug5("xRange return", ret); - return ret; + function step(result) { + result.done ? resolve9(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 exec = __importStar2(require_exec2()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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 + }); }); } - function replaceStars(comp, options) { - debug5("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; - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + 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); } - return false; + __setModuleDefault2(result, mod); + return result; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve9) { + resolve9(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug5(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve9(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_utils5(); + var os5 = __importStar2(require("os")); + var path16 = __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 exportVariable6(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + 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); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path16.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; + return inputs.map((input) => input.trim()); } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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 && range.test(minver)) { - return minver; - } - return null; + process.stdout.write(os5.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug3() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug3; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning11(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning11; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os5.EOL); + } + exports2.info = info6; + 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 saveState2(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.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); + exports2.getState = getState2; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt2; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt2; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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/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]; + } }; } - if (satisfies2(version, range, options)) { - return false; + 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); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core14 = __importStar2(require_core2()); + 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; + core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core14.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + return result; } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path16 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname3(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + let result = path16.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname3; + 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)}`; } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } 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)}`; } - safeRe[t.COERCERTL].lastIndex = -1; } - if (match === null) { - return null; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path16.sep; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path16.sep)) { + return p; + } + if (p === path16.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -34022,932 +33440,1220 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve9, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve9, reject) { - v = o[n](v), settle(resolve9, reject, v.done, v.value); - }); - }; } - function settle(resolve9, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve9({ value: v2, done: d }); - }, reject); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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); + } } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob2 = __importStar4(require_glob()); - var io7 = __importStar4(require_io3()); - var crypto2 = __importStar4(require("crypto")); - var fs15 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); - var semver9 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path16.join(baseLocation, "actions", "temp"); - } - const dest = path16.join(tempDirectory, crypto2.randomUUID()); - yield io7.mkdirP(dest); - return dest; - }); + return result; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs15.statSync(filePath).size; + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - 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 = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path16.relative(workspace, file).replace(new RegExp(`\\${path16.sep}`, "g"), "/"); - core14.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; + }; + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs15.unlink)(filePath); - }); + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - }); - } catch (err) { - core14.debug(err.message); + bi = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - versionOutput = versionOutput.trim(); - core14.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver9.clean(versionOutput); - core14.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + if (begs.length) { + result = [left, right]; } - }); + } + return result; } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs15.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io7.which("tar") : ""; - }); + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - components.push(versionSalt); - return crypto2.createHash("sha256").update(components.join("|")).digest("hex"); + parts.push.apply(parts, p); + return parts; } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - return token; + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } 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}`); + N = concatMap(n, function(el) { + return expand(el, false); + }); } - 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; + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); } } - 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]"); + return expansions; } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path16 = (function() { + try { + return require("path"); + } catch (e) { } - __setModuleDefault4(result, mod); - return result; + })() || { + sep: "/" }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + minimatch.sep = path16.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } }; - 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); } - 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); + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(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", () => { - resolve9(output.toString()); - }); - })); - }); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve9(Buffer.concat(chunks)); - }); - })); - }); + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path16.sep !== "/") { + pattern = pattern.split(path16.sep).join("/"); } + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + Minimatch.prototype.debug = function() { }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + Minimatch.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 set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug5() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = 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++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; } + self2.debug("clearStateChar %j %j", stateChar, re); + stateChar = false; } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + 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 && reSpecials[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; + } + 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 (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; + } } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + 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(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + clearStateChar(); + if (escaping) { + re += "\\\\"; } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + 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; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + if (re !== "" && hasMagic) { + re = "(?=.)" + re; } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + if (addPatternStart) { + re = patternStart + re; } - /** - * 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 __awaiter4(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); - }); + if (isSub === SUBPARSE) { + return [re, hasMagic]; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + if (!hasMagic) { + return globUnescape(pattern); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re + "$", flags); + } catch (er) { + return new RegExp("$."); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + regExp._glob = pattern; + regExp._src = re; + return regExp; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, data); - } else { - return response; - } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path16.sep !== "/") { + f = f.split(path16.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; } - 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) { + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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); + this.debug("globstar swallow a segment, and continue"); + fr++; } - } 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(); + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + return false; } - this._disposed = true; + 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 regExpEscape(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 || 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.Path = void 0; + var path16 = __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 { /** - * Raw request. - * @param info - * @param data + * Constructs a Path + * @param itemPath Path or array of segments */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve9(res); - } + 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(path16.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path16.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); + 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(path16.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } } /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * Converts the path to it's string representation */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path16.sep; } + result += this.segments[i]; } - const req = info6.httpModule.request(info6.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(); + 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 || 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.Pattern = void 0; + var os5 = __importStar2(require("os")); + var path16 = __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}`; } - handleResult(new Error(`Request timeout: ${info6.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(); + 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(path16.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); } /** - * 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 + * Matches the pattern against the specified path */ - 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 info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path16.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path16.sep}`; } + } else { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); } - return info6; + 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; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + /** + * 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 lowercaseKeys(headers || {}); + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + /** + * 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(`.${path16.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { + homedir2 = homedir2 || os5.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 additionalHeaders[header] || clientHeader || _default2; + return pathHelper.normalizeSeparators(pattern); } - _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 https2.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 __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve9) => setTimeout(() => resolve9(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve9(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + /** + * 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; + } else { + set2 += c2; } - 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; + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - 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})`; + if (set2) { + literal += set2; + i = closed; + continue; } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve9(response); } - })); - }); + } + literal += c; + } + return literal; + } + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.Pattern = Pattern; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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(path16, level) { + this.path = path16; + 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -34974,3172 +34680,2309 @@ var require_auth2 = __commonJS({ 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; + 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(resolve9, reject) { + v = o[n](v), settle(resolve9, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve9, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve9({ value: v2, done: d }); + }, reject); } }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - // 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"); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - // 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")}`; + function fulfill(value) { + resume("next", value); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + function reject(value) { + resume("throw", value); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + exports2.DefaultGlobber = void 0; + var core14 = __importStar2(require_core2()); + var fs15 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path16 = __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); } - 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; + getSearchPaths() { + return this.searchPaths.slice(); } - 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; + glob() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } } + return result; }); - this._orderedPolicies = void 0; - return removedPolicies; - } - sendRequest(httpClient, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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); - } + 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("**"))); } } - if (options.beforePolicies) { - for (const beforePolicyName of options.beforePolicies) { - const beforeNode = policyMap.get(beforePolicyName); - if (beforeNode) { - beforeNode.dependsOn.add(node); - node.dependants.add(beforeNode); + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core14.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs15.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } + throw err; } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - } - function walkPhase(phase) { - phase.hasRun = true; - for (const node of phase.policies) { - if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) { + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { continue; } - if (node.dependsOn.size === 0) { - result.push(node.policy); - for (const dependant of node.dependants) { - dependant.dependsOn.delete(node); + 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 && path16.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await2(item.path); + } else if (!partialMatch) { + continue; } - policyMap.delete(node.policy.name); - phase.policies.delete(node); + const childLevel = item.level + 1; + const childItems = (yield __await2(fs15.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path16.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); } } - } - function walkPhases() { - for (const phase of orderedPhases) { - walkPhase(phase); - if (phase.policies.size > 0 && phase !== noPhase) { - if (!noPhase.hasRun) { - walkPhase(noPhase); - } - return; + }); + } + /** + * 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)); } - if (phase.hasAfterPolicies) { - walkPhase(noPhase); + } + 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 fs15.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core14.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 fs15.promises.lstat(item.path); } - } - 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."); + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs15.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + if (traversalChain.some((x) => x === realPath)) { + core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); } - } - return result; + return stats; + }); } }; - function createEmptyPipeline() { - return HttpPipeline.create(); - } + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os5 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os5.EOL}`); - } - 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 - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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]; + } }; } - } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + 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); } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + __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(resolve9) { + resolve9(value); + }); } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } - return false; - } - 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: extend3 - }); - function debug6(...args) { - if (!newDebugger.enabled) { - return; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; + function step(result) { + result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; - } - return false; - } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; - } - var debug5 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug5("azure"); - AzureLogger.log = (...args) => { - debug5.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } - } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + 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(resolve9, reject) { + v = o[n](v), settle(resolve9, reject, v.done, v.value); + }); + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); - } + function settle(resolve9, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve9({ value: v2, done: d }); + }, reject); } - debug5.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; - } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto3 = __importStar2(require("crypto")); + var core14 = __importStar2(require_core2()); + var fs15 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path16 = __importStar2(require("path")); + function hashFiles2(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core14.info : core14.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(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path16.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs15.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto3.createHash("sha256"); + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(fs15.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_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 ""; + } }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug5.disable(); - debug5.enable(enabledNamespaces2 + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); + exports2.hashFiles = hashFiles2; } }); -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve9) { + resolve9(value); + }); } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve9, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - try { - buildPromise((x) => { - removeListeners(); - resolve9(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + function step(result) { + result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/delay.js -var require_delay = __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 random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve9) => { - token = setTimeout(resolve9, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage + exports2.hashFiles = exports2.create = void 0; + var internal_globber_1 = require_internal_globber(); + var internal_hash_files_1 = require_internal_hash_files(); + function create2(patterns, options) { + return __awaiter2(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); }); } - 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 }; + exports2.create = create2; + function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create2(patterns, { followSymbolicLinks }); + return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); + }); } + exports2.hashFiles = hashFiles2; } }); -// 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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } +// 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 debug5; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug5 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug5 = function() { + }; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + 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++; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + 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 false; + return value; } - function getErrorMessage2(e) { - if (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}`; + 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++) { + debug5(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + var i; + exports2.parse = parse; + function parse(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; + } } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return 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); } - return true; - } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID2; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID2() { - return uuidFunction(); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; + if (!(this instanceof SemVer)) { + return new SemVer(version, options); + } + debug5("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; } - seen.add(value); } - return value; - }, 2); + return id; + }); } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url = new URL(value); - if (!url.search) { - return value; - } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); - } - } - return url.toString(); + 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("."); } - 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; + return this.version; + }; + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug5("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - 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; + 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); }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); - } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; - } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - 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(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var i2 = 0; + do { + var a = this.prerelease[i2]; + var b = other.prerelease[i2]; + debug5("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); } - } - function step(result) { - result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { 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]); + var i2 = 0; + do { + var a = this.build[i2]; + var b = other.build[i2]; + debug5("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); }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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; + 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 4: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; + 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); } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; + this.inc("pre", identifier); + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + 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; } - op = body.call(thisArg, _); - } 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 }; + exports2.diff = diff; + function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(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; + } } - }; - 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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } - 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]; + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - } - 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]); + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } - 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(resolve9, reject) { - v = o[n](v), settle(resolve9, reject, v.done, v.value); - }); - }; - } - function settle(resolve9, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve9({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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; + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - 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); - } + exports2.compare = compare2; + function compare2(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os5 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare2(a, b, true); } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os5.arch()}-${os5.type()}-${os5.release()})`); + 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); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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(" "); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare2(b, a, loose); } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - 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; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); - } - }; + exports2.gt = gt; + function gt(a, b, loose) { + return compare2(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - exports2.isReadableStream = isReadableStream; - exports2.isBlob = isBlob; - function isNodeReadableStream(x) { - return Boolean(x && typeof x["pipe"] === "function"); + exports2.lt = lt2; + function lt2(a, b, loose) { + return compare2(a, b, loose) < 0; } - function isWebReadableStream(x) { - return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); + exports2.eq = eq; + function eq(a, b, loose) { + return compare2(a, b, loose) === 0; } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + exports2.neq = neq; + function neq(a, b, loose) { + return compare2(a, b, loose) !== 0; } - function isBlob(x) { - return typeof x.stream === "function"; + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare2(a, b, loose) >= 0; } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; + exports2.lte = lte; + function lte(a, b, loose) { + return compare2(a, b, loose) <= 0; } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); + 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 gte6(a, b, loose); + case "<": + return lt2(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } } - function createFileFromStream(stream2, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream2(); - if ((0, typeGuards_js_1.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 = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); - } - yield yield tslib_1.__await(value); - } - } finally { - reader.releaseLock(); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - }); - } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return node_stream_1.Readable.fromWeb(stream2); + comp = comp.trim().split(/\s+/).join(" "); + debug5("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; } else { - return stream2; + this.value = this.operator + this.semver.version; } + debug5("comp", this); } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); - } else { - return ensureNodeStream(source); + 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); } - } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream2 of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream2)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } - } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; - } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; } - 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; + if (!m[2]) { + this.semver = ANY; } else { - return void 0; + this.semver = new SemVer(m[2], this.options.loose); } - } - 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; - } + }; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug5("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; } - return total; - } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } } - request.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`); + 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 (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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 !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); - } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); + var rangeTmp; + if (this.operator === "") { + if (this.value === "") { + return true; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __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; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); + rangeTmp = new Range2(comp.value, options); + return satisfies2(this.value, rangeTmp, options); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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"; + 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.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve9, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); - }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); - } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); - } - removeListeners(); - return rejectOnAbort(); + exports2.Range = Range2; + function Range2(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve9(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + } + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); } + } + if (range instanceof Comparator) { + return new Range2(range.value, options); + } + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - function parseHeaderValueAsNumber(response, headerName) { - const value = response.headers.get(headerName); - if (!value) - return; - const valueAsNum = Number(value); - if (Number.isNaN(valueAsNum)) - return; - return valueAsNum; + 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(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug5("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); + }); + } + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; + }; + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); + } + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.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; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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; - } + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); + } + function parseComparator(comp, options) { + debug5("comp", comp, options); + comp = replaceCarets(comp, options); + debug5("caret", comp); + comp = replaceTildes(comp, options); + debug5("tildes", comp); + comp = replaceXRanges(comp, options); + debug5("xrange", comp); + comp = replaceStars(comp, options); + debug5("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(_, M, m, p, pr) { + debug5("tilde", comp, _, 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) { + debug5("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - 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 (_a) { - return void 0; - } + debug5("tilde return", ret); + return ret; + }); } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; + function replaceCaret(comp, options) { + debug5("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("caret", comp, _, 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) { + debug5("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 { + debug5("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"; } - return { - retryAfterInMs - }; } - }; + debug5("caret return", ret); + return ret; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + function replaceXRanges(comp, options) { + debug5("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) { + debug5("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 = "*"; } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; + } 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; + } } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; + 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; } - }; + debug5("xRange return", ret); + return ret; + }); } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + function replaceStars(comp, options) { + debug5("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - function isSystemError(err) { - if (!err) { - return false; + 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; } - return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.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/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); - } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; + 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(); } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); - } + Range2.prototype.test = function(version) { + if (!version) { + return false; + } + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; } } - /** - * 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() }); + for (var i2 = 0; i2 < this.set.length; i2++) { + if (testSet(this.set[i2], version, this.options)) { + return true; + } } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + return false; + }; + function testSet(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } } - /** - * 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)); + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug5(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } + } + } + return false; } - /** - * Remove the header with the provided headerName. - * @param name - The name of the header to remove. - */ - delete(name) { - this._headersMap.delete(normalizeName(name)); + return true; + } + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - /** - * 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; + return range.test(version); + } + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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); } - } else { - for (const [normalizedName, entry] of this._headersMap) { - result[normalizedName] = entry.value; + } + }); + return max; + } + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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 result; + }); + return min; + } + exports2.minVersion = minVersion; + function minVersion(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJSON({ preserveCase: true })); + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; } - /** - * Iterate over tuples of header [name, value] pairs. - */ - [Symbol.iterator]() { - return headerIterator(this._headersMap); + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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); + } + }); } - }; - function createHttpHeaders(rawHeaders) { - return new HttpHeadersImpl(rawHeaders); + if (minver && range.test(minver)) { + return minver; + } + return null; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __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 core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; } - return formDataMap; } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt2; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt2; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies2(version, range, options)) { + return false; + } + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.set[i2]; + var high = null; + var low = null; + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 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; } - return next(request); + }); + if (high.operator === comp || high.operator === ecomp) { + return false; } - }; - } - 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()); + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; } } - return urlSearchParams.toString(); + return true; } - async function prepareFormData(formData, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; + exports2.prerelease = prerelease; + function prerelease(version, options) { + var parsed = parse(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; } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); + if (typeof version === "number") { + version = String(version); + } + if (typeof version !== "string") { + return null; + } + options = options || {}; + var match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } + safeRe[t.COERCERTL].lastIndex = -1; } - request.multipartBody = { parts }; + if (match === null) { + return null; + } + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); - }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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/@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.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); } }); -// 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 hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; +// 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]); } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + __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(resolve9) { + resolve9(value); + }); } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug5(...args) { - if (!debug5.enabled) { - return; - } - const self2 = debug5; - 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"); + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); } - debug5.namespace = namespace; - debug5.useColors = createDebug.useColors(); - debug5.color = createDebug.selectColor(namespace); - debug5.extend = extend3; - debug5.destroy = createDebug.destroy; - Object.defineProperty(debug5, "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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug5); } - return debug5; + function step(result) { + result.done ? resolve9(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(resolve9, reject) { + v = o[n](v), settle(resolve9, reject, v.done, v.value); + }); + }; } - function extend3(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; + function settle(resolve9, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve9({ value: v2, done: d }); + }, reject); } - 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)); + }; + 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 core14 = __importStar2(require_core()); + var exec = __importStar2(require_exec()); + var glob2 = __importStar2(require_glob()); + var io7 = __importStar2(require_io()); + var crypto3 = __importStar2(require("crypto")); + var fs15 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); + var semver10 = __importStar2(require_semver3()); + var util = __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 { - createDebug.names.push(ns); + if (process.platform === "darwin") { + baseLocation = "/Users"; + } else { + baseLocation = "/home"; + } } + tempDirectory = path16.join(baseLocation, "actions", "temp"); } - } - 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++; + const dest = path16.join(tempDirectory, crypto3.randomUUID()); + yield io7.mkdirP(dest); + return dest; + }); + } + function getArchiveFileSizeInBytes(filePath) { + return fs15.statSync(filePath).size; + } + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path16.relative(workspace, file).replace(new RegExp(`\\${path16.sep}`, "g"), "/"); + core14.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); } else { - searchIndex++; - templateIndex++; + paths.push(`${relativeFile}`); } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; + return paths; + }); + } + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs15.unlink)(filePath); + }); + } + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() + } + }); + } catch (err) { + core14.debug(err.message); } - 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; - } + versionOutput = versionOutput.trim(); + core14.debug(versionOutput); + return versionOutput; + }); + } + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver10.clean(versionOutput); + core14.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } + }); + } + 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 (fs15.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } - return false; + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io7.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - function coerce3(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - 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`."); + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - createDebug.enable(createDebug.load()); - return createDebug; + 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; } - 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+)/); +// 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]]; } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); + 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 _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.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], context2); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; } - exports2.log = console.debug || console.log || (() => { + } + 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(resolve9) { + resolve9(value); }); - function save(namespaces) { + } + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { + step(generator.next(value)); + } catch (e) { + reject(e); } } - function load2() { - let r; + function rejected(value) { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return r; } - function localstorage() { - try { - return localStorage; - } catch (error4) { - } + function step(result) { + result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.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); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { 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]); }; } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os5 = 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 step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) 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: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; + } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; + } + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; + } + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; + 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 }; } - 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 = os5.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; + }; + 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; } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); - return translateLevel(level); + } + 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]; } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) + } + 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); }; } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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]; + 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 { - 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 (error4) { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - 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, (_, k) => { - return k.toUpperCase(); + } + 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(resolve9, reject) { + v = o[n](v), settle(resolve9, reject, v.done, v.value); }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); - } - obj[prop] = val2; - 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(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } + }; + } + function settle(resolve9, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve9({ 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]; } - function load2() { - return process.env.DEBUG; + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function init(debug5) { - debug5.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug5.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { + try { + inner.call(this); + } catch (e) { + return Promise.reject(e); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + env.stack.push({ value, dispose, async }); + } else if (async) { + env.stack.push({ async: true }); } -}); - -// 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(); + 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; } -}); - -// node_modules/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + return next(); +} +function __rewriteRelativeImportExtension(path16, preserveJsx) { + if (typeof path16 === "string" && /^\.\.?\//.test(path16)) { + return path16.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path16; +} +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)) { @@ -38151,980 +36994,760 @@ var require_helpers3 = __commonJS({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + }); + __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; }; + 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.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(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 json2(stream2) { - const buf = await toBuffer(stream2); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; + 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}`); } - exports2.json = json2; - function req(url, opts = {}) { - const href = typeof url === "string" ? url : url.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); - const promise = new Promise((resolve9, reject) => { - req2.once("response", resolve9).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) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + 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 }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); + } } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = Symbol("AgentBaseInternalState"); - var Agent = class extends http.Agent { - constructor(opts) { - super(opts); - this[INTERNAL] = {}; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - /** - * 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); + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - // 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] = []; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; } - 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 index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; } } - // 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); + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - 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); + 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; } } - 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"); + 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; } - return socket; } - get defaultPort() { - return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); - } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + 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(debug5, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug5(...args) { + if (!newDebugger.enabled) { + return; } - } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); - } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; } + newDebugger.log(...args); } - }; - exports2.Agent = Agent; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; + } + function extend3(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; + } + exports2.default = debugObj; } }); -// 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) { +// 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"; - var __importDefault4 = 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 = __importDefault4(require_src()); - var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve9, 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); + 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(",")}`); } - function onend() { - cleanup(); - debug5("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + logLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } } - function onerror(err) { - cleanup(); - debug5("onerror %o", err); - reject(err); + 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 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) { - debug5("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; - } - } - debug5("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve9({ - connect: { - statusCode, - statusText, - headers - }, - buffered - }); + } + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); + } + function createLogger(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); } - socket.on("error", onerror); - socket.on("end", onend); - read(); - }); + registeredLoggers.add(logger); + return logger; + } + function contextGetLogLevel() { + return logLevel; + } + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; + } + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/https-proxy-agent/dist/index.js -var require_dist3 = __commonJS({ - "node_modules/https-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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(exports2, "__esModule", { value: true }); + exports2.createHttpHeaders = createHttpHeaders; + function normalizeName(name) { + return name.toLowerCase(); + } + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + } + 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]); + } + } } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug5 = (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 - }; + /** + * 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() }); } - return options; - }; - var HttpsProxyAgent = 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 ?? {}; - debug5("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 ? omit(opts, "headers") : null, - host, - port - }; + /** + * 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; } /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. + * 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. */ - async connect(req, opts) { - const { proxy } = this; - if (!opts.host) { - throw new TypeError('No "host" provided'); - } - let socket; - if (proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + 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 { - debug5("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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) { - debug5("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + for (const [normalizedName, entry] of this._headersMap) { + result[normalizedName] = entry.value; } - return socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug5("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + 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); } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); } - function omit(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/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 = randomUUID2; + function randomUUID2() { + return crypto.randomUUID(); } } }); -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; }; + 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.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug5 = (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 ?? {}; - debug5("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 ? omit(opts, "headers") : null, - host, - port - }; - } - addRequest(req, opts) { - req._header = null; - this.setRequestProps(req, opts); - super.addRequest(req, opts); + 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; } - setRequestProps(req, opts) { - const { proxy } = this; - const protocol = opts.secureEndpoint ? "https:" : "http:"; - const hostname = req.getHeader("host") || "localhost"; - const base = `${protocol}//${hostname}`; - const url = new url_1.URL(req.path, base); - if (opts.port !== 80) { - url.port = String(opts.port); + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - req.path = String(url); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - for (const name of Object.keys(headers)) { - const value = headers[name]; - if (value) { - req.setHeader(name, value); + 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, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); + } + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - async connect(req, opts) { - req._header = null; - if (!req.path.includes("://")) { - this.setRequestProps(req, opts); - } - let first; - let endOfHeaders; - debug5("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug5("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); - debug5("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug5("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 omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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_log(); - 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; + clone() { + return new _HttpPipeline(this._policies); } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + static create() { + return new _HttpPipeline(); } - let isBypassedFlag = false; - for (const pattern of noProxyList) { - if (pattern[0] === ".") { - if (host.endsWith(pattern)) { - isBypassedFlag = true; + 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 { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } else { - if (host === pattern) { - isBypassedFlag = true; + return noPhase; } } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + 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); } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + 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); + } + } + } } - request.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(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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); + } } - return next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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); + } } - return next(request); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __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; - exports2.tlsPolicyName = "tlsPolicy"; - function tlsPolicy(tlsSettings) { - return { - name: exports2.tlsPolicyName, - sendRequest: async (req, next) => { - if (!req.tlsSettings) { - req.tlsSettings = tlsSettings; + 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 next(req); } - }; - } - } -}); - -// 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.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; - } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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; + return result; } }; - 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 - }; + function createEmptyPipeline() { + return HttpPipeline.create(); + } } }); -// node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js -var require_instrumenter = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js"(exports2) { +// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } - exports2.getInstrumenter = getInstrumenter; } }); -// node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js -var require_tracingClient = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js"(exports2) { +// 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.createTracingClient = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); - } - function parseTraceparentHeader(traceparentHeader) { - return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); - } - function createRequestHeaders(tracingContext) { - return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + 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 { - startSpan, - withSpan, - withContext, - parseTraceparentHeader, - createRequestHeaders - }; + return false; } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/inspect.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.custom = void 0; @@ -39133,18 +37756,196 @@ var require_inspect = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { +// 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 url = new URL(value); + if (!url.search) { + return value; + } + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } + } + return url.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 core_util_1 = require_commonjs2(); + 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"; @@ -39152,212 +37953,86 @@ var require_restError = __commonJS({ 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); } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } }; exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; function isRestError(e) { if (e instanceof RestError) { return true; } - return (0, core_util_1.isError)(e) && e.name === "RestError"; + return (0, error_js_1.isError)(e) && e.name === "RestError"; } } }); -// 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) { +// 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.tracingPolicyName = void 0; - exports2.tracingPolicy = tracingPolicy; - var core_tracing_1 = require_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.statusCode); - } - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + exports2.uint8ArrayToString = uint8ArrayToString; + exports2.stringToUint8Array = stringToUint8Array; + function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); } - 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); - } - span.setStatus({ - status: "success" - }); - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + function stringToUint8Array(value, format) { + return Buffer.from(value, format); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { +// 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.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 multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { + "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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib2 = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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((resolve9) => { const handler = () => { resolve9(); @@ -39374,6 +38049,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -39387,25 +38064,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -39414,13 +38088,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -39444,8 +38121,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -39467,7 +38147,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -39485,9 +38165,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -39496,29 +38175,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url = new URL(request.url); const isInsecure = url.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url.hostname, path: `${url.pathname}${url.search}`, port: url.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve9, reject) => { - const req = isInsecure ? http.request(options, resolve9) : https2.request(options, resolve9); + const req = isInsecure ? node_http_1.default.request(options, resolve9) : node_https_1.default.request(options, resolve9); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -39539,30 +38217,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -39585,11 +38264,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream2, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib2.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream2.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib2.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream2.pipe(inflate); return inflate; } @@ -39609,7 +38288,7 @@ var require_nodeHttpClient = __commonJS({ resolve9(Buffer.concat(buffer).toString("utf8")); }); stream2.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -39640,9 +38319,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -39653,9462 +38332,16679 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.systemErrorRetryPolicyName = void 0; - exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; - function systemErrorRetryPolicy(options = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; + 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.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest + name: exports2.userAgentPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } }; } } }); -// 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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + exports2.decompressResponsePolicyName = void 0; + exports2.decompressResponsePolicy = decompressResponsePolicy; + exports2.decompressResponsePolicyName = "decompressResponsePolicy"; + function decompressResponsePolicy() { + return { + name: exports2.decompressResponsePolicyName, + async sendRequest(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; + } +}); + +// 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((resolve9, 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); } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + }; + onAborted = () => { + if (timer) { + clearTimeout(timer); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + removeListeners(); + return rejectOnAbort(); + }; + if (options?.abortSignal && options.abortSignal.aborted) { + return rejectOnAbort(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve9(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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; + } } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; +}); + +// 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 hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug5(...args) { + if (!debug5.enabled) { + return; } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; + const self2 = debug5; + 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"); } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + debug5.namespace = namespace; + debug5.useColors = createDebug.useColors(); + debug5.color = createDebug.selectColor(namespace); + debug5.extend = extend3; + debug5.destroy = createDebug.destroy; + Object.defineProperty(debug5, "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 (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } 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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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 __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); + if (typeof createDebug.init === "function") { + createDebug.init(debug5); + } + return debug5; + } + function extend3(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; } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); +}); + +// 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 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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve9, reject) { - v = o[n](v), settle(resolve9, reject, v.done, v.value); + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } }); - }; - } - function settle(resolve9, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve9({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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]; + args.splice(lastC, 0, c); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { + function load2() { + let r; try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error3) { } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + function localstorage() { 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); + return localStorage; + } catch (error3) { } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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 __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - } }; + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 }; } }); -// node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js -var require_azureKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js"(exports2) { +// node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "node_modules/has-flag/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureKeyCredential = void 0; - var AzureKeyCredential = class { - /** - * 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; - } + 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); }; - 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) { +// node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs2(); - function isKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; + var os5 = 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; } - } -}); - -// 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + 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); } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + } + function translateLevel(level) { + if (level === 0) { + return false; } - /** - * 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"); + 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 = os5.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } - this._name = name; - this._key = key; + return 1; } - /** - * 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"); + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; } - this._name = newName; - this._key = newKey; + return min; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } - /** - * 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; + if (env.COLORTERM === "truecolor") { + return 3; } - /** - * 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"); + 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; } - this._signature = newSignature; } - }; - exports2.AzureSASCredential = AzureSASCredential; - function isSASCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; + 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/@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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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, (_, 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(util.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 init(debug5) { + debug5.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug5.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; } }); -// node_modules/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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/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/@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) { +// 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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); - } - }; + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __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.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); + exports2.toBuffer = toBuffer; + async function json2(stream2) { + const buf = await toBuffer(stream2); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; + exports2.json = json2; + function req(url, opts = {}) { + const href = typeof url === "string" ? url : url.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); + const promise = new Promise((resolve9, reject) => { + req2.once("response", resolve9).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; + } + exports2.req = req; } }); -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// node_modules/agent-base/dist/index.js +var require_dist = __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 result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(thisArg, body) { - var _ = { 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]); + 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); }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; + 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 (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; + if (typeof options.protocol === "string") { + return options.protocol === "https:"; } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; + } + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + } } - op = body.call(thisArg, _); - } 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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 __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + // 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); }); - }; - 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 __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve9, reject) { - v = o[n](v), settle(resolve9, reject, v.done, v.value); - }); - }; - } - function settle(resolve9, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve9({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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 __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + 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; } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); - }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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]; + 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; } - return t; - }; - return __assign3.apply(this, arguments); - }; - __createBinding3 = 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]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 }; + exports2.Agent = Agent; } }); -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); - } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); - } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); - } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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) { +// 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.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; - } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); - } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, 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 = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; - } - } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + exports2.parseProxyResponse = void 0; + var debug_1 = __importDefault2(require_src()); + var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve9, 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(); + debug5("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); + } + function onerror(err) { + cleanup(); + debug5("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) { + debug5("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; + } } + debug5("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve9({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - 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) + socket.on("error", onerror); + socket.on("end", onend); + read(); }); } - exports2.flattenResponse = flattenResponse; + exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/@azure/core-client/dist/commonjs/serializer.js -var require_serializer = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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.MapperTypeNames = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + 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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug5 = (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 + }; } - /** - * @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}.`); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port }; - 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 + * Called when the node-core HTTP client library is creating a + * new HTTP request. */ - serialize(mapper, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : 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) { - object = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + async connect(req, opts) { + const { proxy } = this; + if (!opts.host) { + throw new TypeError('No "host" provided'); } - if (object === void 0 || object === null) { - payload = object; + let socket; + if (proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - let payload; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - 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); - } + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r +`; } - if (mapper.isConstant) { - payload = mapper.defaultValue; + 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) { + debug5("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; } - return payload; + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug5("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } } - return str2.substr(0, len); + return ret; } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var debug5 = (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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + addRequest(req, opts) { + req._header = null; + this.setRequestProps(req, opts); + super.addRequest(req, opts); } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; + setRequestProps(req, opts) { + const { proxy } = this; + const protocol = opts.secureEndpoint ? "https:" : "http:"; + const hostname = req.getHeader("host") || "localhost"; + const base = `${protocol}//${hostname}`; + const url = new url_1.URL(req.path, base); + if (opts.port !== 80) { + url.port = String(opts.port); + } + req.path = String(url); + const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - 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.`); - } + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); } - } - 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(); + let first; + let endOfHeaders; + debug5("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug5("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); + debug5("Output buffer: %o", req.outputData[0].data); } - 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.`); + let socket; + if (this.proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - value = base64.encodeByteArray(value); + await (0, events_1.once)(socket, "connect"); + return socket; } - 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.`); + }; + HttpProxyAgent.protocols = ["http", "https"]; + exports2.HttpProxyAgent = HttpProxyAgent; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); - } - } + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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 value; + return void 0; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - 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}.`); + 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; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + const host = new URL(uri).hostname; + if (bypassedMap?.has(host)) { + return bypassedMap.get(host); } - const tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + let isBypassedFlag = false; + for (const pattern of noProxyList) { + if (pattern[0] === ".") { + if (host.endsWith(pattern)) { + isBypassedFlag = true; } else { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream2) { + if (stream2 instanceof ReadableStream) { + makeAsyncIterable(stream2); + return stream_1.Readable.fromWeb(stream2); + } else { + return stream2; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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; } } - } 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; - } + })()); + }; + } + } +}); + +// 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; } } - 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 total; + } + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); + } + request.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(request, next) { + if (!request.multipartBody) { + return next(request); } - return true; - }; - for (const responsePropName in responseBody) { - if (isAdditionalProperty(responsePropName)) { - instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '["' + responsePropName + '"]', options); + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); } - } - } 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]; + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - } - 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); + } +}); + +// 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - return tempDictionary; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - return responseBody; - } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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}`); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - if (responseBody) { - if (!Array.isArray(responseBody)) { - responseBody = [responseBody]; - } - if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } + } +}); + +// 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 url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; + } + return next(req); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + }; + } + } +}); + +// 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(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url = new URL(request.url); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; } - return tempArray; } - return responseBody; + return false; } - 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]; + function emitInsecureConnectionWarning() { + const warning11 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning11); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning11); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } 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); - } - } + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - return void 0; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); } + request.headers.set(scheme.name, options.credential.key); + return next(request); } - } - 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; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); + } + }; + } } }); -// node_modules/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } - } else { - if (parameterMapper.required) { - value = {}; + }; + } + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } - 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 pipeline; + } + 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_multipart2 = __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 value; + return void 0; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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; + 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 (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; } - return result; + return disposition; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + 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 getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); + 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); } - let info6 = state_js_1.state.operationRequestMap.get(request); - if (!info6) { - info6 = {}; - state_js_1.state.operationRequestMap.set(request, info6); + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); } - return info6; + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + 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, rawHeaders: headers, parsedBody }); } - }; - return { - name: exports2.deserializationPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + return { + request, + 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, rawHeaders }, e); } - }; + throw e; + } } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + 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 result; + return "application/json"; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); - } - return result; + function buildPipelineRequest(method, url, 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, + 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 + }); } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if ((0, typeGuards_js_1.isReadableStream)(body)) { + return { body }; } - 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] : []; + 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) }; } - 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; + return { body: JSON.stringify(body) }; + case "text/plain": + return { body: String(body) }; + default: + if (typeof body === "string") { + return { body }; } - } 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 { body: JSON.stringify(body) }; } - return parsedResponse; } - function isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + 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 + }); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; + } +}); + +// 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.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(url, options = {}) { + if (!options.queryParameters) { + return url; + } + const parsedUrl = new URL(url); + 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 { - return { error: null, shouldReturnResponse: false }; + paramStrings.push(getQueryParamValue(key, options.skipUrlEncoding ?? false, style, rawValue)); } } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); + } + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; + } + 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 (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); + if (!param.toString || typeof param.toString !== "function") { + throw new Error(`Path parameters must be able to be represented as string, ${key} can't`); } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + let value = param.toISOString !== void 0 ? param.toISOString() : String(param); + if (!options.skipUrlEncoding) { + value = encodeURIComponent(param); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return { error: error4, shouldReturnResponse: false }; + return endpoint; } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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 operationResponse; + return routePath; + } + function replaceAll(value, searchValue, replaceValue) { + return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || ""); } } }); -// node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js -var require_interfaceHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/interfaceHelpers.js"(exports2) { +// 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - return result; + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path16, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path16, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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."); + } + } + }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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; + exports2.operationOptionsToRequestParameters = operationOptionsToRequestParameters; + function operationOptionsToRequestParameters(options) { return { - name: exports2.serializationPolicyName, - async sendRequest(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } + 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 }; } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } - } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); - } - } + } +}); + +// 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) + }); } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } + function toPipelineResponse(response) { + return { + headers: (0, httpHeaders_js_1.createHttpHeaders)(response.headers), + request: response.request, + status: statusCodeToNumber(response.status) ?? -1 }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } - } - } - } - exports2.serializeRequestBody = serializeRequestBody; - 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; + function statusCodeToNumber(statusCode) { + const status = Number.parseInt(statusCode); + return Number.isNaN(status) ? void 0 : status; } } }); -// node_modules/@azure/core-client/dist/commonjs/pipeline.js +// 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-client/dist/commonjs/pipeline.js"(exports2) { + "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); - } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; + exports2.createEmptyPipeline = createEmptyPipeline; + var ts_http_runtime_1 = require_commonjs(); + function createEmptyPipeline() { + return (0, ts_http_runtime_1.createEmptyPipeline)(); } - exports2.createClientPipeline = createClientPipeline; } }); -// node_modules/@azure/core-client/dist/commonjs/httpClientCache.js -var require_httpClientCache = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/httpClientCache.js"(exports2) { +// 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.getCachedDefaultHttpClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); - } - return cachedHttpClient; - } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; + 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/core-client/dist/commonjs/urlHelpers.js -var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { +// 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.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path16 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path16.startsWith("/")) { - path16 = path16.substring(1); - } - if (isAbsoluteUrl(path16)) { - requestUrl = path16; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path16); - } - } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; + exports2.AzureLogger = void 0; + exports2.setLogLevel = setLogLevel; + exports2.getLogLevel = getLogLevel; + exports2.createClientLogger = createClientLogger; + var logger_1 = require_internal(); + var context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); - } - return result; + function getLogLevel() { + return context2.getLogLevel(); } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function isAbsoluteUrl(url) { - return url.includes("://"); + } +}); + +// 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 + }); } - function appendPath(url, pathToAppend) { - if (!pathToAppend) { - return url; - } - const parsedUrl = new URL(url); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path16 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path16; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; - } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); + } +}); + +// 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 + }; } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } - } - } + } +}); + +// 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 { - queryParams: result, - sequenceParams + 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 }; } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; - } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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(url, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url; - } - const parsedUrl = new URL(url); - 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(); - } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, 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; + 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-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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"; } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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; + } +}); + +// 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; + return parts.join(" "); } - 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) => Object.assign(Object.assign({}, a), b), {}); + function getUserAgentHeaderName() { + return (0, userAgentPlatform_js_1.getHeaderName)(); } - function requestToOptions(request) { - return { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions - }; + 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-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } + }; + } + } +}); + +// 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 serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + var uuidUtils_js_1 = require_uuidUtils(); + Object.defineProperty(exports2, "randomUUID", { enumerable: true, get: function() { + return uuidUtils_js_1.randomUUID; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var checkEnvironment_js_1 = require_checkEnvironment(); + Object.defineProperty(exports2, "isBrowser", { enumerable: true, get: function() { + return checkEnvironment_js_1.isBrowser; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + Object.defineProperty(exports2, "isBun", { enumerable: true, get: function() { + return checkEnvironment_js_1.isBun; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "isNodeLike", { enumerable: true, get: function() { + return checkEnvironment_js_1.isNodeLike; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; + exports2.cancelablePromiseRace = cancelablePromiseRace; + async function cancelablePromiseRace(abortablePromiseBuilders, options) { + const aborter = new AbortController(); + function abortHandler() { + aborter.abort(); } - } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; + 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); } } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); - } - var HttpHeaders = class _HttpHeaders { - 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); + } +}); + +// 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.HttpHeaders = HttpHeaders; + exports2.AbortError = AbortError; } }); -// 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } - } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); - } - } - exports2.toPipelineResponse = toPipelineResponse; + 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-http-compat/dist/commonjs/extendedClient.js -var require_extendedClient = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/extendedClient.js"(exports2) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); + exports2.createAbortablePromise = createAbortablePromise; + var abort_controller_1 = require_commonjs3(); + function createAbortablePromise(buildPromise, options) { + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; + return new Promise((resolve9, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.handleRedirects) === false) { - this.pipeline.removePolicy({ - name: core_rest_pipeline_1.redirectPolicyName - }); + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - /** - * Compatible send operation request function. - * - * @param operationArguments - Operation arguments - * @param operationSpec - Operation Spec - * @returns - */ - async sendOperationRequest(operationArguments, operationSpec) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - operationArguments.options = Object.assign(Object.assign({}, operationArguments.options), { onResponse }); - const result = await super.sendOperationRequest(operationArguments, operationSpec); - if (lastResponse) { - Object.defineProperty(result, "_response", { - value: (0, response_js_1.toCompatResponse)(lastResponse) + if (abortSignal?.aborted) { + return rejectOnAbort(); + } + try { + buildPromise((x) => { + removeListeners(); + resolve9(x); + }, (x) => { + removeListeners(); + reject(x); }); + } catch (err) { + reject(err); } - return result; - } - }; - exports2.ExtendedServiceClient = ExtendedServiceClient; + abortSignal?.addEventListener("abort", onAbort); + }); + } } }); -// 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) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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(request, 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)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + 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)((resolve9) => { + token = setTimeout(resolve9, 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}`; + } } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); + exports2.isDefined = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; } - }; + } + return true; + } + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 = randomUUID2; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var createAbortablePromise_js_1 = require_createAbortablePromise(); + Object.defineProperty(exports2, "createAbortablePromise", { enumerable: true, get: function() { + return createAbortablePromise_js_1.createAbortablePromise; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var delay_js_1 = require_delay2(); + Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { + return delay_js_1.delay; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error2(); + Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { + return error_js_1.getErrorMessage; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var typeGuards_js_1 = require_typeGuards2(); + Object.defineProperty(exports2, "isDefined", { enumerable: true, get: function() { + return typeGuards_js_1.isDefined; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "isObjectWithProperties", { enumerable: true, get: function() { + return typeGuards_js_1.isObjectWithProperties; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + Object.defineProperty(exports2, "objectHasProperty", { enumerable: true, get: function() { + return typeGuards_js_1.objectHasProperty; } }); - } -}); - -// node_modules/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } - } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; - } - }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; - } -}); - -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { - "use strict"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } - return i; + function calculateRetryDelay(retryAttempt, config) { + return tspRuntime.calculateRetryDelay(retryAttempt, config); } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } - } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); - } - } - return true; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; + function isError(e) { + return tspRuntime.isError(e); } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col - } - }; + function isObject2(input) { + return tspRuntime.isObject(input); } - function validateAttrName(attrName) { - return util.isName(attrName); + function randomUUID2() { + 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 validateTagName(tagname) { - return util.isName(tagname); + function stringToUint8Array(value, format) { + return tspRuntime.stringToUint8Array(value, format); } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; + } +}); + +// 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"); } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true + var unimplementedMethods = { + arrayBuffer: () => { + throw new Error("Not implemented"); }, - tagValueProcessor: function(tagName, val2) { - return val2; + bytes: () => { + throw new Error("Not implemented"); }, - attributeValueProcessor: function(attrName, val2) { - return val2; + slice: () => { + throw new Error("Not implemented"); }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } - } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); - } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); + text: () => { + throw new Error("Not implemented"); } - return { entities, i }; + }; + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); + } else { + return blob; } - return [entityName2, val2, i]; - } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; - } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; - } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; - } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; + 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 validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); + 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 { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; - } - } else { - return str2; - } + return new File([toArrayBuffer(content)], name, options); } } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } - return numStr; + return source.map((x) => x); } - module2.exports = toNumber; } }); -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; +// 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } - }; - } - return () => false; + return tspPolicy.sendRequest(request, next); + } + }; } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + 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)(); } - var replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); - } - return val2; - }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; + } +}); + +// 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); } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; + } +}); + +// 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)(); } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } + } +}); + +// 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 findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); - } else { - return closingIndex + str2.length - 1; - } + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + } +}); + +// 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 { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName - }; - } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } + name: exports2.setClientRequestIdPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - } - } - function parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } - } + }; } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; - } - } - } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + 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); } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); +// 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; + } + 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; } }; - module2.exports = XMLParser; + exports2.TracingContextImpl = TracingContextImpl; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; +// 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: () => { } - isPreviousElementTag = true; - } - return xmlStr; + }; } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } + 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); } - } - return attrStr; + }; } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); } - return textValue; + return state_js_1.state.instrumenterImplementation; } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; + 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 }; - this.tagEndChar = ">"; - this.newLine = ""; } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; + 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(); } - return this.j2x(jObj, 0, []).val; } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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(request, next) { + if (!tracingClient) { + return next(request); } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; } } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); + }; + } + 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; } } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.tracingOptions }, { + spanKind: "client", + spanAttributes + }); + if (!span.isRecording()) { + span.end(); + return void 0; } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; + const headers = tracingClient.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); + for (const [key, value] of Object.entries(headers)) { + request.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; } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); + } + 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)}`); } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; + } +}); + +// 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 }; } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder - }; + 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); + } + } + }; + } } }); -// 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) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + } + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false - }; - } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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 }); - } - 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(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); - } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; - } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - 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; + async sendRequest(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); + } } - } - return parsedXml; + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; - } }); + exports2.createHttpHeaders = createHttpHeaders; + var ts_http_runtime_1 = require_commonjs(); + function createHttpHeaders(rawHeaders) { + return (0, ts_http_runtime_1.createHttpHeaders)(rawHeaders); + } } }); -// 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) { +// 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.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; + exports2.createPipelineRequest = createPipelineRequest; + var ts_http_runtime_1 = require_commonjs(); + function createPipelineRequest(options) { + return (0, ts_http_runtime_1.createPipelineRequest)(options); + } } }); -// node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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; } - 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); + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } - /** - * 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."); + 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(); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + }; + 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; } - /** - * 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; + return async (scopes, tokenOptions) => { + const hasClaimChallenge = Boolean(tokenOptions.claims); + const tenantIdChanged = tenantId !== tokenOptions.tenantId; + if (hasClaimChallenge) { + token = null; } - for (const parentSignal of parentSignals) { - if (parentSignal.aborted) { - this.abort(); - } else { - parentSignal.addEventListener("abort", () => { - this.abort(); - }); - } + const mustRefresh = tenantIdChanged || hasClaimChallenge || cycler.mustRefresh; + if (mustRefresh) { + return refresh(scopes, tokenOptions); } - } - /** - * 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(); + if (cycler.shouldRefresh) { + refresh(scopes, tokenOptions); } - return signal; - } - }; - exports2.AbortController = AbortController2; - exports2.AbortError = AbortError; - exports2.AbortSignal = AbortSignal2; + return token; + }; + } } }); -// node_modules/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { + 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(request, next) { try { - return JSON.parse(serializedState).state; + return [await next(request), void 0]; } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); - } - throw error4; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - 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 isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - 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.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 - })); + 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 buildResult(inputs) { - const { processResult, response, state } = inputs; - return processResult ? processResult(response, state) : response; - } - async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation + 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) }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; - } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; + 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(request, next) { + if (!request.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, + getAccessToken, + logger + }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } } - } - return { response, status }; + }; } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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; } - 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) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; + } +}); + +// 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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); } } + return next(request); } - } + }; } - 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; - } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions + }; + return (await getAccessToken(scopes, getTokenOptions))?.token ?? ""; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - } - } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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; + } +}); + +// 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; } - return void 0; - } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; + /** + * 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; } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; + /** + * 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; } - return error4; + }; + 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"; } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + } +}); + +// 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; } - return void 0; - } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case void 0: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; } - const status = helper(); - return status === "running" && operationLocation === void 0 ? "succeeded" : status; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return 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 - }); - } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + /** + * 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"); } - case "Body": - default: { - return void 0; + 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); - } - case "Body": { - return getProvisioningState(rawResponse); + } +}); + +// 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + this._signature = signature; } - } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + /** + * 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; } - return state.config.resourceLocation; + }; + exports2.AzureSASCredential = AzureSASCredential; + function isSASCredential(credential) { + return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; } - function isOperationError(e) { - return e.name === "RestError"; + } +}); + +// 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"; } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); + function isPopToken(accessToken) { + return accessToken.tokenType === "pop"; } - var createStateProxy$1 = () => ({ - /** - * 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, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } }; } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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; + } +}); + +// 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_utils6 = __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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + } + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + 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]; + } } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (parsedHeaders) { + for (const key of Object.keys(parsedHeaders)) { + arrayResponse[key] = parsedHeaders[key]; + } } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + 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_utils6(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Serializes the Poller operation. + * @deprecated Removing the constraints validation on client side. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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); + } + } } - }; - 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); + * Serialize the given object based on its metadata defined in the mapper * - * // You can assign more local properties here. - * } - * } - * ``` + * @param mapper - The mapper which defines the metadata of the serializable object * - * 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. + * @param object - A valid Javascript object to be serialized * - * 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: + * @param objectName - Name of the serialized object * - * ```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 options - additional options to serialization * - * @param operation - Must contain the basic properties of `PollOperation`. + * @returns A valid serialized Javascript object */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve9, reject) => { - this.resolve = resolve9; - 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; + serialize(mapper, object, 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; } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - } - /** - * 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) - }); + if (mapper.isConstant) { + object = mapper.defaultValue; } - this.processUpdatedState(); + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. + * Deserialize the given object based on its metadata defined in the mapper * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * @param mapper - The mapper which defines the metadata of the serializable object * - * @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. + * @param responseBody - A valid Javascript entity to be deserialized * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @param objectName - Name of the deserialized object * - * @param options - Optional properties passed to the operation's update method. + * @param options - Controls behavior of XML parser and builder. + * + * @returns A valid deserialized Javascript object */ - 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; + 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; } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + 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 (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + if (mapper.isConstant) { + payload = mapper.defaultValue; } + return payload; } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; + } + return str2.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 str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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 = ""; + } } - 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); - }; + return classes; + } + function dateToUnixTime(d) { + if (!d) { + return void 0; } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + if (typeof d.valueOf() === "string") { + d = new Date(d); } - /** - * 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")); + 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.`); } } } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + 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.`); } - /** - * 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"); + const isPresent = allowedValues.some((item) => { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); } - return this.cancelPromise; + return item === value; + }); + if (!isPresent) { + throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); } - /** - * 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; + 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); } - /** - * 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; + 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); } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); + 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}".`); + } + } } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + return value; + } + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve9) => setTimeout(() => resolve9(), this.config.intervalInMs)); + 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}.`); } - }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto2 = require("crypto"); - var coreTracing = require_commonjs4(); - var stream2 = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs15 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; + } + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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; + } } - n.default = e; - return Object.freeze(n); + return tempArray; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs15); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - /** - * 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); + 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}.`); } - /** - * 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); + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + 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; } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path16 = urlParsed.pathname; - path16 = path16 || "/"; - path16 = escape(path16); - urlParsed.pathname = path16; - return urlParsed.toString(); + return tempDictionary; } - 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]; - } - } + 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 proxyUri; + return additionalProperties; } - function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; + 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 ""; + return modelProps; } - function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - 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'"); + if (object !== void 0 && object !== null) { + const payload = {}; + const modelProps = resolveModelProperties(serializer, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); + 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) && (object[key] !== void 0 && object[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 = object[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; + } + } } - 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 escape(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 path16 = urlParsed.pathname; - path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; - urlParsed.pathname = path16; - 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); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } } } + return payload; } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); - } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : 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}`; + return object; } - 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; + function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; } - return queries; - } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + 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; + } } - 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"; + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + function isSpecialXmlProperty(propertyName, options) { + return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + 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 res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve9, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve9(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== void 0) { - aborter.addEventListener("abort", abortHandler); + 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; } - }); - } - 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); + 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; + } } - return padString.slice(0, targetLength) + currentString; } - } - 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 = ""; + 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 accountName; - } catch (error4) { - throw new Error("Unable to extract accountName with provided information."); } + return instance; } - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); } + return tempDictionary; } - return tagPairs.join("&"); + return responseBody; } - function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + 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 res; + return responseBody; } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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); + } + } + } } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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 res; + return mapper; } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + 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]; } - 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 - } + 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); } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - }; - case "parquet": - return { - format: { - type: "parquet" + 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 = {}; } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + value[propertyName] = propertyValue; + } + } } + return value; } - 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); + 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 { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); + break; } } - return orProperties; + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } + let info6 = state_js_1.state.operationRequestMap.get(request); + if (!info6) { + info6 = {}; + state_js_1.state.operationRequestMap.set(request, info6); + } + return info6; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; } - 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; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } - 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 - }; - } + return result; } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return split.join("/"); + return result; } - function assertResponse(response) { - if (`_response` in response) { - return response; + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; } - throw new TypeError(`Unexpected response object ${response}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); + const operationSpec = operationInfo?.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + const responseSpec = getOperationResponseMap(parsedResponse); + const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); + if (error3) { + throw error3; + } else if (shouldReturnResponse) { + return parsedResponse; } - /** - * 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); + 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 (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); } - let response; + } + 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 parse(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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; + 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; } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw 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; } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; + 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)); } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; + } + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } 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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + } + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path16 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path16.startsWith("/")) { + path16 = path16.substring(1); + } + if (isAbsoluteUrl(path16)) { + requestUrl = path16; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path16); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + 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); } - } else { - delayTimeInMs = Math.random() * 1e3; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } - }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + return result; + } + function isAbsoluteUrl(url) { + return url.includes("://"); + } + function appendPath(url, pathToAppend) { + if (!pathToAppend) { + return url; } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + const parsedUrl = new URL(url); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path16 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path16; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + } + } else { + newPath = newPath + pathToAppend; } - }; - 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; + parsedUrl.pathname = newPath; + return parsedUrl.toString(); } - 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; + 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 pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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(url, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url; + } + const parsedUrl = new URL(url); + 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_utils6(); + 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(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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 request; + } 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") { + request.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)) { + request[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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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_util8(); + 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(request, 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)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt2, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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 = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt2(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt2.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt2.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt2.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt2.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt2.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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(url) { + const urlParsed = new URL(url); + let path16 = urlParsed.pathname; + path16 = path16 || "/"; + path16 = escape(path16); + urlParsed.pathname = path16; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path16 = urlParsed.pathname; + path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; + urlParsed.pathname = path16; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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((resolve9, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve9(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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((resolve9, 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(resolve9).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve9(); + } + } + }); + }); + } + /** + * 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(url) { + const urlParsed = new URL(url); + let path16 = urlParsed.pathname; + path16 = path16 || "/"; + path16 = escape(path16); + urlParsed.pathname = path16; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path16 = urlParsed.pathname; + path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name; + urlParsed.pathname = path16; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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((resolve9, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve9(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path16 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path16}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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" + } + } + } + } } - 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; + } + }; + 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" + } + } + } + } } } - return false; - } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { - /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - - */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; + }; + 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" + } + } + } } - /** - * Signs request. - * - * @param request - - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + }; + 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" + } + } } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; } - /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; + }; + 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" + } + } } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + } + }; + 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" + } + } } - 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + }; + 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" + } } - 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(request) { - const path16 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path16}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } } - return canonicalizedResourceString; } }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); + 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" + } + } + } } }; - var StorageSharedKeyCredential = class extends Credential { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto2.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + 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" + } + } + } } }; - var AnonymousCredentialPolicy = class extends 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.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" + } + } + } } }; - var AnonymousCredential = class extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + 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" + } + } + } } }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + 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" + } } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; - } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + 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" } } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } + }; + 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" + } } } - return false; } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; + }; + 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" + } } - } else { - delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } + }; + 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" } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay2(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + }, + 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" } - attempt++; - } - if (response) { - return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto2.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; } - return value; } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); + }; + 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" + } } } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; } - function getCanonicalizedResourceString(request) { - const path16 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path16}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; - } - var StorageBrowserPolicy = class extends 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(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); - } - }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + 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" + } + } } } - return { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); + }; + 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" + } + } } - }; - } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * 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 - }; } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); - } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; - } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; + 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" + } + } } } - return void 0; - } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }; + exports2.ContainerCreateHeaders = { + serializedName: "Container_createHeaders", + type: { + name: "Composite", + className: "ContainerCreateHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } - } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }, + 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" } } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); } - pipeline._corePipeline = corePipeline; - } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); - } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; + }; + 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" + } + } } } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; - } - return factory.constructor.name === "StorageSharedKeyCredential"; - } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; - } - return factory.constructor.name === "AnonymousCredential"; - } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); - } - function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; - } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof 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 (request) => { - return { - request, - headers: request.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); - }); - } - var BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", + }; + exports2.ContainerGetPropertiesHeaders = { + serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", - className: "BlobServiceProperties", + className: "ContainerGetPropertiesHeaders", modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "Logging" + name: "Dictionary", + value: { type: { name: "String" } } } }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Composite", - className: "Metrics" + name: "String" } }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "Metrics" + name: "DateTimeRfc1123" } }, - cors: { - serializedName: "Cors", - xmlName: "Cors", - xmlIsWrapped: true, - xmlElementName: "CorsRule", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", + 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" } }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "StaticWebsite" + 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" } } } } }; - var Logging = { - serializedName: "Logging", + exports2.ContainerDeleteHeaders = { + serializedName: "Container_deleteHeaders", type: { name: "Composite", - className: "Logging", + className: "ContainerDeleteHeaders", modelProperties: { - version: { - serializedName: "Version", - required: true, - xmlName: "Version", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleteProperty: { - serializedName: "Delete", - required: true, - xmlName: "Delete", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - read: { - serializedName: "Read", - required: true, - xmlName: "Read", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - write: { - serializedName: "Write", - required: true, - xmlName: "Write", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; - var RetentionPolicy = { - serializedName: "RetentionPolicy", + exports2.ContainerDeleteExceptionHeaders = { + serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", - className: "RetentionPolicy", + className: "ContainerDeleteExceptionHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var Metrics = { - serializedName: "Metrics", + exports2.ContainerSetMetadataHeaders = { + serializedName: "Container_setMetadataHeaders", type: { name: "Composite", - className: "Metrics", + className: "ContainerSetMetadataHeaders", modelProperties: { - version: { - serializedName: "Version", - xmlName: "Version", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - } - } - } - }; - var CorsRule = { - serializedName: "CorsRule", - type: { - name: "Composite", - className: "CorsRule", - modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", - required: true, - xmlName: "AllowedOrigins", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - allowedMethods: { - serializedName: "AllowedMethods", - required: true, - xmlName: "AllowedMethods", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", + } + } + } + }; + exports2.ContainerSetMetadataExceptionHeaders = { + serializedName: "Container_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var StaticWebsite = { - serializedName: "StaticWebsite", + exports2.ContainerGetAccessPolicyHeaders = { + serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", - className: "StaticWebsite", + className: "ContainerGetAccessPolicyHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["container", "blob"] } }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } - } - } - } - }; - var StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - code: { - serializedName: "Code", - xmlName: "Code", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49116,106 +55012,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", + exports2.ContainerGetAccessPolicyExceptionHeaders = { + serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", - className: "BlobServiceStatistics", + className: "ContainerGetAccessPolicyExceptionHeaders", modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "GeoReplication" + name: "String" } } } } }; - var GeoReplication = { - serializedName: "GeoReplication", + exports2.ContainerSetAccessPolicyHeaders = { + serializedName: "Container_setAccessPolicyHeaders", type: { name: "Composite", - className: "GeoReplication", + className: "ContainerSetAccessPolicyHeaders", modelProperties: { - status: { - serializedName: "Status", - required: true, - xmlName: "Status", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] + name: "String" } }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListContainersSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } + name: "String" } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + } + } + } + }; + 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" } @@ -49223,184 +55102,218 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", + exports2.ContainerRestoreHeaders = { + serializedName: "Container_restoreHeaders", type: { name: "Composite", - className: "ContainerItem", + className: "ContainerRestoreHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, version: { - serializedName: "Version", - xmlName: "Version", + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "ContainerProperties" + name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; - var ContainerProperties = { - serializedName: "ContainerProperties", + exports2.ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", - className: "ContainerProperties", + className: "ContainerRestoreExceptionHeaders", modelProperties: { - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + 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" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + 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" } }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "String" } }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", + 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: "Boolean" + name: "String" } - }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", + } + } + } + }; + 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: "Boolean" + name: "String" } }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", - type: { - name: "Number" - } - }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", - type: { - name: "Boolean" - } } } } }; - var KeyInfo = { - serializedName: "KeyInfo", + exports2.ContainerFilterBlobsExceptionHeaders = { + serializedName: "Container_filterBlobsExceptionHeaders", type: { name: "Composite", - className: "KeyInfo", + className: "ContainerFilterBlobsExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49408,457 +55321,429 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { - serializedName: "UserDelegationKey", + exports2.ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", - className: "UserDelegationKey", + className: "ContainerAcquireLeaseHeaders", modelProperties: { - signedObjectId: { - serializedName: "SignedOid", - required: true, - xmlName: "SignedOid", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", + exports2.ContainerAcquireLeaseExceptionHeaders = { + serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "ContainerAcquireLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - where: { - serializedName: "Where", - required: true, - xmlName: "Where", + } + } + } + }; + exports2.ContainerReleaseLeaseHeaders = { + serializedName: "Container_releaseLeaseHeaders", + type: { + name: "Composite", + className: "ContainerReleaseLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - blobs: { - serializedName: "Blobs", - required: true, - xmlName: "Blobs", - xmlIsWrapped: true, - xmlElementName: "Blob", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } - } - } - } - }; - var FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", - type: { - name: "Composite", - className: "FilterBlobItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - tags: { - serializedName: "Tags", - xmlName: "Tags", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobTags" + name: "DateTimeRfc1123" } } } } }; - var BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", + exports2.ContainerReleaseLeaseExceptionHeaders = { + serializedName: "Container_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobTags", + className: "ContainerReleaseLeaseExceptionHeaders", modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } + name: "String" } } } } }; - var BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", + exports2.ContainerRenewLeaseHeaders = { + serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", - className: "BlobTag", + className: "ContainerRenewLeaseHeaders", modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + 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" + } } } } }; - var SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", + exports2.ContainerRenewLeaseExceptionHeaders = { + serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "SignedIdentifier", + className: "ContainerRenewLeaseExceptionHeaders", modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } } } } }; - var AccessPolicy = { - serializedName: "AccessPolicy", + exports2.ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", - className: "AccessPolicy", + className: "ContainerBreakLeaseHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", + 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" } }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", + 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" + } } } } }; - var ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", + exports2.ContainerBreakLeaseExceptionHeaders = { + serializedName: "Container_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "ContainerBreakLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + exports2.ContainerChangeLeaseHeaders = { + serializedName: "Container_changeLeaseHeaders", + type: { + name: "Composite", + className: "ContainerChangeLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } } } } }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", + exports2.ContainerChangeLeaseExceptionHeaders = { + serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobFlatListSegment", + className: "ContainerChangeLeaseExceptionHeaders", modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", + exports2.ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", - className: "BlobItemInternal", + className: "ContainerListBlobFlatSegmentHeaders", 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", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", 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", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobTags" + name: "String" } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTimeRfc1123" } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49866,1017 +55751,720 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.ContainerListBlobHierarchySegmentHeaders = { + serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "ContainerListBlobHierarchySegmentHeaders", modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", - type: { - name: "DateTimeRfc1123" - } - }, - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + } + } + } + }; + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { + serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + type: { + name: "Composite", + className: "ContainerListBlobHierarchySegmentExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "ByteArray" + name: "String" } - }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + } + } + } + }; + 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" } }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { name: "Enum", - allowedValues: ["locked", "unlocked"] + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { name: "Enum", allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "Boolean" } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + } + } + } + }; + 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" } - }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + } + } + } + }; + exports2.BlobDownloadHeaders = { + serializedName: "Blob_downloadHeaders", + type: { + name: "Composite", + className: "BlobDownloadHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "DateTimeRfc1123" + name: "Dictionary", + value: { type: { name: "String" } } } }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { - name: "Boolean" + name: "Dictionary", + value: { type: { name: "String" } } } }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "Boolean" + name: "Number" } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + contentRange: { + serializedName: "content-range", + xmlName: "content-range", type: { - name: "Number" + name: "String" } }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "String" } }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Boolean" + name: "ByteArray" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "String" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { - name: "DateTimeRfc1123" + name: "String" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", 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", + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: ["High", "Standard"] - } - }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", - type: { - name: "DateTimeRfc1123" + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", - type: { - name: "Boolean" - } - } - } - } - }; - var 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, + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } - }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment", - modelProperties: { - blobPrefixes: { - serializedName: "BlobPrefixes", - xmlName: "BlobPrefixes", - xmlElementName: "BlobPrefix", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobPrefix" - } - } + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } - } - } - } - }; - var BlobPrefix = { - serializedName: "BlobPrefix", - type: { - name: "Composite", - className: "BlobPrefix", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "Composite", - className: "BlobName" + name: "Enum", + allowedValues: ["locked", "unlocked"] } - } - } - } - }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } - } - } - } - }; - var BlockList = { - serializedName: "BlockList", - type: { - name: "Composite", - className: "BlockList", - modelProperties: { - committedBlocks: { - serializedName: "CommittedBlocks", - xmlName: "CommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } }, - uncommittedBlocks: { - serializedName: "UncommittedBlocks", - xmlName: "UncommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "Boolean" } - } - } - } - }; - var Block = { - serializedName: "Block", - type: { - name: "Composite", - className: "Block", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", + 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" } - } - } - } - }; - var PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "Boolean" } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } - } - } - } - }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", - type: { - name: "Composite", - className: "PageRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Number" + name: "ByteArray" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { name: "Number" } - } - } - } - }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", - type: { - name: "Composite", - className: "ClearRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "Number" + name: "Boolean" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { - name: "Number" + name: "DateTimeRfc1123" } - } - } - } - }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + }, + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "String" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "Composite", - className: "QuerySerialization" + name: "Boolean" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "BlobDownloadExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.BlobGetPropertiesHeaders = { + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "BlobGetPropertiesHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "DateTimeRfc1123" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "Dictionary", + value: { type: { name: "String" } } } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { name: "Dictionary", - value: { type: { name: "any" } } + value: { type: { name: "String" } } } - } - } - } - }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + }, + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { - name: "String" + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { - name: "Boolean" + name: "String" } - } - } - } - }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration", - modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + }, + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } - } - } - } - }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration", - modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } - } - } - } - }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", - type: { - name: "Composite", - className: "ArrowField", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + }, + isIncrementalCopy: { + serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { - name: "String" + name: "Boolean" } }, - name: { - serializedName: "Name", - xmlName: "Name", + destinationSnapshot: { + serializedName: "x-ms-copy-destination-snapshot", + xmlName: "x-ms-copy-destination-snapshot", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Number" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "Number" + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } - } - } - } - }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "String" + name: "Enum", + allowedValues: ["locked", "unlocked"] } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } - } - } - } - }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } - } - } - } - }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -50905,210 +56493,137 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } - } - } - } - }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + 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", + accessTier: { + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { name: "String" } - } - } - } - }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + accessTierInferred: { + serializedName: "x-ms-access-tier-inferred", + xmlName: "x-ms-access-tier-inferred", type: { - name: "String" + name: "Boolean" } - } - } - } - }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + archiveStatus: { + serializedName: "x-ms-archive-status", + xmlName: "x-ms-archive-status", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + accessTierChangedOn: { + serializedName: "x-ms-access-tier-change-time", + xmlName: "x-ms-access-tier-change-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + expiresOn: { + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "String" + name: "Boolean" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + rehydratePriority: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, - date: { - serializedName: "date", - xmlName: "date", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "DateTimeRfc1123" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { name: "Boolean" } @@ -51123,11 +56638,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "BlobGetPropertiesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51139,15 +56654,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.BlobDeleteHeaders = { + serializedName: "Blob_deleteHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "BlobDeleteHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } @@ -51166,11 +56681,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, errorCode: { @@ -51183,11 +56698,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", + exports2.BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", + className: "BlobDeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51199,11 +56714,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", + exports2.BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + className: "BlobUndeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51243,11 +56758,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", + className: "BlobUndeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51259,11 +56774,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "BlobSetExpiryHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51306,22 +56821,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", + exports2.BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateExceptionHeaders", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51333,21 +56841,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", + exports2.BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "BlobSetHttpHeadersHeaders", 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", @@ -51362,34 +56861,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "Number" } }, clientRequestId: { @@ -51420,49 +56896,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51473,11 +56906,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51489,11 +56922,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.BlobSetImmutabilityPolicyHeaders = { + serializedName: "Blob_setImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + className: "BlobSetImmutabilityPolicyHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51523,21 +56956,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" + } + }, + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "BlobSetImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51549,26 +56990,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.BlobDeleteImmutabilityPolicyHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "BlobDeleteImmutabilityPolicyHeaders", 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", @@ -51596,22 +57023,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51623,34 +57043,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.BlobSetLegalHoldHeaders = { + serializedName: "Blob_setLegalHoldHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "BlobSetLegalHoldHeaders", 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", @@ -51679,21 +57077,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "String" + name: "Boolean" } } } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51705,11 +57103,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "BlobSetMetadataHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51746,6 +57144,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51753,6 +57158,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51763,11 +57189,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "BlobSetMetadataExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51779,12 +57205,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + 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", @@ -51812,22 +57259,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "BlobAcquireLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51839,12 +57279,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -51872,22 +57326,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51899,58 +57346,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "BlobRenewLeaseHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -51982,11 +57404,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51998,11 +57420,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "BlobChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52018,13 +57440,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52039,6 +57454,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52056,11 +57478,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", + className: "BlobChangeLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52072,11 +57494,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "BlobBreakLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52092,6 +57514,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52123,11 +57552,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52139,12 +57568,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "BlobCreateSnapshotHeaders", modelProperties: { + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", + type: { + name: "String" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -52159,13 +57595,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52187,21 +57616,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52213,11 +57663,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlobStartCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52233,13 +57683,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52261,21 +57704,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52283,15 +57755,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlobCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52307,13 +57793,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52335,21 +57814,71 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52357,23 +57886,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52412,11 +57948,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52428,19 +57964,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlobSetTierHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52462,13 +57991,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52479,11 +58001,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52495,11 +58017,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52567,11 +58089,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52583,11 +58105,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlobQueryHeaders", modelProperties: { lastModified: { serializedName: "last-modified", @@ -52596,13 +58118,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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-", @@ -52612,22 +58127,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52706,7 +58205,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - copyCompletedOn: { + copyCompletionTime: { serializedName: "x-ms-copy-completion-time", xmlName: "x-ms-copy-completion-time", type: { @@ -52800,20 +58299,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52863,47 +58348,71 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "ByteArray" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } - }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + } + } + } + }; + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", + type: { + name: "Composite", + className: "BlobQueryExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + 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" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, errorCode: { @@ -52912,22 +58421,75 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "ByteArray" + 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" } } } } }; - var BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52939,160 +58501,121 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesHeaders = { - serializedName: "Blob_getPropertiesHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlobGetPropertiesHeaders", + className: "PageBlobCreateHeaders", 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", + etag: { + serializedName: "etag", + xmlName: "etag", 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "DateTimeRfc1123" } }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "DateTimeRfc1123" } }, - isIncrementalCopy: { - serializedName: "x-ms-incremental-copy", - xmlName: "x-ms-incremental-copy", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - destinationSnapshot: { - serializedName: "x-ms-copy-destination-snapshot", - xmlName: "x-ms-copy-destination-snapshot", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", + } + } + } + }; + 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", @@ -53100,6 +58623,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, contentMD5: { serializedName: "content-md5", xmlName: "content-md5", @@ -53107,32 +58637,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, blobSequenceNumber: { @@ -53170,23 +58679,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -53205,106 +58700,101 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessTierInferred: { - serializedName: "x-ms-access-tier-inferred", - xmlName: "x-ms-access-tier-inferred", + } + } + } + }; + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobUploadPagesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - archiveStatus: { - serializedName: "x-ms-archive-status", - xmlName: "x-ms-archive-status", + } + } + } + }; + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", + type: { + name: "Composite", + className: "PageBlobClearPagesHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + date: { + serializedName: "date", + xmlName: "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", @@ -53315,11 +58805,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53331,19 +58821,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "BlobDeleteHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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", @@ -53365,6 +58883,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53375,11 +58914,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53387,16 +58926,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + 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", @@ -53435,11 +59009,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53451,12 +59025,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -53464,11 +59045,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -53498,15 +59079,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "BlobSetExpiryExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53518,11 +59106,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersHeaders", + className: "PageBlobResizeHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53583,11 +59171,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53599,12 +59187,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", + 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", @@ -53633,29 +59242,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } } } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53667,12 +59268,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", + 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", @@ -53700,15 +59315,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53720,12 +59357,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldHeaders", + 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", @@ -53747,6 +59405,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -53754,21 +59419,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + 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" + } } } } }; - var BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53780,11 +59466,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "BlobSetMetadataHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53800,6 +59486,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53821,13 +59521,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -53835,6 +59528,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53866,11 +59573,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "BlobSetMetadataExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53882,11 +59589,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53902,18 +59609,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, requestId: { @@ -53936,15 +59643,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53952,15 +59701,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseHeaders", + className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54003,15 +59766,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } } } } }; - var BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54023,11 +59793,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "BlobRenewLeaseHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54043,11 +59813,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -54071,21 +59841,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54097,11 +59902,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "BlobChangeLeaseHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54117,6 +59922,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54131,16 +59943,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } @@ -54151,16 +59963,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", - modelProperties: { + }, + 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", @@ -54171,32 +59995,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + 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", @@ -54225,15 +60065,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54245,31 +60120,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotHeaders", + className: "BlockBlobStageBlockFromURLHeaders", modelProperties: { - snapshot: { - serializedName: "x-ms-snapshot", - xmlName: "x-ms-snapshot", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, clientRequestId: { @@ -54293,13 +60161,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54314,6 +60175,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54324,11 +60199,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54336,28 +60211,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLHeaders", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { etag: { serializedName: "etag", xmlName: "etag", type: { - name: "String" + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, clientRequestId: { @@ -54395,19 +60298,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -54420,11 +60329,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", + exports2.BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", + className: "BlockBlobCommitBlockListExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54436,12 +60345,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", + exports2.BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", type: { name: "Composite", - className: "BlobCopyFromURLHeaders", + className: "BlockBlobGetBlockListHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -54449,11 +60365,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" + } + }, + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", + type: { + name: "Number" } }, clientRequestId: { @@ -54477,13 +60400,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54491,8621 +60407,7791 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", + } + } + } + }; + 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" } - }, - 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", + } + } + } + }; + } +}); + +// 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: "String" + name: "Enum", + allowedValues: ["metadata", "deleted", "system"] } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + } + } + }, + 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: "String" + name: "Composite", + className: "SignedIdentifier" } } } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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" } } }; - var 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.sourceLeaseId = { + parameterPath: ["options", "sourceLeaseId"], + mapper: { + serializedName: "x-ms-source-lease-id", + xmlName: "x-ms-source-lease-id", + type: { + name: "String" } } }; - var 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.comp10 = { + parameterPath: "comp", + mapper: { + defaultValue: "lease", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.action = { + parameterPath: "action", + mapper: { + defaultValue: "acquire", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.duration = { + parameterPath: ["options", "duration"], + mapper: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Number" } } }; - var 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.proposedLeaseId = { + parameterPath: ["options", "proposedLeaseId"], + mapper: { + serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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.action1 = { + parameterPath: "action", + mapper: { + defaultValue: "release", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.action3 = { + parameterPath: "action", + mapper: { + defaultValue: "break", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.breakPeriod = { + parameterPath: ["options", "breakPeriod"], + mapper: { + serializedName: "x-ms-lease-break-period", + xmlName: "x-ms-lease-break-period", + type: { + name: "Number" } } }; - var 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.action4 = { + parameterPath: "action", + mapper: { + defaultValue: "change", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.proposedLeaseId1 = { + parameterPath: "proposedLeaseId", + mapper: { + serializedName: "x-ms-proposed-lease-id", + required: true, + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetTagsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + exports2.include1 = { + parameterPath: ["options", "include"], + mapper: { + serializedName: "include", + xmlName: "include", + xmlElementName: "ListBlobsIncludeItem", + type: { + name: "Sequence", + element: { type: { - name: "String" + 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" + } } }; - var 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.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" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var 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.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] } } }; - var 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.sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.sourceIfMatch = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], + mapper: { + serializedName: "x-ms-source-if-match", + xmlName: "x-ms-source-if-match", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var 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.comp15 = { + parameterPath: "comp", + mapper: { + defaultValue: "copy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", + mapper: { + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", + type: { + name: "String" } } }; - var 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.copyId = { + parameterPath: "copyId", + mapper: { + serializedName: "copyid", + required: true, + xmlName: "copyid", + type: { + name: "String" } } }; - var 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.comp16 = { + parameterPath: "comp", + mapper: { + defaultValue: "tier", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", + mapper: { + defaultValue: "query", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.blobContentLength = { + parameterPath: "blobContentLength", + mapper: { + serializedName: "x-ms-blob-content-length", + required: true, + xmlName: "x-ms-blob-content-length", + type: { + name: "Number" } } }; - var 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.blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], + mapper: { + defaultValue: 0, + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" } } }; - var 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.contentType1 = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/octet-stream", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" } } }; - var 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.body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.accept2 = { + parameterPath: "accept", + mapper: { + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" } } }; - var 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.comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "page", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.pageWrite = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" } } }; - var 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.ifSequenceNumberLessThanOrEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", + type: { + name: "Number" } } }; - var 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.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" } } }; - var 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.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], + mapper: { + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", + type: { + name: "ByteArray" } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.range1 = { + parameterPath: "range", + mapper: { + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.comp20 = { + parameterPath: "comp", + mapper: { + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], + mapper: { + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", + type: { + name: "String" } } }; - var 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.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], + mapper: { + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", + type: { + name: "String" } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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"] } } }; - var 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.comp21 = { + parameterPath: "comp", + mapper: { + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blobType1 = { + parameterPath: "blobType", + mapper: { + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" } } - }; - var 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.comp22 = { + parameterPath: "comp", + mapper: { + defaultValue: "appendblock", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], + exports2.appendPosition = { + parameterPath: [ + "options", + "appendPositionAccessConditions", + "appendPosition" + ], mapper: { - defaultValue: "application/xml", + 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: "Content-Type", + serializedName: "comp", type: { name: "String" } } }; - var blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + exports2.blobType2 = { + parameterPath: "blobType", + mapper: { + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" + } + } }; - var accept = { - parameterPath: "accept", + exports2.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - defaultValue: "application/xml", + 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: "Accept", + 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 url = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" + var deleteOperationSpec = { + path: "/{containerName}", + httpMethod: "DELETE", + responses: { + 202: { + headersMapper: Mappers.ContainerDeleteHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerDeleteExceptionHeaders } }, - skipEncoding: true + 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 restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 + var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerSetAccessPolicyHeaders }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" + 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 version = { - parameterPath: "version", - mapper: { - defaultValue: "2024-11-04", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" + 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 requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" + 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 accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" + 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 marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" + 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 maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 + var breakLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.ContainerBreakLeaseHeaders }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" + 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 include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + var changeLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerChangeLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerChangeLeaseExceptionHeaders } }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + 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 comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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 }; - var comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } + /** + * 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); } - }; - var multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } + /** + * 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); } - }; - var comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + /** + * 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); } - }; - var access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } + /** + * 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); } - }; - var defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } + /** + * 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); } - }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } + /** + * 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); } - }; - var comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } + /** + * 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); } - }; - var comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" - } + /** + * 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); } - }; - var comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } }; - var action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" + 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 proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" + 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 action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + var setMetadataOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.BlobSetMetadataHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetMetadataExceptionHeaders } - } - }; - var 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" - ] - } - } + }, + 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 } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" + 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 ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" + 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 ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" + 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 deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] + 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 }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * 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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * 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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" - } + /** + * 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); } }; - var comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" + 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 immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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 comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" + 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 comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + 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 rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + var copyIncrementalOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.PageBlobCopyIncrementalHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCopyIncrementalExceptionHeaders } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } + } +}); + +// 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; } - }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * 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); } }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" + 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 sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" + 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 legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" + 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 }; - var sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } + } +}); + +// 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; } - }; - var copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } + /** + * 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); } - }; - var 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"] - } + /** + * 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); } - }; - var comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" - } + /** + * 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); } - }; - var copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" - } + /** + * 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); } }; - var comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } - } - }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags + }, + 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 transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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 transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" + 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 }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + } +}); + +// 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(url, options) { + if (url === void 0) { + throw new Error("'url' cannot be null"); } - } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + if (!options) { + options = {}; } - } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + const defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; + super(optionsWithDefaults); + this.url = url; + 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); } }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } + 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(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + const storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = void 0; } }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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; } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + /** + * 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; } - } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.add) { + blobSASPermissions.add = true; } - } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.create) { + blobSASPermissions.create = true; } - } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + if (permissionLike.write) { + blobSASPermissions.write = true; } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" + if (permissionLike.delete) { + blobSASPermissions.delete = true; } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" + if (permissionLike.deleteVersion) { + blobSASPermissions.deleteVersion = true; } - } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.tag) { + blobSASPermissions.tag = true; } - } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + if (permissionLike.move) { + blobSASPermissions.move = true; } - } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.execute) { + blobSASPermissions.execute = true; } - } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + if (permissionLike.setImmutabilityPolicy) { + blobSASPermissions.setImmutabilityPolicy = true; } - } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + if (permissionLike.permanentDelete) { + blobSASPermissions.permanentDelete = true; } + return blobSASPermissions; } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + /** + * 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"); } - } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + 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"); } - } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - } - }; - var 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"] + if (this.permanentDelete) { + permissions.push("y"); } + return permissions.join(""); } }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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; } - }; - var blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + /** + * 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; } - } - }; - var comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.add) { + containerSASPermissions.add = true; } - } - }; - var maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + if (permissionLike.create) { + containerSASPermissions.create = true; } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + if (permissionLike.write) { + containerSASPermissions.write = true; } - } - }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.delete) { + containerSASPermissions.delete = true; } - } - }; - var comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.list) { + containerSASPermissions.list = true; } - } - }; - var blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.deleteVersion) { + containerSASPermissions.deleteVersion = true; } - } - }; - var copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + if (permissionLike.tag) { + containerSASPermissions.tag = true; } - } - }; - var comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.move) { + containerSASPermissions.move = true; } - } - }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + if (permissionLike.execute) { + containerSASPermissions.execute = true; } - } - }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList - }; - var comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.setImmutabilityPolicy) { + containerSASPermissions.setImmutabilityPolicy = true; } - } - }; - var listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + if (permissionLike.permanentDelete) { + containerSASPermissions.permanentDelete = true; + } + if (permissionLike.filterByTags) { + containerSASPermissions.filterByTags = true; } + return containerSASPermissions; } - }; - var ServiceImpl = class { /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client + * Specifies Read access granted. */ - constructor(client) { - this.client = client; - } + read = false; /** - * 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. + * Specifies Add access granted. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); - } + add = false; /** - * 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. + * Specifies Create access granted. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); - } + create = false; /** - * 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. + * Specifies Write access granted. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); - } + write = false; /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. + * Specifies Delete access granted. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); - } + deleteVersion = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Specifies List access granted. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); - } + list = false; /** - * 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. + * Specfies Tag access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); - } + tag = false; /** - * 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. + * Specifies Move access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); - } - }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + 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"); } - }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + 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(""); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * The storage API version. */ - constructor(client) { - this.client = client; - } + version; /** - * 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. + * Optional. The allowed HTTP protocol(s). */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); - } + protocol; /** - * 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. + * Optional. The start time for this SAS token. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); - } + startsOn; /** - * 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. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); - } + expiresOn; /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); - } + permissions; /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + services; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + resourceTypes; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); - } + identifier; /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Optional. Encryption scope to use when sending requests authorized with this SAS URI. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); - } + encryptionScope; /** - * 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. + * 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 */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); - } + resource; /** - * 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. + * The signature for the SAS token. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } + signature; /** - * [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. + * Value for cache-control header in Blob/File Service SAS. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); - } + cacheControl; /** - * [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. + * Value for content-disposition header in Blob/File Service SAS. */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); - } + contentDisposition; /** - * [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. + * Value for content-encoding header in Blob/File Service SAS. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); - } + contentEncoding; /** - * [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. + * Value for content-length header in Blob/File Service SAS. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); - } + contentLanguage; /** - * [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. + * Value for content-type header in Blob/File Service SAS. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); - } + contentType; /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. + * Inner value of getter ipRange. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); - } + ipRangeInner; /** - * [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. + * The Azure Active Directory object ID in GUID format. + * Property of user delegation key. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); - } + signedOid; /** - * Returns the sku name and account kind - * @param options The options parameters. + * The Azure Active Directory tenant ID in GUID format. + * Property of user delegation key. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); - } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders + 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 + }; } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders + 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; + } } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders + } + /** + * 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; + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + 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; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 + } }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + } + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + } + 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."); } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + } + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + } + 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(); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var BlobImpl = class { - /** - * 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); + 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * 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); + 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(); + } } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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, + timestamp2, + 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."); } - /** - * 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(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); + 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(); + } } - /** - * 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); + 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, + timestamp2, + 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}`); } - /** - * 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); + 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'."); } - /** - * 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(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - /** - * 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); + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - /** - * [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); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - /** - * [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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - /** - * 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); + 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."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + if (version < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - /** - * 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(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + 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; /** - * 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. + * Gets the lease Id. + * + * @readonly */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + get leaseId() { + return this._leaseId; } /** - * Returns the sku name and account kind - * @param options The options parameters. + * Gets the url. + * + * @readonly */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + get url() { + return this._url; } /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); + 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; } /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * 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. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); + 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 + })); + }); } /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. + * 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. */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); - } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders - } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + 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."); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + 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."); } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var PageBlobImpl = class { + 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 + }); + }); + } /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * 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. */ - constructor(client) { - this.client = client; + 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; /** - * 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. + * 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 - */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + 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 { /** - * 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. + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * 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. + * Returns if it was previously specified + * for the file. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * 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. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * 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. + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } /** - * 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. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get contentType() { + return this.originalResponse.contentType; } /** - * 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. + * 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 */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + 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; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get copySource() { + return this.originalResponse.copySource; } /** - * 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. + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get leaseState() { + return this.originalResponse.leaseState; } /** - * 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. + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get leaseStatus() { + return this.originalResponse.leaseStatus; } /** - * 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. + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. + * + * @readonly */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get date() { + return this.originalResponse.date; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + */ + get etag() { + return this.originalResponse.etag; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * The number of tags associated with the blob + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get tagCount() { + return this.originalResponse.tagCount; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * The error code. + * + * @readonly + */ + get errorCode() { + return this.originalResponse.errorCode; } /** - * 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. + * 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). * - * @param permissions - + * @readonly */ - 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; + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * 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. * - * @param permissionLike - + * @readonly */ - 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; + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Returns the date and time the file was last + * modified. Any operation that modifies the file or its properties updates + * the last modified time. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); + get lastModified() { + return this.originalResponse.lastModified; } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + /** + * 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; } /** - * 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. + * Returns the date and time the blob was created. * - * @param permissions - + * @readonly */ - 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; + 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; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates the versionId of the downloaded blob version. * - * @param permissionLike - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Indicates whether version of this blob is a current version. * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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 */ - 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(""); + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * 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) */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get contentCrc64() { + return this.originalResponse.contentCrc64; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Object Replication Policy Id of the destination blob. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto2.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * If this blob has been sealed. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + get isSealed() { + return this.originalResponse.isSealed; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } + /** + * Indicates if a legal hold is present on the blob. + * + * @readonly + */ + get legalHold() { + return this.originalResponse.legalHold; } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get contentAsBlob() { + return this.originalResponse.blobBody; } - if (version2 >= "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."); - } + /** + * 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; } - 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."); + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; + 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); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * 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]; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + // 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); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + static async readLong(stream2, options = {}) { + return _AvroParser.readZigZagLong(stream2, options); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readInt(stream2, options = {}) { + return _AvroParser.readZigZagLong(stream2, options); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + 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 { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + 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); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + 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); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + 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 }); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + static async readString(stream2, options = {}) { + const u8arr = await _AvroParser.readBytes(stream2, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readMapPair(stream2, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream2, options); + const value = await readItemMethod(stream2, options); + return { key, value }; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readMap(stream2, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } + return dict; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + 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; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + return _AvroType.fromObjectSchema(schema2); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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}`); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); + } } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { + } + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + } } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + // 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"); + } } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + // 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]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + async read(stream2, options = {}) { + const typeIndex = await AvroParser.readInt(stream2, options); + return this._types[typeIndex].read(stream2, options); } - if (version2 < "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."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + // 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); } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + // 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; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + }; + } +}); + +// 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; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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; + _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."); } - if (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); + 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._leaseId = leaseId2; - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + }); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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; } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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 tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); + return data; } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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; } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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((resolve9, 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(); + resolve9(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); + } }); - }); - } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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 tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream2.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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. @@ -63221,7 +68307,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -63328,14 +68414,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -63378,23 +68456,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63423,7 +68484,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.originalResponse.clientRequestId; } /** - * Indicates the version of the Blob service used + * Indicates the version of the File service used * to execute the request. * * @readonly @@ -63431,22 +68492,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63465,73 +68510,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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; + get blobBody() { + return void 0; } /** * The response body as a node.js Readable stream. * Always undefined in the browser. * - * It will automatically retry when internal read stream unexpected ends. + * It will parse avor data returned by blob query. * * @readonly */ get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** * The HTTP response. @@ -63539,1032 +68536,1289 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get _response() { return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** - * Creates an instance of BlobDownloadResponse. + * Creates an instance of BlobQueryResponse. * * @param originalResponse - - * @param getter - - * @param offset - - * @param count - * @param options - */ - constructor(originalResponse, getter, offset, count, options = {}) { + constructor(originalResponse, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + this.blobDownloadStream = new BlobQuickQueryStream_js_1.BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - var AvroParser = class _AvroParser { - /** - * Reads a fixed number of bytes from the stream. - * - * @param stream - - * @param length - - * @param options - - */ - static async readFixedBytes(stream3, length, options = {}) { - const bytes = await stream3.read(length, { abortSignal: options.abortSignal }); - if (bytes.length !== length) { - throw new Error("Hit stream end."); + 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 + } } - return bytes; + }; + } + } +}); + +// 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}`); } - /** - * Reads a single byte from the stream. - * - * @param stream - - * @param options - - */ - static async readByte(stream3, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream3, 1, options); - return buf[0]; + } + 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 + "."; } - // 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(stream3, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await _AvroParser.readByte(stream3, 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(stream3, 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 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}`; } - return res; - } - return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); - } - static async readLong(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readInt(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readNull() { - return null; - } - static async readBoolean(stream3, options = {}) { - const b = await _AvroParser.readByte(stream3, options); - if (b === 1) { - return true; - } else if (b === 0) { - return false; - } else { - throw new Error("Byte was not a boolean."); + 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; } - } - static async readFloat(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); - } - static async readDouble(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); - } - static async readBytes(stream3, options = {}) { - const size = await _AvroParser.readLong(stream3, options); - if (size < 0) { - throw new Error("Bytes size was negative."); + case "canceled": { + stateProxy.setCanceled(state); + break; } - return stream3.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream3, options = {}) { - const u8arr = await _AvroParser.readBytes(stream3, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); } - static async readMapPair(stream3, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream3, options); - const value = await readItemMethod(stream3, options); - return { key, value }; + 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 + })); } - static async readMap(stream3, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream3, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; + } + function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; + } + async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 dict; } - static async readArray(stream3, readItemMethod, options = {}) { - const items = []; - for (let count = await _AvroParser.readLong(stream3, options); count !== 0; count = await _AvroParser.readLong(stream3, options)) { - if (count < 0) { - await _AvroParser.readLong(stream3, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream3, options); - items.push(item); - } + 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); } - return items; + updateState === null || updateState === void 0 ? void 0 : updateState(state, response); } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); + case "DELETE": { + return void 0; } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + default: { + return getDefault(); } } - }; - var AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream3, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream3, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream3, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream3, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream3, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream3, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream3, options); - default: - throw new Error("Unknown Avro Primitive"); + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; + } } } - }; - var AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, options = {}) { - const value = await AvroParser.readInt(stream3, options); - return this._symbols[value]; - } - }; - var AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; + } + 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; } - async read(stream3, options = {}) { - const typeIndex = await AvroParser.readInt(stream3, options); - return this._types[typeIndex].read(stream3, options); + } + 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.`); } - }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + 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; + } } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - const readItemMethod = (s, opts) => { - return this._itemType.read(s, opts); - }; - return AvroParser.readMap(stream3, readItemMethod, options); + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; + } + 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; } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, 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(stream3, options); - } - } - return record; + 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; } - }; - 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; + 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 true; + return error3; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; + exports2.getErrorFromResponse = getErrorFromResponse; + function calculatePollingIntervalFromDate(retryAfterDate) { + const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; } - get objectIndex() { - return this._objectIndex; + return void 0; + } + function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } } - 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; + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return void 0; + } } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; + case "Body": { + return getProvisioningState(rawResponse); } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + } + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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, 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, + stateProxy, + processResult, + getOperationStatus: getStatusFromInitialResponse, + withOperationLocation, + setErrorAsResult: !resolveOnUnsuccessful }); - await 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; - } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); + 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 }); + } } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; + } 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; } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); + } + 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; } } - yield yield tslib.__await(result); } - }); - } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); - } - return data; - } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + }; + 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; } - get position() { - return this._position; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - async read(size, options = {}) { + async update(options) { var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.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 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 chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve9, 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(); - resolve9(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); - } + 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 }); } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; + } + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } - }; - var BlobQuickQueryStream = class extends stream2.Readable { /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * Serializes the Poller operation. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); - } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); - } + toString() { + return JSON.stringify({ + state: this.state + }); } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); + }; + 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); } }; - var BlobQueryResponse = class { - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + 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 { /** - * Returns if it was previously specified - * for the file. + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @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. + * 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. * - * @readonly - */ - get contentDisposition() { - return this.originalResponse.contentDisposition; - } - /** - * Returns the value that was specified - * for the Content-Encoding request header. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @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. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @readonly - */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; - } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * // You can assign more local properties here. + * } + * } + * ``` * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. + * 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. * - * @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. + * 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: * - * @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. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get contentRange() { - return this.originalResponse.contentRange; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve9, reject) => { + this.resolve = resolve9; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get contentType() { - return this.originalResponse.contentType; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * 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. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get copyCompletedOn() { - return void 0; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get copyId() { - return this.originalResponse.copyId; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * 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. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @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. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get copySource() { - return this.originalResponse.copySource; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' - * - * @readonly + * Invokes the underlying operation's cancel method. */ - get copyStatus() { - return this.originalResponse.copyStatus; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. + * 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. * - * @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'. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + 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; } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; + 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()); + } } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get date() { - return this.originalResponse.date; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly + * Returns true if the poller has finished polling. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. - * - * @readonly + * Stops the poller from continuing to poll. */ - get etag() { - return this.originalResponse.etag; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * The error code. - * - * @readonly + * Returns true if the poller is stopped. */ - get errorCode() { - return this.originalResponse.errorCode; + isStopped() { + return this.stopped; } /** - * 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). + * Attempts to cancel the underlying operation. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @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. + * If it's called again before it finishes, it will throw an error. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get lastModified() { - return this.originalResponse.lastModified; + 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; } /** - * A name-value pair - * to associate with a file storage object. + * Returns the state of the operation. * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * 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. * - * @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. + * Example: * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the File service used - * to execute the request. + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } * - * @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. + * // 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; + * } * - * @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. + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... * - * @readonly - */ - get blobBody() { - return void 0; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * 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, * - * It will parse avor data returned by blob query. + * // The only other property needed by PublicState. + * publicProperty: state.publicProperty + * } + * } + * } + * ``` * - * @readonly + * You can see this in the tests of this repository, go to the file: + * `../test/utils/testPoller.ts` + * and look for the getOperationState implementation. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve9) => setTimeout(() => resolve9(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -64572,20 +69826,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -64593,10 +69848,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -64636,12 +69891,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + 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.`); @@ -64651,27 +69915,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -64686,8 +69984,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -64702,9 +70000,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve9, reject) => { this.emitter.on("finish", resolve9); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -64741,333 +70039,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream2.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve9, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve9).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve9(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream3, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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((resolve9, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream3.on("readable", () => { + 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); resolve9(); return; } - let chunk = stream3.read(); + let chunk = stream2.read(); if (!chunk) { return; } @@ -65075,28 +70076,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream3.on("end", () => { + stream2.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve9(); }); - stream3.on("error", (msg) => { + stream2.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream3, buffer2, encoding) { + async function streamToBuffer2(stream2, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve9, reject) => { - stream3.on("readable", () => { - let chunk = stream3.read(); + stream2.on("readable", () => { + let chunk = stream2.read(); if (!chunk) { return; } @@ -65107,18 +70108,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream3.on("end", () => { + stream2.on("end", () => { resolve9(pos); }); - stream3.on("error", reject); + stream2.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve9, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve9(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve9, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -65129,9 +70142,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_utils7(); + 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. */ @@ -65147,49 +70199,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -65198,8 +70250,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -65208,8 +70260,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -65239,7 +70291,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -65248,76 +70300,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -65325,8 +70407,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -65334,9 +70415,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -65345,7 +70426,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -65362,9 +70446,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -65375,7 +70459,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -65385,7 +70469,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -65396,17 +70480,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -65414,19 +70506,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -65436,19 +70530,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65458,13 +70560,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -65475,7 +70577,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -65487,14 +70589,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -65505,22 +70609,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65536,15 +70642,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -65554,15 +70662,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -65573,24 +70688,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65611,57 +70728,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using a changing polling interval (default 15 seconds): + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -65669,15 +70787,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -65689,14 +70807,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -65706,36 +70824,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -65746,31 +70867,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -65778,12 +70900,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -65794,26 +70916,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -65827,8 +70952,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream3 = response.readableStreamBody; - await streamToBuffer(stream3, buffer2, off - offset, chunkEnd - offset); + 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 }); @@ -65836,7 +70961,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -65856,10 +70981,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -65874,7 +71002,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -65890,7 +71018,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -65902,21 +71030,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -65924,12 +71054,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -65941,18 +71071,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve9) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve9(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve9((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -65961,17 +71097,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve9) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve9((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. @@ -65979,8 +71165,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -65991,8 +71177,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -66005,8 +71191,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -66016,60 +71202,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -66080,40 +71271,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66121,20 +71327,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -66147,20 +71364,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -66169,29 +71388,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -66206,7 +71440,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -66220,74 +71454,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -66299,8 +71548,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -66309,15 +71558,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -66333,26 +71599,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -66370,7 +71638,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -66381,32 +71649,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66431,22 +71715,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -66454,10 +71753,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -66475,7 +71774,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -66492,18 +71791,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -66514,30 +71814,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66545,20 +71847,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -66587,18 +71891,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -66625,7 +71929,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -66646,23 +71950,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -66672,32 +71975,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -66723,15 +72026,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -66750,27 +72056,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream3, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + 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 tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream3, + const scheduler = new storage_common_1.BufferScheduler( + stream2, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -66788,50 +72094,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -66842,13 +72156,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -66856,23 +72170,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66881,21 +72197,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -66903,7 +72231,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -66911,19 +72239,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -66936,7 +72266,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -66947,32 +72277,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -66981,13 +72314,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -66997,7 +72332,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67006,16 +72341,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -67023,22 +72360,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -67058,17 +72397,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -67077,94 +72414,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * 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()`: - * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67190,13 +72512,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67206,17 +72531,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -67225,7 +72552,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67233,20 +72560,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67267,17 +72596,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -67287,94 +72614,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67383,7 +72704,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -67401,13 +72724,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67415,24 +72741,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -67440,12 +72768,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -67453,22 +72783,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67478,38 +72810,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_utils7(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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."); @@ -67520,15 +72886,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -67540,18 +72906,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -67571,7 +72937,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -67586,7 +72952,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -67601,6 +72967,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -67640,6 +73016,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve9(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -67656,11 +73034,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -67684,13 +73087,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -67702,13 +73105,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; + let url; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -67717,28 +73120,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; + let url; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -67746,24 +73149,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + await new Clients_js_1.BlobClient(url, 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -67776,9 +73187,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -67787,19 +73198,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -67808,23 +73219,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path16 = getURLPath(subRequest.url); + const path16 = (0, utils_common_js_1.getURLPath)(subRequest.url); if (!path16 || path16 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } @@ -67835,7 +73246,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -67852,7 +73263,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -67863,7 +73274,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -67874,18 +73285,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url2, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path16 = getURLPath(url2); + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path16 = (0, utils_common_js_1.getURLPath)(url); if (path16 && path16 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { @@ -67897,10 +73326,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -67911,7 +73340,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -67929,11 +73358,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -67941,17 +73384,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -67960,10 +73418,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -67980,7 +73440,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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. */ @@ -67989,48 +73477,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -68038,34 +73526,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -68082,7 +73588,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -68104,7 +73610,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -68112,7 +73618,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -68122,15 +73628,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * 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 BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -68138,12 +73656,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -68156,14 +73674,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -68171,8 +73693,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -68183,19 +73705,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68207,24 +73736,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -68237,7 +73766,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -68245,8 +73774,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -68295,29 +73824,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -68332,7 +73861,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -68346,7 +73875,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -68356,10 +73885,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -68371,14 +73900,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -68391,18 +73920,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -68411,23 +73960,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -68443,44 +74015,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -68488,64 +74042,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -68553,41 +74106,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -68606,7 +74162,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68623,17 +74182,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -68641,35 +74198,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -68677,118 +74221,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -68806,7 +74370,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68827,23 +74394,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -68863,18 +74434,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -68885,27 +74454,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -68915,53 +74468,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: - * - * ```js - * let i = 1; + * // 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 @@ -68969,11 +74523,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -68985,7 +74538,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -69004,7 +74559,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69013,14 +74571,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -69032,7 +74590,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -69042,7 +74600,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -69052,18 +74610,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve9) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve9(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve9((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -69072,45 +74633,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve9) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve9((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -69214,6 +74808,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -69221,7 +74867,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69268,12 +74914,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -69299,10 +74950,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69319,13 +74982,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -69354,6 +75021,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -69375,44 +75058,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -69423,22 +75124,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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. @@ -69453,35 +75182,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url2, credentialOrPipeline, options) { + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url2, pipeline); + super(url, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -69492,22 +75221,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -69524,7 +75262,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -69538,47 +75276,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -69587,15 +75307,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -69605,14 +75325,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -69623,14 +75343,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -69638,7 +75358,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -69650,9 +75370,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -69673,23 +75399,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -69709,18 +75439,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -69731,27 +75459,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -69759,57 +75471,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // 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 @@ -69821,7 +75529,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -69833,7 +75541,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -69852,7 +75562,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69868,45 +75581,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -69914,45 +75609,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js + * // Use for await to iterate the containers * let i = 1; * for await (const container of blobServiceClient.listContainers()) { * console.log(`Container ${i++}: ${container.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -69974,7 +75665,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -69986,17 +75677,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -70015,7 +75709,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -70025,16 +75722,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -70048,19 +75745,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -70068,7 +75773,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -70076,21 +75781,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -70098,7 +75804,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -70106,66 +75812,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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; + } }); } }); @@ -70250,7 +76014,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70263,21 +76027,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -70305,9 +76079,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core14 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core14 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { constructor(contentLength) { @@ -70390,15 +76165,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -70409,15 +76186,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -70425,7 +76201,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70438,21 +76214,31 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -70480,9 +76266,14 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -70490,14 +76281,12 @@ var require_requestUtils = __commonJS({ } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -70509,14 +76298,13 @@ var require_requestUtils = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve9) => setTimeout(resolve9, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(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) { @@ -70525,12 +76313,12 @@ var require_requestUtils = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -70553,9 +76341,8 @@ var require_requestUtils = __commonJS({ throw Error(`${name} failed: ${errorMessage}`); }); } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3( name, method, @@ -70564,13 +76351,13 @@ var require_requestUtils = __commonJS({ delay2, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { + (error3) => { + if (error3 instanceof http_client_1.HttpClientError) { return { - statusCode: error4.statusCode, + statusCode: error3.statusCode, result: null, headers: {}, - error: error4 + error: error3 }; } else { return void 0; @@ -70579,13 +76366,155 @@ var require_requestUtils = __commonJS({ ); }); } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); }); } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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; } }); @@ -70593,7 +76522,7 @@ var require_requestUtils = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70606,21 +76535,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -70648,20 +76587,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs15 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs15 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream2.pipeline); yield pipeline(response.message, output); }); @@ -70763,10 +76705,10 @@ var require_downloadUtils = __commonJS({ }; exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const writeStream = fs15.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { + 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, () => { @@ -70786,17 +76728,16 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const archiveDescriptor = yield fs15.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", () => __awaiter4(this, void 0, void 0, function* () { + 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"]; @@ -70813,7 +76754,7 @@ var require_downloadUtils = __commonJS({ const count = Math.min(blockSize, length - offset); downloads.push({ offset, - promiseGetter: () => __awaiter4(this, void 0, void 0, function* () { + promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); }) }); @@ -70826,7 +76767,7 @@ var require_downloadUtils = __commonJS({ const progressFn = progress.onProgress(); const activeDownloads = []; let nextDownload; - const waitAndWrite = () => __awaiter4(this, void 0, void 0, function* () { + 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--; @@ -70850,9 +76791,8 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const retries = 5; let failures = 0; while (true) { @@ -70873,8 +76813,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { + 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}` }); @@ -70890,8 +76830,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { retryOptions: { // Override the timeout used when downloading each 4 MB chunk @@ -70935,8 +76875,7 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; const timeoutPromise = new Promise((resolve9) => { timeoutHandle = setTimeout(() => resolve9("timeout"), timeoutMs); @@ -70953,7 +76892,7 @@ var require_downloadUtils = __commonJS({ var require_options = __commonJS({ "node_modules/@actions/cache/lib/options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70966,23 +76905,34 @@ var require_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core14 = __importStar4(require_core()); + exports2.getUploadOptions = getUploadOptions; + exports2.getDownloadOptions = getDownloadOptions; + var core14 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -71007,7 +76957,6 @@ var require_options = __commonJS({ core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } - exports2.getUploadOptions = getUploadOptions; function getDownloadOptions(copy) { const result = { useAzureSdk: false, @@ -71049,7 +76998,6 @@ var require_options = __commonJS({ core14.debug(`Lookup only: ${result.lookupOnly}`); return result; } - exports2.getDownloadOptions = getDownloadOptions; } }); @@ -71058,7 +77006,9 @@ var require_config = __commonJS({ "node_modules/@actions/cache/lib/internal/config.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; + exports2.isGhes = isGhes; + exports2.getCacheServiceVersion = getCacheServiceVersion; + exports2.getCacheServiceURL = getCacheServiceURL; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); @@ -71067,13 +77017,11 @@ var require_config = __commonJS({ const isLocalHost = hostname.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } - exports2.isGhes = isGhes; function getCacheServiceVersion() { if (isGhes()) return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } - exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { const version = getCacheServiceVersion(); switch (version) { @@ -71085,7 +77033,6 @@ var require_config = __commonJS({ throw new Error(`Unsupported cache service version: ${version}`); } } - exports2.getCacheServiceURL = getCacheServiceURL; } }); @@ -71094,7 +77041,7 @@ var require_package2 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", - version: "4.1.0", + version: "5.0.1", preview: true, description: "Actions cache lib", keywords: [ @@ -71131,22 +77078,26 @@ var require_package2 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", + "@azure/core-rest-pipeline": "^1.22.0", + "@azure/storage-blob": "^12.29.1", semver: "^6.3.1" }, devDependencies: { - "@types/node": "^22.13.9", + "@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" } }; } @@ -71157,12 +77108,11 @@ 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 = void 0; + exports2.getUserAgentString = getUserAgentString; var packageJson = require_package2(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } - exports2.getUserAgentString = getUserAgentString; } }); @@ -71170,7 +77120,7 @@ var require_user_agent = __commonJS({ var require_cacheHttpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -71183,21 +77133,31 @@ var require_cacheHttpClient = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -71225,13 +77185,16 @@ var require_cacheHttpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var auth_1 = require_auth2(); - var fs15 = __importStar4(require("fs")); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache4; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs15 = __importStar2(require("fs")); var url_1 = require("url"); - var utils = __importStar4(require_cacheUtils()); + var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); var downloadUtils_1 = require_downloadUtils(); var options_1 = require_options(); @@ -71264,11 +77227,11 @@ var require_cacheHttpClient = __commonJS({ return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); } function getCacheEntry(keys, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { @@ -71291,11 +77254,10 @@ var require_cacheHttpClient = __commonJS({ return cacheResult; }); } - exports2.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { @@ -71312,7 +77274,7 @@ Other caches with similar key:`); }); } function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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")) { @@ -71328,9 +77290,8 @@ Other caches with similar key:`); } }); } - exports2.downloadCache = downloadCache; function reserveCache(key, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -71338,24 +77299,23 @@ Other caches with similar key:`); version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); })); return response; }); } - exports2.reserveCache = reserveCache; function getContentRange(start, end) { return `bytes ${start}-${end}/*`; } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { core14.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})`, () => __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -71364,7 +77324,7 @@ Other caches with similar key:`); }); } function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); const fd = fs15.openSync(archivePath, "r"); @@ -71375,7 +77335,7 @@ Other caches with similar key:`); core14.debug("Awaiting all uploads"); let offset = 0; try { - yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -71386,8 +77346,8 @@ Other caches with similar key:`); start, end, autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); + }).on("error", (error3) => { + throw new Error(`Cache upload failed because file read failed with ${error3.message}`); }), start, end); } }))); @@ -71398,15 +77358,15 @@ Other caches with similar key:`); }); } function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); } function saveCache4(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { if (!signedUploadURL) { @@ -71428,7 +77388,6 @@ Other caches with similar key:`); } }); } - exports2.saveCache = saveCache4; } }); @@ -71600,7 +77559,7 @@ var require_binary_format_contract = __commonJS({ exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; var UnknownFieldHandler; (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = Symbol.for("protobuf-ts/unknown"); + 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 }); @@ -72525,7 +78484,7 @@ var require_message_type_contract = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); } }); @@ -73023,26 +78982,26 @@ var require_reflection_json_reader = __commonJS({ const fieldObj = target[localName]; for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { this.assert(jsonObjValue !== null, field.name + " map value", null); - let val2; + let val; switch (field.V.kind) { case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); + val = field.V.T().internalJsonRead(jsonObjValue, options); break; case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); break; } - this.assert(val2 !== void 0, field.name + " map value", jsonObjValue); + 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] = val2; + fieldObj[key] = val; } } else if (field.repeat) { if (jsonValue === null) @@ -73051,22 +79010,22 @@ var require_reflection_json_reader = __commonJS({ const fieldArr = target[localName]; for (const jsonItem of jsonValue) { this.assert(jsonItem !== null, field.name, null); - let val2; + let val; switch (field.kind) { case "message": - val2 = field.T().internalJsonRead(jsonItem, options); + val = field.T().internalJsonRead(jsonItem, options); break; case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); + val = this.scalar(jsonItem, field.T, field.L, field.name); break; } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); + this.assert(val !== void 0, field.name, jsonValue); + fieldArr.push(val); } } else { switch (field.kind) { @@ -73080,10 +79039,10 @@ var require_reflection_json_reader = __commonJS({ case "enum": if (jsonValue === null) continue; - let val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; - target[localName] = val2; + target[localName] = val; break; case "scalar": if (jsonValue === null) @@ -73233,8 +79192,8 @@ var require_reflection_json_reader = __commonJS({ break; return base64_1.base64decode(json2); } - } catch (error4) { - e = error4.message; + } catch (error3) { + e = error3.message; } this.assert(false, fieldName + (e ? " - " + e : ""), json2); } @@ -73288,26 +79247,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== void 0); + jsonObj[entryKey.toString()] = val; } break; } @@ -73319,26 +79278,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { - const val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== void 0); + jsonArr.push(val); } break; } @@ -73588,7 +79547,7 @@ var require_reflection_binary_reader = __commonJS({ let length = reader.uint32(); let end = reader.pos + length; let key = void 0; - let val2 = void 0; + let val = void 0; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -73601,13 +79560,13 @@ var require_reflection_binary_reader = __commonJS({ case 2: switch (field.V.kind) { case "scalar": - val2 = this.scalar(reader, field.V.T, field.V.L); + val = this.scalar(reader, field.V.T, field.V.L); break; case "enum": - val2 = reader.int32(); + val = reader.int32(); break; case "message": - val2 = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); break; } break; @@ -73619,19 +79578,19 @@ var require_reflection_binary_reader = __commonJS({ let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; } - if (val2 === void 0) + if (val === void 0) switch (field.V.kind) { case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); break; case "enum": - val2 = 0; + val = 0; break; case "message": - val2 = field.V.T().create(); + val = field.V.T().create(); break; } - return [key, val2]; + return [key, val]; } scalar(reader, type2, longType) { switch (type2) { @@ -73736,8 +79695,8 @@ var require_reflection_binary_writer = __commonJS({ break; case "map": assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); break; } } @@ -74307,18 +80266,18 @@ var require_enum_object = __commonJS({ } exports2.listEnumValues = listEnumValues; function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + return listEnumValues(enumObject).map((val) => val.name); } exports2.listEnumNames = listEnumNames; function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } exports2.listEnumNumbers = listEnumNumbers; } }); // node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ +var require_commonjs16 = __commonJS({ "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -74509,7 +80468,7 @@ var require_reflection_info2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function normalizeMethodInfo(method, service) { var _a, _b, _c; let m = method; @@ -74618,7 +80577,7 @@ var require_rpc_options = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function mergeRpcOptions(defaults, options) { if (!options) return defaults; @@ -74626,7 +80585,7 @@ var require_rpc_options = __commonJS({ copy(defaults, o); copy(options, o); for (let key of Object.keys(options)) { - let val2 = options[key]; + let val = options[key]; switch (key) { case "jsonOptions": o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); @@ -74640,7 +80599,7 @@ var require_rpc_options = __commonJS({ copy(options.meta, o.meta); break; case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); break; } } @@ -74732,9 +80691,9 @@ var require_deferred = __commonJS({ /** * Resolve the promise. Ignore if not pending. */ - resolvePending(val2) { + resolvePending(val) { if (this._state === DeferredState.PENDING) - this.resolve(val2); + this.resolve(val); } /** * Reject the promise. Ignore if not pending. @@ -74755,7 +80714,7 @@ var require_rpc_output_stream = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RpcOutputStreamController = void 0; var deferred_1 = require_deferred(); - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); var RpcOutputStreamController = class { constructor() { this._lis = { @@ -74805,12 +80764,12 @@ var require_rpc_output_stream = __commonJS({ * at a time. * Can be used to wrap a stream by using the other stream's `onNext`. */ - notifyNext(message, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); + 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 (error4) - this.notifyError(error4); + if (error3) + this.notifyError(error3); if (complete) this.notifyComplete(); } @@ -74830,12 +80789,12 @@ var require_rpc_output_stream = __commonJS({ * * Triggers onNext and onError callbacks. */ - notifyError(error4) { + notifyError(error3) { runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); + 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(); } /** @@ -74904,7 +80863,7 @@ var require_rpc_output_stream = __commonJS({ var require_unary_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/unary-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -74951,7 +80910,7 @@ var require_unary_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -74973,7 +80932,7 @@ var require_unary_call = __commonJS({ var require_server_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -75022,7 +80981,7 @@ var require_server_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -75043,7 +81002,7 @@ var require_server_streaming_call = __commonJS({ var require_client_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/client-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -75091,7 +81050,7 @@ var require_client_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -75112,7 +81071,7 @@ var require_client_streaming_call = __commonJS({ var require_duplex_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/duplex-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -75160,7 +81119,7 @@ var require_duplex_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -75180,7 +81139,7 @@ var require_duplex_streaming_call = __commonJS({ var require_test_transport = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/test-transport.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -75210,7 +81169,7 @@ var require_test_transport = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.TestTransport = void 0; var rpc_error_1 = require_rpc_error(); - var runtime_1 = require_commonjs11(); + 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(); @@ -75284,7 +81243,7 @@ var require_test_transport = __commonJS({ * not reject. If it does, code is broken. */ streamResponses(method, stream2, abort) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const messages = []; if (this.data.response === void 0) { messages.push(method.O.create()); @@ -75299,8 +81258,8 @@ var require_test_transport = __commonJS({ } try { yield delay2(this.responseDelay, abort)(void 0); - } catch (error4) { - stream2.notifyError(error4); + } catch (error3) { + stream2.notifyError(error3); return; } if (this.data.response instanceof rpc_error_1.RpcError) { @@ -75311,8 +81270,8 @@ var require_test_transport = __commonJS({ stream2.notifyMessage(msg); try { yield delay2(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream2.notifyError(error4); + } catch (error3) { + stream2.notifyError(error3); return; } } @@ -75454,7 +81413,7 @@ var require_rpc_interceptor = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.stackDuplexStreamingInterceptors = exports2.stackClientStreamingInterceptors = exports2.stackServerStreamingInterceptors = exports2.stackUnaryInterceptors = exports2.stackIntercept = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function stackIntercept(kind, transport, method, options, input) { var _a, _b, _c, _d; if (kind == "unary") { @@ -75578,7 +81537,7 @@ var require_server_call_context = __commonJS({ }); // node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs12 = __commonJS({ +var require_commonjs17 = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -75664,11 +81623,11 @@ var require_cachescope = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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", [ @@ -75740,11 +81699,11 @@ var require_cachemetadata = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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() { @@ -75806,17 +81765,17 @@ var require_cachemetadata = __commonJS({ }); // node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __commonJS({ +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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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() { @@ -76291,7 +82250,7 @@ var require_cache_twirp_client = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); + var cache_1 = require_cache3(); var CacheServiceClientJSON = class { constructor(rpc) { this.rpc = rpc; @@ -76359,11 +82318,12 @@ var require_cache_twirp_client = __commonJS({ }); // node_modules/@actions/cache/lib/internal/shared/util.js -var require_util10 = __commonJS({ +var require_util9 = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; var core_1 = require_core(); function maskSigUrl(url) { if (!url) @@ -76375,11 +82335,10 @@ var require_util10 = __commonJS({ (0, core_1.setSecret)(signature); (0, core_1.setSecret)(encodeURIComponent(signature)); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${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"); @@ -76392,7 +82351,6 @@ var require_util10 = __commonJS({ maskSigUrl(body.signed_download_url); } } - exports2.maskSecretUrls = maskSecretUrls; } }); @@ -76400,7 +82358,7 @@ var require_util10 = __commonJS({ var require_cacheTwirpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -76428,16 +82386,16 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; + 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_auth2(); - var http_client_1 = require_lib4(); + 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 util_1 = require_util9(); var CacheServiceClient = class { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -76461,24 +82419,24 @@ var require_cacheTwirpClient = __commonJS({ // This function satisfies the Rpc interface. It is compatible with the JSON // JSON generated client. request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; (0, core_1.debug)(`[Request] ${method} ${url}`); const headers = { "Content-Type": contentType }; try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { return this.httpClient.post(url, JSON.stringify(data), headers); })); return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); } }); } retryableRequest(operation) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let attempt = 0; let errorMessage = ""; let rawBody = ""; @@ -76504,18 +82462,18 @@ var require_cacheTwirpClient = __commonJS({ } errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { + } catch (error3) { + if (error3 instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); } - if (error4 instanceof errors_1.UsageError) { - throw error4; + if (error3 instanceof errors_1.UsageError) { + throw error3; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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 = error4.message; + errorMessage = error3.message; } if (!isRetryable) { throw new Error(`Received non-retryable error: ${errorMessage}`); @@ -76549,7 +82507,7 @@ var require_cacheTwirpClient = __commonJS({ return retryableStatusCodes.includes(statusCode); } sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve9) => setTimeout(resolve9, milliseconds)); }); } @@ -76569,7 +82527,6 @@ var require_cacheTwirpClient = __commonJS({ 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); } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; } }); @@ -76577,7 +82534,7 @@ var require_cacheTwirpClient = __commonJS({ var require_tar = __commonJS({ "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -76590,21 +82547,31 @@ var require_tar = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -76632,16 +82599,18 @@ var require_tar = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; + exports2.listTar = listTar; + exports2.extractTar = extractTar2; + exports2.createTar = createTar; var exec_1 = require_exec(); - var io7 = __importStar4(require_io3()); + var io7 = __importStar2(require_io()); var fs_1 = require("fs"); - var path16 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); + var path16 = __importStar2(require("path")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var IS_WINDOWS = process.platform === "win32"; function getTarPath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { switch (process.platform) { case "win32": { const gnuTar = yield utils.getGnuTarPathOnWindows(); @@ -76673,8 +82642,8 @@ var require_tar = __commonJS({ }; }); } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getTarArgs(tarPath_1, compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (tarPath, compressionMethod, type2, archivePath = "") { const args = [`"${tarPath.path}"`]; const cacheFileName = utils.getCacheFileName(compressionMethod); const tarFile = "cache.tar"; @@ -76704,8 +82673,8 @@ var require_tar = __commonJS({ return args; }); } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { let args; const tarPath = yield getTarPath(); const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); @@ -76727,7 +82696,7 @@ var require_tar = __commonJS({ return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); } function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + 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: @@ -76751,7 +82720,7 @@ var require_tar = __commonJS({ }); } function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -76776,51 +82745,48 @@ var require_tar = __commonJS({ }); } function execCommands(commands, cwd) { - return __awaiter4(this, void 0, void 0, function* () { + 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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + } 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commands = yield getCommands(compressionMethod, "list", archivePath); yield execCommands(commands); }); } - exports2.listTar = listTar; function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const workingDirectory = getWorkingDirectory(); yield io7.mkdirP(workingDirectory); const commands = yield getCommands(compressionMethod, "extract", archivePath); yield execCommands(commands); }); } - exports2.extractTar = extractTar2; function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { (0, fs_1.writeFileSync)(path16.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); } - exports2.createTar = createTar; } }); // node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ +var require_cache4 = __commonJS({ "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -76833,21 +82799,31 @@ var require_cache3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -76875,15 +82851,18 @@ var require_cache3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core14 = __importStar4(require_core()); - var path16 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; + var core14 = __importStar2(require_core()); + var path16 = __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_lib4(); + var http_client_1 = require_lib(); var ValidationError = class _ValidationError extends Error { constructor(message) { super(message); @@ -76932,9 +82911,8 @@ var require_cache3 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache4(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCache4(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)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -76947,9 +82925,8 @@ var require_cache3 = __commonJS({ } }); } - exports2.restoreCache = restoreCache4; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; core14.debug("Resolved Keys:"); @@ -76985,29 +82962,29 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core14.info("Cache restored successfully"); return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); + core14.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error4.message}`); + core14.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; @@ -77055,857 +83032,1285 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core14.info("Cache restored successfully"); return response.matchedKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); + core14.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error4.message}`); + core14.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + if (archivePath) { + yield utils.unlinkFile(archivePath); } + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); + } + } + return void 0; + }); + } + function saveCache4(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + core14.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + checkKey(key); + 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 _a, _b, _c, _d, _e; + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core14.debug("Cache Paths:"); + core14.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 = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.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.`); + } + core14.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { + throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + } + core14.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 === ReserveCacheError2.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); + } else { + core14.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.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) { + 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); + core14.debug("Cache Paths:"); + core14.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 = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core14.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core14.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); + } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core14.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + } + core14.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); + core14.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 === ReserveCacheError2.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core14.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); + } else { + core14.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); + } + } + return cacheId; + }); + } + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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 os5 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os5.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/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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 fs15 = __importStar2(require("fs")); + var os5 = __importStar2(require("os")); + var utils_1 = require_utils8(); + 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 (!fs15.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs15.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os5.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}${os5.EOL}${convertedValue}${os5.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/tool-cache/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 (_a) { + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve9) { + resolve9(value); + }); + } + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } finally { + } + function rejected(value) { try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function saveCache4(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); + function step(result) { + result.done ? resolve9(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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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.saveCache = saveCache4; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core14.debug("Cache Paths:"); - core14.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 = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); + 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((resolve9) => __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", () => { + resolve9(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve9(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(userAgent, 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 = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.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.`); + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; } - core14.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize - }); - if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; } - core14.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError2.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); - } + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; + } + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; + } + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; } } - return cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core14.debug("Cache Paths:"); - core14.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 = path16.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + 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 archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core14.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; - try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core14.warning(`Cache reservation failed: ${response.message}`); + const parsedUrl = new URL(requestUrl); + let info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, data); + } else { + return response; } - throw new Error(response.message || "Response was not ok"); } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core14.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); - } - core14.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); - core14.debug(`FinalizeCacheEntryUploadResponse: ${finalizeResponse.ok}`); - if (!finalizeResponse.ok) { - if (finalizeResponse.message) { - throw new FinalizeCacheError(finalizeResponse.message); + 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, data); + redirectsRemaining--; } - throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`); - } - cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError2.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core14.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); + 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(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve9(res); + } } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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 info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } } - return cacheId; - }); - } - } -}); - -// node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + return info6; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(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; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - if (typeof copy.matchDirectories === "boolean") { - result.matchDirectories = copy.matchDirectories; - core14.debug(`matchDirectories '${result.matchDirectories}'`); + if (!useProxy) { + agent = this._agent; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + if (agent) { + return agent; } - if (typeof copy.excludeHiddenFiles === "boolean") { - result.excludeHiddenFiles = copy.excludeHiddenFiles; - core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - } - return result; - } - exports2.getOptions = getOptions; - } -}); - -// node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path16 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - let result = path16.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; - } - exports2.dirname = dirname3; - 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)}`; - } + 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 { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } - } 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)}`; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; } - (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path16.sep; - } - return root + itemPath; - } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - 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("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - 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("/"); - } - exports2.hasRoot = hasRoot; - 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, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; - } - p = normalizeSeparators(p); - if (!p.endsWith(path16.sep)) { - return p; + _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; } - if (p === path16.sep) { - return p; + _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((resolve9) => setTimeout(() => resolve9(), ms)); + }); } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve9(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 { + resolve9(response); + } + })); + }); } - return p.substr(0, p.length - 1); - } - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind2 = __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 = {})); + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(require_internal_path_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - 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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve9) { + resolve9(value); + }); } - const result = []; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - if (searchPathMap[key] === "included") { - continue; + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function step(result) { + result.done ? resolve9(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; } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); - } - exports2.partialMatch = partialMatch; - } -}); - -// node_modules/@actions/glob/lib/internal-path.js -var require_internal_path2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path16 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(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(path16.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path16.basename(remaining); - this.segments.unshift(basename); - 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(path16.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } - } + 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; } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path16.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path16.sep; - } - result += this.segments[i]; + 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"); } - return result; + 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.Path = Path; + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve9) { + resolve9(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os5 = __importStar4(require("os")); - var path16 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(require("assert")); - var minimatch_1 = require_minimatch(); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_path_1 = require_internal_path2(); - 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}`; + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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(path16.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(path16.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path16.sep}`; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - } 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; + function step(result) { + result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); } - return internal_match_kind_1.MatchKind.None; + 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_auth3(); + 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); } - /** - * 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); + 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 this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + return token; } - /** - * Escapes glob patterns within a path - */ - static globEscape(s) { - return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); + 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; } - /** - * 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(`.${path16.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path16.sep}`)) { - homedir2 = homedir2 || os5.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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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_state2 = __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(path16, level) { - this.path = path16; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -77932,225 +84337,274 @@ var require_internal_globber2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve9, reject) { - v = o[n](v), settle(resolve9, reject, v.done, v.value); - }); - }; + 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 = ""; } - function settle(resolve9, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve9({ value: v2, done: d }); - }, reject); + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + /** + * 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; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } + /** + * 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; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - function fulfill(value) { - resume("next", value); + /** + * 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(); } - function reject(value) { - resume("throw", value); + /** + * 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(); } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * 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(); } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core14 = __importStar4(require_core()); - var fs15 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper2()); - var path16 = __importStar4(require("path")); - var patternHelper = __importStar4(require_internal_pattern_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_pattern_1 = require_internal_pattern2(); - var internal_search_state_1 = require_internal_search_state2(); - var IS_WINDOWS = process.platform === "win32"; - var DefaultGlobber = class _DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); + /** + * 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(); } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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(); } - glob() { - var _a, e_1, _b, _c; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _d = true, _e = __asyncValues4(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * 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(); } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs15.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (options.excludeHiddenFiles && path16.basename(item.path).match(/^\./)) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs15.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path16.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * Adds an HTML blockquote to the summary buffer + * + * @param {string} text quote text + * @param {string} cite (optional) citation url + * + * @returns {Summary} summary instance */ - static create(patterns, options) { - return __awaiter4(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; - }); + addQuote(text, cite) { + const attrs = Object.assign({}, cite && { cite }); + const element = this.wrap("blockquote", text, attrs); + return this.addRaw(element).addEOL(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs15.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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 fs15.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs15.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; - } - traversalChain.push(realPath); - } - return stats; - }); + /** + * 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// 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) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78163,189 +84617,43 @@ var require_internal_hash_files = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve9, reject) { - v = o[n](v), settle(resolve9, reject, v.done, v.value); - }); - }; - } - function settle(resolve9, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve9({ value: v2, done: d }); - }, reject); - } - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = void 0; - var crypto2 = __importStar4(require("crypto")); - var core14 = __importStar4(require_core()); - var fs15 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var path16 = __importStar4(require("path")); - function hashFiles2(globber, currentWorkspace, verbose = false) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const writeDelegate = verbose ? core14.info : core14.debug; - let hasMatch = false; - const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const result = crypto2.createHash("sha256"); - let count = 0; - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path16.sep}`)) { - writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); - continue; - } - if (fs15.statSync(file).isDirectory()) { - writeDelegate(`Skip directory '${file}'.`); - continue; - } - const hash = crypto2.createHash("sha256"); - const pipeline = util.promisify(stream2.pipeline); - yield pipeline(fs15.createReadStream(file), hash); - result.write(hash.digest()); - count++; - if (!hasMatch) { - hasMatch = true; - } - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a && (_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 ""; - } - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path16 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.hashFiles = hashFiles2; - } -}); - -// node_modules/@actions/glob/lib/glob.js -var require_glob2 = __commonJS({ - "node_modules/@actions/glob/lib/glob.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = exports2.create = void 0; - var internal_globber_1 = require_internal_globber2(); - var internal_hash_files_1 = require_internal_hash_files(); - function create2(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); } - exports2.create = create2; - function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { - return __awaiter4(this, void 0, void 0, function* () { - let followSymbolicLinks = true; - if (options && typeof options.followSymbolicLinks === "boolean") { - followSymbolicLinks = options.followSymbolicLinks; - } - const globber = yield create2(patterns, { followSymbolicLinks }); - return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); - }); + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path16.sep); } - exports2.hashFiles = hashFiles2; + exports2.toPlatformPath = toPlatformPath; } }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ +var require_io_util3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -78354,21 +84662,21 @@ var require_io_util4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -78398,14 +84706,14 @@ var require_io_util4 = __commonJS({ var _a; 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 fs15 = __importStar4(require("fs")); - var path16 = __importStar4(require("path")); + var fs15 = __importStar2(require("fs")); + var path16 = __importStar2(require("path")); _a = fs15.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs15.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -78419,7 +84727,7 @@ var require_io_util4 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -78437,7 +84745,7 @@ var require_io_util4 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -78515,10 +84823,10 @@ var require_io_util4 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ +var require_io3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -78527,21 +84835,21 @@ var require_io4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -78571,10 +84879,10 @@ var require_io4 = __commonJS({ 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 path16 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); + var path16 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -78601,7 +84909,7 @@ var require_io4 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -78622,7 +84930,7 @@ var require_io4 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -78642,14 +84950,14 @@ var require_io4 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which7(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -78673,7 +84981,7 @@ var require_io4 = __commonJS({ } exports2.which = which7; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -78698,323 +85006,98 @@ var require_io4 = __commonJS({ const directories = []; if (process.env.PATH) { for (const p of process.env.PATH.split(path16.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path16.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve9) { - resolve9(value); - }); - } - return new (P || (P = Promise))(function(resolve9, 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 ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver9 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os5 = require("os"); - var cp = require("child_process"); - var fs15 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os5.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; + if (p) { + directories.push(p); } } } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os5.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; - } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path16.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); } } - } - return version; + return matches; + }); } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs15.existsSync(lsbReleaseFile)) { - contents = fs15.readFileSync(lsbReleaseFile).toString(); - } else if (fs15.existsSync(osReleaseFile)) { - contents = fs15.readFileSync(osReleaseFile).toString(); - } - return contents; + 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 }; } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/tool-cache/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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + 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 copyFile(srcFile, destFile, force); + } } - } else { - return void 0; - } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - 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; + function copyFile(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); } - } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -79042,598 +85125,463 @@ var require_lib5 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(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", () => { - resolve9(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve9(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(userAgent, 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 = userAgent; - 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; - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os5 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path16 = __importStar2(require("path")); + var io7 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + _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}`; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - } 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(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve9(res); - } + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; } } - const req = info6.httpModule.request(info6.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(); + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os5.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os5.EOL.length); + n = s.indexOf(os5.EOL); } - handleResult(new Error(`Request timeout: ${info6.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(); + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } } - /** - * 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; + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + return this.toolPath; } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + _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 info6; + return this.args; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + _endsWith(str2, end) { + return str2.endsWith(end); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - if (!useProxy) { - agent = this._agent; + if (!arg) { + return '""'; } - if (agent) { - return agent; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; + } } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (!needsQuotes) { + return arg; } - 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; + 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 { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + quoteHit = false; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); } - return agent; + reverse += '"'; + return reverse.split("").reverse().join(""); } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - if (proxyAgent) { - return proxyAgent; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - 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 - }); + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; } - return proxyAgent; + 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(""); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve9) => setTimeout(() => resolve9(), ms)); - }); + _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; } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve9(response); + _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 = path16.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io7.which(this.toolPath, true); + return new Promise((resolve9, 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}`); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os5.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); } - } - return value; + 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 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); + 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); } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { + 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); + } + }); + }); } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; + 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 { - msg = `Failed request: (${statusCode})`; + resolve9(exitCode); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve9(response); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } })); }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.ToolRunner = ToolRunner6; + 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/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -79661,58 +85609,63 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core14 = __importStar4(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"); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + function exec(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.`); } - } - execute(action, isRetryable) { - return __awaiter4(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; - } - core14.info(err.message); - } - const seconds = this.getSleepAmount(); - core14.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => setTimeout(resolve9, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + }; + 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 exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -79725,21 +85678,21 @@ var require_tool_cache = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve9) { resolve9(value); @@ -79766,613 +85719,546 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core14 = __importStar4(require_core()); - var io7 = __importStar4(require_io4()); - var crypto2 = __importStar4(require("crypto")); - var fs15 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os5 = __importStar4(require("os")); - var path16 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver9 = __importStar4(require_semver2()); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(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); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path16.join(_getTempDirectory(), crypto2.randomUUID()); - yield io7.mkdirP(path16.dirname(dest)); - core14.debug(`Downloading ${url}`); - core14.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs15.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core14.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream2.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs15.createWriteStream(dest)); - core14.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core14.debug("download failed"); - try { - yield io7.rmRF(dest); - } catch (err) { - core14.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core14.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path16.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 io7.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core14.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() - } - }); - core14.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core14.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core14.isDebug()) { - args.push("-v"); - } - const xarPath = yield io7.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; + 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 exec = __importStar2(require_exec3()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io7.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 - ]; - core14.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 io7.which("powershell", true); - core14.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io7.which("unzip", true); - const args = [file]; - if (!core14.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + return { + name: name.trim(), + version: version.trim() + }; + }); + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true }); - } - function cacheDir(sourceDir, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver9.clean(version) || version; - arch2 = arch2 || os5.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch2}`); - core14.debug(`source dir: ${sourceDir}`); - if (!fs15.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs15.readdirSync(sourceDir)) { - const s = path16.join(sourceDir, itemName); - yield io7.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch2); - return destPath; + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + silent: true }); - } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver9.clean(version) || version; - arch2 = arch2 || os5.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch2}`); - core14.debug(`source file: ${sourceFile}`); - if (!fs15.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path16.join(destFolder, targetFile); - core14.debug(`destination file ${destPath}`); - yield io7.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); - return destFolder; + 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.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch2) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch2 = arch2 || os5.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver9.clean(versionSpec) || ""; - const cachePath = path16.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core14.debug(`checking cache: ${cachePath}`); - if (fs15.existsSync(cachePath) && fs15.existsSync(`${cachePath}.complete`)) { - core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); - toolPath = cachePath; - } else { - core14.debug("not found"); - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch2) { - const versions = []; - arch2 = arch2 || os5.arch(); - const toolPath = path16.join(_getCacheDirectory(), toolName); - if (fs15.existsSync(toolPath)) { - const children = fs15.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path16.join(toolPath, child, arch2 || ""); - if (fs15.existsSync(fullPath) && fs15.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } + 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); } - return versions; - } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core14.debug("set auth"); - headers.authorization = auth; - } - 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; + __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(resolve9) { + resolve9(value); + }); + } + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - headers["accept"] = "application/vnd.github.VERSION.raw"; - let versionsRaw = yield (yield http.get(manifestUrl, headers)).readBody(); - if (versionsRaw) { - versionsRaw = versionsRaw.replace(/^\uFEFF/, ""); + function rejected(value) { try { - releases = JSON.parse(versionsRaw); - } catch (_a) { - core14.debug("Invalid json"); + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os5.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path16.join(_getTempDirectory(), crypto2.randomUUID()); + function step(result) { + result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); } - yield io7.mkdirP(dest); - return dest; + 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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os5 = __importStar2(require("os")); + var path16 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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 _createToolPath(tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); - core14.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io7.rmRF(folderPath); - yield io7.rmRF(markerPath); - yield io7.mkdirP(folderPath); - return folderPath; - }); + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); } - function _completeToolPath(tool, version, arch2) { - const folderPath = path16.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); - const markerPath = `${folderPath}.complete`; - fs15.writeFileSync(markerPath, ""); - core14.debug("finished caching tool"); + exports2.setSecret = setSecret; + 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}${path16.delimiter}${process.env["PATH"]}`; } - function isExplicitVersion(versionSpec) { - const c = semver9.clean(versionSpec) || ""; - core14.debug(`isExplicit: ${c}`); - const valid3 = semver9.valid(c) != null; - core14.debug(`explicit? ${valid3}`); - return valid3; + 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.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core14.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver9.gt(a, b)) { - return 1; - } - return -1; - }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver9.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - if (version) { - core14.debug(`matched: ${version}`); - } else { - core14.debug("match not found"); + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return version; + process.stdout.write(os5.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.evaluateVersions = evaluateVersions; - function _getCacheDirectory() { - const cacheDirectory = process.env["RUNNER_TOOL_CACHE"] || ""; - (0, assert_1.ok)(cacheDirectory, "Expected RUNNER_TOOL_CACHE to be defined"); - return cacheDirectory; + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); } - function _getTempDirectory() { - const tempDirectory = process.env["RUNNER_TEMP"] || ""; - (0, assert_1.ok)(tempDirectory, "Expected RUNNER_TEMP to be defined"); - return tempDirectory; + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); } - function _getGlobal(key, defaultValue) { - const value = global[key]; - return value !== void 0 ? value : defaultValue; + exports2.setFailed = setFailed2; + function isDebug3() { + return process.env["RUNNER_DEBUG"] === "1"; } - function _unique(values) { - return Array.from(new Set(values)); + exports2.isDebug = isDebug3; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning11(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning11; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os5.EOL); + } + exports2.info = info6; + 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 saveState2(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 = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/fast-deep-equal/index.js -var require_fast_deep_equal = __commonJS({ - "node_modules/fast-deep-equal/index.js"(exports2, module2) { +// node_modules/@actions/tool-cache/lib/manifest.js +var require_manifest = __commonJS({ + "node_modules/@actions/tool-cache/lib/manifest.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; + 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(resolve9) { + resolve9(value); + }); + } + return new (P || (P = Promise))(function(resolve9, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - return true; - } - return a !== a && b !== b; + function step(result) { + result.done ? resolve9(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - } -}); - -// node_modules/@actions/http-client/lib/proxy.js -var require_proxy5 = __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"]; + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver10 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os5 = require("os"); + var cp = require("child_process"); + var fs15 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os5.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver10.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 = semver10.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; } - } else { - return void 0; - } + return result; + }); } - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os5.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; + } + } + } } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs15.existsSync(lsbReleaseFile)) { + contents = fs15.readFileSync(lsbReleaseFile).toString(); + } else if (fs15.existsSync(osReleaseFile)) { + contents = fs15.readFileSync(osReleaseFile).toString(); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + return contents; + } + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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]; + } }; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + __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(resolve9) { + resolve9(value); + }); } - 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 new (P || (P = Promise))(function(resolve9, 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 ? resolve9(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 core14 = __importStar2(require_core3()); + 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"); } } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + 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; + } + core14.info(err.message); + } + const seconds = this.getSleepAmount(); + core14.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); + }); } - get username() { - return this._decodedUsername; + getSleepAmount() { + return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; } - get password() { - return this._decodedPassword; + sleep(seconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve9) => setTimeout(resolve9, seconds * 1e3)); + }); } }; + exports2.RetryHelper = RetryHelper; } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80385,31 +86271,21 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve9) { resolve9(value); @@ -80437,628 +86313,535 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core14 = __importStar2(require_core3()); + var io7 = __importStar2(require_io3()); + var crypto3 = __importStar2(require("crypto")); + var fs15 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os5 = __importStar2(require("os")); + var path16 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver10 = __importStar2(require_semver2()); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + 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.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(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", () => { - resolve9(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve9(Buffer.concat(chunks)); - }); - })); + exports2.HTTPError = HTTPError2; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path16.join(_getTempDirectory(), crypto3.randomUUID()); + yield io7.mkdirP(path16.dirname(dest)); + core14.debug(`Downloading ${url}`); + core14.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(url, dest || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + }); } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; - } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs15.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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); + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false }); - } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + if (auth) { + core14.debug("set auth"); + if (headers === void 0) { + headers = {}; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + headers.authorization = auth; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve9(res); - } + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream2.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs15.createWriteStream(dest)); + core14.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core14.debug("download failed"); + try { + yield io7.rmRF(dest); + } catch (err) { + core14.debug(`Failed to delete '${dest}'. ${err.message}`); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + }); + } + 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 = core14.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } + } else { + const escapedScript = path16.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 io7.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - const req = info6.httpModule.request(info6.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(); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core14.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() } - handleResult(new Error(`Request timeout: ${info6.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + core14.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); + if (core14.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 { - req.end(); + args = [flags]; } - } - /** - * 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; + args.push("-x", "-C", dest, "-f", file); + if (core14.isDebug()) { + args.push("-v"); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; + const xarPath = yield io7.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + function extractZip(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } + dest = yield _createExtractFolder(dest); + if (IS_WINDOWS) { + yield extractZipWin(file, dest); + } else { + yield extractZipNix(file, dest); } - return info6; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + return dest; + }); + } + exports2.extractZip = extractZip; + 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 io7.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 + ]; + core14.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 io7.which("powershell", true); + core14.debug(`Using powershell at path: ${powershellPath}`); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); } - return lowercaseKeys(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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; - if (headerValue) { - clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; - } + }); + } + function extractZipNix(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + const unzipPath = yield io7.which("unzip", true); + const args = [file]; + if (!core14.isDebug()) { + args.unshift("-q"); } - const additionalValue = additionalHeaders[header]; - if (additionalValue !== void 0) { - return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver10.clean(version) || version; + arch2 = arch2 || os5.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch2}`); + core14.debug(`source dir: ${sourceDir}`); + if (!fs15.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); } - if (clientHeader !== void 0) { - return clientHeader; + const destPath = yield _createToolPath(tool, version, arch2); + for (const itemName of fs15.readdirSync(sourceDir)) { + const s = path16.join(sourceDir, itemName); + yield io7.cp(s, destPath, { recursive: true }); } - return _default2; + _completeToolPath(tool, version, arch2); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver10.clean(version) || version; + arch2 = arch2 || os5.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch2}`); + core14.debug(`source file: ${sourceFile}`); + if (!fs15.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); + } + const destFolder = yield _createToolPath(tool, version, arch2); + const destPath = path16.join(destFolder, targetFile); + core14.debug(`destination file ${destPath}`); + yield io7.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch2); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch2) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; - } - } + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); + } + arch2 = arch2 || os5.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch2); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver10.clean(versionSpec) || ""; + const cachePath = path16.join(_getCacheDirectory(), toolName, versionSpec, arch2); + core14.debug(`checking cache: ${cachePath}`); + if (fs15.existsSync(cachePath) && fs15.existsSync(`${cachePath}.complete`)) { + core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + toolPath = cachePath; + } else { + core14.debug("not found"); } - 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; + } + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch2) { + const versions = []; + arch2 = arch2 || os5.arch(); + const toolPath = path16.join(_getCacheDirectory(), toolName); + if (fs15.existsSync(toolPath)) { + const children = fs15.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path16.join(toolPath, child, arch2 || ""); + if (fs15.existsSync(fullPath) && fs15.existsSync(`${fullPath}.complete`)) { + versions.push(child); + } } } - if (clientHeader !== void 0) { - return clientHeader; - } - return _default2; } - _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; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core14.debug("set auth"); + headers.authorization = auth; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; } - 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; + let manifestUrl = ""; + for (const item of response.result.tree) { + if (item.path === "versions-manifest.json") { + manifestUrl = item.url; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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 (_a) { + core14.debug("Invalid json"); + } } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os5.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path16.join(_getTempDirectory(), crypto3.randomUUID()); } - if (proxyAgent) { - return proxyAgent; + yield io7.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path16.join(_getCacheDirectory(), tool, semver10.clean(version) || version, arch2 || ""); + core14.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io7.rmRF(folderPath); + yield io7.rmRF(markerPath); + yield io7.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch2) { + const folderPath = path16.join(_getCacheDirectory(), tool, semver10.clean(version) || version, arch2 || ""); + const markerPath = `${folderPath}.complete`; + fs15.writeFileSync(markerPath, ""); + core14.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver10.clean(versionSpec) || ""; + core14.debug(`isExplicit: ${c}`); + const valid3 = semver10.valid(c) != null; + core14.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core14.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver10.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver10.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve9) => setTimeout(() => resolve9(), ms)); - }); + if (version) { + core14.debug(`matched: ${version}`); + } else { + core14.debug("match not found"); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve9, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve9(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 { - resolve9(response); - } - })); - }); + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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; }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ +var require_debug3 = __commonJS({ "node_modules/follow-redirects/debug.js"(exports2, module2) { var debug5; module2.exports = function() { if (!debug5) { try { debug5 = require_src()("follow-redirects"); - } catch (error4) { + } catch (error3) { } if (typeof debug5 !== "function") { debug5 = function() { @@ -81079,7 +86862,7 @@ var require_follow_redirects = __commonJS({ var https2 = require("https"); var Writable = require("stream").Writable; var assert = require("assert"); - var debug5 = require_debug2(); + var debug5 = require_debug3(); (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; @@ -81091,8 +86874,8 @@ var require_follow_redirects = __commonJS({ var useNativeURL = false; try { assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; } var preservedUrlFields = [ "auth", @@ -81166,9 +86949,9 @@ var require_follow_redirects = __commonJS({ this._currentRequest.abort(); this.emit("abort"); }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); + RedirectableRequest.prototype.destroy = function(error3) { + destroyRequest(this._currentRequest, error3); + destroy.call(this, error3); return this; }; RedirectableRequest.prototype.write = function(data, encoding, callback) { @@ -81335,10 +87118,10 @@ var require_follow_redirects = __commonJS({ var i = 0; var self2 = this; var buffers = this._requestBodyBuffers; - (function writeNext(error4) { + (function writeNext(error3) { if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); + if (error3) { + self2.emit("error", error3); } else if (i < buffers.length) { var buffer = buffers[i++]; if (!request.finished) { @@ -81537,12 +87320,12 @@ var require_follow_redirects = __commonJS({ }); return CustomError; } - function destroyRequest(request, error4) { + function destroyRequest(request, error3) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); - request.destroy(error4); + request.destroy(error3); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); @@ -81567,11 +87350,16 @@ var require_follow_redirects = __commonJS({ }); // src/init-action.ts +var init_action_exports = {}; +__export(init_action_exports, { + CODEQL_VERSION_JAR_MINIMIZATION: () => CODEQL_VERSION_JAR_MINIMIZATION +}); +module.exports = __toCommonJS(init_action_exports); var fs14 = __toESM(require("fs")); var path15 = __toESM(require("path")); var core13 = __toESM(require_core()); -var io6 = __toESM(require_io2()); -var semver8 = __toESM(require_semver2()); +var io6 = __toESM(require_io()); +var semver9 = __toESM(require_semver2()); // node_modules/uuid/dist-node/stringify.js var byteToHex = []; @@ -81633,7 +87421,7 @@ var path2 = __toESM(require("path")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var fs = __toESM(require("fs")); @@ -81641,8 +87429,7 @@ var fsPromises = __toESM(require("fs/promises")); var os = __toESM(require("os")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -81659,14 +87446,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs15.lstat(itemPath, { bigint: true }) : await fs15.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs15.lstat(itemPath, { bigint: true }) : await fs15.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 fs15.readdir(itemPath) : await fs15.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs15.readdir(itemPath) : await fs15.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -81677,13 +87464,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -82563,6 +88350,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -82682,7 +88481,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -82722,16 +88521,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -84287,7 +90077,7 @@ var safeDump = renamed("safeDump", "dump"); var semver = __toESM(require_semver2()); // src/api-compatibility.json -var maximumVersion = "3.19"; +var maximumVersion = "3.20"; var minimumVersion = "3.14"; // src/util.ts @@ -84306,9 +90096,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -84394,7 +90184,7 @@ function getCgroupMemoryLimitBytes(limitFile, logger) { ); return limit; } -function getMemoryFlagValue(userInput, logger) { +function getCodeQLMemoryLimit(userInput, logger) { return getMemoryFlagValueForPlatform( userInput, getTotalMemoryBytes(logger), @@ -84532,7 +90322,7 @@ function parseGitHubUrl(inputUrl) { var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; var hasBeenWarnedAboutVersion = false; function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== 1 /* GHES */) { + if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { return; } const disallowedAPIVersionReason = apiVersionInRange( @@ -84696,11 +90486,11 @@ function parseMatrixInput(matrixInput) { } return JSON.parse(matrixInput); } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +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}` : ""}`; @@ -84726,22 +90516,22 @@ async function checkDiskUsage(logger) { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, numTotalBytes: diskUsage.blocks * blockSizeInBytes }; - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to check available disk space: ${getErrorMessage(error4)}` + `Failed to check available disk space: ${getErrorMessage(error3)}` ); return void 0; } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + 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 === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( + 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.11" + ">=3.20" )) { - core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + core3.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/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } @@ -85116,17 +90906,17 @@ function getAuthorizationHeaderFor(logger, apiDetails, url) { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -85233,6 +91023,7 @@ function wrapApiConfigurationError(e) { } // src/caching-utils.ts +var crypto2 = __toESM(require("crypto")); var core6 = __toESM(require_core()); async function getTotalCacheSize(paths, logger, quiet = false) { const sizes = await Promise.all( @@ -85265,6 +91056,11 @@ function getCachingKind(input) { 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); @@ -85275,7 +91071,7 @@ function getDependencyCachingEnabled() { // src/config-utils.ts var fs6 = __toESM(require("fs")); -var path7 = __toESM(require("path")); +var path8 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); // src/config/db-config.ts @@ -85299,9 +91095,9 @@ function getInvalidConfigFileMessage(configFile, messages) { return `The configuration file "${configFile}" is invalid: ${messages.slice(0, 10).join(", ")}${andMore}`; } function getConfigFileRepoFormatInvalidMessage(configFile) { - let error4 = `The configuration file "${configFile}" is not a supported remote file reference.`; - error4 += " Expected format //@"; - return error4; + 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`; @@ -85312,15 +91108,15 @@ function getConfigFileDirectoryGivenMessage(configFile) { 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, error4) { +function getConfigFilePropertyError(configFile, property, error3) { if (configFile === void 0) { - return `The workflow property "${property}" is invalid: ${error4}`; + return `The workflow property "${property}" is invalid: ${error3}`; } else { - return `The configuration file "${configFile}" is invalid: property "${property}" ${error4}`; + return `The configuration file "${configFile}" is invalid: property "${property}" ${error3}`; } } -function getRepoPropertyError(propertyName, error4) { - return `The repository property "${propertyName}" is invalid: ${error4}`; +function getRepoPropertyError(propertyName, error3) { + return `The repository property "${propertyName}" is invalid: ${error3}`; } function getPacksStrInvalid(packStr, configFile) { return configFile ? getConfigFilePropertyError( @@ -85342,7 +91138,7 @@ var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => { return RepositoryPropertyName2; })(RepositoryPropertyName || {}); async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) { - if (gitHubVersion.type === 1 /* GHES */) { + if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */) { return {}; } try { @@ -85599,8 +91395,8 @@ function parseUserConfig(logger, pathInput, contents, validateConfig) { if (validateConfig) { const result = new jsonschema.Validator().validate(doc, schema2); if (result.errors.length > 0) { - for (const error4 of result.errors) { - logger.error(error4.stack); + for (const error3 of result.errors) { + logger.error(error3.stack); } throw new ConfigurationError( getInvalidConfigFileMessage( @@ -85611,39 +91407,173 @@ function parseUserConfig(logger, pathInput, contents, validateConfig) { } } return doc; - } catch (error4) { - if (error4 instanceof YAMLException) { + } catch (error3) { + if (error3 instanceof YAMLException) { throw new ConfigurationError( - getConfigFileParseErrorMessage(pathInput, error4.message) + getConfigFileParseErrorMessage(pathInput, error3.message) ); } - throw error4; + throw error3; } } +// src/diagnostics.ts +var import_fs = require("fs"); +var import_path = __toESM(require("path")); + +// src/logging.ts +var core7 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup + }; +} +async function withGroupAsync(groupName, f) { + core7.startGroup(groupName); + try { + return await f(); + } finally { + core7.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/diagnostics.ts +var unwrittenDiagnostics = []; +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 writeDiagnostic(config, language, diagnostic) { + const logger = getActionsLogger(); + const databasePath = language ? getCodeQLDatabasePath(config, language) : config.dbLocation; + const diagnosticsPath = import_path.default.resolve( + databasePath, + "diagnostic", + "codeql-action" + ); + try { + (0, import_fs.mkdirSync)(diagnosticsPath, { recursive: true }); + const jsonPath = import_path.default.resolve( + diagnosticsPath, + // Remove colons from the timestamp as these are not allowed in Windows filenames. + `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.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(); + logger.debug( + `Writing ${unwrittenDiagnostics.length} diagnostic(s) to database.` + ); + for (const unwritten of unwrittenDiagnostics) { + writeDiagnostic(config, unwritten.language, unwritten.diagnostic); + } + unwrittenDiagnostics = []; +} +function makeTelemetryDiagnostic(id, name, attributes) { + return makeDiagnostic(id, name, { + attributes, + visibility: { + cliSummaryTable: false, + statusPage: false, + telemetry: true + } + }); +} + // src/feature-flags.ts var fs4 = __toESM(require("fs")); -var path5 = __toESM(require("path")); -var semver4 = __toESM(require_semver2()); +var path6 = __toESM(require("path")); +var semver5 = __toESM(require_semver2()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.23.3"; -var cliVersion = "2.23.3"; +var bundleVersion = "codeql-bundle-v2.23.8"; +var cliVersion = "2.23.8"; // src/overlay-database-utils.ts -var crypto = __toESM(require("crypto")); var fs3 = __toESM(require("fs")); -var path4 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var path5 = __toESM(require("path")); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); +var GIT_MINIMUM_VERSION_FOR_OVERLAY = "2.38.0"; +var GitVersionInfo = class { + constructor(truncatedVersion, fullVersion) { + this.truncatedVersion = truncatedVersion; + this.fullVersion = fullVersion; + } + isAtLeast(minVersion) { + return semver3.gte(this.truncatedVersion, minVersion); + } +}; +async function getGitVersionOrThrow() { + const stdout = await runGitCommand( + void 0, + ["--version"], + "Failed to get git version." + ); + 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()}`); +} var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core7.debug(`Running git command: git ${args.join(" ")}`); + core8.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -85658,13 +91588,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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."; } - core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error4; + core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -85786,7 +91716,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core7.debug( + core8.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -85811,41 +91741,8 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/logging.ts -var core8 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup - }; -} -async function withGroupAsync(groupName, f) { - core8.startGroup(groupName); - try { - return await f(); - } finally { - core8.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/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -85870,7 +91767,7 @@ async function readBaseDatabaseOidsFile(config, logger) { } } function getBaseDatabaseOidsFilePath(config) { - return path4.join(config.dbLocation, "base-database-oids.json"); + return path5.join(config.dbLocation, "base-database-oids.json"); } async function writeOverlayChangesFile(config, sourceRoot, logger) { const baseFileOids = await readBaseDatabaseOidsFile(config, logger); @@ -85880,7 +91777,7 @@ async function writeOverlayChangesFile(config, sourceRoot, logger) { `Found ${changedFiles.length} changed file(s) under ${sourceRoot}.` ); const changedFilesJson = JSON.stringify({ changes: changedFiles }); - const overlayChangesFile = path4.join( + const overlayChangesFile = path5.join( getTemporaryDirectory(), "overlay-changes.json" ); @@ -85907,7 +91804,7 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { var CACHE_VERSION = 1; var CACHE_PREFIX = "codeql-overlay-base-database"; var MAX_CACHE_OPERATION_MS = 6e5; -function checkOverlayBaseDatabase(config, logger, warningPrefix) { +async function checkOverlayBaseDatabase(codeql, config, logger, warningPrefix) { const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); if (!fs3.existsSync(baseDatabaseOidsFilePath)) { logger.warning( @@ -85915,6 +91812,23 @@ function checkOverlayBaseDatabase(config, logger, warningPrefix) { ); 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 downloadOverlayBaseDatabaseFromCache(codeql, config, logger) { @@ -85996,13 +91910,14 @@ async function downloadOverlayBaseDatabaseFromCache(codeql, config, logger) { logger.info( `Downloaded overlay-base database in cache with key ${foundKey}` ); - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to download overlay-base database from cache: ${error4 instanceof Error ? error4.message : String(error4)}` + `Failed to download overlay-base database from cache: ${error3 instanceof Error ? error3.message : String(error3)}` ); return void 0; } - const databaseIsValid = checkOverlayBaseDatabase( + const databaseIsValid = await checkOverlayBaseDatabase( + codeql, config, logger, "Downloaded overlay-base database is invalid" @@ -86033,13 +91948,9 @@ async function getCacheRestoreKeyPrefix(config, codeQlVersion) { const componentsHash = createCacheKeyHash(cacheKeyComponents); return `${CACHE_PREFIX}-${CACHE_VERSION}-${componentsHash}-${languages}-${codeQlVersion}-`; } -function createCacheKeyHash(components) { - const componentsJson = JSON.stringify(components); - return crypto.createHash("sha256").update(componentsJson).digest("hex").substring(0, 16); -} // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); function isSupportedToolsFeature(versionInfo, feature) { return !!versionInfo.features && versionInfo.features[feature]; } @@ -86054,11 +91965,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -86070,6 +91976,16 @@ var featureConfig = { 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", @@ -86098,12 +92014,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -86204,6 +92114,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -86215,21 +92130,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -86244,7 +92160,7 @@ var Features = class { this.gitHubFeatureFlags = new GitHubFeatureFlags( gitHubVersion, repositoryNwo, - path5.join(tempDir, FEATURE_FLAGS_FILE_NAME), + path6.join(tempDir, FEATURE_FLAGS_FILE_NAME), logger ); } @@ -86343,7 +92259,7 @@ var GitHubFeatureFlags = class { DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length, f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length ).replace(/_/g, "."); - if (!semver4.valid(version)) { + if (!semver5.valid(version)) { this.logger.warning( `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.` ); @@ -86352,15 +92268,15 @@ var GitHubFeatureFlags = class { return version; } async getDefaultCliVersion(variant) { - if (variant === 0 /* DOTCOM */) { - return await this.getDefaultDotcomCliVersion(); + if (supportsFeatureFlags(variant)) { + return await this.getDefaultCliVersionFromFlags(); } return { cliVersion, tagName: bundleVersion }; } - async getDefaultDotcomCliVersion() { + async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( ([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : void 0 @@ -86449,7 +92365,7 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (this.gitHubVersion.type !== 0 /* DOTCOM */ && this.gitHubVersion.type !== 2 /* GHE_DOTCOM */) { + if (!supportsFeatureFlags(this.gitHubVersion.type)) { this.logger.debug( "Not running against github.com. Disabling all toggleable features." ); @@ -86502,6 +92418,9 @@ var GitHubFeatureFlags = class { } } }; +function supportsFeatureFlags(githubVariant) { + return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; +} // src/diff-informed-analysis-utils.ts async function shouldPerformDiffInformedAnalysis(codeql, features, logger) { @@ -86512,7 +92431,7 @@ async function getDiffInformedAnalysisBranches(codeql, features, logger) { return void 0; } const gitHubVersion = await getGitHubVersion(); - if (gitHubVersion.type === 1 /* GHES */ && satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)) { + if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)) { return void 0; } const branches = getPullRequestBranches(); @@ -86541,8 +92460,8 @@ var KnownLanguage = /* @__PURE__ */ ((KnownLanguage2) => { // src/trap-caching.ts var fs5 = __toESM(require("fs")); -var path6 = __toESM(require("path")); -var actionsCache2 = __toESM(require_cache3()); +var path7 = __toESM(require("path")); +var actionsCache2 = __toESM(require_cache4()); var CACHE_VERSION2 = 1; var CODEQL_TRAP_CACHE_PREFIX = "codeql-trap"; var MAX_CACHE_OPERATION_MS2 = 12e4; @@ -86557,12 +92476,12 @@ async function downloadTrapCaches(codeql, languages, logger) { `Found ${languagesSupportingCaching.length} languages that support TRAP caching` ); if (languagesSupportingCaching.length === 0) return result; - const cachesDir = path6.join( + const cachesDir = path7.join( getTemporaryDirectory(), "trapCaches" ); for (const language of languagesSupportingCaching) { - const cacheDir = path6.join(cachesDir, language); + const cacheDir = path7.join(cachesDir, language); fs5.mkdirSync(cacheDir, { recursive: true }); result[language] = cacheDir; } @@ -86575,7 +92494,7 @@ async function downloadTrapCaches(codeql, languages, logger) { let baseSha = "unknown"; const eventPath = process.env.GITHUB_EVENT_PATH; if (getWorkflowEventName() === "pull_request" && eventPath !== void 0) { - const event = JSON.parse(fs5.readFileSync(path6.resolve(eventPath), "utf-8")); + const event = JSON.parse(fs5.readFileSync(path7.resolve(eventPath), "utf-8")); baseSha = event.pull_request?.base?.sha || baseSha; } for (const language of languages) { @@ -86649,10 +92568,12 @@ async function cachePrefix(codeql, language) { } // src/config-utils.ts -async function getSupportedLanguageMap(codeql, features, logger) { - const resolveSupportedLanguagesUsingCli = await features.getValue( - "resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */, - codeql +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; +async function getSupportedLanguageMap(codeql, logger) { + const resolveSupportedLanguagesUsingCli = await codeql.supportsFeature( + "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ ); const resolveResult = await codeql.betterResolveLanguages({ filterToLanguagesWithQueries: resolveSupportedLanguagesUsingCli @@ -86677,7 +92598,7 @@ async function getSupportedLanguageMap(codeql, features, logger) { } var baseWorkflowsPath = ".github/workflows"; function hasActionsWorkflows(sourceRoot) { - const workflowsPath = path7.resolve(sourceRoot, baseWorkflowsPath); + const workflowsPath = path8.resolve(sourceRoot, baseWorkflowsPath); const stats = fs6.lstatSync(workflowsPath, { throwIfNoEntry: false }); return stats !== void 0 && stats.isDirectory() && fs6.readdirSync(workflowsPath).length > 0; } @@ -86700,14 +92621,14 @@ async function getRawLanguagesInRepo(repository, sourceRoot, logger) { logger.debug(`Raw languages in repository: ${result.join(", ")}`); return result; } -async function getLanguages(codeql, languagesInput, repository, sourceRoot, features, logger) { +async function getLanguages(codeql, languagesInput, repository, sourceRoot, logger) { const { rawLanguages, autodetected } = await getRawLanguages( languagesInput, repository, sourceRoot, logger ); - const languageMap = await getSupportedLanguageMap(codeql, features, logger); + const languageMap = await getSupportedLanguageMap(codeql, logger); const languagesSet = /* @__PURE__ */ new Set(); const unknownLanguages = []; for (const language of rawLanguages) { @@ -86773,7 +92694,6 @@ async function initActionState({ languagesInput, repository, sourceRoot, - features, logger ); const buildMode = await parseBuildModeInput( @@ -86825,6 +92745,7 @@ async function initActionState({ trapCaches, trapCacheDownloadTime, dependencyCachingEnabled: getCachingKind(dependencyCachingEnabled), + dependencyCachingRestoredKeys: [], extraQueryExclusions: [], overlayDatabaseMode: "none" /* None */, useOverlayDatabaseCaching: false, @@ -86844,8 +92765,8 @@ async function downloadCacheWithTime(trapCachingEnabled, codeQL, languages, logg async function loadUserConfig(logger, configFile, workspacePath, apiDetails, tempDir, validateConfig) { if (isLocal(configFile)) { if (configFile !== userConfigFromActionPath(tempDir)) { - configFile = path7.resolve(workspacePath, configFile); - if (!(configFile + path7.sep).startsWith(workspacePath + path7.sep)) { + configFile = path8.resolve(workspacePath, configFile); + if (!(configFile + path8.sep).startsWith(workspacePath + path8.sep)) { throw new ConfigurationError( getConfigFileOutsideWorkspaceErrorMessage(configFile) ); @@ -86885,10 +92806,7 @@ var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { rust: "overlay_analysis_code_scanning_rust" /* OverlayAnalysisCodeScanningRust */, swift: "overlay_analysis_code_scanning_swift" /* OverlayAnalysisCodeScanningSwift */ }; -async function isOverlayAnalysisFeatureEnabled(repository, features, codeql, languages, codeScanningConfig) { - if (!["github", "dsp-testing"].includes(repository.owner)) { - return false; - } +async function isOverlayAnalysisFeatureEnabled(features, codeql, languages, codeScanningConfig) { if (!await features.getValue("overlay_analysis" /* OverlayAnalysis */, codeql)) { return false; } @@ -86910,7 +92828,25 @@ async function isOverlayAnalysisFeatureEnabled(repository, features, codeql, lan } return true; } -async function getOverlayDatabaseMode(codeql, repository, features, languages, sourceRoot, buildMode, codeScanningConfig, logger) { +async function runnerSupportsOverlayAnalysis(ramInput, logger) { + const diskUsage = await checkDiskUsage(logger); + if (diskUsage === void 0 || diskUsage.numAvailableBytes < OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES) { + const diskSpaceMb = diskUsage === void 0 ? 0 : Math.round(diskUsage.numAvailableBytes / 1e6); + logger.info( + `Setting overlay database mode to ${"none" /* None */} due to insufficient disk space (${diskSpaceMb} MB).` + ); + return false; + } + 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).` + ); + return false; + } + return true; +} +async function getOverlayDatabaseMode(codeql, features, languages, sourceRoot, buildMode, ramInput, codeScanningConfig, gitVersion, logger) { let overlayDatabaseMode = "none" /* None */; let useOverlayDatabaseCaching = false; const modeEnv = process.env.CODEQL_OVERLAY_DATABASE_MODE; @@ -86920,13 +92856,18 @@ async function getOverlayDatabaseMode(codeql, repository, features, languages, s `Setting overlay database mode to ${overlayDatabaseMode} from the CODEQL_OVERLAY_DATABASE_MODE environment variable.` ); } else if (await isOverlayAnalysisFeatureEnabled( - repository, features, codeql, languages, codeScanningConfig )) { - if (isAnalyzingPullRequest()) { + const performResourceChecks = !await features.getValue( + "overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */, + codeql + ); + if (performResourceChecks && !await runnerSupportsOverlayAnalysis(ramInput, logger)) { + overlayDatabaseMode = "none" /* None */; + } else if (isAnalyzingPullRequest()) { overlayDatabaseMode = "overlay" /* Overlay */; useOverlayDatabaseCaching = true; logger.info( @@ -86973,16 +92914,28 @@ async function getOverlayDatabaseMode(codeql, repository, features, languages, s ); return nonOverlayAnalysis; } + if (gitVersion === void 0) { + logger.warning( + `Cannot build an ${overlayDatabaseMode} database because the Git version could not be determined. Falling back to creating a normal full database instead.` + ); + return nonOverlayAnalysis; + } + if (!gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY)) { + logger.warning( + `Cannot build an ${overlayDatabaseMode} database because the installed Git version is older than ${GIT_MINIMUM_VERSION_FOR_OVERLAY}. Falling back to creating a normal full database instead.` + ); + return nonOverlayAnalysis; + } return { overlayDatabaseMode, useOverlayDatabaseCaching }; } function dbLocationOrDefault(dbLocation, tempDir) { - return dbLocation || path7.resolve(tempDir, "codeql_databases"); + return dbLocation || path8.resolve(tempDir, "codeql_databases"); } function userConfigFromActionPath(tempDir) { - return path7.resolve(tempDir, "user-config-from-action.yml"); + return path8.resolve(tempDir, "user-config-from-action.yml"); } function hasQueryCustomisation(userConfig) { return isDefined(userConfig["disable-default-queries"]) || isDefined(userConfig.queries) || isDefined(userConfig["query-filters"]); @@ -87026,14 +92979,26 @@ async function initConfig(features, inputs) { config.computedConfig.queries = queries; config.computedConfig["query-filters"] = []; } + let gitVersion = void 0; + try { + gitVersion = await getGitVersionOrThrow(); + logger.info(`Using Git version ${gitVersion.fullVersion}`); + await logGitVersionTelemetry(config, gitVersion); + } 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; + } + } const { overlayDatabaseMode, useOverlayDatabaseCaching } = await getOverlayDatabaseMode( inputs.codeql, - inputs.repository, inputs.features, config.languages, inputs.sourceRoot, config.buildMode, + inputs.ramInput, config.computedConfig, + gitVersion, logger ); logger.info( @@ -87122,12 +93087,12 @@ async function getRemoteConfig(logger, configFile, apiDetails, validateConfig) { ); } function getPathToParsedConfigFile(tempDir) { - return path7.join(tempDir, "config"); + return path8.join(tempDir, "config"); } async function saveConfig(config, logger) { const configString = JSON.stringify(config); const configFile = getPathToParsedConfigFile(config.tempDir); - fs6.mkdirSync(path7.dirname(configFile), { recursive: true }); + fs6.mkdirSync(path8.dirname(configFile), { recursive: true }); fs6.writeFileSync(configFile, configString, "utf8"); logger.debug("Saved config:"); logger.debug(configString); @@ -87138,7 +93103,7 @@ async function generateRegistries(registriesInput, tempDir, logger) { let qlconfigFile; if (registries) { const qlconfig = createRegistriesBlock(registries); - qlconfigFile = path7.join(tempDir, "qlconfig.yml"); + qlconfigFile = path8.join(tempDir, "qlconfig.yml"); const qlconfigContents = dump(qlconfig); fs6.writeFileSync(qlconfigFile, qlconfigContents, "utf8"); logger.debug("Generated qlconfig.yml:"); @@ -87236,79 +93201,148 @@ function appendExtraQueryExclusions(extraQueryExclusions, cliConfig) { function isCodeQualityEnabled(config) { return config.analysisKinds.includes("code-quality" /* CodeQuality */); } +async function logGitVersionTelemetry(config, gitVersion) { + if (config.languages.length > 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], + makeTelemetryDiagnostic( + "codeql-action/git-version-telemetry", + "Git version telemetry", + { + fullVersion: gitVersion.fullVersion, + truncatedVersion: gitVersion.truncatedVersion + } + ) + ); + } +} // src/dependency-caching.ts var os2 = __toESM(require("os")); -var import_path = require("path"); -var actionsCache3 = __toESM(require_cache3()); -var glob = __toESM(require_glob2()); +var import_path2 = require("path"); +var actionsCache3 = __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_path.join)(getTemporaryDirectory(), "codeql_java", "repository"); + return (0, import_path2.join)(getTemporaryDirectory(), "codeql_java", "repository"); } -function getDefaultCacheConfig() { - return { - java: { - paths: [ - // Maven - (0, import_path.join)(os2.homedir(), ".m2", "repository"), - // Gradle - (0, import_path.join)(os2.homedir(), ".gradle", "caches"), - // CodeQL Java build-mode: none - getJavaTempDependencyDir() - ], - hash: [ - // Maven - "**/pom.xml", - // Gradle - "**/*.gradle*", - "**/gradle-wrapper.properties", - "buildSrc/**/Versions.kt", - "buildSrc/**/Dependencies.kt", - "gradle/*.versions.toml", - "**/versions.properties" - ] - }, - csharp: { - paths: [(0, import_path.join)(os2.homedir(), ".nuget", "packages")], - hash: [ - // NuGet - "**/packages.lock.json", - // Paket - "**/paket.lock" - ] - }, - go: { - paths: [(0, import_path.join)(os2.homedir(), "go", "pkg", "mod")], - hash: ["**/go.sum"] - } - }; +async function getJavaDependencyDirs() { + return [ + // Maven + (0, import_path2.join)(os2.homedir(), ".m2", "repository"), + // Gradle + (0, import_path2.join)(os2.homedir(), ".gradle", "caches"), + // CodeQL Java build-mode: none + getJavaTempDependencyDir() + ]; +} +function getCsharpTempDependencyDir() { + return (0, import_path2.join)(getTemporaryDirectory(), "codeql_csharp", "repository"); } +async function getCsharpDependencyDirs(codeql, features) { + const dirs = [ + // Nuget + (0, import_path2.join)(os2.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_path2.join)(os2.homedir(), "go", "pkg", "mod")], + getHashPatterns: async () => internal.makePatternCheck(["**/go.sum"]) + } +}; async function makeGlobber(patterns) { return glob.create(patterns.join("\n")); } -async function downloadDependencyCaches(languages, logger, minimizeJavaJars) { +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 = getDefaultCacheConfig()[language]; + 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 globber = await makeGlobber(cacheConfig.hash); - if ((await globber.glob()).length === 0) { + const patterns = await checkHashPatterns( + codeql, + features, + language, + cacheConfig, + "download", + logger + ); + if (patterns === void 0) { status.push({ language, hit_kind: "no-hash" /* NoHash */ }); - logger.info( - `Skipping download of dependency cache for ${language} as we cannot calculate a hash for the cache key.` - ); continue; } - const primaryKey = await cacheKey2(language, cacheConfig, minimizeJavaJars); + const primaryKey = await cacheKey2(codeql, features, language, patterns); const restoreKeys = [ - await cachePrefix2(language, minimizeJavaJars) + await cachePrefix2(codeql, features, language) ]; logger.info( `Downloading cache for ${language} with key ${primaryKey} and restore keys ${restoreKeys.join( @@ -87317,111 +93351,69 @@ async function downloadDependencyCaches(languages, logger, minimizeJavaJars) { ); const start = performance.now(); const hitKey = await actionsCache3.restoreCache( - cacheConfig.paths, + 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}.`); - const hit_kind = hitKey === primaryKey ? "exact" /* Exact */ : "partial" /* Partial */; - status.push({ language, hit_kind, download_duration_ms }); + 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 status; + return { statusReport: status, restoredKeys }; +} +async function cacheKey2(codeql, features, language, patterns) { + const hash = await glob.hashFiles(patterns.join("\n")); + return `${await cachePrefix2(codeql, features, language)}${hash}`; } -async function cacheKey2(language, cacheConfig, minimizeJavaJars = false) { - const hash = await glob.hashFiles(cacheConfig.hash.join("\n")); - return `${await cachePrefix2(language, minimizeJavaJars)}${hash}`; +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(language, minimizeJavaJars) { +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}`; } - if (language === "java" /* java */ && minimizeJavaJars) { - prefix = `minify-${prefix}`; - } - return `${prefix}-${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`; -} - -// src/diagnostics.ts -var import_fs = require("fs"); -var import_path2 = __toESM(require("path")); -var unwrittenDiagnostics = []; -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 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 jsonPath = import_path2.default.resolve( - diagnosticsPath, - // Remove colons from the timestamp as these are not allowed in Windows filenames. - `codeql-action-${diagnostic.timestamp.replaceAll(":", "")}.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(); - logger.debug( - `Writing ${unwrittenDiagnostics.length} diagnostic(s) to database.` - ); - for (const unwritten of unwrittenDiagnostics) { - writeDiagnostic(config, unwritten.language, unwritten.diagnostic); - } - unwrittenDiagnostics = []; + const featurePrefix = await getFeaturePrefix(codeql, features, language); + return `${prefix}-${featurePrefix}${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${language}-`; } +var internal = { + makePatternCheck +}; // src/init.ts var fs12 = __toESM(require("fs")); var path13 = __toESM(require("path")); var toolrunner4 = __toESM(require_toolrunner()); -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); // src/codeql.ts var fs11 = __toESM(require("fs")); @@ -87459,19 +93451,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -87487,9 +93479,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -87674,16 +93666,16 @@ var fs9 = __toESM(require("fs")); var path10 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // src/tar.ts var import_child_process = require("child_process"); var fs7 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; async function getTarVersion() { @@ -87725,9 +93717,9 @@ async function isZstdAvailable(logger) { case "gnu": return { available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver5.gte( - semver5.coerce(version), - semver5.coerce(MIN_REQUIRED_GNU_TAR_VERSION) + semver6.gte( + semver6.coerce(version), + semver6.coerce(MIN_REQUIRED_GNU_TAR_VERSION) ), foundZstdBinary, version: tarVersion @@ -87736,7 +93728,7 @@ async function isZstdAvailable(logger) { return { available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain // a patch version number. - semver5.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), + semver6.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), foundZstdBinary, version: tarVersion }; @@ -87840,10 +93832,10 @@ var os3 = __toESM(require("os")); var path9 = __toESM(require("path")); var import_perf_hooks2 = require("perf_hooks"); var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; var TOOLCACHE_TOOL_NAME = "CodeQL"; function makeDownloadFirstToolsDownloadDurations(downloadDurationMs, extractionDurationMs) { @@ -87973,7 +93965,7 @@ function getToolcacheDirectory(version) { return path9.join( getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, - semver6.clean(version) || version, + semver7.clean(version) || version, os3.arch() || "" ); } @@ -88098,13 +94090,13 @@ function tryGetTagNameFromUrl(url, logger) { return match[1]; } function convertToSemVer(version, logger) { - if (!semver7.valid(version)) { + if (!semver8.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 = semver7.clean(version); + const s = semver8.clean(version); if (!s) { throw new Error(`Bundle version ${version} is not in SemVer format.`); } @@ -88212,7 +94204,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian url = toolsInput; if (tagName) { const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver7.valid(bundleVersion3)) { + if (bundleVersion3 && semver8.valid(bundleVersion3)) { cliVersion2 = convertToSemVer(bundleVersion3, logger); } } @@ -88295,7 +94287,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: cliVersion2 ?? humanReadableVersion }; } - if (variant !== 0 /* DOTCOM */ && !forceShippedTools && !toolsInput) { + if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { const result = await findOverridingToolsInCache( humanReadableVersion, logger @@ -88483,7 +94475,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau async function useZstdBundle(cliVersion2, tarSupportsZstd) { return ( // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver7.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) + process.platform !== "win32" && tarSupportsZstd && semver8.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) ); } function getTempExtractionDir(tempDir) { @@ -88515,7 +94507,7 @@ async function getNightlyToolsUrl(logger) { } } function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver7.compare(b, a)); + const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver8.compare(b, a)); logger.debug( `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( allVersions @@ -89020,6 +95012,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -89320,9 +95329,9 @@ function isFirstPartyAnalysis(actionName) { } return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; } -function getActionsStatus(error4, otherFailureCause) { - if (error4 || otherFailureCause) { - return error4 instanceof ConfigurationError ? "user-error" : "failure"; +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; } else { return "success"; } @@ -89712,7 +95721,7 @@ async function getWorkflowAbsolutePath(logger) { async function checkWorkflow(logger, codeql) { if (!isDynamicWorkflow() && process.env["CODEQL_ACTION_SKIP_WORKFLOW_VALIDATION" /* SKIP_WORKFLOW_VALIDATION */] !== "true") { core12.startGroup("Validating workflow"); - const validateWorkflowResult = await internal.validateWorkflow( + const validateWorkflowResult = await internal2.validateWorkflow( codeql, logger ); @@ -89726,11 +95735,12 @@ async function checkWorkflow(logger, codeql) { core12.endGroup(); } } -var internal = { +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 */, @@ -89744,16 +95754,16 @@ async function sendStartingStatusReport(startedAt, config, logger) { await sendStatusReport(statusReportBase); } } -async function sendCompletedStatusReport(startedAt, config, configFile, toolsDownloadStatusReport, toolsFeatureFlagsValid, toolsSource, toolsVersion, overlayBaseDatabaseStats, dependencyCachingResults, logger, error4) { +async function sendCompletedStatusReport(startedAt, config, configFile, toolsDownloadStatusReport, toolsFeatureFlagsValid, toolsSource, toolsVersion, overlayBaseDatabaseStats, dependencyCachingResults, logger, error3) { const statusReportBase = await createStatusReportBase( "init" /* Init */, - getActionsStatus(error4), + getActionsStatus(error3), startedAt, config, await checkDiskUsage(logger), logger, - error4?.message, - error4?.stack + error3?.message, + error3?.stack ); if (statusReportBase === void 0) { return; @@ -89875,12 +95885,12 @@ async function run() { const experimental = "2.19.3"; const publicPreview = "2.22.1"; const actualVer = (await codeql.getVersion()).version; - if (semver8.lt(actualVer, experimental)) { + if (semver9.lt(actualVer, experimental)) { throw new ConfigurationError( `Rust analysis is supported by CodeQL CLI version ${experimental} or higher, but found version ${actualVer}` ); } - if (semver8.lt(actualVer, publicPreview)) { + if (semver9.lt(actualVer, publicPreview)) { core13.exportVariable("CODEQL_ENABLE_EXPERIMENTAL_FEATURES" /* EXPERIMENTAL_FEATURES */, "true"); logger.info("Experimental Rust analysis enabled"); } @@ -89892,6 +95902,7 @@ async function run() { queriesInput: getOptionalInput("queries"), packsInput: getOptionalInput("packs"), buildModeInput: getOptionalInput("build-mode"), + ramInput: getOptionalInput("ram"), configFile, dbLocation: getOptionalInput("db-location"), configInput: getOptionalInput("config"), @@ -89917,17 +95928,17 @@ async function run() { }); await checkInstallPython311(config.languages, codeql); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); - core13.setFailed(error4.message); + const error3 = wrapError(unwrappedError); + core13.setFailed(error3.message); const statusReportBase = await createStatusReportBase( "init" /* Init */, - error4 instanceof ConfigurationError ? "user-error" : "aborted", + error3 instanceof ConfigurationError ? "user-error" : "aborted", startedAt, config, await checkDiskUsage(logger), logger, - error4.message, - error4.stack + error3.message, + error3.stack ); if (statusReportBase !== void 0) { await sendStatusReport(statusReportBase); @@ -89935,7 +95946,7 @@ async function run() { return; } let overlayBaseDatabaseStats; - let dependencyCachingResults; + let dependencyCachingStatus; try { if (config.overlayDatabaseMode === "overlay" /* Overlay */ && config.useOverlayDatabaseCaching) { overlayBaseDatabaseStats = await downloadOverlayBaseDatabaseFromCache( @@ -89962,17 +95973,10 @@ async function run() { // Arbitrarily choose the first language. We could also choose all languages, but that // increases the risk of misinterpreting the data. config.languages[0], - makeDiagnostic( + makeTelemetryDiagnostic( "codeql-action/bundle-download-telemetry", "CodeQL bundle download telemetry", - { - attributes: toolsDownloadStatusReport, - visibility: { - cliSummaryTable: false, - statusPage: false, - telemetry: true - } - } + toolsDownloadStatusReport ) ); } @@ -90048,7 +96052,7 @@ exec ${goBinaryPath} "$@"` } core13.exportVariable( "CODEQL_RAM", - process.env["CODEQL_RAM"] || getMemoryFlagValue(getOptionalInput("ram"), logger).toString() + process.env["CODEQL_RAM"] || getCodeQLMemoryLimit(getOptionalInput("ram"), logger).toString() ); core13.exportVariable( "CODEQL_THREADS", @@ -90075,16 +96079,15 @@ exec ${goBinaryPath} "$@"` core13.exportVariable(envVar, "false"); } } - const minimizeJavaJars = await features.getValue( - "java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */, - codeql - ); if (shouldRestoreCache(config.dependencyCachingEnabled)) { - dependencyCachingResults = await downloadDependencyCaches( + const dependencyCachingResult = await downloadDependencyCaches( + codeql, + features, config.languages, - logger, - minimizeJavaJars + logger ); + dependencyCachingStatus = dependencyCachingResult.statusReport; + config.dependencyCachingRestoredKeys = dependencyCachingResult.restoredKeys; } if (await codeQlVersionAtLeast(codeql, "2.17.1")) { } else { @@ -90121,7 +96124,7 @@ exec ${goBinaryPath} "$@"` 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 (minimizeJavaJars && config.dependencyCachingEnabled && config.buildMode === "none" /* None */ && config.languages.includes("java" /* java */)) { + } else if (await codeQlVersionAtLeast(codeql, CODEQL_VERSION_JAR_MINIMIZATION) && config.dependencyCachingEnabled && config.buildMode === "none" /* None */ && config.languages.includes("java" /* java */)) { core13.exportVariable( "CODEQL_EXTRACTOR_JAVA_OPTION_MINIMIZE_DEPENDENCY_JARS" /* JAVA_EXTRACTOR_MINIMIZE_DEPENDENCY_JARS */, "true" @@ -90173,8 +96176,8 @@ exec ${goBinaryPath} "$@"` core13.setOutput("codeql-path", config.codeQLCmd); core13.setOutput("codeql-version", (await codeql.getVersion()).version); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); - core13.setFailed(error4.message); + const error3 = wrapError(unwrappedError); + core13.setFailed(error3.message); await sendCompletedStatusReport( startedAt, config, @@ -90185,9 +96188,9 @@ exec ${goBinaryPath} "$@"` toolsSource, toolsVersion, overlayBaseDatabaseStats, - dependencyCachingResults, + dependencyCachingStatus, logger, - error4 + error3 ); return; } finally { @@ -90203,7 +96206,7 @@ exec ${goBinaryPath} "$@"` toolsSource, toolsVersion, overlayBaseDatabaseStats, - dependencyCachingResults, + dependencyCachingStatus, logger ); } @@ -90219,29 +96222,26 @@ async function recordZstdAvailability(config, zstdAvailability) { // Arbitrarily choose the first language. We could also choose all languages, but that // increases the risk of misinterpreting the data. config.languages[0], - makeDiagnostic( + makeTelemetryDiagnostic( "codeql-action/zstd-availability", "Zstandard availability", - { - attributes: zstdAvailability, - visibility: { - cliSummaryTable: false, - statusPage: false, - telemetry: true - } - } + zstdAvailability ) ); } async function runWrapper() { try { await run(); - } catch (error4) { - core13.setFailed(`init action failed: ${getErrorMessage(error4)}`); + } catch (error3) { + core13.setFailed(`init action failed: ${getErrorMessage(error3)}`); } await checkForTimeout(); } void runWrapper(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + CODEQL_VERSION_JAR_MINIMIZATION +}); /*! Bundled license information: undici/lib/fetch/body.js: @@ -90251,5 +96251,5 @@ undici/lib/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) */ diff --git a/lib/resolve-environment-action.js b/lib/resolve-environment-action.js index 026a624249..054b7880c1 100644 --- a/lib/resolve-environment-action.js +++ b/lib/resolve-environment-action.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os2 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os2 = __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() + os2.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs5 = __importStar4(require("fs")); - var os2 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs5 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug5("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay: delay2, persist } = mockDispatch2; + 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 (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve4({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve4, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path5 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path5 = __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, path5.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs5 = __importStar4(require("fs")); - var path5 = __importStar4(require("path")); - _a = fs5.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs5 = __importStar2(require("fs")); + var path5 = __importStar2(require("path")); + _a = fs5.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs5.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs5.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path5.dirname(filePath); const upperName = path5.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path5.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which5; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path5 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path5 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which5(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which5; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os2 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path5 = __importStar4(require("path")); - var io5 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path5 = __importStar2(require("path")); + var io5 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner5 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path5.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io5.which(this.toolPath, true); - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve4(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + exports2.exec = exec; + exports2.getExecOutput = getExecOutput; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner()); + function exec(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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 exec = __importStar2(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 = exportVariable5; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput2; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug5; + exports2.error = error3; + exports2.warning = warning9; + exports2.notice = notice; + exports2.info = info6; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os2 = __importStar4(require("os")); - var path5 = __importStar4(require("path")); + var os2 = __importStar2(require("os")); + var path5 = __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 exportVariable5(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable5(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable5; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19681,18 +19872,16 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path5.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,19 +19889,17 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput2(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { @@ -19721,50 +19908,39 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.stdout.write(os2.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput2; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug5(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug5; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning8(message, properties = {}) { + function warning9(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning8; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info6(message) { process.stdout.write(message + os2.EOL); } - exports2.info = info6; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve4, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter4(this, void 0, void 0, function* () { + const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,532 +25406,74 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs5 = __importStar4(require("fs")); - var path5 = __importStar4(require("path")); - _a = fs5.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs5.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs5.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path5.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 = path5.dirname(filePath); - const upperName = path5.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path5.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 = which5; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path5 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path5.join(dest, path5.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 (path5.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path5.join(dest, path5.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(path5.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which5(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which5(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 __awaiter4(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(path5.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(path5.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path5.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path5.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug5; - } -}); - -// 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 debug5 = 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}}`); + var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug5; + } +}); + +// 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 debug5 = 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; }; @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare2 = require_compare(); - var gte5 = (a, b, loose) => compare2(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare2(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises2)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run2, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } } doExpire(clearGlobalState, run2, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run2, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run2, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve4, returned, task; + var args, cb, error3, reject, resolve4, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve4, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve4(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info6) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info6) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29565,8 +29279,8 @@ var require_helpers = __commonJS({ } return decimalPlaces; }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; }; } }); @@ -30548,1424 +30262,1097 @@ var require_lib3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core13 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core13.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core13.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core13.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path5 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname2(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs5 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path5.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs5.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs5.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname2; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path5.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path5.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path5.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __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", () => { + resolve4(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve4(Buffer.concat(chunks)); + }); + })); + }); + } }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var 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 expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path5 = (function() { - try { - return require("path"); - } catch (e) { + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path5.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + /** + * 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); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path5.sep !== "/") { - pattern = pattern.split(path5.sep).join("/"); + 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); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + 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); + }); } - if (!pattern) { - this.empty = true; - return; + 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); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug5() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = 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++) { - negate = !negate; - negateOffset++; + /** + * 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve4(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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(); + } } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + /** + * 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); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; } + return info6; } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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; } - 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; - } - 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve4) => setTimeout(() => resolve4(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve4(response); } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } - var cs = pattern.substring(classStart + 1, i); + let obj; + let contents; 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; + 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) { } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + 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 { + resolve4(response); } - 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]; + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/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(resolve4) { + resolve4(value); + }); } - 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(_, $1, $2) { - if (!$2) { - $2 = "\\"; + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve4(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; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - 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 = "$"; + 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"); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + options.headers["Authorization"] = `Bearer ${this.token}`; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - if (addPatternStart) { - re = patternStart + re; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - if (!hasMagic) { - return globUnescape(pattern); + // 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")}`; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path5.sep !== "/") { - f = f.split(path5.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - 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] === ""; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - throw new Error("wtf?"); }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path5 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path5.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path5.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path5.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path5.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path5.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os2 = __importStar4(require("os")); - var path5 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path5.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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path5.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path5.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; + 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 internal_match_kind_1.MatchKind.None; + return token; } - /** - * 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); + 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 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, "[*]"); + return runtimeUrl; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path5.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path5.sep}`)) { - homedir = homedir || os2.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path5, level) { - this.path = path5; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -31992,263 +31379,323 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); - }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ value: v2, done: d }); - }, reject); + 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 = ""; } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + /** + * 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}`; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * 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(); + }); } - function fulfill(value) { - resume("next", value); + /** + * 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 }); + }); } - function reject(value) { - resume("throw", value); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core13 = __importStar4(require_core()); - var fs5 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path5 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - globGenerator() { - return __asyncGenerator4(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)) { - core13.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs5.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs5.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path5.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; - }); + 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(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs5.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core13.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 fs5.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs5.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core13.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + /** + * 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); } - traversalChain.push(realPath); - } - return stats; - }); + 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path5 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.create = create; + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path5.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32257,21 +31704,21 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -32301,14 +31748,14 @@ var require_io_util3 = __commonJS({ var _a; 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 fs5 = __importStar4(require("fs")); - var path5 = __importStar4(require("path")); + var fs5 = __importStar2(require("fs")); + var path5 = __importStar2(require("path")); _a = fs5.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs5.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -32322,7 +31769,7 @@ var require_io_util3 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -32340,7 +31787,7 @@ var require_io_util3 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -32417,11 +31864,11 @@ var require_io_util3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32430,21 +31877,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -32474,10 +31921,10 @@ var require_io3 = __commonJS({ 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 path5 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); + var path5 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -32504,7 +31951,7 @@ var require_io3 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -32525,7 +31972,7 @@ var require_io3 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -32545,14 +31992,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which5(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32576,7 +32023,7 @@ var require_io3 = __commonJS({ } exports2.which = which5; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32624,7 +32071,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -32644,7 +32091,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -32665,1200 +32112,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug5; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug5 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug5 = 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 + "}"); +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - 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++) { - debug5(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; + __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(resolve4) { + resolve4(value); + }); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path5 = __importStar2(require("path")); + var io5 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + _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 { - version = version.version; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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); - } - debug5("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"); + return cmd; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - 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; + _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 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) { - debug5("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 this.args; } - 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug5("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); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } 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]; - debug5("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); + if (!arg) { + return '""'; } - } 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++; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - 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]; + } + 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 { - 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]; - } + quoteHit = false; } - 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; + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.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 = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(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 = rcompare; - function rcompare(a, b, loose) { - return compare2(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 compare2(a, b, loose) > 0; - } - exports2.lt = lt; - function lt(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports2.gte = gte5; - function gte5(a, b, loose) { - return compare2(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(a, b, loose) { - return compare2(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + 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(""); } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _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; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug5("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; - } - debug5("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); + /** + * 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 = path5.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io5.which(this.toolPath, true); + return new Promise((resolve4, 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) + os2.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 { + resolve4(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug5("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; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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; }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug5("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); }); } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - 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(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug5("comp", comp, options); - comp = replaceCarets(comp, options); - debug5("caret", comp); - comp = replaceTildes(comp, options); - debug5("tildes", comp); - comp = replaceXRanges(comp, options); - debug5("xrange", comp); - comp = replaceStars(comp, options); - debug5("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(_, M, m, p, pr) { - debug5("tilde", comp, _, 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) { - debug5("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + 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 exec(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.`); } - debug5("tilde return", ret); - return ret; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug5("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug5("caret", comp, _, 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) { - debug5("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"; + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } else { - debug5("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"; + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - debug5("caret return", ret); - return ret; + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; }); } - function replaceXRanges(comp, options) { - debug5("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) { - debug5("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; } - debug5("xRange return", ret); - return ret; + function step(result) { + result.done ? resolve4(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 exec = __importStar2(require_exec2()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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 + }); }); } - function replaceStars(comp, options) { - debug5("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; - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + 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); } - return false; + __setModuleDefault2(result, mod); + return result; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug5(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve4(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_utils5(); + var os2 = __importStar2(require("os")); + var path5 = __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 exportVariable5(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable5; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path5.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; + return inputs.map((input) => input.trim()); } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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 && range.test(minver)) { - return minver; - } - return null; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(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.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); + exports2.getState = getState2; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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/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]; + } }; } - if (satisfies2(version, range, options)) { - return false; + 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); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core13 = __importStar2(require_core2()); + 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; + core13.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core13.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core13.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core13.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core13.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + return result; } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path5 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname2(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + let result = path5.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname2; + 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)}`; } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } 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)}`; } - safeRe[t.COERCERTL].lastIndex = -1; } - if (match === null) { - return null; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path5.sep; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path5.sep)) { + return p; + } + if (p === path5.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -33871,313 +33289,871 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); - }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ value: v2, done: d }); - }, reject); } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core13 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob = __importStar4(require_glob()); - var io5 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs5 = __importStar4(require("fs")); - var path5 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path5.join(baseLocation, "actions", "temp"); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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); } - const dest = path5.join(tempDirectory, crypto.randomUUID()); - yield io5.mkdirP(dest); - return dest; - }); + } + return result; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs5.statSync(filePath).size; + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const paths = []; - const workspace = (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const globber = yield glob.create(patterns.join("\n"), { - implicitDescendants: false - }); - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path5.relative(workspace, file).replace(new RegExp(`\\${path5.sep}`, "g"), "/"); - core13.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; + }; + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs5.unlink)(filePath); - }); + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core13.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - }); - } catch (err) { - core13.debug(err.message); + bi = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - versionOutput = versionOutput.trim(); - core13.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core13.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + if (begs.length) { + result = [left, right]; } - }); + } + return result; } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs5.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io5.which("tar") : ""; - }); + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + parts.push.apply(parts, p); + return parts; } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - return token; + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } else { - return void 0; + N = concatMap(n, function(el) { + return expand(el, false); + }); + } + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } + return expansions; } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path5 = (function() { + try { + return require("path"); + } catch (e) { } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + })() || { + sep: "/" + }; + minimatch.sep = path5.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { 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}`); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - 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; - } + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path5.sep !== "/") { + pattern = pattern.split(path5.sep).join("/"); } - 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]"); + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern = this.pattern; + var options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; } - get username() { - return this._decodedUsername; + if (!pattern) { + this.empty = true; + return; } - get password() { - return this._decodedPassword; + this.parseNegate(); + var set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug5() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = 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++) { + negate = !negate; + negateOffset++; } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); }; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + 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 && reSpecials[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; + } + 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 (reSpecials[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(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = 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 (addPatternStart) { + 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; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path5.sep !== "/") { + f = f.split(path5.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + 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 regExpEscape(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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -34190,613 +34166,615 @@ var require_lib4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 path5 = __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(path5.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path5.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); + } + this.segments.unshift(remaining); } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + } 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(path5.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } } } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path5.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path5.sep; + } + result += this.segments[i]; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 || 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.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(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", () => { - resolve4(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve4(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(userAgent, 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 = userAgent; - 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; + exports2.Pattern = void 0; + var os2 = __importStar2(require("os")); + var path5 = __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, homedir) { + 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}`; } } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path5.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); } /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + * Matches the pattern against the specified path */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(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 __awaiter4(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); - }); + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path5.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path5.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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * Escapes glob patterns within a path + */ + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * Normalizes slashes and ensures absolute root */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + static fixupPattern(pattern, homedir) { + (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(`.${path5.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path5.sep}`)) { + homedir = homedir || os2.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 += "\\"; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, data); + 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; } else { - return response; + set2 += c2; } } - 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."); + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + if (set2) { + literal += set2; + i = closed; + continue; } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + } + literal += c; } - this._disposed = true; + return literal; } /** - * Raw request. - * @param info - * @param data + * Escapes regexp special characters + * https://javascript.info/regexp-escaping */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve4(res); - } - } - this.requestRawWithCallback(info6, data, callbackForResult); - }); + 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(path5, level) { + this.path = path5; + 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 || 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(resolve4) { + resolve4(value); }); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - const req = info6.httpModule.request(info6.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(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - handleResult(new Error(`Request timeout: ${info6.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(); + function step(result) { + result.done ? resolve4(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(resolve4, reject) { + v = o[n](v), settle(resolve4, reject, v.done, v.value); + }); + }; } - /** - * 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); + function settle(resolve4, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve4({ value: v2, done: d }); + }, reject); } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } - } - return info6; + }; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - return lowercaseKeys(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + function fulfill(value) { + resume("next", value); } - _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; + function reject(value) { + resume("throw", value); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); + 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 core13 = __importStar2(require_core2()); + var fs5 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path5 = __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() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } + } + return result; }); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve4(response); + 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("**"))); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + } + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core13.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs5.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } - return value; + throw err; } - let obj; - let contents; + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !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 && path5.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & 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(fs5.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path5.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & 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 { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); + stats = yield fs5.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core13.debug(`Broken symlink '${item.path}'`); + return void 0; } - response.result = obj; + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); } - response.headers = res.message.headers; - } catch (err) { + throw 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 { - resolve4(response); + } else { + stats = yield fs5.promises.lstat(item.path); + } + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs5.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); } - })); + if (traversalChain.some((x) => x === realPath)) { + core13.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -34823,4390 +34801,3087 @@ var require_auth2 = __commonJS({ 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; + 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(resolve4, reject) { + v = o[n](v), settle(resolve4, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve4, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve4({ value: v2, done: d }); + }, reject); } }; - 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"); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core13 = __importStar2(require_core2()); + var fs5 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path5 = __importStar2(require("path")); + function hashFiles(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core13.info : core13.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path5.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs5.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs5.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; + } } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + result.end(); + if (hasMatch) { + writeDelegate(`Found ${count} files to hash.`); + return result.digest("hex"); + } else { + writeDelegate(`No matches found for glob`); + return ""; } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + }); + } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - addPolicy(policy, options = {}) { - if (options.phase && options.afterPhase) { - throw new Error("Policies inside a phase cannot specify afterPhase."); + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (options.phase && !ValidPhaseNames.has(options.phase)) { - throw new Error(`Invalid phase name: ${options.phase}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { - throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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; - } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - function createEmptyPipeline() { - return HttpPipeline.create(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = exports2.create = void 0; + var internal_globber_1 = require_internal_globber(); + var internal_hash_files_1 = require_internal_hash_files(); + function create(patterns, options) { + return __awaiter2(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); + } + exports2.create = create; + function hashFiles(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create(patterns, { followSymbolicLinks }); + return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); + }); } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os2 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os2.EOL}`); +// 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 debug5; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug5 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug5 = function() { + }; } - var debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; - var enabledString; - var enabledNamespaces = []; - var skippedNamespaces = []; - var debuggers = []; - if (debugEnvVariable) { - enable(debugEnvVariable); + 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 debugObj = Object.assign((namespace) => { - return createDebugger(namespace); - }, { - enable, - enabled, - disable, - log - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } + 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 + "}"); } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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++) { + debug5(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); } } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + if (version instanceof SemVer) { + return version; } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; - } + if (typeof version !== "string") { + return null; } - return false; - } - 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: extend3 - }); - function debug6(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); + if (version.length > MAX_LENGTH) { + return null; } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; + 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; } - return false; } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - var debug5 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug5("azure"); - AzureLogger.log = (...args) => { - debug5.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); + 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); } - debug5.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); + } + if (!(this instanceof SemVer)) { + return new SemVer(version, options); + } + debug5("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(); } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 + SemVer.prototype.format = function() { + this.version = this.major + "." + this.minor + "." + this.patch; + if (this.prerelease.length) { + this.version += "-" + this.prerelease.join("."); + } + return this.version; }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug5.disable(); - debug5.enable(enabledNamespaces2 + "," + logger.namespace); + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug5("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __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"; + 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); }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve4, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); + 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]; + debug5("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); } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + } 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]; + debug5("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); } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + } 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 = parse(version1); + var v2 = parse(version2); + var prefix = ""; + if (v1.prerelease.length || v2.prerelease.length) { + prefix = "pre"; + var defaultResult = "prerelease"; } - try { - buildPromise((x) => { - removeListeners(); - resolve4(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + for (var key in v1) { + if (key === "major" || key === "minor" || key === "patch") { + if (v1[key] !== v2[key]) { + return prefix + key; + } + } } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); + return defaultResult; + } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/delay.js -var require_delay = __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 random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve4) => { - token = setTimeout(resolve4, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage - }); + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - 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 }; + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } -}); - -// 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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + exports2.compare = compare2; + function compare2(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - function getErrorMessage2(e) { - if (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}`; - } + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare2(a, b, true); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + 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); } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare2(b, a, loose); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; + exports2.gt = gt; + function gt(a, b, loose) { + return compare2(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID() { - return uuidFunction(); + exports2.lt = lt; + function lt(a, b, loose) { + return compare2(a, b, loose) < 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.eq = eq; + function eq(a, b, loose) { + return compare2(a, b, loose) === 0; } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); + exports2.neq = neq; + function neq(a, b, loose) { + return compare2(a, b, loose) !== 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare2(a, b, loose) >= 0; + } + exports2.lte = lte; + function lte(a, b, loose) { + return compare2(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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); + } + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url = new URL(value); - if (!url.search) { - return value; - } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); - } + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - return url.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; + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - 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; + comp = comp.trim().split(/\s+/).join(" "); + debug5("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; + } + debug5("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); } }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug5("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; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); + } + 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; } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; + rangeTmp = new Range2(comp.value, options); + return satisfies2(this.value, rangeTmp, options); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + rangeTmp = new Range2(this.value, options); + return satisfies2(comp.semver, rangeTmp, options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); + 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; }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - 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(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + exports2.Range = Range2; + function Range2(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); + } } + if (range instanceof Comparator) { + return new Range2(range.value, options); + } + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { 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]); + Range2.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(" ").trim(); + }).join("||").trim(); + return this.range; }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } 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 (error4) { - e = { error: error4 }; - } 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); + Range2.prototype.toString = function() { + return this.range; }; - } - 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); + Range2.prototype.parseRange = function(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug5("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); }); - }; - 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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); - }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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); } + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; }; - 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); + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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); + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { + return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); }; - __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]; - } }; + 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(); } - 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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os2 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + return result; } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os2.arch()}-${os2.type()}-${os2.release()})`); + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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 parseComparator(comp, options) { + debug5("comp", comp, options); + comp = replaceCarets(comp, options); + debug5("caret", comp); + comp = replaceTildes(comp, options); + debug5("tildes", comp); + comp = replaceXRanges(comp, options); + debug5("xrange", comp); + comp = replaceStars(comp, options); + debug5("stars", comp); + return comp; } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + function isX(id) { + return !id || id.toLowerCase() === "x" || id === "*"; } - 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; + function replaceTildes(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceTilde(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); + function replaceTilde(comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("tilde", comp, _, 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) { + debug5("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - 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"); + debug5("tilde return", ret); + return ret; + }); } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); } - function isBlob(x) { - return typeof x.stream === "function"; - } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; - } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); - } - } - function createFileFromStream(stream, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + function replaceCaret(comp, options) { + debug5("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("caret", comp, _, 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) { + debug5("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 { + debug5("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"; + } } - return s; - }, [rawContent]: stream }); + debug5("caret return", ret); + return ret; + }); } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); - } + function replaceXRanges(comp, options) { + debug5("replaceXRanges", comp, options); + return comp.split(/\s+/).map(function(comp2) { + return replaceXRange(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); + 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) { + debug5("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; } - yield yield tslib_1.__await(value); } - } finally { - reader.releaseLock(); + 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; } + debug5("xRange return", ret); + return ret; }); } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } + function replaceStars(comp, options) { + debug5("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - function ensureNodeStream(stream) { - if (stream instanceof ReadableStream) { - makeAsyncIterable(stream); - return node_stream_1.Readable.fromWeb(stream); + 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 { - return stream; + from = ">=" + from; } - } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); + 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 { - return ensureNodeStream(source); + to = "<=" + to; } + return (from + " " + to).trim(); } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } + 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(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug5(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; + } + } + return false; + } + return true; } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - return result; + return range.test(version); } - 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; + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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; } - 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; + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - return total; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 && range.test(minver)) { + return minver; + } + return null; } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; } - request.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`); + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + if (satisfies2(version, range, options)) { + return false; } - } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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}`); + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.set[i2]; + var high = null; + var low = null; + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); } - 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`); + 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; } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); + }); + 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 = parse(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 match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } - }; + safeRe[t.COERCERTL].lastIndex = -1; + } + if (match === null) { + return null; + } + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { +// 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.decompressResponsePolicyName = void 0; - exports2.decompressResponsePolicy = decompressResponsePolicy; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; - } + 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); } }); -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/cache/lib/internal/cacheUtils.js +var require_cacheUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/cacheUtils.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"; + 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]; + } }; } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve4, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); + 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; }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); } - timer = setTimeout(() => { - removeListeners(); - resolve4(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - 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/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { - "use strict"; + }; + 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(resolve4, reject) { + v = o[n](v), settle(resolve4, reject, v.done, v.value); + }); + }; + } + function settle(resolve4, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve4({ value: v2, done: d }); + }, reject); + } + }; 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; + 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 core13 = __importStar2(require_core()); + var exec = __importStar2(require_exec()); + var glob = __importStar2(require_glob()); + var io5 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs5 = __importStar2(require("fs")); + var path5 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 = path5.join(baseLocation, "actions", "temp"); } - 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 (_a) { - return void 0; - } - } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + const dest = path5.join(tempDirectory, crypto2.randomUUID()); + yield io5.mkdirP(dest); + return dest; + }); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; - } - return { - retryAfterInMs - }; - } - }; + function getArchiveFileSizeInBytes(filePath) { + return fs5.statSync(filePath).size; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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 glob.create(patterns.join("\n"), { + implicitDescendants: false + }); + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path5.relative(workspace, file).replace(new RegExp(`\\${path5.sep}`, "g"), "/"); + core13.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); + } else { + paths.push(`${relativeFile}`); + } } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + return paths; + }); } - 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"; + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs5.unlink)(filePath); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.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; + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core13.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() } - } + }); + } catch (err) { + core13.debug(err.message); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + versionOutput = versionOutput.trim(); + core13.debug(versionOutput); + return versionOutput; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core13.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; + } + }); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + function getCacheFileName(compressionMethod) { + return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); - } + function getGnuTarPathOnWindows() { + return __awaiter2(this, void 0, void 0, function* () { + if (fs5.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io5.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - /** - * 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() }); + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - /** - * 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)); + components.push(versionSalt); + return crypto2.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"); } - /** - * 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); + return token; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __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 core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); - } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); - } - }; - } - 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, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); - } - } - } - request.multipartBody = { parts }; +// 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; } -}); - -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); + 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 _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.addInitializer = function(f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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; - } + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; } - 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"; + } + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return ms + " ms"; } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { 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]); + }; } -}); - -// 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 hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug5(...args) { - if (!debug5.enabled) { - return; + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) 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: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; } - const self2 = debug5; - 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"); + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug5.namespace = namespace; - debug5.useColors = createDebug.useColors(); - debug5.color = createDebug.selectColor(namespace); - debug5.extend = extend3; - debug5.destroy = createDebug.destroy; - Object.defineProperty(debug5, "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 (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug5); - } - return debug5; - } - function extend3(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); + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; } - } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } - 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(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; - } - 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; + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; } - module2.exports = setup; + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } -}); - -// 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`."); - } +} +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); + }); }; - })(); - 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+)/); + if (f) i[n] = f(i[n]); } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } + } + 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(resolve4, reject) { + v = o[n](v), settle(resolve4, reject, v.done, v.value); }); - args.splice(lastC, 0, c); + }; + } + function settle(resolve4, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve4({ 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]; } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { - } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function load2() { - let r; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + inner.call(this); + } catch (e) { + return Promise.reject(e); } - return r; - } - function localstorage() { + }; + 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 { - return localStorage; - } catch (error4) { + 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); } } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.message; + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path5, preserveJsx) { + if (typeof path5 === "string" && /^\.\.?\//.test(path5)) { + return path5.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path5; +} +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/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports2, module2) { +// 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"; - 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); + 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/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { +// 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"; - var os2 = 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; + 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}`); } - 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); - } + } +}); + +// 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); } - function translateLevel(level) { - if (level === 0) { - return false; + 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); + } } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - if (hasFlag("color=256")) { - return 2; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; + } } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; + } } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - if (process.platform === "win32") { - const osRelease = os2.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; + 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; } - 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; + 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(debug5, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug5(...args) { + if (!newDebugger.enabled) { + return; } - return min; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; } - if (env.COLORTERM === "truecolor") { - return 3; + return false; + } + function extend3(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 ("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 (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(", ")}.`); } } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; + function createLogger(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; } - if ("COLORTERM" in env) { - return 1; + function contextGetLogLevel() { + return logLevel; } - return min; + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - 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 util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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 (error4) { +// 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(); } - 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, (_, k) => { - return k.toUpperCase(); - }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - obj[prop] = val2; - 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]; + 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]); + } + } } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; + /** + * 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() }); } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; + /** + * 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; } - } - function load2() { - return process.env.DEBUG; - } - function init(debug5) { - debug5.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug5.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + /** + * 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); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); + } } }); -// 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/@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/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - async function toBuffer(stream) { - let length = 0; - const chunks = []; - for await (const chunk of stream) { - length += chunk.length; - chunks.push(chunk); - } - return Buffer.concat(chunks, length); - } - exports2.toBuffer = toBuffer; - async function json2(stream) { - const buf = await toBuffer(stream); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; - } - } - exports2.json = json2; - function req(url, opts = {}) { - const href = typeof url === "string" ? url : url.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); - const promise = new Promise((resolve4, reject) => { - req2.once("response", resolve4).once("error", reject).end(); - }); - req2.then = promise.then.bind(promise); - return req2; + } +}); + +// 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(); } - exports2.req = req; } }); -// node_modules/agent-base/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/agent-base/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); }; + 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.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = 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; + 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; } - decrementSockets(name, socket) { - if (!this.sockets[name] || socket === null) { - return; + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - const sockets = this.sockets[name]; - const index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - } - // 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); + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - return super.getName(options); + this._policies.push({ + policy, + options + }); + this._orderedPolicies = void 0; } - 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); - } + 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[INTERNAL].currentSocket = socket; - super.createSocket(req, options, cb); - }, (err) => { - this.decrementSockets(name, fakeSocket); - cb(err); }); + this._orderedPolicies = void 0; + return removedPolicies; } - 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); + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + clone() { + return new _HttpPipeline(this._policies); } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; - } + static create() { + return new _HttpPipeline(); } - }; - 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 __importDefault4 = 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 = __importDefault4(require_src()); - var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve4, 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); + orderPolicies() { + const result = []; + const policyMap = /* @__PURE__ */ new Map(); + function createPhase(name) { + return { + name, + policies: /* @__PURE__ */ new Set(), + hasRun: false, + hasAfterPolicies: false + }; } - function onend() { - cleanup(); - debug5("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + 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; + } } - function onerror(err) { - cleanup(); - debug5("onerror %o", err); - reject(err); + 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); } - 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) { - debug5("have not received end of HTTP headers yet..."); - read(); - return; + 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}`); } - 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")); + if (options.afterPolicies) { + for (const afterPolicyName of options.afterPolicies) { + const afterNode = policyMap.get(afterPolicyName); + if (afterNode) { + node.dependsOn.add(afterNode); + afterNode.dependants.add(node); + } + } } - const firstLineParts = firstLine.split(" "); - const statusCode = +firstLineParts[1]; - const statusText = firstLineParts.slice(2).join(" "); - const headers = {}; - for (const header of headerParts) { - if (!header) + 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; - 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; + 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); } } - debug5("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve4({ - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug5 = (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 HttpsProxyAgent = 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 ?? {}; - debug5("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 ? omit(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:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); - } else { - debug5("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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 -`; + 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); + } + } } - 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) { - debug5("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + 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 socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug5("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + return result; } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); - } - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + function createEmptyPipeline() { + return HttpPipeline.create(); } } }); -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug5 = (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 ?? {}; - debug5("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 ? omit(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 url = new url_1.URL(req.path, base); - if (opts.port !== 80) { - url.port = String(opts.port); - } - req.path = String(url); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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; - debug5("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug5("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); - debug5("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug5("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 omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { +// 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.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_log(); - 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; + 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; } - const httpsProxy = getEnvironmentValue(HTTPS_PROXY); - const allProxy = getEnvironmentValue(ALL_PROXY); - const httpProxy = getEnvironmentValue(HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; + return false; } - function isBypassed(uri, noProxyList, bypassedMap) { - if (noProxyList.length === 0) { - return false; - } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + } +}); + +// 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())); } - 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; - } + /** + * 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 + }; } - } else { - if (host === pattern) { - isBypassedFlag = true; + 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); } - } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 value; + }, 2); } - return []; - } - function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return void 0; + /** + * 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 parsedUrl = new URL(proxyUrl); - const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + const url = new URL(value); + if (!url.search) { + return value; } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } } - request.agent = cachedAgents.httpsProxyAgent; - } - } - function proxyPolicy(proxySettings, options) { - if (!noProxyListLoaded) { - exports2.globalNoProxyList.push(...loadNoProxy()); + return url.toString(); } - const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); - const cachedAgents = {}; - return { - name: exports2.proxyPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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 next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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 next(request); } - }; - } + return sanitized; + } + }; + exports2.Sanitizer = Sanitizer; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { +// 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.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); - } - }; + 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/@azure/core-tracing/dist/commonjs/tracingContext.js -var require_tracingContext = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js"(exports2) { +// 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.TracingContextImpl = exports2.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; + 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); } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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) { +// 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.state = void 0; - exports2.state = { - instrumenterImplementation: void 0 - }; + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; - } - exports2.getInstrumenter = getInstrumenter; - } -}); - -// 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 = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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 - }; - } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __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 core_util_1 = require_commonjs2(); - 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 { - 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 }); - Object.setPrototypeOf(this, _RestError.prototype); - } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } - }; - exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - function isRestError(e) { - if (e instanceof RestError) { - return true; - } - return (0, core_util_1.isError)(e) && e.name === "RestError"; - } - } -}); - -// 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_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.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); - } - span.setStatus({ - status: "success" - }); - 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/createPipelineFromOptions.js -var require_createPipelineFromOptions = __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_logPolicy(); - var pipeline_js_1 = require_pipeline(); - var redirectPolicy_js_1 = require_redirectPolicy(); - var userAgentPolicy_js_1 = require_userAgentPolicy(); - var multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { +// 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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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(stream) { + if (stream.readable === false) { + return Promise.resolve(); + } return new Promise((resolve4) => { const handler = () => { resolve4(); @@ -39223,6 +37898,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -39236,25 +37913,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -39263,13 +37937,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -39293,8 +37970,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -39316,7 +37996,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -39334,9 +38014,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -39345,29 +38024,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url = new URL(request.url); const isInsecure = url.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url.hostname, path: `${url.pathname}${url.search}`, port: url.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve4, reject) => { - const req = isInsecure ? http.request(options, resolve4) : https2.request(options, resolve4); + const req = isInsecure ? node_http_1.default.request(options, resolve4) : node_https_1.default.request(options, resolve4); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -39388,30 +38066,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -39434,11 +38113,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream.pipe(inflate); return inflate; } @@ -39458,7 +38137,7 @@ var require_nodeHttpClient = __commonJS({ resolve4(Buffer.concat(buffer).toString("utf8")); }); stream.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -39489,9 +38168,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -39502,1760 +38181,1368 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; - } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + logger(`Response status code: ${response.status}`); + logger(`Headers: ${sanitizer.sanitize(response.headers)}`); + return response; + } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); + } + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.throttlingRetryPolicyName = void 0; - exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; - function throttlingRetryPolicy(options = {}) { - var _a; - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; - } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + } +}); + +// 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(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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(); + return next(request); } }; - function refresh(scopes, getTokenOptions) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + } + } +}); + +// 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((resolve4, 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(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve4(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; } - } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + return void 0; } - op = body.call(thisArg, _); - } 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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 }; + 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"; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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"; } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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]; + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); +}); + +// 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]; }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(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(); + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug5(...args) { + if (!debug5.enabled) { + return; + } + const self2 = debug5; + 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 index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; }); - } 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(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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]; + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); } - return t; - }; - return __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 - }; - } -}); - -// 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 { - /** - * 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"); + debug5.namespace = namespace; + debug5.useColors = createDebug.useColors(); + debug5.color = createDebug.selectColor(namespace); + debug5.extend = extend3; + debug5.destroy = createDebug.destroy; + Object.defineProperty(debug5, "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(debug5); } - 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_commonjs2(); - 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + return debug5; } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + function extend3(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; } - /** - * 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"); + 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); + } } - 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"); + 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; + } } - this._name = newName; - this._key = newKey; + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; } - /** - * 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"); + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } } - this._signature = signature; + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + return false; } - /** - * 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"); + function coerce3(val) { + if (val instanceof Error) { + return val.stack || val.message; } - this._signature = newSignature; + return val; } - }; - 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); + 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/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); +// 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+)/); } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); - } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; - } -}); - -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); + exports2.log = console.debug || console.log || (() => { }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { + function save(namespaces) { try { - step(generator.next(value)); - } catch (e) { - reject(e); + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { } } - function rejected(value) { + function load2() { + let r; try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + function localstorage() { + try { + return localStorage; + } catch (error3) { + } } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(thisArg, body) { - var _ = { 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]); + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; + } }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; +}); + +// 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 os2 = 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); } - op = body.call(thisArg, _); - } 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 }; + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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 = os2.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; } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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]; + function getSupportLevel(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; } - 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) { +}); + +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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 { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); + 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, (_, k) => { + return k.toUpperCase(); }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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]; + 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); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + 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]; + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); + function load2() { + return process.env.DEBUG; + } + function init(debug5) { + debug5.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug5.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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 __assign3.apply(this, arguments); + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; - __createBinding3 = Object.create ? (function(o, m, k, k2) { + } +}); + +// 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)) { @@ -41267,7697 +39554,15306 @@ var init_tslib_es63 = __esm({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { + })); + 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; }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 - }; - } -}); - -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + async function toBuffer(stream) { + let length = 0; + const chunks = []; + for await (const chunk of stream) { + length += chunk.length; + chunks.push(chunk); + } + return Buffer.concat(chunks, length); } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); + exports2.toBuffer = toBuffer; + async function json2(stream) { + const buf = await toBuffer(stream); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); + exports2.json = json2; + function req(url, opts = {}) { + const href = typeof url === "string" ? url : url.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); + const promise = new Promise((resolve4, reject) => { + req2.once("response", resolve4).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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 = "_"; + exports2.req = req; } }); -// node_modules/@azure/core-client/dist/commonjs/utils.js -var require_utils5 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { +// node_modules/agent-base/dist/index.js +var require_dist = __commonJS({ + "node_modules/agent-base/dist/index.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; + 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]; + } }; } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); + 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); } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, parsedHeaders), { blobBody: fullResponse.blobBody, readableStreamBody: fullResponse.readableStreamBody }); + __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] = {}; } - const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {}; - const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); - if (expectedBodyTypeName === "Sequence" || isPageableResponse) { - const arrayResponse = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; + /** + * 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:"; } } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } } - 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) - }); - } - exports2.flattenResponse = flattenResponse; - } -}); - -// 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 = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + // 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); } - /** - * @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}.`); + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options) }; - 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); + 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); + } } - 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); - } - } + this[INTERNAL].currentSocket = socket; + super.createSocket(req, options, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); } - /** - * 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, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - } - }; - let payload = {}; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = void 0; + if (!socket) { + throw new Error("No socket was returned in the `connect()` function"); } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; + return socket; + } + get defaultPort() { + return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; } - if (mapper.isConstant) { - object = mapper.defaultValue; + } + get protocol() { + return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); + } + }; + 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 debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve4, reject) => { + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once("readable", read); } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); + function cleanup() { + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("readable", read); } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + function onend() { + cleanup(); + debug5("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); } - if (object === void 0 || object === null) { - payload = object; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + function onerror(err) { + cleanup(); + debug5("onerror %o", err); + reject(err); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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) { + debug5("have not received end of HTTP headers yet..."); + read(); + return; } - 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]; - } + 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")); } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; + 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}"`)); } - } else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; - } else if (responseBody === "false") { - payload = false; + 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 { - payload = responseBody; + headers[key] = value; } - } 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); } + debug5("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve4({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - } - }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); - } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; - } - return str2.substr(0, len); + socket.on("error", onerror); + socket.on("end", onend); + read(); + }); } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + exports2.parseProxyResponse = parseProxyResponse; + } +}); + +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug5 = (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 + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port + }; } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; - } + /** + * 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'); } - } - 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.`); - } + let socket; + if (proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + } else { + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - } - 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(); + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - 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.`); + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - value = base64.encodeByteArray(value); + 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) { + debug5("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; + } + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug5("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } - return value; + }; + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - function serializeBase64UrlType(objectName, value) { - if (value !== void 0 && value !== null) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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_dist(); + var url_1 = require("url"); + var debug5 = (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 ?? {}; + debug5("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 ? omit(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 url = new url_1.URL(req.path, base); + if (opts.port !== 80) { + url.port = String(opts.port); + } + req.path = String(url); + const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - return value; + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); + } + let first; + let endOfHeaders; + debug5("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug5("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); + debug5("Output buffer: %o", req.outputData[0].data); + } + let socket; + if (this.proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug5("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 omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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()]; } - 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}.`); + return void 0; + } + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + 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 tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + 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 { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); + } else { + return stream; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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 stream of streams) { + for await (const chunk of stream) { + 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 { - 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; - } + total += partLength; } } - 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 total; + } + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); } - return instance; + request.body = await (0, concat_js_1.concat)(sources); } - 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}`); + 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 (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; + if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { + throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); } - return responseBody; } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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]; + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); + } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); + } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + }; + } + } +}); + +// 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); } - return tempArray; + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); - } - } - } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return void 0; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); - } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + } +}); + +// 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 url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; } + return next(req); } - } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; - } + exports2.ensureSecureConnection = ensureSecureConnection; + var log_js_1 = require_log2(); + var insecureConnectionWarningEmmitted = false; + function allowInsecureConnection(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url = new URL(request.url); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; } } - return value; + return false; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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]; + function emitInsecureConnectionWarning() { + const warning9 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning9); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning9); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } else { - break; + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info6 = state_js_1.state.operationRequestMap.get(request); - if (!info6) { - info6 = {}; - state_js_1.state.operationRequestMap.set(request, info6); - } - return info6; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; + } + } +}); + +// 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.deserializationPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } } - return result; + return pipeline; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); } - return result; + return cachedHttpClient; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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]; + } } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if (descriptor.contentType === null) { + return void 0; } - 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 }); - } + if (descriptor.contentType) { + return descriptor.contentType; } - return parsedResponse; + 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 isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escapeDispositionField(value) { + return JSON.stringify(value); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; - } + function getContentDisposition(descriptor) { + const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); + if (contentDispositionHeader) { + return contentDispositionHeader; } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (descriptor.dispositionType === void 0 && descriptor.name === void 0 && descriptor.filename === void 0) { + return void 0; } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + const dispositionType = descriptor.dispositionType ?? "form-data"; + let disposition = dispositionType; + if (descriptor.name) { + disposition += `; name=${escapeDispositionField(descriptor.name)}`; } - return { error: error4, shouldReturnResponse: false }; - } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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; } } - return operationResponse; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; + } + return disposition; } - } -}); - -// 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); } - return result; + 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}`); } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + 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); } - return result; + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } + 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_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + const headers = response.headers.toJSON(); + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; + if (options?.onResponse) { + options.onResponse({ ...response, request, rawHeaders: headers, parsedBody }); } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + return { + request, + 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, rawHeaders }, e); } + throw e; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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; + 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 { - if (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; } } + return "application/json"; } - exports2.serializeRequestBody = serializeRequestBody; - 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 buildPipelineRequest(method, url, 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, + 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 prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - 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_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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) }; } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; } - exports2.createClientPipeline = createClientPipeline; - } -}); - -// 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 = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; + 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 + }); } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path5 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path5.startsWith("/")) { - path5 = path5.substring(1); - } - if (isAbsoluteUrl(path5)) { - requestUrl = path5; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path5); - } + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.toString().replace(/([^:]\/)\/+/g, "$1"); + } + function getQueryParamValue(key, allowReserved, style, param) { + let separator; + if (style === "pipeDelimited") { + separator = "|"; + } else if (style === "spaceDelimited") { + separator = "%20"; + } else { + separator = ","; } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + 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]; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; } - } - return result; - } - function isAbsoluteUrl(url) { - return url.includes("://"); + 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 appendPath(url, pathToAppend) { - if (!pathToAppend) { + function appendQueryParams(url, options = {}) { + if (!options.queryParameters) { return url; } const parsedUrl = new URL(url); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path5 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path5; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } + 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)); } - if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "CSV" || queryParameter.collectionFormat === "Pipes")) { - queryParameterValue = queryParameterValue.join(delimiter); + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); } - result.set(queryParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter), queryParameterValue); + } 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)); } } - return { - queryParams: result, - sequenceParams - }; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return result; + return endpoint; } - function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url; + 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)); } - const parsedUrl = new URL(url); - 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); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - 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}`); + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path5, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path5, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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."); } - } else { - searchPieces.push(`${name}=${value}`); } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); + }; } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, options), { credentialOptions })); + 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 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; + 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/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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)(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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 getLogLevel() { + return context2.getLogLevel(); } - 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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + } +}); + +// 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 + }); } - 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) => Object.assign(Object.assign({}, a), b), {}); + } +}); + +// 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 + }; } - function requestToOptions(request) { + } +}); + +// 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 { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions + 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/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } + 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 + }); } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); + } +}); + +// 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); } - var HttpHeaders = class _HttpHeaders { - 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } + 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"; } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - exports2.toPipelineResponse = toPipelineResponse; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.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) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + 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-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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.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); } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); + 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.requestPolicyFactoryPolicyName, + name: exports2.userAgentPolicyName, async sendRequest(request, 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); + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; + 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); } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + 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/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } +// 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(); } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + 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); } - }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; + } } }); -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { +// 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"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError = class extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } + 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((resolve4, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - return i; - } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); + if (abortSignal?.aborted) { + return rejectOnAbort(); } - } - return true; - } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; - } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; - } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col + try { + buildPromise((x) => { + removeListeners(); + resolve4(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } - }; - } - function validateAttrName(attrName) { - return util.isName(attrName); + abortSignal?.addEventListener("abort", onAbort); + }); } - function validateTagName(tagname) { - return util.isName(tagname); + } +}); + +// 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)((resolve4) => { + token = setTimeout(resolve4, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage + }); } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; + 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 }; } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; + } +}); + +// 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 { - exp += xmlData[i]; + stringified = String(e); } + } catch (err) { + stringified = "[unable to stringify input]"; } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); - } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); + return `Unknown error ${stringified}`; } - return { entities, i }; } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; + } +}); + +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } } - return [entityName2, val2, i]; + return true; } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; + } +}); + +// 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 isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; - } - } else { - return str2; - } - } + function isError(e) { + return tspRuntime.isError(e); } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; + function isObject2(input) { + return tspRuntime.isObject(input); } - module2.exports = toNumber; - } -}); - -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; - } - return () => false; + 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); } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + 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 replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); + 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"); } - return val2; }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; - } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; - } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - function findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); } else { - return closingIndex + str2.length - 1; + return blob; } } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + function createFileFromStream(stream, name, options = {}) { return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName + ...unimplementedMethods, + type: options.type ?? "", + lastModified: options.lastModified ?? (/* @__PURE__ */ new Date()).getTime(), + webkitRelativePath: options.webkitRelativePath ?? "", + size: options.size ?? -1, + name, + stream: () => { + const s = stream(); + if (isNodeReadableStream(s)) { + throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + } + return s; + }, + [rawContent]: stream }; } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } - } - } + 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 parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } + return source.map((x) => x); } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; + 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } + return tspPolicy.sendRequest(request, next); } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + }; } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; +// 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/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; +// 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); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; + } +}); + +// 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)(); } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + } +}); + +// 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 replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; - } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; - } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } + }; } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; - } - } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); + } +}); + +// 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); } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; - } + } +}); + +// 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); } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder + 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; + } + 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-xml/dist/commonjs/xml.common.js -var require_xml_common = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.common.js"(exports2) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + exports2.state = void 0; + exports2.state = { + instrumenterImplementation: void 0 + }; } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false + end: () => { + }, + isRecording: () => false, + recordException: () => { + }, + setAttribute: () => { + }, + setStatus: () => { + }, + addEvent: () => { + } }; } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + 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 getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - 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, ""); + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); + } + return state_js_1.state.instrumenterImplementation; } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); + } +}); + +// 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 + }; } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; + 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(); + } } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; - } + function parseTraceparentHeader(traceparentHeader) { + return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); } - return parsedXml; + function createRequestHeaders(tracingContext) { + return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + } + return { + startSpan, + withSpan, + withContext, + parseTraceparentHeader, + createRequestHeaders + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; + 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; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return xml_common_js_1.XML_CHARKEY; + var tracingClient_js_1 = require_tracingClient(); + Object.defineProperty(exports2, "createTracingClient", { enumerable: true, get: function() { + return tracingClient_js_1.createTracingClient; } }); } }); -// 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_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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(request, next) { + if (!tracingClient) { + return next(request); + } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; + } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); + } + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; + } } - return abortedMap.get(this); + }; + } + 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; } - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - static get none() { - return new _AbortSignal(); + } + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { + request.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; } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - listeners.push(listener); + span.end(); + } catch (e) { + log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + 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)}`); } - /** - * 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."); + } + } +}); + +// 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 }; } - }; - function abortSignal(signal) { - if (signal.aborted) { - return; + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; } - if (signal.onabort) { - signal.onabort.call(signal); + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; + } } - const listeners = listenersMap.get(signal); - if (listeners) { - listeners.slice().forEach((listener) => { - listener.call(signal, { type: "abort" }); - }); + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); } - abortedMap.set(signal, true); + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; } - 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(); - }); + } +}); + +// 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); } } - } - /** - * 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/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - throw error4; - }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return { - code, - message - }; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - 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}`; + } +}); + +// 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(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - 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, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; - } - } - return { response, status }; + } +}); + +// 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); } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); - } + } +}); + +// 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); } - function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; + } +}); + +// 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); } - function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; + } +}); + +// 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); } - function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; + } +}); + +// 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); } - function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; + } +}); + +// 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 + }); } - function findResourceLocation(inputs) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } + } +}); + +// 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; } } - } - 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; + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } + return token; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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; + }; } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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"; + } +}); + +// 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(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - 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; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true + }; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - return void 0; } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error4; + function isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { + const { scopes } = onChallengeOptions; + const accessToken = await onChallengeOptions.getAccessToken(scopes, { + enableCae: true, + claims: caeClaims + }); + if (!accessToken) { + return false; } - return void 0; + onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); + return true; } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return initOperation({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig + 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(request, next) { + if (!request.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, + getAccessToken, + logger }); - 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 - }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } + } + }; } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + } + } + return next(request); } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + }; + } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - case "Body": - default: { - return void 0; + }; + } + } +}); + +// 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); + } +}); + +// 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"); } - case "Body": { - return getProvisioningState(rawResponse); + 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + 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"; } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + } +}); + +// 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; } - return state.config.resourceLocation; - } - function isOperationError(e) { - return e.name === "RestError"; - } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); - } - var createStateProxy$1 = () => ({ /** - * 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. + * 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 */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => state.status = "canceled", - setError: (state, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } }; } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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; + } +}); + +// 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_utils6 = __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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + } + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + 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]; + } } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (parsedHeaders) { + for (const key of Object.keys(parsedHeaders)) { + arrayResponse[key] = parsedHeaders[key]; + } } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + 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_utils6(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Serializes the Poller operation. + * @deprecated Removing the constraints validation on client side. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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); + } + } } - }; - 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); + * Serialize the given object based on its metadata defined in the mapper * - * // You can assign more local properties here. - * } - * } - * ``` + * @param mapper - The mapper which defines the metadata of the serializable object * - * 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. + * @param object - A valid Javascript object to be serialized * - * 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: + * @param objectName - Name of the serialized object * - * ```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 options - additional options to serialization * - * @param operation - Must contain the basic properties of `PollOperation`. + * @returns A valid serialized Javascript object */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve4, reject) => { - this.resolve = resolve4; - 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; + serialize(mapper, object, 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; } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - } - /** - * 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) - }); + if (mapper.isConstant) { + object = mapper.defaultValue; } - this.processUpdatedState(); + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. + * Deserialize the given object based on its metadata defined in the mapper * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * @param mapper - The mapper which defines the metadata of the serializable object * - * @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. + * @param responseBody - A valid Javascript entity to be deserialized * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @param objectName - Name of the deserialized object * - * @param options - Optional properties passed to the operation's update method. + * @param options - Controls behavior of XML parser and builder. + * + * @returns A valid deserialized Javascript object */ - 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; + 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; } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + 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 (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + if (mapper.isConstant) { + payload = mapper.defaultValue; } + return payload; } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; + } + return str2.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 str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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 = ""; + } } - 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); - }; + return classes; + } + function dateToUnixTime(d) { + if (!d) { + return void 0; } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + if (typeof d.valueOf() === "string") { + d = new Date(d); } - /** - * 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")); + 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.`); } } } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + 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.`); } - /** - * 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"); + const isPresent = allowedValues.some((item) => { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); } - return this.cancelPromise; + return item === value; + }); + if (!isPresent) { + throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); } - /** - * 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; + 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); } - /** - * 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; + 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); } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); + 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}".`); + } + } } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + return value; + } + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve4) => setTimeout(() => resolve4(), this.config.intervalInMs)); + 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}.`); } - }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs5 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; + } + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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; + } } - n.default = e; - return Object.freeze(n); + return tempArray; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs5); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - /** - * 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); + 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}.`); } - /** - * 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); + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + 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; } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path5 = urlParsed.pathname; - path5 = path5 || "/"; - path5 = escape(path5); - urlParsed.pathname = path5; - return urlParsed.toString(); + return tempDictionary; } - 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]; - } - } + 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 proxyUri; + return additionalProperties; } - function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; + 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 ""; + return modelProps; } - function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - 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'"); + if (object !== void 0 && object !== null) { + const payload = {}; + const modelProps = resolveModelProperties(serializer, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); + 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) && (object[key] !== void 0 && object[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 = object[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; + } + } } - 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 escape(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 path5 = urlParsed.pathname; - path5 = path5 ? path5.endsWith("/") ? `${path5}${name}` : `${path5}/${name}` : name; - urlParsed.pathname = path5; - 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); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } } } + return payload; } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); - } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : 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}`; + return object; } - 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; + function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; } - return queries; - } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + 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; + } } - 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"; + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + function isSpecialXmlProperty(propertyName, options) { + return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + 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 res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve4, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve4(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== void 0) { - aborter.addEventListener("abort", abortHandler); + 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; } - }); - } - 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); + 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; + } } - return padString.slice(0, targetLength) + currentString; } - } - 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 = ""; + 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 accountName; - } catch (error4) { - throw new Error("Unable to extract accountName with provided information."); } + return instance; } - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); } + return tempDictionary; } - return tagPairs.join("&"); + return responseBody; } - function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + 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 res; + return responseBody; } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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); + } + } + } } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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 res; + return mapper; } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + 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]; } - 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 - } + 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); } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - }; - case "parquet": - return { - format: { - type: "parquet" + 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 = {}; } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + value[propertyName] = propertyValue; + } + } } + return value; } - 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); + 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 { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); + break; } } - return orProperties; + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } + let info6 = state_js_1.state.operationRequestMap.get(request); + if (!info6) { + info6 = {}; + state_js_1.state.operationRequestMap.set(request, info6); + } + return info6; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; } - 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; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } - 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 - }; - } + return result; } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return split.join("/"); + return result; } - function assertResponse(response) { - if (`_response` in response) { - return response; + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; } - throw new TypeError(`Unexpected response object ${response}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); + const operationSpec = operationInfo?.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + const responseSpec = getOperationResponseMap(parsedResponse); + const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); + if (error3) { + throw error3; + } else if (shouldReturnResponse) { + return parsedResponse; } - /** - * 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); + 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 (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); } - let response; + } + 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 parse(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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; + 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; } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw 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; } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; + 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)); } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; + } + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } 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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + } + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path5 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path5.startsWith("/")) { + path5 = path5.substring(1); + } + if (isAbsoluteUrl(path5)) { + requestUrl = path5; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path5); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + 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); } - } else { - delayTimeInMs = Math.random() * 1e3; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } - }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + return result; + } + function isAbsoluteUrl(url) { + return url.includes("://"); + } + function appendPath(url, pathToAppend) { + if (!pathToAppend) { + return url; } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + const parsedUrl = new URL(url); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path5 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path5; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + } + } else { + newPath = newPath + pathToAppend; } - }; - 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; + parsedUrl.pathname = newPath; + return parsedUrl.toString(); } - 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; + 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 pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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(url, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url; + } + const parsedUrl = new URL(url); + 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_utils6(); + 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(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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 request; + } 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") { + request.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)) { + request[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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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_util8(); + 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(request, 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)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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 = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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(url) { + const urlParsed = new URL(url); + let path5 = urlParsed.pathname; + path5 = path5 || "/"; + path5 = escape(path5); + urlParsed.pathname = path5; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path5 = urlParsed.pathname; + path5 = path5 ? path5.endsWith("/") ? `${path5}${name}` : `${path5}/${name}` : name; + urlParsed.pathname = path5; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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((resolve4, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve4(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path5 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path5}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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((resolve4, 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(resolve4).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve4(); + } + } + }); + }); + } + /** + * 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(url) { + const urlParsed = new URL(url); + let path5 = urlParsed.pathname; + path5 = path5 || "/"; + path5 = escape(path5); + urlParsed.pathname = path5; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path5 = urlParsed.pathname; + path5 = path5 ? path5.endsWith("/") ? `${path5}${name}` : `${path5}/${name}` : name; + urlParsed.pathname = path5; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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((resolve4, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve4(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path5 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path5}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path5 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path5}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path5 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path5}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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" + } + } + } + } } - 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; + } + }; + 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" + } + } + } + } } } - return false; - } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { - /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - - */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; + }; + 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" + } + } + } } - /** - * Signs request. - * - * @param request - - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + }; + 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" + } + } } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; } - /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; + }; + 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" + } + } } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + } + }; + 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" + } + } } - 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + }; + 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" + } } - 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(request) { - const path5 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path5}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } } - return canonicalizedResourceString; } }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); + 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" + } + } + } } }; - var StorageSharedKeyCredential = class extends Credential { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + 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" + } + } + } } }; - var AnonymousCredentialPolicy = class extends 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.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" + } + } + } } }; - var AnonymousCredential = class extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + 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" + } + } + } } }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + 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" + } } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; - } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + 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" } } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } + }; + 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" + } } } - return false; } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; + }; + 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" + } } - } else { - delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } + }; + 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" } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay2(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + }, + 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" } - attempt++; - } - if (response) { - return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; } - return value; } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); + }; + 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" + } } } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; } - function getCanonicalizedResourceString(request) { - const path5 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path5}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; - } - var StorageBrowserPolicy = class extends 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(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); - } - }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + 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" + } + } } } - return { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); + }; + 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" + } + } } - }; - } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * 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 - }; } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); - } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; - } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; + 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" + } + } } } - return void 0; - } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }; + exports2.ContainerCreateHeaders = { + serializedName: "Container_createHeaders", + type: { + name: "Composite", + className: "ContainerCreateHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } - } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }, + 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" } } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); } - pipeline._corePipeline = corePipeline; - } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); - } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; + }; + 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" + } + } } } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; - } - return factory.constructor.name === "StorageSharedKeyCredential"; - } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; - } - return factory.constructor.name === "AnonymousCredential"; - } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); - } - function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; - } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof 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 (request) => { - return { - request, - headers: request.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); - }); - } - var BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", + }; + exports2.ContainerGetPropertiesHeaders = { + serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", - className: "BlobServiceProperties", + className: "ContainerGetPropertiesHeaders", modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "Logging" + name: "Dictionary", + value: { type: { name: "String" } } } }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Composite", - className: "Metrics" + name: "String" } }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "Metrics" + name: "DateTimeRfc1123" } }, - cors: { - serializedName: "Cors", - xmlName: "Cors", - xmlIsWrapped: true, - xmlElementName: "CorsRule", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", + 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" } }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "StaticWebsite" + 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" } } } } }; - var Logging = { - serializedName: "Logging", + exports2.ContainerDeleteHeaders = { + serializedName: "Container_deleteHeaders", type: { name: "Composite", - className: "Logging", + className: "ContainerDeleteHeaders", modelProperties: { - version: { - serializedName: "Version", - required: true, - xmlName: "Version", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleteProperty: { - serializedName: "Delete", - required: true, - xmlName: "Delete", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - read: { - serializedName: "Read", - required: true, - xmlName: "Read", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - write: { - serializedName: "Write", - required: true, - xmlName: "Write", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } } } } }; - var RetentionPolicy = { - serializedName: "RetentionPolicy", + exports2.ContainerDeleteExceptionHeaders = { + serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", - className: "RetentionPolicy", + className: "ContainerDeleteExceptionHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var Metrics = { - serializedName: "Metrics", + exports2.ContainerSetMetadataHeaders = { + serializedName: "Container_setMetadataHeaders", type: { name: "Composite", - className: "Metrics", + className: "ContainerSetMetadataHeaders", modelProperties: { - version: { - serializedName: "Version", - xmlName: "Version", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy" - } - } - } - } - }; - var CorsRule = { - serializedName: "CorsRule", - type: { - name: "Composite", - className: "CorsRule", - modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", - required: true, - xmlName: "AllowedOrigins", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - allowedMethods: { - serializedName: "AllowedMethods", - required: true, - xmlName: "AllowedMethods", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", + } + } + } + }; + exports2.ContainerSetMetadataExceptionHeaders = { + serializedName: "Container_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var StaticWebsite = { - serializedName: "StaticWebsite", + exports2.ContainerGetAccessPolicyHeaders = { + serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", - className: "StaticWebsite", + className: "ContainerGetAccessPolicyHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["container", "blob"] } }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } - } - } - } - }; - var StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - code: { - serializedName: "Code", - xmlName: "Code", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -48965,106 +54861,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", + exports2.ContainerGetAccessPolicyExceptionHeaders = { + serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", - className: "BlobServiceStatistics", + className: "ContainerGetAccessPolicyExceptionHeaders", modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "GeoReplication" + name: "String" } } } } }; - var GeoReplication = { - serializedName: "GeoReplication", + exports2.ContainerSetAccessPolicyHeaders = { + serializedName: "Container_setAccessPolicyHeaders", type: { name: "Composite", - className: "GeoReplication", + className: "ContainerSetAccessPolicyHeaders", modelProperties: { - status: { - serializedName: "Status", - required: true, - xmlName: "Status", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] + name: "String" } }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListContainersSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } + name: "String" } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + } + } + } + }; + 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" } @@ -49072,184 +54951,218 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", + exports2.ContainerRestoreHeaders = { + serializedName: "Container_restoreHeaders", type: { name: "Composite", - className: "ContainerItem", + className: "ContainerRestoreHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, version: { - serializedName: "Version", - xmlName: "Version", + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "ContainerProperties" + name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; - var ContainerProperties = { - serializedName: "ContainerProperties", + exports2.ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", - className: "ContainerProperties", + className: "ContainerRestoreExceptionHeaders", modelProperties: { - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + 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" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + 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" } }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "String" } }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", + 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: "Boolean" + name: "String" } - }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", + } + } + } + }; + 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: "Boolean" + name: "String" } }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", - type: { - name: "Number" - } - }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", - type: { - name: "Boolean" - } } } } }; - var KeyInfo = { - serializedName: "KeyInfo", + exports2.ContainerFilterBlobsExceptionHeaders = { + serializedName: "Container_filterBlobsExceptionHeaders", type: { name: "Composite", - className: "KeyInfo", + className: "ContainerFilterBlobsExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49257,457 +55170,429 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { - serializedName: "UserDelegationKey", + exports2.ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", - className: "UserDelegationKey", + className: "ContainerAcquireLeaseHeaders", modelProperties: { - signedObjectId: { - serializedName: "SignedOid", - required: true, - xmlName: "SignedOid", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", + exports2.ContainerAcquireLeaseExceptionHeaders = { + serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "ContainerAcquireLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - where: { - serializedName: "Where", - required: true, - xmlName: "Where", + } + } + } + }; + exports2.ContainerReleaseLeaseHeaders = { + serializedName: "Container_releaseLeaseHeaders", + type: { + name: "Composite", + className: "ContainerReleaseLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - blobs: { - serializedName: "Blobs", - required: true, - xmlName: "Blobs", - xmlIsWrapped: true, - xmlElementName: "Blob", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } - } - } - } - }; - var FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", - type: { - name: "Composite", - className: "FilterBlobItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - tags: { - serializedName: "Tags", - xmlName: "Tags", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobTags" + name: "DateTimeRfc1123" } } } } }; - var BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", + exports2.ContainerReleaseLeaseExceptionHeaders = { + serializedName: "Container_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobTags", + className: "ContainerReleaseLeaseExceptionHeaders", modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } + name: "String" } } } } }; - var BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", + exports2.ContainerRenewLeaseHeaders = { + serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", - className: "BlobTag", + className: "ContainerRenewLeaseHeaders", modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + 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" + } } } } }; - var SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", + exports2.ContainerRenewLeaseExceptionHeaders = { + serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "SignedIdentifier", + className: "ContainerRenewLeaseExceptionHeaders", modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } } } } }; - var AccessPolicy = { - serializedName: "AccessPolicy", + exports2.ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", - className: "AccessPolicy", + className: "ContainerBreakLeaseHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", + 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" } }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", + 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" + } } } } }; - var ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", + exports2.ContainerBreakLeaseExceptionHeaders = { + serializedName: "Container_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "ContainerBreakLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + exports2.ContainerChangeLeaseHeaders = { + serializedName: "Container_changeLeaseHeaders", + type: { + name: "Composite", + className: "ContainerChangeLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } } } } }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", + exports2.ContainerChangeLeaseExceptionHeaders = { + serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobFlatListSegment", + className: "ContainerChangeLeaseExceptionHeaders", modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", + exports2.ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", - className: "BlobItemInternal", + className: "ContainerListBlobFlatSegmentHeaders", 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", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", 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", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobTags" + name: "String" } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTimeRfc1123" } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49715,1017 +55600,720 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.ContainerListBlobHierarchySegmentHeaders = { + serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "ContainerListBlobHierarchySegmentHeaders", modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", - type: { - name: "DateTimeRfc1123" - } - }, - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + } + } + } + }; + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { + serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + type: { + name: "Composite", + className: "ContainerListBlobHierarchySegmentExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "ByteArray" + name: "String" } - }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + } + } + } + }; + 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" } }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { name: "Enum", - allowedValues: ["locked", "unlocked"] + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { name: "Enum", allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" ] } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "Boolean" } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + } + } + } + }; + 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" } - }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + } + } + } + }; + exports2.BlobDownloadHeaders = { + serializedName: "Blob_downloadHeaders", + type: { + name: "Composite", + className: "BlobDownloadHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "DateTimeRfc1123" + name: "Dictionary", + value: { type: { name: "String" } } } }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { - name: "Boolean" + name: "Dictionary", + value: { type: { name: "String" } } } }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "Boolean" + name: "Number" } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + contentRange: { + serializedName: "content-range", + xmlName: "content-range", type: { - name: "Number" + name: "String" } }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "String" } }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Boolean" + name: "ByteArray" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "String" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { - name: "DateTimeRfc1123" + name: "String" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", 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", + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: ["High", "Standard"] - } - }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", - type: { - name: "DateTimeRfc1123" + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", - type: { - name: "Boolean" - } - } - } - } - }; - var 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, + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", - type: { - name: "String" - } - } - } - } - }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment", - modelProperties: { - blobPrefixes: { - serializedName: "BlobPrefixes", - xmlName: "BlobPrefixes", - xmlElementName: "BlobPrefix", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobPrefix" - } - } + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } - } - } - } - }; - var BlobPrefix = { - serializedName: "BlobPrefix", - type: { - name: "Composite", - className: "BlobPrefix", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "Composite", - className: "BlobName" + name: "Enum", + allowedValues: ["locked", "unlocked"] } - } - } - } - }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } - } - } - } - }; - var BlockList = { - serializedName: "BlockList", - type: { - name: "Composite", - className: "BlockList", - modelProperties: { - committedBlocks: { - serializedName: "CommittedBlocks", - xmlName: "CommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } }, - uncommittedBlocks: { - serializedName: "UncommittedBlocks", - xmlName: "UncommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "Boolean" } - } - } - } - }; - var Block = { - serializedName: "Block", - type: { - name: "Composite", - className: "Block", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", + 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" } - } - } - } - }; - var PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "Boolean" } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } - } - } - } - }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", - type: { - name: "Composite", - className: "PageRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Number" + name: "ByteArray" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { name: "Number" } - } - } - } - }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", - type: { - name: "Composite", - className: "ClearRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "Number" + name: "Boolean" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { - name: "Number" + name: "DateTimeRfc1123" } - } - } - } - }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + }, + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "String" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "Composite", - className: "QuerySerialization" + name: "Boolean" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "BlobDownloadExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.BlobGetPropertiesHeaders = { + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "BlobGetPropertiesHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "DateTimeRfc1123" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "Dictionary", + value: { type: { name: "String" } } } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { name: "Dictionary", - value: { type: { name: "any" } } + value: { type: { name: "String" } } } - } - } - } - }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + }, + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { - name: "String" + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { - name: "Boolean" + name: "String" } - } - } - } - }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration", - modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + }, + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } - } - } - } - }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", - type: { - name: "Composite", - className: "ArrowConfiguration", - modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } - } - } - } - }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", - type: { - name: "Composite", - className: "ArrowField", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + }, + isIncrementalCopy: { + serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { - name: "String" + name: "Boolean" } }, - name: { - serializedName: "Name", - xmlName: "Name", + destinationSnapshot: { + serializedName: "x-ms-copy-destination-snapshot", + xmlName: "x-ms-copy-destination-snapshot", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Number" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "Number" + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } - } - } - } - }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "String" + name: "Enum", + allowedValues: ["locked", "unlocked"] } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } - } - } - } - }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } - } - } - } - }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -50754,210 +56342,137 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } - } - } - } - }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + 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", + accessTier: { + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { name: "String" } - } - } - } - }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", - type: { - name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + accessTierInferred: { + serializedName: "x-ms-access-tier-inferred", + xmlName: "x-ms-access-tier-inferred", type: { - name: "String" + name: "Boolean" } - } - } - } - }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + archiveStatus: { + serializedName: "x-ms-archive-status", + xmlName: "x-ms-archive-status", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + accessTierChangedOn: { + serializedName: "x-ms-access-tier-change-time", + xmlName: "x-ms-access-tier-change-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + expiresOn: { + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "String" + name: "Boolean" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + rehydratePriority: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, - date: { - serializedName: "date", - xmlName: "date", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "DateTimeRfc1123" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { name: "Boolean" } @@ -50972,11 +56487,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "BlobGetPropertiesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50988,15 +56503,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.BlobDeleteHeaders = { + serializedName: "Blob_deleteHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "BlobDeleteHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } @@ -51015,11 +56530,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, errorCode: { @@ -51032,11 +56547,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", + exports2.BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", + className: "BlobDeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51048,11 +56563,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", + exports2.BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + className: "BlobUndeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51092,11 +56607,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", + className: "BlobUndeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51108,11 +56623,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "BlobSetExpiryHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51155,22 +56670,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", + exports2.BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateExceptionHeaders", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51182,21 +56690,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", + exports2.BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "BlobSetHttpHeadersHeaders", 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", @@ -51211,34 +56710,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "Number" } }, clientRequestId: { @@ -51269,49 +56745,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51322,11 +56755,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51338,11 +56771,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.BlobSetImmutabilityPolicyHeaders = { + serializedName: "Blob_setImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + className: "BlobSetImmutabilityPolicyHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51372,21 +56805,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" + } + }, + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "BlobSetImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51398,26 +56839,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.BlobDeleteImmutabilityPolicyHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "BlobDeleteImmutabilityPolicyHeaders", 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", @@ -51445,22 +56872,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51472,34 +56892,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.BlobSetLegalHoldHeaders = { + serializedName: "Blob_setLegalHoldHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "BlobSetLegalHoldHeaders", 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", @@ -51528,21 +56926,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "String" + name: "Boolean" } } } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51554,11 +56952,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "BlobSetMetadataHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51595,6 +56993,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51602,6 +57007,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51612,11 +57038,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "BlobSetMetadataExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51628,12 +57054,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + 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", @@ -51661,22 +57108,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "BlobAcquireLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51688,12 +57128,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -51721,22 +57175,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51748,58 +57195,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "BlobRenewLeaseHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -51831,11 +57253,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51847,11 +57269,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "BlobChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51867,13 +57289,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51888,6 +57303,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51905,11 +57327,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", + className: "BlobChangeLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51921,11 +57343,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "BlobBreakLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51941,6 +57363,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51972,11 +57401,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51988,12 +57417,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "BlobCreateSnapshotHeaders", modelProperties: { + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", + type: { + name: "String" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -52008,13 +57444,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52036,21 +57465,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52062,11 +57512,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlobStartCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52082,13 +57532,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52110,21 +57553,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52132,15 +57604,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlobCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52156,13 +57642,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52184,21 +57663,71 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52206,23 +57735,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52261,11 +57797,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52277,19 +57813,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlobSetTierHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52311,13 +57840,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52328,11 +57850,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52344,11 +57866,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52416,11 +57938,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52432,11 +57954,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlobQueryHeaders", modelProperties: { lastModified: { serializedName: "last-modified", @@ -52445,13 +57967,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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-", @@ -52461,22 +57976,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52555,7 +58054,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - copyCompletedOn: { + copyCompletionTime: { serializedName: "x-ms-copy-completion-time", xmlName: "x-ms-copy-completion-time", type: { @@ -52649,20 +58148,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52712,47 +58197,71 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "ByteArray" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } - }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + } + } + } + }; + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", + type: { + name: "Composite", + className: "BlobQueryExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + 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" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, errorCode: { @@ -52761,22 +58270,75 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "ByteArray" + 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" } } } } }; - var BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52788,160 +58350,121 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesHeaders = { - serializedName: "Blob_getPropertiesHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlobGetPropertiesHeaders", + className: "PageBlobCreateHeaders", 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", + etag: { + serializedName: "etag", + xmlName: "etag", 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "DateTimeRfc1123" } }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "DateTimeRfc1123" } }, - isIncrementalCopy: { - serializedName: "x-ms-incremental-copy", - xmlName: "x-ms-incremental-copy", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - destinationSnapshot: { - serializedName: "x-ms-copy-destination-snapshot", - xmlName: "x-ms-copy-destination-snapshot", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", + } + } + } + }; + 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", @@ -52949,6 +58472,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, contentMD5: { serializedName: "content-md5", xmlName: "content-md5", @@ -52956,32 +58486,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, blobSequenceNumber: { @@ -53019,23 +58528,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -53054,106 +58549,101 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessTierInferred: { - serializedName: "x-ms-access-tier-inferred", - xmlName: "x-ms-access-tier-inferred", + } + } + } + }; + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", + type: { + name: "Composite", + className: "PageBlobUploadPagesExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - archiveStatus: { - serializedName: "x-ms-archive-status", - xmlName: "x-ms-archive-status", + } + } + } + }; + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", + type: { + name: "Composite", + className: "PageBlobClearPagesHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + date: { + serializedName: "date", + xmlName: "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", @@ -53164,11 +58654,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53180,19 +58670,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "BlobDeleteHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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", @@ -53214,6 +58732,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53224,11 +58763,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53236,16 +58775,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + 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", @@ -53284,11 +58858,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53300,12 +58874,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -53313,11 +58894,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -53347,15 +58928,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "BlobSetExpiryExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53367,11 +58955,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersHeaders", + className: "PageBlobResizeHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53432,11 +59020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53448,12 +59036,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", + 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", @@ -53482,29 +59091,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } } } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53516,12 +59117,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", + 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", @@ -53549,15 +59164,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53569,12 +59206,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldHeaders", + 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", @@ -53596,6 +59254,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -53603,21 +59268,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + 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" + } } } } }; - var BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53629,11 +59315,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "BlobSetMetadataHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53649,6 +59335,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53670,13 +59370,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -53684,6 +59377,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53715,11 +59422,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "BlobSetMetadataExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53731,11 +59438,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53751,18 +59458,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, requestId: { @@ -53785,15 +59492,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53801,15 +59550,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseHeaders", + className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53852,15 +59615,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } } } } }; - var BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53872,11 +59642,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "BlobRenewLeaseHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53892,11 +59662,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -53920,21 +59690,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53946,11 +59751,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "BlobChangeLeaseHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53966,6 +59771,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53980,16 +59792,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } @@ -54000,16 +59812,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", - modelProperties: { + }, + 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", @@ -54020,32 +59844,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + 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", @@ -54074,15 +59914,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54094,31 +59969,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotHeaders", + className: "BlockBlobStageBlockFromURLHeaders", modelProperties: { - snapshot: { - serializedName: "x-ms-snapshot", - xmlName: "x-ms-snapshot", - type: { - name: "String" - } - }, - etag: { - serializedName: "etag", - xmlName: "etag", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, clientRequestId: { @@ -54142,13 +60010,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54163,6 +60024,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54173,11 +60048,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54185,28 +60060,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLHeaders", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { etag: { serializedName: "etag", xmlName: "etag", type: { - name: "String" + name: "String" + } + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, clientRequestId: { @@ -54244,19 +60147,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -54269,11 +60178,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", + exports2.BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", + className: "BlockBlobCommitBlockListExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54285,12 +60194,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", + exports2.BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", type: { name: "Composite", - className: "BlobCopyFromURLHeaders", + className: "BlockBlobGetBlockListHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -54298,11 +60214,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" + } + }, + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", + type: { + name: "Number" } }, clientRequestId: { @@ -54326,13 +60249,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54340,8621 +60256,7791 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", + } + } + } + }; + 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" } - }, - 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", + } + } + } + }; + } +}); + +// 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: "String" + name: "Enum", + allowedValues: ["metadata", "deleted", "system"] } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + } + } + }, + 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: "String" + name: "Composite", + className: "SignedIdentifier" } } } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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" } } }; - var 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.sourceLeaseId = { + parameterPath: ["options", "sourceLeaseId"], + mapper: { + serializedName: "x-ms-source-lease-id", + xmlName: "x-ms-source-lease-id", + type: { + name: "String" } } }; - var 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.comp10 = { + parameterPath: "comp", + mapper: { + defaultValue: "lease", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.action = { + parameterPath: "action", + mapper: { + defaultValue: "acquire", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.duration = { + parameterPath: ["options", "duration"], + mapper: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Number" } } }; - var 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.proposedLeaseId = { + parameterPath: ["options", "proposedLeaseId"], + mapper: { + serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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.action1 = { + parameterPath: "action", + mapper: { + defaultValue: "release", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.action3 = { + parameterPath: "action", + mapper: { + defaultValue: "break", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.breakPeriod = { + parameterPath: ["options", "breakPeriod"], + mapper: { + serializedName: "x-ms-lease-break-period", + xmlName: "x-ms-lease-break-period", + type: { + name: "Number" } } }; - var 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.action4 = { + parameterPath: "action", + mapper: { + defaultValue: "change", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.proposedLeaseId1 = { + parameterPath: "proposedLeaseId", + mapper: { + serializedName: "x-ms-proposed-lease-id", + required: true, + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetTagsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + exports2.include1 = { + parameterPath: ["options", "include"], + mapper: { + serializedName: "include", + xmlName: "include", + xmlElementName: "ListBlobsIncludeItem", + type: { + name: "Sequence", + element: { type: { - name: "String" + 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" + } } }; - var 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.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" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var 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.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] } } }; - var 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.sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.sourceIfMatch = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], + mapper: { + serializedName: "x-ms-source-if-match", + xmlName: "x-ms-source-if-match", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var 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.comp15 = { + parameterPath: "comp", + mapper: { + defaultValue: "copy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", + mapper: { + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", + type: { + name: "String" } } }; - var 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.copyId = { + parameterPath: "copyId", + mapper: { + serializedName: "copyid", + required: true, + xmlName: "copyid", + type: { + name: "String" } } }; - var 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.comp16 = { + parameterPath: "comp", + mapper: { + defaultValue: "tier", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", + mapper: { + defaultValue: "query", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.blobContentLength = { + parameterPath: "blobContentLength", + mapper: { + serializedName: "x-ms-blob-content-length", + required: true, + xmlName: "x-ms-blob-content-length", + type: { + name: "Number" } } }; - var 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.blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], + mapper: { + defaultValue: 0, + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" } } }; - var 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.contentType1 = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/octet-stream", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" } } }; - var 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.body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.accept2 = { + parameterPath: "accept", + mapper: { + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" } } }; - var 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.comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "page", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.pageWrite = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" } } }; - var 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.ifSequenceNumberLessThanOrEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", + type: { + name: "Number" } } }; - var 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.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" } } }; - var 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.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], + mapper: { + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", + type: { + name: "ByteArray" } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.range1 = { + parameterPath: "range", + mapper: { + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.comp20 = { + parameterPath: "comp", + mapper: { + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], + mapper: { + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", + type: { + name: "String" } } }; - var 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.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], + mapper: { + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", + type: { + name: "String" } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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"] } } }; - var 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.comp21 = { + parameterPath: "comp", + mapper: { + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blobType1 = { + parameterPath: "blobType", + mapper: { + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" } } - }; - var 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.comp22 = { + parameterPath: "comp", + mapper: { + defaultValue: "appendblock", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], + exports2.appendPosition = { + parameterPath: [ + "options", + "appendPositionAccessConditions", + "appendPosition" + ], mapper: { - defaultValue: "application/xml", + 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: "Content-Type", + serializedName: "comp", type: { name: "String" } } }; - var blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + exports2.blobType2 = { + parameterPath: "blobType", + mapper: { + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" + } + } }; - var accept = { - parameterPath: "accept", + exports2.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - defaultValue: "application/xml", + 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: "Accept", + 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 url = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" + var deleteOperationSpec = { + path: "/{containerName}", + httpMethod: "DELETE", + responses: { + 202: { + headersMapper: Mappers.ContainerDeleteHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerDeleteExceptionHeaders } }, - skipEncoding: true + 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 restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 + var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerSetAccessPolicyHeaders }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" + 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 version = { - parameterPath: "version", - mapper: { - defaultValue: "2024-11-04", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" + 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 requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" + 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 accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" + 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 marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" + 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 maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 + var breakLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.ContainerBreakLeaseHeaders }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" + 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 include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + var changeLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerChangeLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerChangeLeaseExceptionHeaders } }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + 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 comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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 }; - var comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } + /** + * 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); } - }; - var multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } + /** + * 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); } - }; - var comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + /** + * 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); } - }; - var access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } + /** + * 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); } - }; - var defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } + /** + * 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); } - }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } + /** + * 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); } - }; - var comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } + /** + * 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); } - }; - var comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" - } + /** + * 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); } - }; - var comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } }; - var action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" + 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 proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" + 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 action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + var setMetadataOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.BlobSetMetadataHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetMetadataExceptionHeaders } - } - }; - var 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" - ] - } - } + }, + 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 } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" + 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 ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" + 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 ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" + 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 deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] + 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 }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * 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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * 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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" - } + /** + * 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); } }; - var comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" + 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 immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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 comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" + 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 comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + 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 rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + var copyIncrementalOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.PageBlobCopyIncrementalHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCopyIncrementalExceptionHeaders } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } + } +}); + +// 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; } - }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * 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); } }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" + 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 sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" + 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 legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" + 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 }; - var sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } + } +}); + +// 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; } - }; - var copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } + /** + * 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); } - }; - var 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"] - } + /** + * 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); } - }; - var comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" - } + /** + * 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); } - }; - var copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" - } + /** + * 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); } }; - var comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } - } - }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags + }, + 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 transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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 transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" + 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 }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + } +}); + +// 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(url, options) { + if (url === void 0) { + throw new Error("'url' cannot be null"); } - } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + if (!options) { + options = {}; } - } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + const defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; + super(optionsWithDefaults); + this.url = url; + 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); } }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } + 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(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + const storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = void 0; } }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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; } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + /** + * 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; } - } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.add) { + blobSASPermissions.add = true; } - } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.create) { + blobSASPermissions.create = true; } - } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + if (permissionLike.write) { + blobSASPermissions.write = true; } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" + if (permissionLike.delete) { + blobSASPermissions.delete = true; } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" + if (permissionLike.deleteVersion) { + blobSASPermissions.deleteVersion = true; } - } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.tag) { + blobSASPermissions.tag = true; } - } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + if (permissionLike.move) { + blobSASPermissions.move = true; } - } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.execute) { + blobSASPermissions.execute = true; } - } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + if (permissionLike.setImmutabilityPolicy) { + blobSASPermissions.setImmutabilityPolicy = true; } - } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + if (permissionLike.permanentDelete) { + blobSASPermissions.permanentDelete = true; } + return blobSASPermissions; } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + /** + * 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"); } - } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + 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"); } - } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - } - }; - var 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"] + if (this.permanentDelete) { + permissions.push("y"); } + return permissions.join(""); } }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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; } - }; - var blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + /** + * 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; } - } - }; - var comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.add) { + containerSASPermissions.add = true; } - } - }; - var maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + if (permissionLike.create) { + containerSASPermissions.create = true; } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + if (permissionLike.write) { + containerSASPermissions.write = true; } - } - }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.delete) { + containerSASPermissions.delete = true; } - } - }; - var comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.list) { + containerSASPermissions.list = true; } - } - }; - var blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.deleteVersion) { + containerSASPermissions.deleteVersion = true; } - } - }; - var copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + if (permissionLike.tag) { + containerSASPermissions.tag = true; } - } - }; - var comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.move) { + containerSASPermissions.move = true; } - } - }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + if (permissionLike.execute) { + containerSASPermissions.execute = true; } - } - }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList - }; - var comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.setImmutabilityPolicy) { + containerSASPermissions.setImmutabilityPolicy = true; } - } - }; - var listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + if (permissionLike.permanentDelete) { + containerSASPermissions.permanentDelete = true; + } + if (permissionLike.filterByTags) { + containerSASPermissions.filterByTags = true; } + return containerSASPermissions; } - }; - var ServiceImpl = class { /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client + * Specifies Read access granted. */ - constructor(client) { - this.client = client; - } + read = false; /** - * 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. + * Specifies Add access granted. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); - } + add = false; /** - * 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. + * Specifies Create access granted. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); - } + create = false; /** - * 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. + * Specifies Write access granted. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); - } + write = false; /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. + * Specifies Delete access granted. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); - } + deleteVersion = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Specifies List access granted. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); - } + list = false; /** - * 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. + * Specfies Tag access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); - } + tag = false; /** - * 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. + * Specifies Move access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); - } - }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + 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"); } - }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + 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(""); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * The storage API version. */ - constructor(client) { - this.client = client; - } + version; /** - * 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. + * Optional. The allowed HTTP protocol(s). */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); - } + protocol; /** - * 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. + * Optional. The start time for this SAS token. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); - } + startsOn; /** - * 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. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); - } + expiresOn; /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); - } + permissions; /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + services; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + resourceTypes; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); - } + identifier; /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Optional. Encryption scope to use when sending requests authorized with this SAS URI. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); - } + encryptionScope; /** - * 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. + * 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 */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); - } + resource; /** - * 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. + * The signature for the SAS token. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } + signature; /** - * [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. + * Value for cache-control header in Blob/File Service SAS. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); - } + cacheControl; /** - * [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. + * Value for content-disposition header in Blob/File Service SAS. */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); - } + contentDisposition; /** - * [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. + * Value for content-encoding header in Blob/File Service SAS. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); - } + contentEncoding; /** - * [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. + * Value for content-length header in Blob/File Service SAS. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); - } + contentLanguage; /** - * [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. + * Value for content-type header in Blob/File Service SAS. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); - } + contentType; /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. + * Inner value of getter ipRange. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); - } + ipRangeInner; /** - * [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. + * The Azure Active Directory object ID in GUID format. + * Property of user delegation key. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); - } + signedOid; /** - * Returns the sku name and account kind - * @param options The options parameters. + * The Azure Active Directory tenant ID in GUID format. + * Property of user delegation key. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); - } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders + 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 + }; } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders + 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; + } } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders + } + /** + * 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; + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + 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; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 + } }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + } + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + } + 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."); } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + } + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + } + 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(); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var BlobImpl = class { - /** - * 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); + 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * 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); + 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(); + } } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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, + timestamp2, + 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."); } - /** - * 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(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); + 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(); + } } - /** - * 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); + 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, + timestamp2, + 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}`); } - /** - * 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); + 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'."); } - /** - * 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(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - /** - * 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); + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - /** - * [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); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - /** - * [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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - /** - * 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); + 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."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + if (version < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - /** - * 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(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + 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; /** - * 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. + * Gets the lease Id. + * + * @readonly */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + get leaseId() { + return this._leaseId; } /** - * Returns the sku name and account kind - * @param options The options parameters. + * Gets the url. + * + * @readonly */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + get url() { + return this._url; } /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); + 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; } /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * 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. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); + 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 + })); + }); } /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. + * 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. */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); - } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders - } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + 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."); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + 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."); } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var PageBlobImpl = class { + 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 + }); + }); + } /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * 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. */ - constructor(client) { - this.client = client; + 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; /** - * 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. + * 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 - */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + 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 { /** - * 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. + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * 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. + * Returns if it was previously specified + * for the file. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * 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. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * 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. + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } /** - * 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. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get contentType() { + return this.originalResponse.contentType; } /** - * 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. + * 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 */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + 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; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get copySource() { + return this.originalResponse.copySource; } /** - * 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. + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get leaseState() { + return this.originalResponse.leaseState; } /** - * 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. + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get leaseStatus() { + return this.originalResponse.leaseStatus; } /** - * 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. + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. + * + * @readonly */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get date() { + return this.originalResponse.date; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + */ + get etag() { + return this.originalResponse.etag; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * The number of tags associated with the blob + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get tagCount() { + return this.originalResponse.tagCount; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * The error code. + * + * @readonly + */ + get errorCode() { + return this.originalResponse.errorCode; } /** - * 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. + * 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). * - * @param permissions - + * @readonly */ - 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; + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * 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. * - * @param permissionLike - + * @readonly */ - 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; + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Returns the date and time the file was last + * modified. Any operation that modifies the file or its properties updates + * the last modified time. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); + get lastModified() { + return this.originalResponse.lastModified; } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + /** + * 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; } /** - * 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. + * Returns the date and time the blob was created. * - * @param permissions - + * @readonly */ - 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; + 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; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates the versionId of the downloaded blob version. * - * @param permissionLike - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Indicates whether version of this blob is a current version. * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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 */ - 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(""); + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * 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) */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get contentCrc64() { + return this.originalResponse.contentCrc64; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Object Replication Policy Id of the destination blob. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * If this blob has been sealed. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + get isSealed() { + return this.originalResponse.isSealed; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } + /** + * Indicates if a legal hold is present on the blob. + * + * @readonly + */ + get legalHold() { + return this.originalResponse.legalHold; } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get contentAsBlob() { + return this.originalResponse.blobBody; } - if (version2 >= "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."); - } + /** + * 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; } - 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."); + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; + 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); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); + if (bytes.length !== length) { + throw new Error("Hit stream end."); } + return bytes; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * Reads a single byte from the stream. + * + * @param stream - + * @param options - + */ + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 1, options); + return buf[0]; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + // 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(stream, options = {}) { + let zigZagEncoded = 0; + let significanceInBit = 0; + let byte, haveMoreByte, significanceInFloat; + do { + byte = await _AvroParser.readByte(stream, 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(stream, 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); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readNull() { + return null; + } + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); + if (b === 1) { + return true; + } else if (b === 0) { + return false; } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat32(0, true); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat64(0, true); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); + if (size < 0) { + throw new Error("Bytes size was negative."); } + return stream.read(size, { abortSignal: options.abortSignal }); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); + return { key, value }; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readMap(stream, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } + return dict; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static async readArray(stream, readItemMethod, options = {}) { + const items = []; + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { + if (count < 0) { + await _AvroParser.readLong(stream, options); + count = -count; + } + while (count--) { + const item = await readItemMethod(stream, options); + items.push(item); + } } + return items; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + return _AvroType.fromObjectSchema(schema2); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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}`); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); + } } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { + } + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + } } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + switch (this._primitive) { + case AvroPrimitive.NULL: + return AvroParser.readNull(); + case AvroPrimitive.BOOLEAN: + return AvroParser.readBoolean(stream, options); + case AvroPrimitive.INT: + return AvroParser.readInt(stream, options); + case AvroPrimitive.LONG: + return AvroParser.readLong(stream, options); + case AvroPrimitive.FLOAT: + return AvroParser.readFloat(stream, options); + case AvroPrimitive.DOUBLE: + return AvroParser.readDouble(stream, options); + case AvroPrimitive.BYTES: + return AvroParser.readBytes(stream, options); + case AvroPrimitive.STRING: + return AvroParser.readString(stream, options); + default: + throw new Error("Unknown Avro Primitive"); + } } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); + return this._symbols[value]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } - if (version2 < "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."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + const readItemMethod = (s, opts) => { + return this._itemType.read(s, opts); + }; + return AvroParser.readMap(stream, readItemMethod, options); } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, 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(stream, options); + } + } + return record; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + }; + } +}); + +// 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; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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; + _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."); } - if (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); + 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._leaseId = leaseId2; - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + }); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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; } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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 tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); + return data; } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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; } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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((resolve4, 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(); + resolve4(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); + } }); - }); - } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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 tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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. @@ -63070,7 +68156,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -63177,14 +68263,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -63227,23 +68305,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63272,7 +68333,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.originalResponse.clientRequestId; } /** - * Indicates the version of the Blob service used + * Indicates the version of the File service used * to execute the request. * * @readonly @@ -63280,22 +68341,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63314,73 +68359,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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; + get blobBody() { + return void 0; } /** * The response body as a node.js Readable stream. * Always undefined in the browser. * - * It will automatically retry when internal read stream unexpected ends. + * It will parse avor data returned by blob query. * * @readonly */ get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** * The HTTP response. @@ -63388,1032 +68385,1289 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get _response() { return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** - * Creates an instance of BlobDownloadResponse. + * Creates an instance of BlobQueryResponse. * * @param originalResponse - - * @param getter - - * @param offset - - * @param count - * @param options - */ - constructor(originalResponse, getter, offset, count, options = {}) { + constructor(originalResponse, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + this.blobDownloadStream = new BlobQuickQueryStream_js_1.BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - 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."); + 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 + } } - return bytes; + }; + } + } +}); + +// 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}`); } - /** - * 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]; + } + 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 + "."; } - // 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 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}`; } - 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."); + 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; } - } - 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."); + case "canceled": { + stateProxy.setCanceled(state); + break; } - 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 }; + 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 + })); } - static async readMap(stream2, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; + } + function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; + } + async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 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 { 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); } - return items; + updateState === null || updateState === void 0 ? void 0 : updateState(state, response); } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); + case "DELETE": { + return void 0; } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + default: { + return getDefault(); } } - }; - var AvroPrimitiveType = class extends AvroType { - 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"); + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; + } } } - }; - var AvroEnumType = class extends AvroType { - 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 { - constructor(types) { - super(); - this._types = types; + } + 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; } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); + } + 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.`); } - }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + 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; + } } - // 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); + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; + } + 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; } - // 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; + 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; } - }; - 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; + 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 true; + return error3; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; + exports2.getErrorFromResponse = getErrorFromResponse; + function calculatePollingIntervalFromDate(retryAfterDate) { + const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); + const retryAfterTime = retryAfterDate.getTime(); + if (timeNow < retryAfterTime) { + return retryAfterTime - timeNow; } - get objectIndex() { - return this._objectIndex; + return void 0; + } + function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } } - 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; + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return void 0; + } } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; + case "Body": { + return getProvisioningState(rawResponse); } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + } + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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, 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, + stateProxy, + processResult, + getOperationStatus: getStatusFromInitialResponse, + withOperationLocation, + setErrorAsResult: !resolveOnUnsuccessful }); - await 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; - } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); + 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 }); + } } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; + } 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; } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); + } + 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; } } - yield yield tslib.__await(result); } - }); - } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); - } - return data; - } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + }; + 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; } - get position() { - return this._position; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - async read(size, options = {}) { + async update(options) { var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.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 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 chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve4, 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(); - resolve4(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); - } + 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 }); } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; + } + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } - }; - var BlobQuickQueryStream = class extends stream.Readable { /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * Serializes the Poller operation. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); - } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); - } + toString() { + return JSON.stringify({ + state: this.state + }); } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); + }; + 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); } }; - var BlobQueryResponse = class { - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + 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 { /** - * Returns if it was previously specified - * for the file. + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @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. + * 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. * - * @readonly - */ - get contentDisposition() { - return this.originalResponse.contentDisposition; - } - /** - * Returns the value that was specified - * for the Content-Encoding request header. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @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. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @readonly - */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; - } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * // You can assign more local properties here. + * } + * } + * ``` * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. + * 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. * - * @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. + * 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: * - * @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. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get contentRange() { - return this.originalResponse.contentRange; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve4, reject) => { + this.resolve = resolve4; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get contentType() { - return this.originalResponse.contentType; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * 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. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get copyCompletedOn() { - return void 0; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get copyId() { - return this.originalResponse.copyId; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * 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. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @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. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get copySource() { - return this.originalResponse.copySource; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' - * - * @readonly + * Invokes the underlying operation's cancel method. */ - get copyStatus() { - return this.originalResponse.copyStatus; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. + * 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. * - * @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'. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + 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; } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; + 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()); + } } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get date() { - return this.originalResponse.date; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly + * Returns true if the poller has finished polling. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. - * - * @readonly + * Stops the poller from continuing to poll. */ - get etag() { - return this.originalResponse.etag; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * The error code. - * - * @readonly + * Returns true if the poller is stopped. */ - get errorCode() { - return this.originalResponse.errorCode; + isStopped() { + return this.stopped; } /** - * 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). + * Attempts to cancel the underlying operation. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @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. + * If it's called again before it finishes, it will throw an error. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get lastModified() { - return this.originalResponse.lastModified; + 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; } /** - * A name-value pair - * to associate with a file storage object. + * Returns the state of the operation. * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * 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. * - * @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. + * Example: * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the File service used - * to execute the request. + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } * - * @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. + * // 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; + * } * - * @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. + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... * - * @readonly - */ - get blobBody() { - return void 0; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * 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, * - * It will parse avor data returned by blob query. + * // The only other property needed by PublicState. + * publicProperty: state.publicProperty + * } + * } + * } + * ``` * - * @readonly + * You can see this in the tests of this repository, go to the file: + * `../test/utils/testPoller.ts` + * and look for the getOperationState implementation. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve4) => setTimeout(() => resolve4(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -64421,20 +69675,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -64442,10 +69697,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -64485,12 +69740,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + 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.`); @@ -64500,27 +69764,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -64535,8 +69833,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -64551,9 +69849,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve4, reject) => { this.emitter.on("finish", resolve4); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -64590,333 +69888,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve4, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve4).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve4(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream2, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve4, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream2.on("readable", () => { + const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); resolve4(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -64924,28 +69925,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve4(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream2, buffer2, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve4, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -64956,18 +69957,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream.on("end", () => { resolve4(pos); }); - stream2.on("error", reject); + stream.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve4, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve4(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve4, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -64978,9 +69991,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_utils7(); + 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. */ @@ -64996,49 +70048,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -65047,8 +70099,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -65057,8 +70109,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -65088,7 +70140,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -65097,76 +70149,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -65174,8 +70256,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -65183,9 +70264,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -65194,7 +70275,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -65211,9 +70295,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -65224,7 +70308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -65234,7 +70318,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -65245,17 +70329,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -65263,19 +70355,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -65285,19 +70379,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65307,13 +70409,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -65324,7 +70426,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -65336,14 +70438,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -65354,22 +70458,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65385,15 +70491,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -65403,15 +70511,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -65422,24 +70537,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65460,57 +70577,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -65518,15 +70636,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -65538,14 +70656,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -65555,36 +70673,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -65595,31 +70716,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -65627,12 +70749,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -65643,26 +70765,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -65676,8 +70801,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await streamToBuffer(stream2, buffer2, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -65685,7 +70810,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -65705,10 +70830,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -65723,7 +70851,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -65739,7 +70867,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -65751,21 +70879,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -65773,12 +70903,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -65790,18 +70920,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve4) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve4(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve4((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -65810,17 +70946,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve4) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve4((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. @@ -65828,8 +71014,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -65840,8 +71026,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -65854,8 +71040,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -65865,60 +71051,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -65929,40 +71120,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -65970,20 +71176,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65996,20 +71213,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -66018,29 +71237,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -66055,7 +71289,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -66069,74 +71303,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -66148,8 +71397,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -66158,15 +71407,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -66182,26 +71448,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -66219,7 +71487,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -66230,32 +71498,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66280,22 +71564,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -66303,10 +71602,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -66324,7 +71623,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -66341,18 +71640,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -66363,30 +71663,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66394,20 +71696,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -66436,18 +71740,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -66474,7 +71778,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -66495,23 +71799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -66521,32 +71824,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -66572,15 +71875,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -66599,27 +71905,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream2, + const scheduler = new storage_common_1.BufferScheduler( + stream, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -66637,50 +71943,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -66691,13 +72005,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -66705,23 +72019,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66730,21 +72046,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -66752,7 +72080,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -66760,19 +72088,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -66785,7 +72115,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -66796,32 +72126,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -66830,13 +72163,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -66846,7 +72181,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -66855,16 +72190,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -66872,22 +72209,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -66907,17 +72246,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -66926,94 +72263,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```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); * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * // 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()`: * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67039,13 +72361,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67055,17 +72380,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -67074,7 +72401,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67082,20 +72409,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67116,17 +72445,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -67136,94 +72463,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67232,7 +72553,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -67250,13 +72573,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67264,24 +72590,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -67289,12 +72617,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -67302,22 +72632,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67327,38 +72659,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_utils7(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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."); @@ -67369,15 +72735,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -67389,18 +72755,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -67420,7 +72786,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -67435,7 +72801,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -67450,6 +72816,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -67489,6 +72865,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve4(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -67505,11 +72883,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -67533,13 +72936,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -67551,13 +72954,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; + let url; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -67566,28 +72969,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; + let url; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -67595,24 +72998,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + await new Clients_js_1.BlobClient(url, 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -67625,9 +73036,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -67636,19 +73047,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -67657,23 +73068,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path5 = getURLPath(subRequest.url); + const path5 = (0, utils_common_js_1.getURLPath)(subRequest.url); if (!path5 || path5 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } @@ -67684,7 +73095,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -67701,7 +73112,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -67712,7 +73123,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -67723,18 +73134,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url2, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path5 = getURLPath(url2); + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path5 = (0, utils_common_js_1.getURLPath)(url); if (path5 && path5 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { @@ -67746,10 +73175,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -67760,7 +73189,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -67778,11 +73207,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -67790,17 +73233,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -67809,10 +73267,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -67829,7 +73289,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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. */ @@ -67838,48 +73326,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -67887,34 +73375,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -67931,7 +73437,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -67953,7 +73459,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67961,7 +73467,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67971,15 +73477,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * 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 BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67987,12 +73505,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -68005,14 +73523,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -68020,8 +73542,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -68032,19 +73554,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68056,24 +73585,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -68086,7 +73615,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -68094,8 +73623,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -68144,29 +73673,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -68181,7 +73710,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -68195,7 +73724,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -68205,10 +73734,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -68220,14 +73749,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -68240,18 +73769,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -68260,23 +73809,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -68292,44 +73864,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -68337,64 +73891,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -68402,41 +73955,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -68455,7 +74011,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68472,17 +74031,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -68490,35 +74047,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -68526,118 +74070,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```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); * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * // 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -68655,7 +74219,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68676,23 +74243,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -68712,18 +74283,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -68734,27 +74303,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -68764,53 +74317,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: - * - * ```js - * let i = 1; + * // 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 @@ -68818,11 +74372,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -68834,7 +74387,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -68853,7 +74408,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -68862,14 +74420,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -68881,7 +74439,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -68891,7 +74449,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -68901,18 +74459,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve4) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve4(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve4((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -68921,45 +74482,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve4) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve4((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -69063,6 +74657,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -69070,7 +74716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69117,12 +74763,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -69148,10 +74799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69168,13 +74831,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -69203,6 +74870,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -69224,44 +74907,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -69272,22 +74973,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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. @@ -69302,35 +75031,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url2, credentialOrPipeline, options) { + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url2, pipeline); + super(url, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -69341,22 +75070,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -69373,7 +75111,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -69387,47 +75125,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -69436,15 +75156,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -69454,14 +75174,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -69472,14 +75192,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -69487,7 +75207,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -69499,9 +75219,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -69522,23 +75248,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -69558,18 +75288,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -69580,27 +75308,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -69608,57 +75320,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // 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 @@ -69670,7 +75378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -69682,7 +75390,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -69701,7 +75411,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69717,45 +75430,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -69763,45 +75458,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js + * // Use for await to iterate the containers * let i = 1; * for await (const container of blobServiceClient.listContainers()) { * console.log(`Container ${i++}: ${container.name}`); * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -69823,7 +75514,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -69835,17 +75526,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -69864,7 +75558,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69874,16 +75571,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -69897,19 +75594,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -69917,7 +75622,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69925,21 +75630,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -69947,7 +75653,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69955,66 +75661,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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; + } }); } }); @@ -70099,7 +75863,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70112,21 +75876,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -70154,9 +75928,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core13 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core13 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { constructor(contentLength) { @@ -70239,15 +76014,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -70258,15 +76035,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core13.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core13.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -70274,7 +76050,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70287,21 +76063,31 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -70329,9 +76115,14 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core13 = __importStar4(require_core()); - var http_client_1 = require_lib4(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core13 = __importStar2(require_core()); + var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -70339,14 +76130,12 @@ var require_requestUtils = __commonJS({ } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -70358,14 +76147,13 @@ var require_requestUtils = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve4) => setTimeout(resolve4, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(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) { @@ -70374,12 +76162,12 @@ var require_requestUtils = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -70402,9 +76190,8 @@ var require_requestUtils = __commonJS({ throw Error(`${name} failed: ${errorMessage}`); }); } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3( name, method, @@ -70413,13 +76200,13 @@ var require_requestUtils = __commonJS({ delay2, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { + (error3) => { + if (error3 instanceof http_client_1.HttpClientError) { return { - statusCode: error4.statusCode, + statusCode: error3.statusCode, result: null, headers: {}, - error: error4 + error: error3 }; } else { return void 0; @@ -70428,13 +76215,155 @@ var require_requestUtils = __commonJS({ ); }); } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); }); } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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; } }); @@ -70442,7 +76371,7 @@ var require_requestUtils = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70455,21 +76384,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -70497,20 +76436,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core13 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs5 = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core13 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs5 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream.pipeline); yield pipeline(response.message, output); }); @@ -70612,10 +76554,10 @@ var require_downloadUtils = __commonJS({ }; exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const writeStream = fs5.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { + 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, () => { @@ -70635,17 +76577,16 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const archiveDescriptor = yield fs5.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", () => __awaiter4(this, void 0, void 0, function* () { + 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"]; @@ -70662,7 +76603,7 @@ var require_downloadUtils = __commonJS({ const count = Math.min(blockSize, length - offset); downloads.push({ offset, - promiseGetter: () => __awaiter4(this, void 0, void 0, function* () { + promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); }) }); @@ -70675,7 +76616,7 @@ var require_downloadUtils = __commonJS({ const progressFn = progress.onProgress(); const activeDownloads = []; let nextDownload; - const waitAndWrite = () => __awaiter4(this, void 0, void 0, function* () { + 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--; @@ -70699,9 +76640,8 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const retries = 5; let failures = 0; while (true) { @@ -70722,8 +76662,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { + 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}` }); @@ -70739,8 +76679,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { retryOptions: { // Override the timeout used when downloading each 4 MB chunk @@ -70784,8 +76724,7 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; const timeoutPromise = new Promise((resolve4) => { timeoutHandle = setTimeout(() => resolve4("timeout"), timeoutMs); @@ -70802,7 +76741,7 @@ var require_downloadUtils = __commonJS({ var require_options = __commonJS({ "node_modules/@actions/cache/lib/options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70815,23 +76754,34 @@ var require_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core13 = __importStar4(require_core()); + exports2.getUploadOptions = getUploadOptions; + exports2.getDownloadOptions = getDownloadOptions; + var core13 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -70856,7 +76806,6 @@ var require_options = __commonJS({ core13.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } - exports2.getUploadOptions = getUploadOptions; function getDownloadOptions(copy) { const result = { useAzureSdk: false, @@ -70898,7 +76847,6 @@ var require_options = __commonJS({ core13.debug(`Lookup only: ${result.lookupOnly}`); return result; } - exports2.getDownloadOptions = getDownloadOptions; } }); @@ -70907,7 +76855,9 @@ var require_config = __commonJS({ "node_modules/@actions/cache/lib/internal/config.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; + exports2.isGhes = isGhes; + exports2.getCacheServiceVersion = getCacheServiceVersion; + exports2.getCacheServiceURL = getCacheServiceURL; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); @@ -70916,13 +76866,11 @@ var require_config = __commonJS({ const isLocalHost = hostname.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } - exports2.isGhes = isGhes; function getCacheServiceVersion() { if (isGhes()) return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } - exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { const version = getCacheServiceVersion(); switch (version) { @@ -70934,7 +76882,6 @@ var require_config = __commonJS({ throw new Error(`Unsupported cache service version: ${version}`); } } - exports2.getCacheServiceURL = getCacheServiceURL; } }); @@ -70943,7 +76890,7 @@ var require_package2 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", - version: "4.1.0", + version: "5.0.1", preview: true, description: "Actions cache lib", keywords: [ @@ -70980,22 +76927,26 @@ var require_package2 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", + "@azure/core-rest-pipeline": "^1.22.0", + "@azure/storage-blob": "^12.29.1", semver: "^6.3.1" }, devDependencies: { - "@types/node": "^22.13.9", + "@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" } }; } @@ -71006,12 +76957,11 @@ 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 = void 0; + exports2.getUserAgentString = getUserAgentString; var packageJson = require_package2(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } - exports2.getUserAgentString = getUserAgentString; } }); @@ -71019,7 +76969,7 @@ var require_user_agent = __commonJS({ var require_cacheHttpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -71032,21 +76982,31 @@ var require_cacheHttpClient = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -71074,13 +77034,16 @@ var require_cacheHttpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core13 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var auth_1 = require_auth2(); - var fs5 = __importStar4(require("fs")); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache3; + var core13 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs5 = __importStar2(require("fs")); var url_1 = require("url"); - var utils = __importStar4(require_cacheUtils()); + var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); var downloadUtils_1 = require_downloadUtils(); var options_1 = require_options(); @@ -71113,11 +77076,11 @@ var require_cacheHttpClient = __commonJS({ return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); } function getCacheEntry(keys, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { @@ -71140,11 +77103,10 @@ var require_cacheHttpClient = __commonJS({ return cacheResult; }); } - exports2.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { @@ -71161,7 +77123,7 @@ Other caches with similar key:`); }); } function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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")) { @@ -71177,9 +77139,8 @@ Other caches with similar key:`); } }); } - exports2.downloadCache = downloadCache; function reserveCache(key, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -71187,24 +77148,23 @@ Other caches with similar key:`); version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); })); return response; }); } - exports2.reserveCache = reserveCache; function getContentRange(start, end) { return `bytes ${start}-${end}/*`; } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { core13.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})`, () => __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -71213,7 +77173,7 @@ Other caches with similar key:`); }); } function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); const fd = fs5.openSync(archivePath, "r"); @@ -71224,7 +77184,7 @@ Other caches with similar key:`); core13.debug("Awaiting all uploads"); let offset = 0; try { - yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -71235,8 +77195,8 @@ Other caches with similar key:`); start, end, autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); + }).on("error", (error3) => { + throw new Error(`Cache upload failed because file read failed with ${error3.message}`); }), start, end); } }))); @@ -71247,15 +77207,15 @@ Other caches with similar key:`); }); } function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); } function saveCache3(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { if (!signedUploadURL) { @@ -71277,7 +77237,6 @@ Other caches with similar key:`); } }); } - exports2.saveCache = saveCache3; } }); @@ -71449,7 +77408,7 @@ var require_binary_format_contract = __commonJS({ exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; var UnknownFieldHandler; (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = Symbol.for("protobuf-ts/unknown"); + 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 }); @@ -72374,7 +78333,7 @@ var require_message_type_contract = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); } }); @@ -72872,26 +78831,26 @@ var require_reflection_json_reader = __commonJS({ const fieldObj = target[localName]; for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { this.assert(jsonObjValue !== null, field.name + " map value", null); - let val2; + let val; switch (field.V.kind) { case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); + val = field.V.T().internalJsonRead(jsonObjValue, options); break; case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); break; } - this.assert(val2 !== void 0, field.name + " map value", jsonObjValue); + 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] = val2; + fieldObj[key] = val; } } else if (field.repeat) { if (jsonValue === null) @@ -72900,22 +78859,22 @@ var require_reflection_json_reader = __commonJS({ const fieldArr = target[localName]; for (const jsonItem of jsonValue) { this.assert(jsonItem !== null, field.name, null); - let val2; + let val; switch (field.kind) { case "message": - val2 = field.T().internalJsonRead(jsonItem, options); + val = field.T().internalJsonRead(jsonItem, options); break; case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); + val = this.scalar(jsonItem, field.T, field.L, field.name); break; } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); + this.assert(val !== void 0, field.name, jsonValue); + fieldArr.push(val); } } else { switch (field.kind) { @@ -72929,10 +78888,10 @@ var require_reflection_json_reader = __commonJS({ case "enum": if (jsonValue === null) continue; - let val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; - target[localName] = val2; + target[localName] = val; break; case "scalar": if (jsonValue === null) @@ -73082,8 +79041,8 @@ var require_reflection_json_reader = __commonJS({ break; return base64_1.base64decode(json2); } - } catch (error4) { - e = error4.message; + } catch (error3) { + e = error3.message; } this.assert(false, fieldName + (e ? " - " + e : ""), json2); } @@ -73137,26 +79096,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== void 0); + jsonObj[entryKey.toString()] = val; } break; } @@ -73168,26 +79127,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { - const val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== void 0); + jsonArr.push(val); } break; } @@ -73437,7 +79396,7 @@ var require_reflection_binary_reader = __commonJS({ let length = reader.uint32(); let end = reader.pos + length; let key = void 0; - let val2 = void 0; + let val = void 0; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -73450,13 +79409,13 @@ var require_reflection_binary_reader = __commonJS({ case 2: switch (field.V.kind) { case "scalar": - val2 = this.scalar(reader, field.V.T, field.V.L); + val = this.scalar(reader, field.V.T, field.V.L); break; case "enum": - val2 = reader.int32(); + val = reader.int32(); break; case "message": - val2 = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); break; } break; @@ -73468,19 +79427,19 @@ var require_reflection_binary_reader = __commonJS({ let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; } - if (val2 === void 0) + if (val === void 0) switch (field.V.kind) { case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); break; case "enum": - val2 = 0; + val = 0; break; case "message": - val2 = field.V.T().create(); + val = field.V.T().create(); break; } - return [key, val2]; + return [key, val]; } scalar(reader, type2, longType) { switch (type2) { @@ -73585,8 +79544,8 @@ var require_reflection_binary_writer = __commonJS({ break; case "map": assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); break; } } @@ -74156,18 +80115,18 @@ var require_enum_object = __commonJS({ } exports2.listEnumValues = listEnumValues; function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + return listEnumValues(enumObject).map((val) => val.name); } exports2.listEnumNames = listEnumNames; function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } exports2.listEnumNumbers = listEnumNumbers; } }); // node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ +var require_commonjs16 = __commonJS({ "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -74358,7 +80317,7 @@ var require_reflection_info2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function normalizeMethodInfo(method, service) { var _a, _b, _c; let m = method; @@ -74467,7 +80426,7 @@ var require_rpc_options = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function mergeRpcOptions(defaults, options) { if (!options) return defaults; @@ -74475,7 +80434,7 @@ var require_rpc_options = __commonJS({ copy(defaults, o); copy(options, o); for (let key of Object.keys(options)) { - let val2 = options[key]; + let val = options[key]; switch (key) { case "jsonOptions": o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); @@ -74489,7 +80448,7 @@ var require_rpc_options = __commonJS({ copy(options.meta, o.meta); break; case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); break; } } @@ -74581,9 +80540,9 @@ var require_deferred = __commonJS({ /** * Resolve the promise. Ignore if not pending. */ - resolvePending(val2) { + resolvePending(val) { if (this._state === DeferredState.PENDING) - this.resolve(val2); + this.resolve(val); } /** * Reject the promise. Ignore if not pending. @@ -74604,7 +80563,7 @@ var require_rpc_output_stream = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RpcOutputStreamController = void 0; var deferred_1 = require_deferred(); - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); var RpcOutputStreamController = class { constructor() { this._lis = { @@ -74654,12 +80613,12 @@ var require_rpc_output_stream = __commonJS({ * at a time. * Can be used to wrap a stream by using the other stream's `onNext`. */ - notifyNext(message, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); + 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 (error4) - this.notifyError(error4); + if (error3) + this.notifyError(error3); if (complete) this.notifyComplete(); } @@ -74679,12 +80638,12 @@ var require_rpc_output_stream = __commonJS({ * * Triggers onNext and onError callbacks. */ - notifyError(error4) { + notifyError(error3) { runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); + 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(); } /** @@ -74745,15 +80704,223 @@ var require_rpc_output_stream = __commonJS({ } } }; - exports2.RpcOutputStreamController = RpcOutputStreamController; + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + 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/unary-call.js -var require_unary_call = __commonJS({ - "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/unary-call.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -74781,1475 +80948,2424 @@ var require_unary_call = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.UnaryCall = void 0; - var UnaryCall = class { + exports2.DuplexStreamingCall = void 0; + var DuplexStreamingCall = class { constructor(method, requestHeaders, request, headers, response, status, trailers) { this.method = method; this.requestHeaders = requestHeaders; - this.request = request; + this.requests = request; this.headers = headers; - this.response = response; + this.responses = 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`. + * 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 __awaiter4(this, void 0, void 0, function* () { - let [headers, response, status, trailers] = yield Promise.all([this.headers, this.response, this.status, this.trailers]); + 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, - response, status, trailers }; }); } }; - exports2.UnaryCall = UnaryCall; + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 _a; + const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _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, stream, 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) { + stream.notifyError(error3); + return; + } + if (this.data.response instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.response); + return; + } + for (let msg of messages) { + stream.notifyMessage(msg); + try { + yield delay2(this.betweenResponseDelay, abort)(void 0); + } catch (error3) { + stream.notifyError(error3); + return; + } + } + if (this.data.status instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.status); + return; + } + if (this.data.trailers instanceof rpc_error_1.RpcError) { + stream.notifyError(this.data.trailers); + return; + } + stream.notifyComplete(); + }); + } + // Creates a promise for response status from the mock data. + promiseStatus() { + var _a; + const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _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 _a; + const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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((resolve4, reject) => { + if (abort === null || abort === void 0 ? void 0 : abort.aborted) { + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + } else { + const id = setTimeout(() => resolve4(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 _a, _b, _c, _d; + if (kind == "unary") { + let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); + for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).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/@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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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*/ } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + ]); + } + 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); } } - function step(result) { - result.done ? resolve4(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - 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)); + return message; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.ServerStreamingCall = ServerStreamingCall; + exports2.CacheScope = new CacheScope$Type(); } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + 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 } + ]); } - return new (P || (P = Promise))(function(resolve4, 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); + 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); } } - function step(result) { - result.done ? resolve4(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - 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)); + return message; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.ClientStreamingCall = ClientStreamingCall; + exports2.CacheMetadata = new CacheMetadata$Type(); } }); -// 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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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*/ } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + ]); + } + 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); } } - function step(result) { - result.done ? resolve4(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - 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)); + return message; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + 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*/ + } + ]); } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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); } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } } - function step(result) { - result.done ? resolve4(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_commonjs11(); - 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 : {}; + return message; } - /** - * 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 []; + 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; } - /** - * 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; + }; + 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*/ + } + ]); } - // Creates a promise for response headers from the mock data. - promiseHeaders() { - var _a; - const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; - return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); + 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; } - // 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(); + 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); + } } - runtime_1.assert(method.O.is(r)); - return Promise.resolve(r); + return message; } - /** - * 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, stream, abort) { - return __awaiter4(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 (error4) { - stream.notifyError(error4); - return; - } - if (this.data.response instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.response); - return; - } - for (let msg of messages) { - stream.notifyMessage(msg); - try { - yield delay2(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); - return; - } - } - if (this.data.status instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.status); - return; - } - if (this.data.trailers instanceof rpc_error_1.RpcError) { - stream.notifyError(this.data.trailers); - return; - } - stream.notifyComplete(); - }); + 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; } - // Creates a promise for response status from the mock data. - promiseStatus() { - var _a; - const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; - return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); + }; + 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*/ + } + ]); } - // Creates a promise for response trailers from the mock data. - promiseTrailers() { - var _a; - const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; - return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); + 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; } - maybeSuppressUncaught(...promise) { - if (this.suppressUncaughtRejections) { - for (let p of promise) { - p.catch(() => { - }); + 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; } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); + 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; } - unary(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseTrailers()); - this.maybeSuppressUncaught(statusPromise, trailersPromise); - this.lastInput = { single: input }; - return new unary_call_1.UnaryCall(method, requestHeaders, input, headersPromise, responsePromise, statusPromise, trailersPromise); + }; + 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*/ + } + ]); } - serverStreaming(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); + 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; } - clientStreaming(method, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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); + 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; } - duplex(method, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); + 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.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((resolve4, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - } else { - const id = setTimeout(() => resolve4(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; + 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); } - get sent() { - return this._sent; + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toJson(request, { + 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 + })); } - get completed() { - return this._completed; + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { + 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 + })); } - 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)); + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { + 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 + })); } - 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)); + }; + exports2.CacheServiceClientJSON = CacheServiceClientJSON; + var CacheServiceClientProtobuf = class { + constructor(rpc) { + this.rpc = rpc; + this.CreateCacheEntry.bind(this); + this.FinalizeCacheEntryUpload.bind(this); + this.GetCacheEntryDownloadURL.bind(this); + } + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toBinary(request); + 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(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); + 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(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); + 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/@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) { +// node_modules/@actions/cache/lib/internal/shared/util.js +var require_util9 = __commonJS({ + "node_modules/@actions/cache/lib/internal/shared/util.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_commonjs11(); - function stackIntercept(kind, transport, method, options, input) { - var _a, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; + var core_1 = require_core(); + function maskSigUrl(url) { + if (!url) + return; + try { + const parsedUrl = new URL(url); + const signature = parsedUrl.searchParams.get("sig"); + if (signature) { + (0, core_1.setSecret)(signature); + (0, core_1.setSecret)(encodeURIComponent(signature)); } - return tail(method, input, options); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${error3 instanceof Error ? error3.message : String(error3)}`); } - 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); + } + function maskSecretUrls(body) { + if (typeof body !== "object" || body === null) { + (0, core_1.debug)("body is not an object or is null"); + return; } - 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 ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { + maskSigUrl(body.signed_upload_url); } - 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); + if ("signed_download_url" in body && typeof body.signed_download_url === "string") { + maskSigUrl(body.signed_download_url); } - 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) { +// 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"; - 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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - /** - * 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(); + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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_util9(); + var CacheServiceClient = class { + constructor(userAgent, 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(userAgent, [ + new auth_1.BearerCredentialHandler(token) + ]); } - /** - * Send response headers. - */ - sendResponseHeaders(data) { - this._sendRH(data); + // 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 url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; + (0, core_1.debug)(`[Request] ${method} ${url}`); + const headers = { + "Content-Type": contentType + }; + try { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { + return this.httpClient.post(url, JSON.stringify(data), headers); + })); + return body; + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); + } + }); } - /** - * 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; + 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`); + }); } - /** - * 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); - }; + 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((resolve4) => setTimeout(resolve4, 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); } }; - exports2.ServerCallContextController = ServerCallContextController; - } -}); - -// node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs12 = __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; - } }); + 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/generated/results/entities/v1/cachescope.js -var require_cachescope = __commonJS({ - "node_modules/@actions/cache/lib/generated/results/entities/v1/cachescope.js"(exports2) { +// node_modules/@actions/cache/lib/internal/tar.js +var require_tar = __commonJS({ + "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ - } - ]); + 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]; + } }; } - 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; + 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(resolve4) { + resolve4(value); + }); } - 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(); + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 = extractTar2; + exports2.createTar = createTar; + var exec_1 = require_exec(); + var io5 = __importStar2(require_io()); + var fs_1 = require("fs"); + var path5 = __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 io5.which("gtar", false); + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else { + return { + path: yield io5.which("tar", true), + type: constants_1.ArchiveToolType.BSD + }; + } + } + default: + break; + } + return { + path: yield io5.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, type2, 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 (type2) { + case "create": + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + break; + case "extract": + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path5.sep}`, "g"), "/")); + break; + case "list": + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P"); + break; + } + if (tarPath.type === constants_1.ArchiveToolType.GNU) { + switch (process.platform) { + case "win32": + args.push("--force-local"); break; - case /* int64 permission */ - 2: - message.permission = reader.int64().toString(); + case "darwin": + args.push("--delay-directory-restore"); 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(); + return args; + }); + } + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { + let args; + const tarPath = yield getTarPath(); + const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); + const compressionArgs = type2 !== "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 && type2 !== "create") { + args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + } else { + args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + } + if (BSD_TAR_ZSTD) { + return args; + } + return [args.join(" ")]; + }); + } + function getWorkingDirectory() { + var _a; + return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : 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(`\\${path5.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(`\\${path5.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(`\\${path5.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(`\\${path5.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 extractTar2(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const workingDirectory = getWorkingDirectory(); + yield io5.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)(path5.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + const commands = yield getCommands(compressionMethod, "create"); + yield execCommands(commands, archiveFolder); + }); + } } }); -// 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) { +// node_modules/@actions/cache/lib/cache.js +var require_cache4 = __commonJS({ + "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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 } - ]); + 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]; + } }; } - 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; + 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(resolve4) { + resolve4(value); + }); } - 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 new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - return message; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache3; + exports2.saveCache = saveCache3; + var core13 = __importStar2(require_core()); + var path5 = __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 ValidationError = class _ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + Object.setPrototypeOf(this, _ValidationError.prototype); } - 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.ValidationError = ValidationError; + var ReserveCacheError = class _ReserveCacheError extends Error { + constructor(message) { + super(message); + this.name = "ReserveCacheError"; + Object.setPrototypeOf(this, _ReserveCacheError.prototype); } }; - exports2.CacheMetadata = new CacheMetadata$Type(); - } -}); - -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ - } - ]); + exports2.ReserveCacheError = ReserveCacheError; + var FinalizeCacheError = class _FinalizeCacheError extends Error { + constructor(message) { + super(message); + this.name = "FinalizeCacheError"; + Object.setPrototypeOf(this, _FinalizeCacheError.prototype); } - 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; + }; + 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`); } - 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); + } + 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 restoreCache3(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)(); + core13.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + 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) { + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core13.debug("Resolved Keys:"); + core13.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 { + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + return void 0; + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core13.info("Lookup only - skipping download"); + return cacheEntry.cacheKey; + } + archivePath = path5.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core13.debug(`Archive Path: ${archivePath}`); + yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); + if (core13.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core13.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) { + core13.error(`Failed to restore: ${error3.message}`); + } else { + core13.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core13.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) { + options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core13.debug("Resolved Keys:"); + core13.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 request = { + key: primaryKey, + restoreKeys, + version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) + }; + const response = yield twirpClient.GetCacheEntryDownloadURL(request); + if (!response.ok) { + core13.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); + return void 0; + } + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core13.info(`Cache hit for restore-key: ${response.matchedKey}`); + } else { + core13.info(`Cache hit for: ${response.matchedKey}`); + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core13.info("Lookup only - skipping download"); + return response.matchedKey; + } + archivePath = path5.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core13.debug(`Archive path: ${archivePath}`); + core13.debug(`Starting download of archive to: ${archivePath}`); + yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core13.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core13.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) { + core13.error(`Failed to restore: ${error3.message}`); + } else { + core13.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + if (archivePath) { + yield utils.unlinkFile(archivePath); + } + } catch (error3) { + core13.debug(`Failed to delete archive: ${error3}`); + } + } + return void 0; + }); + } + function saveCache3(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + core13.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + checkKey(key); + 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 _a, _b, _c, _d, _e; + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core13.debug("Cache Paths:"); + core13.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 = path5.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core13.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core13.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.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.`); } - } - 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*/ + core13.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); } - ]); - } - 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); + core13.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 === ReserveCacheError.name) { + core13.info(`Failed to save: ${typedError.message}`); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core13.error(`Failed to save: ${typedError.message}`); + } else { + core13.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core13.debug(`Failed to delete archive: ${error3}`); } } - 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*/ + return cacheId; + }); + } + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + 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); + core13.debug("Cache Paths:"); + core13.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 = path5.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core13.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core13.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - ]); - } - 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); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core13.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core13.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); + } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core13.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - } - 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*/ + core13.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); + core13.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.`); } - ]); - } - 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); + cacheId = parseInt(finalizeResponse.entryId); + } catch (error3) { + const typedError = error3; + if (typedError.name === ValidationError.name) { + throw error3; + } else if (typedError.name === ReserveCacheError.name) { + core13.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core13.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core13.error(`Failed to save: ${typedError.message}`); + } else { + core13.warning(`Failed to save: ${typedError.message}`); + } } - } - 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*/ + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core13.debug(`Failed to delete archive: ${error3}`); } - ]); + } + return cacheId; + }); + } + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/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; } - 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; + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - 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; + 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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - 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; + 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; }; - 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; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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; } - 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); + 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)}`; + } + } } } - 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; + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } }; - 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 } - ]); + 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/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) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); - var CacheServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); - } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toJson(request, { - 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(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { - 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 - })); + 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]; + } }; } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { - 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 - })); + 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; }; - exports2.CacheServiceClientJSON = CacheServiceClientJSON; - var CacheServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs5 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); + if (!fs5.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); + fs5.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/protobuf", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromBinary(data2)); + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - }; - exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/cache/lib/internal/shared/util.js -var require_util10 = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; - var core_1 = require_core(); - function maskSigUrl(url) { - if (!url) - return; - try { - const parsedUrl = new URL(url); - const signature = parsedUrl.searchParams.get("sig"); - if (signature) { - (0, core_1.setSecret)(signature); - (0, core_1.setSecret)(encodeURIComponent(signature)); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + } else { + return void 0; } } - 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; + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { - maskSigUrl(body.signed_upload_url); + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - if ("signed_download_url" in body && typeof body.signed_download_url === "string") { - maskSigUrl(body.signed_download_url); + 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.maskSecretUrls = maskSecretUrls; + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js -var require_cacheTwirpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -76277,426 +83393,571 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; - 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_auth2(); - var http_client_1 = require_lib4(); - var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util10(); - var CacheServiceClient = class { - constructor(userAgent, 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; + exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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((resolve4) => __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", () => { + resolve4(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve4(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(userAgent, 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 = userAgent; + 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; + } } - this.httpClient = new http_client_1.HttpClient(userAgent, [ - 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 __awaiter4(this, void 0, void 0, function* () { - const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; - (0, core_1.debug)(`[Request] ${method} ${url}`); - const headers = { - "Content-Type": contentType - }; - try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { - return this.httpClient.post(url, JSON.stringify(data), headers); - })); - return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); - } + 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, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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); }); } - retryableRequest(operation) { - return __awaiter4(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(); + /** + * 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; } - errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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; } - if (error4 instanceof errors_1.UsageError) { - throw error4; + 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."); } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + yield response.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + if (header.toLowerCase() === "authorization") { + delete headers[header]; + } + } } - isRetryable = true; - errorMessage = error4.message; + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, data); + redirectsRemaining--; } - if (!isRetryable) { - throw new Error(`Received non-retryable error: ${errorMessage}`); + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; } - if (attempt + 1 === this.maxAttempts) { - throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); } - 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`); + } while (numTries < maxTries); + return response; }); } - 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); + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; } - sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => setTimeout(resolve4, milliseconds)); + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve4(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); }); } - getExponentialRetryTimeMilliseconds(attempt) { - if (attempt < 0) { - throw new Error("attempt should be a positive integer"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - if (attempt === 0) { - return this.baseRetryIntervalMilliseconds; + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } } - 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); - } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; - } -}); - -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); + const req = info6.httpModule.request(info6.options, (msg) => { + const res = new HttpClientResponse(msg); + handleResult(void 0, res); }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + let socket; + req.on("socket", (sock) => { + socket = sock; + }); + req.setTimeout(this._socketTimeout || 3 * 6e4, () => { + if (socket) { + socket.end(); } + handleResult(new Error(`Request timeout: ${info6.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + /** + * 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; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; - var exec_1 = require_exec(); - var io5 = __importStar4(require_io3()); - var fs_1 = require("fs"); - var path5 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { - return __awaiter4(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 io5.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io5.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; - } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - default: - break; } - return { - path: yield io5.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); - } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - 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 (type2) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path5.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path5.sep}`, "g"), "/"), "-P"); - break; + return info6; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - 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 lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - return args; - }); - } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); - const compressionArgs = type2 !== "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 && type2 !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; - } else { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - if (BSD_TAR_ZSTD) { - return args; + if (!useProxy) { + agent = this._agent; } - return [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a; - return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(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(`\\${path5.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(`\\${path5.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; + if (agent) { + return agent; } - }); - } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(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(`\\${path5.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(`\\${path5.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - }); - } - function execCommands(commands, cwd) { - return __awaiter4(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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + 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; } - }); - } - function listTar(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - exports2.listTar = listTar; - function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io5.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - exports2.extractTar = extractTar2; - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path5.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - exports2.createTar = createTar; + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve4) => setTimeout(() => resolve4(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve4(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 { + resolve4(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -76724,380 +83985,524 @@ var require_cache3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core13 = __importStar4(require_core()); - var path5 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); - var config_1 = require_config(); - var tar_1 = require_tar(); - var http_client_1 = require_lib4(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); + exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; + var BasicCredentialHandler = class { + constructor(username, password) { + this.username = username; + this.password = password; } - }; - exports2.ValidationError = ValidationError; - var ReserveCacheError = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - }; - exports2.ReserveCacheError = ReserveCacheError; - var FinalizeCacheError = class _FinalizeCacheError extends Error { - constructor(message) { - super(message); - this.name = "FinalizeCacheError"; - Object.setPrototypeOf(this, _FinalizeCacheError.prototype); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } }; - 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`); + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - } - function checkKey(key) { - if (key.length > 512) { - throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); + // 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}`; } - const regex = /^[^,]*$/; - if (!regex.test(key)) { - throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - } - 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"]; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core13.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - switch (cacheServiceVersion) { - case "v2": - return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - case "v1": - default: - return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - } - }); - } - exports2.restoreCache = restoreCache3; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core13.debug("Resolved Keys:"); - core13.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); + }; + 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"); } - const compressionMethod = yield utils.getCompressionMethod(); - let archivePath = ""; - try { - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core13.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path5.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core13.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core13.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to restore: ${error4.message}`); - } else { - core13.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + 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/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core13.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core13.debug("Resolved Keys:"); - core13.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 request = { - key: primaryKey, - restoreKeys, - version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) - }; - const response = yield twirpClient.GetCacheEntryDownloadURL(request); - if (!response.ok) { - core13.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); - return void 0; - } - const isRestoreKeyMatch = request.key !== response.matchedKey; - if (isRestoreKeyMatch) { - core13.info(`Cache hit for restore-key: ${response.matchedKey}`); - } else { - core13.info(`Cache hit for: ${response.matchedKey}`); - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core13.info("Lookup only - skipping download"); - return response.matchedKey; - } - archivePath = path5.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive path: ${archivePath}`); - core13.debug(`Starting download of archive to: ${archivePath}`); - yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core13.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core13.info("Cache restored successfully"); - return response.matchedKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to restore: ${error4.message}`); - } else { - core13.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + function rejected(value) { try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error4) { - core13.debug(`Failed to delete archive: ${error4}`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function saveCache3(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core13.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - exports2.saveCache = saveCache3; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core13.debug("Cache Paths:"); - core13.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.`); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OidcClient = void 0; + var http_client_1 = require_lib5(); + var auth_1 = require_auth3(); + 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"); } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path5.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core13.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.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.`); - } - core13.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize + 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 _a; + 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}`); }); - if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - core13.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core13.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to save: ${typedError.message}`); - } else { - core13.warning(`Failed to save: ${typedError.message}`); + 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}`); } - } finally { + }); + } + }; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core13.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core13.debug("Cache Paths:"); - core13.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 = path5.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core13.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core13.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; + function rejected(value) { try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core13.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core13.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } - core13.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); - core13.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.`); + } + function step(result) { + result.done ? resolve4(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; } - cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core13.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core13.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to save: ${typedError.message}`); - } else { - core13.warning(`Failed to save: ${typedError.message}`); - } + 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.`); } - } finally { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core13.debug(`Failed to delete archive: ${error4}`); + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + 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 cacheId; - }); + 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/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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 path5 = __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, path5.sep); } + exports2.toPlatformPath = toPlatformPath; } }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ +var require_io_util3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77106,21 +84511,21 @@ var require_io_util4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -77150,14 +84555,14 @@ var require_io_util4 = __commonJS({ var _a; 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 fs5 = __importStar4(require("fs")); - var path5 = __importStar4(require("path")); + var fs5 = __importStar2(require("fs")); + var path5 = __importStar2(require("path")); _a = fs5.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs5.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -77171,7 +84576,7 @@ var require_io_util4 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -77189,7 +84594,7 @@ var require_io_util4 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -77267,10 +84672,10 @@ var require_io_util4 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ +var require_io3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77279,21 +84684,21 @@ var require_io4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -77323,10 +84728,10 @@ var require_io4 = __commonJS({ 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 path5 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); + var path5 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -77353,7 +84758,7 @@ var require_io4 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -77374,7 +84779,7 @@ var require_io4 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -77394,14 +84799,14 @@ var require_io4 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which5(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77425,7 +84830,7 @@ var require_io4 = __commonJS({ } exports2.which = which5; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77473,7 +84878,7 @@ var require_io4 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -77484,289 +84889,64 @@ var require_io4 = __commonJS({ const destFile = `${destDir}/${fileName}`; const srcFileStat = yield ioUtil.lstat(srcFile); if (srcFileStat.isDirectory()) { - yield cpDirRecursive(srcFile, destFile, currentDepth, force); - } else { - yield copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os2 = require("os"); - var cp = require("child_process"); - var fs5 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os2.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os2.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; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs5.existsSync(lsbReleaseFile)) { - contents = fs5.readFileSync(lsbReleaseFile).toString(); - } else if (fs5.existsSync(osReleaseFile)) { - contents = fs5.readFileSync(osReleaseFile).toString(); - } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/tool-cache/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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } else { + yield copyFile(srcFile, destFile, force); + } } - } else { - return void 0; - } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - 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; + function copyFile(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); } - } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -77794,598 +84974,463 @@ var require_lib5 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(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", () => { - resolve4(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve4(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(userAgent, 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 = userAgent; - 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; - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path5 = __importStar2(require("path")); + var io5 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + _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}`; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - } 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(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve4(res); - } + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info6.httpModule.request(info6.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: ${info6.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; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + return cmd; } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - return info6; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } } - return lowercaseKeys(headers || {}); + return this.toolPath; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + _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 additionalHeaders[header] || clientHeader || _default2; + return this.args; } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + _endsWith(str2, end) { + return str2.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 (!useProxy) { - agent = this._agent; + if (!arg) { + return '""'; } - if (agent) { - return agent; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; + } } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (!needsQuotes) { + return arg; } - 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; + 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 { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + quoteHit = false; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); } - return agent; + reverse += '"'; + return reverse.split("").reverse().join(""); } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - if (proxyAgent) { - return proxyAgent; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - 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 - }); + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; } - return proxyAgent; + 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(""); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); - }); + _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; } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve4(response); + _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 = path5.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io5.which(this.toolPath, true); + return new Promise((resolve4, 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}`); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os2.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); } - } - return value; + 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 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); + 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); } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { + 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); + } + }); + }); } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; + 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 { - msg = `Failed request: (${statusCode})`; + resolve4(exitCode); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve4(response); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } })); }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.ToolRunner = ToolRunner5; + 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/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -78413,58 +85458,63 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core13 = __importStar4(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"); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + function exec(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.`); } - } - execute(action, isRetryable) { - return __awaiter4(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; - } - core13.info(err.message); - } - const seconds = this.getSleepAmount(); - core13.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => setTimeout(resolve4, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + }; + 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 exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78477,21 +85527,21 @@ var require_tool_cache = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -78518,613 +85568,301 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core13 = __importStar4(require_core()); - var io5 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs5 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os2 = __importStar4(require("os")); - var path5 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver8 = __importStar4(require_semver2()); - var stream = __importStar4(require("stream")); - var util = __importStar4(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); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path5.join(_getTempDirectory(), crypto.randomUUID()); - yield io5.mkdirP(path5.dirname(dest)); - core13.debug(`Downloading ${url}`); - core13.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs5.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core13.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core13.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs5.createWriteStream(dest)); - core13.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core13.debug("download failed"); - try { - yield io5.rmRF(dest); - } catch (err) { - core13.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core13.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path5.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 io5.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core13.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() - } - }); - core13.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core13.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core13.isDebug()) { - args.push("-v"); - } - const xarPath = yield io5.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io5.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 - ]; - core13.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 io5.which("powershell", true); - core13.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io5.which("unzip", true); - const args = [file]; - if (!core13.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os2.arch(); - core13.debug(`Caching tool ${tool} ${version} ${arch}`); - core13.debug(`source dir: ${sourceDir}`); - if (!fs5.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch); - for (const itemName of fs5.readdirSync(sourceDir)) { - const s = path5.join(sourceDir, itemName); - yield io5.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch); - return destPath; - }); - } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os2.arch(); - core13.debug(`Caching tool ${tool} ${version} ${arch}`); - core13.debug(`source file: ${sourceFile}`); - if (!fs5.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch); - const destPath = path5.join(destFolder, targetFile); - core13.debug(`destination file ${destPath}`); - yield io5.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch); - return destFolder; - }); - } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch = arch || os2.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path5.join(_getCacheDirectory(), toolName, versionSpec, arch); - core13.debug(`checking cache: ${cachePath}`); - if (fs5.existsSync(cachePath) && fs5.existsSync(`${cachePath}.complete`)) { - core13.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); - toolPath = cachePath; - } else { - core13.debug("not found"); - } - } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch) { - const versions = []; - arch = arch || os2.arch(); - const toolPath = path5.join(_getCacheDirectory(), toolName); - if (fs5.existsSync(toolPath)) { - const children = fs5.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path5.join(toolPath, child, arch || ""); - if (fs5.existsSync(fullPath) && fs5.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } - } - return versions; - } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core13.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core13.debug("Invalid json"); - } - } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; + 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 exec = __importStar2(require_exec3()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path5.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io5.mkdirP(dest); - return dest; + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true }); - } - function _createToolPath(tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path5.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - core13.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io5.rmRF(folderPath); - yield io5.rmRF(markerPath); - yield io5.mkdirP(folderPath); - return folderPath; + return { + name: name.trim(), + version: version.trim() + }; + }); + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true }); - } - function _completeToolPath(tool, version, arch) { - const folderPath = path5.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - const markerPath = `${folderPath}.complete`; - fs5.writeFileSync(markerPath, ""); - core13.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core13.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core13.debug(`explicit? ${valid3}`); - return valid3; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core13.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; - } - return -1; + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + silent: true }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core13.debug(`matched: ${version}`); - } else { - core13.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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; - }; + 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/http-client/lib/proxy.js -var require_proxy5 = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.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; + 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]; + } }; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } else { - return void 0; + function step(result) { + result.done ? resolve4(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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os2 = __importStar2(require("os")); + var path5 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable5(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 checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + exports2.exportVariable = exportVariable5; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + process.env["PATH"] = `${inputPath}${path5.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + if (options && options.trimWhitespace === false) { + return val; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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; } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - 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; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } + return result; + }); + } + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return false; + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - 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]"); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -79137,31 +85875,21 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -79189,628 +85917,780 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(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", () => { - resolve4(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve4(Buffer.concat(chunks)); + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os2 = require("os"); + var cp = require("child_process"); + var fs5 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os2.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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 (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); + } + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os2.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; + } } } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs5.existsSync(lsbReleaseFile)) { + contents = fs5.readFileSync(lsbReleaseFile).toString(); + } else if (fs5.existsSync(osReleaseFile)) { + contents = fs5.readFileSync(osReleaseFile).toString(); + } + return contents; + } + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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 || 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); } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); + __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(resolve4) { + resolve4(value); }); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 core13 = __importStar2(require_core3()); + 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"); + } } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); + 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; + } + core13.info(err.message); + } + const seconds = this.getSleepAmount(); + core13.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); }); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + getSleepAmount() { + return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); + sleep(seconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => setTimeout(resolve4, seconds * 1e3)); }); } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + 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]; + } }; } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + 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); } - /** - * 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 __awaiter4(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); + __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(resolve4) { + resolve4(value); }); } - postJson(requestUrl_1, obj_1) { - return __awaiter4(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); - }); + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core13 = __importStar2(require_core3()); + var io5 = __importStar2(require_io3()); + var crypto2 = __importStar2(require("crypto")); + var fs5 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os2 = __importStar2(require("os")); + var path5 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver9 = __importStar2(require_semver2()); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + 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); } - putJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }; + exports2.HTTPError = HTTPError2; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path5.join(_getTempDirectory(), crypto2.randomUUID()); + yield io5.mkdirP(path5.dirname(dest)); + core13.debug(`Downloading ${url}`); + core13.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(url, dest || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; }); - } - patchJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }); + } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs5.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false }); - } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + if (auth) { + core13.debug("set auth"); + if (headers === void 0) { + headers = {}; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + headers.authorization = auth; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve4(res); - } + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core13.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs5.createWriteStream(dest)); + core13.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core13.debug("download failed"); + try { + yield io5.rmRF(dest); + } catch (err) { + core13.debug(`Failed to delete '${dest}'. ${err.message}`); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + }); + } + 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 = core13.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } + } else { + const escapedScript = path5.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 io5.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - const req = info6.httpModule.request(info6.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(); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core13.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() } - handleResult(new Error(`Request timeout: ${info6.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + core13.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; + } + if (core13.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 (core13.isDebug()) { + args.push("-v"); + } + const xarPath = yield io5.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io5.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 + ]; + core13.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 io5.which("powershell", true); + core13.debug(`Using powershell at path: ${powershellPath}`); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + }); + } + function extractZipNix(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + const unzipPath = yield io5.which("unzip", true); + const args = [file]; + if (!core13.isDebug()) { + args.unshift("-q"); } - } - /** - * 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; + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os2.arch(); + core13.debug(`Caching tool ${tool} ${version} ${arch}`); + core13.debug(`source dir: ${sourceDir}`); + if (!fs5.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; + const destPath = yield _createToolPath(tool, version, arch); + for (const itemName of fs5.readdirSync(sourceDir)) { + const s = path5.join(sourceDir, itemName); + yield io5.cp(s, destPath, { recursive: true }); } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } + _completeToolPath(tool, version, arch); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os2.arch(); + core13.debug(`Caching tool ${tool} ${version} ${arch}`); + core13.debug(`source file: ${sourceFile}`); + if (!fs5.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); } - return info6; + const destFolder = yield _createToolPath(tool, version, arch); + const destPath = path5.join(destFolder, targetFile); + core13.debug(`destination file ${destPath}`); + yield io5.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + arch = arch || os2.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path5.join(_getCacheDirectory(), toolName, versionSpec, arch); + core13.debug(`checking cache: ${cachePath}`); + if (fs5.existsSync(cachePath) && fs5.existsSync(`${cachePath}.complete`)) { + core13.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; + } else { + core13.debug("not found"); } - return _default2; } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch) { + const versions = []; + arch = arch || os2.arch(); + const toolPath = path5.join(_getCacheDirectory(), toolName); + if (fs5.existsSync(toolPath)) { + const children = fs5.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path5.join(toolPath, child, arch || ""); + if (fs5.existsSync(fullPath) && fs5.existsSync(`${fullPath}.complete`)) { + versions.push(child); } } } - 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 _default2; } - _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; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core13.debug("set auth"); + headers.authorization = auth; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; } - 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; + let manifestUrl = ""; + for (const item of response.result.tree) { + if (item.path === "versions-manifest.json") { + manifestUrl = item.url; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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 (_a) { + core13.debug("Invalid json"); + } } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path5.join(_getTempDirectory(), crypto2.randomUUID()); } - if (proxyAgent) { - return proxyAgent; + yield io5.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path5.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + core13.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io5.rmRF(folderPath); + yield io5.rmRF(markerPath); + yield io5.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch) { + const folderPath = path5.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + const markerPath = `${folderPath}.complete`; + fs5.writeFileSync(markerPath, ""); + core13.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core13.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core13.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core13.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); - }); + if (version) { + core13.debug(`matched: ${version}`); + } else { + core13.debug("match not found"); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve4(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 { - resolve4(response); - } - })); - }); + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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; }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ +var require_debug3 = __commonJS({ "node_modules/follow-redirects/debug.js"(exports2, module2) { var debug5; module2.exports = function() { if (!debug5) { try { debug5 = require_src()("follow-redirects"); - } catch (error4) { + } catch (error3) { } if (typeof debug5 !== "function") { debug5 = function() { @@ -79831,7 +86711,7 @@ var require_follow_redirects = __commonJS({ var https2 = require("https"); var Writable = require("stream").Writable; var assert = require("assert"); - var debug5 = require_debug2(); + var debug5 = require_debug3(); (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; @@ -79843,8 +86723,8 @@ var require_follow_redirects = __commonJS({ var useNativeURL = false; try { assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; } var preservedUrlFields = [ "auth", @@ -79918,9 +86798,9 @@ var require_follow_redirects = __commonJS({ this._currentRequest.abort(); this.emit("abort"); }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); + RedirectableRequest.prototype.destroy = function(error3) { + destroyRequest(this._currentRequest, error3); + destroy.call(this, error3); return this; }; RedirectableRequest.prototype.write = function(data, encoding, callback) { @@ -80087,10 +86967,10 @@ var require_follow_redirects = __commonJS({ var i = 0; var self2 = this; var buffers = this._requestBodyBuffers; - (function writeNext(error4) { + (function writeNext(error3) { if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); + if (error3) { + self2.emit("error", error3); } else if (i < buffers.length) { var buffer = buffers[i++]; if (!request.finished) { @@ -80289,12 +87169,12 @@ var require_follow_redirects = __commonJS({ }); return CustomError; } - function destroyRequest(request, error4) { + function destroyRequest(request, error3) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); - request.destroy(error4); + request.destroy(error3); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); @@ -80326,14 +87206,13 @@ var fs = __toESM(require("fs")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -80350,14 +87229,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs5.lstat(itemPath, { bigint: true }) : await fs5.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs5.lstat(itemPath, { bigint: true }) : await fs5.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 fs5.readdir(itemPath) : await fs5.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs5.readdir(itemPath) : await fs5.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -80368,13 +87247,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -81254,6 +88133,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -81373,7 +88264,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -81413,16 +88304,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -82977,7 +89859,7 @@ var safeDump = renamed("safeDump", "dump"); var semver = __toESM(require_semver2()); // src/api-compatibility.json -var maximumVersion = "3.19"; +var maximumVersion = "3.20"; var minimumVersion = "3.14"; // src/util.ts @@ -82992,9 +89874,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -83032,7 +89914,7 @@ function parseGitHubUrl(inputUrl) { var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; var hasBeenWarnedAboutVersion = false; function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== 1 /* GHES */) { + if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { return; } const disallowedAPIVersionReason = apiVersionInRange( @@ -83134,11 +90016,11 @@ async function checkForTimeout() { process.exit(); } } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } async function checkDiskUsage(logger) { try { @@ -83161,22 +90043,22 @@ async function checkDiskUsage(logger) { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, numTotalBytes: diskUsage.blocks * blockSizeInBytes }; - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to check available disk space: ${getErrorMessage(error4)}` + `Failed to check available disk space: ${getErrorMessage(error3)}` ); return void 0; } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + 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 === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( + 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.11" + ">=3.20" )) { - core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + core3.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/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } @@ -83373,17 +90255,17 @@ function getApiClient() { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -83457,19 +90339,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -83485,9 +90367,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -83692,22 +90574,37 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); +// src/logging.ts +var core7 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup + }; +} + // src/feature-flags.ts -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); // src/overlay-database-utils.ts var fs2 = __toESM(require("fs")); var path2 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core7.debug(`Running git command: git ${args.join(" ")}`); + core8.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -83722,13 +90619,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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."; } - core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error4; + core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -83838,7 +90735,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core7.debug( + core8.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -83863,22 +90760,8 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/logging.ts -var core8 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup - }; -} - // src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -83939,7 +90822,7 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { } // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); function isSupportedToolsFeature(versionInfo, feature) { return !!versionInfo.features && versionInfo.features[feature]; } @@ -83951,11 +90834,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -83967,6 +90845,16 @@ var featureConfig = { 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", @@ -83995,12 +90883,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -84101,6 +90983,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -84112,21 +90999,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -84136,9 +91024,12 @@ var featureConfig = { }; // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -84215,20 +91106,20 @@ var toolrunner3 = __toESM(require_toolrunner()); // src/setup-codeql.ts var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // src/tar.ts var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); // src/tools-download.ts var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // src/tracer-config.ts @@ -84653,6 +91544,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -84809,9 +91717,9 @@ function isFirstPartyAnalysis(actionName) { } return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; } -function getActionsStatus(error4, otherFailureCause) { - if (error4 || otherFailureCause) { - return error4 instanceof ConfigurationError ? "user-error" : "failure"; +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; } else { return "success"; } @@ -85017,25 +91925,25 @@ async function run() { ); core12.setOutput(ENVIRONMENT_OUTPUT_NAME, result); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); - if (error4 instanceof CliError) { + const error3 = wrapError(unwrappedError); + if (error3 instanceof CliError) { core12.setOutput(ENVIRONMENT_OUTPUT_NAME, {}); logger.warning( - `Failed to resolve a build environment suitable for automatically building your code. ${error4.message}` + `Failed to resolve a build environment suitable for automatically building your code. ${error3.message}` ); } else { core12.setFailed( - `Failed to resolve a build environment suitable for automatically building your code. ${error4.message}` + `Failed to resolve a build environment suitable for automatically building your code. ${error3.message}` ); const statusReportBase2 = await createStatusReportBase( "resolve-environment" /* ResolveEnvironment */, - getActionsStatus(error4), + getActionsStatus(error3), startedAt, config, await checkDiskUsage(logger), logger, - error4.message, - error4.stack + error3.message, + error3.stack ); if (statusReportBase2 !== void 0) { await sendStatusReport(statusReportBase2); @@ -85058,10 +91966,10 @@ async function run() { async function runWrapper() { try { await run(); - } catch (error4) { + } catch (error3) { core12.setFailed( `${"resolve-environment" /* ResolveEnvironment */} action failed: ${getErrorMessage( - error4 + error3 )}` ); } @@ -85077,5 +91985,5 @@ undici/lib/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) */ diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 265caf361c..e211b38f78 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os3 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os3 = __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() + os3.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs9 = __importStar4(require("fs")); - var os3 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs9 = __importStar2(require("fs")); + var os3 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug5("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable2 { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable2 { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay: delay2, persist } = mockDispatch2; + 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 (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable2({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve4({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve4, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path8 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path8 = __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, path8.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs9 = __importStar4(require("fs")); - var path8 = __importStar4(require("path")); - _a = fs9.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs9 = __importStar2(require("fs")); + var path8 = __importStar2(require("path")); + _a = fs9.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs9.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs9.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path8.dirname(filePath); const upperName = path8.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path8.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which6; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path8 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path8 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os3 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path8 = __importStar4(require("path")); - var io6 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os3 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path8 = __importStar2(require("path")); + var io6 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner6 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path8.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io6.which(this.toolPath, true); - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve4(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + exports2.exec = exec; + exports2.getExecOutput = getExecOutput; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner()); + function exec(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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 exec = __importStar2(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 = exportVariable6; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput2; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug5; + exports2.error = error3; + exports2.warning = warning9; + exports2.notice = notice; + exports2.info = info6; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os3 = __importStar4(require("os")); - var path8 = __importStar4(require("path")); + var os3 = __importStar2(require("os")); + var path8 = __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 exportVariable6(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable6(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable6; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19681,18 +19872,16 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path8.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,19 +19889,17 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput2(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { @@ -19721,50 +19908,39 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.stdout.write(os3.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput2; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug5(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug5; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning8(message, properties = {}) { + function warning9(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning8; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info6(message) { process.stdout.write(message + os3.EOL); } - exports2.info = info6; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve4, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter4(this, void 0, void 0, function* () { + const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,532 +25406,74 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs9 = __importStar4(require("fs")); - var path8 = __importStar4(require("path")); - _a = fs9.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs9.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs9.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path8.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 = path8.dirname(filePath); - const upperName = path8.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path8.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 = which6; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path8 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path8.join(dest, path8.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 (path8.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path8.join(dest, path8.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(path8.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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 __awaiter4(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(path8.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(path8.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path8.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path8.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug5; - } -}); - -// 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 debug5 = 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}}`); + var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug5; + } +}); + +// 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 debug5 = 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; }; @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare2 = require_compare(); - var gte5 = (a, b, loose) => compare2(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare2(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises3)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run2, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } } doExpire(clearGlobalState, run2, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run2, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run2, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve4, returned, task; + var args, cb, error3, reject, resolve4, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve4, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve4(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info6) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info6) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29251,1424 +28965,1097 @@ var require_dist_node15 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core13 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core13.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core13.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os3 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os3.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core13.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path8 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname2(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs9 = __importStar2(require("fs")); + var os3 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path8.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs9.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs9.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname2; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path8.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path8.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path8.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __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", () => { + resolve4(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve4(Buffer.concat(chunks)); + }); + })); + }); + } }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var 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 expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path8 = (function() { - try { - return require("path"); - } catch (e) { + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path8.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + /** + * 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); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path8.sep !== "/") { - pattern = pattern.split(path8.sep).join("/"); + 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); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + 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); + }); } - if (!pattern) { - this.empty = true; - return; + 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); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug5() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = 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++) { - negate = !negate; - negateOffset++; + /** + * 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve4(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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(); + } } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + /** + * 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); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; } + return info6; } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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; } - 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; - } - 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve4) => setTimeout(() => resolve4(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve4(response); } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } - var cs = pattern.substring(classStart + 1, i); + let obj; + let contents; 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; + 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) { } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + 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 { + resolve4(response); } - 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]; + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/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(resolve4) { + resolve4(value); + }); } - 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(_, $1, $2) { - if (!$2) { - $2 = "\\"; + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve4(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; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - 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 = "$"; + 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"); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + options.headers["Authorization"] = `Bearer ${this.token}`; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - if (addPatternStart) { - re = patternStart + re; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - if (!hasMagic) { - return globUnescape(pattern); + // 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")}`; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path8.sep !== "/") { - f = f.split(path8.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - 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] === ""; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - throw new Error("wtf?"); }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path8 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path8.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path8.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path8.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path8.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path8.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os3 = __importStar4(require("os")); - var path8 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path8.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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib3(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path8.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path8.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; + 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 internal_match_kind_1.MatchKind.None; + return token; } - /** - * 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); + 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 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, "[*]"); + return runtimeUrl; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path8.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path8.sep}`)) { - homedir = homedir || os3.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path8, level) { - this.path = path8; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -30695,263 +30082,323 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); - }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ value: v2, done: d }); - }, reject); + 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 = ""; } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + /** + * 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}`; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * 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(); + }); } - function fulfill(value) { - resume("next", value); + /** + * 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 }); + }); } - function reject(value) { - resume("throw", value); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core13 = __importStar4(require_core()); - var fs9 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path8 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - globGenerator() { - return __asyncGenerator4(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)) { - core13.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs9.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs9.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path8.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; - }); + 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(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs9.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core13.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 fs9.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs9.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core13.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + /** + * 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); } - traversalChain.push(realPath); - } - return stats; - }); + 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path8 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.create = create; + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path8.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -30960,21 +30407,21 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -31004,14 +30451,14 @@ var require_io_util3 = __commonJS({ var _a; 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 fs9 = __importStar4(require("fs")); - var path8 = __importStar4(require("path")); + var fs9 = __importStar2(require("fs")); + var path8 = __importStar2(require("path")); _a = fs9.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs9.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -31025,7 +30472,7 @@ var require_io_util3 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -31043,7 +30490,7 @@ var require_io_util3 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -31120,11 +30567,11 @@ var require_io_util3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -31133,21 +30580,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -31177,10 +30624,10 @@ var require_io3 = __commonJS({ 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 path8 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); + var path8 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -31207,7 +30654,7 @@ var require_io3 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -31228,7 +30675,7 @@ var require_io3 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -31248,14 +30695,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -31279,7 +30726,7 @@ var require_io3 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -31327,7 +30774,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -31347,7 +30794,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -31368,1200 +30815,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug5; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug5 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug5 = 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 + "}"); +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - 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++) { - debug5(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; + __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(resolve4) { + resolve4(value); + }); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 os3 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path8 = __importStar2(require("path")); + var io6 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + _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 { - version = version.version; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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); - } - debug5("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"); + return cmd; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os3.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os3.EOL.length); + n = s.indexOf(os3.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - 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; + _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 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) { - debug5("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 this.args; } - 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug5("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); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } 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]; - debug5("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); + if (!arg) { + return '""'; } - } 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++; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - 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]; + } + 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 { - 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]; - } + quoteHit = false; } - 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; + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.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 = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(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 = rcompare; - function rcompare(a, b, loose) { - return compare2(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 compare2(a, b, loose) > 0; - } - exports2.lt = lt; - function lt(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports2.gte = gte5; - function gte5(a, b, loose) { - return compare2(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(a, b, loose) { - return compare2(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + 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(""); } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _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; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug5("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; - } - debug5("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); + /** + * 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 = path8.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve4, 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) + os3.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 { + resolve4(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug5("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; + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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; }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug5("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); }); } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - 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(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug5("comp", comp, options); - comp = replaceCarets(comp, options); - debug5("caret", comp); - comp = replaceTildes(comp, options); - debug5("tildes", comp); - comp = replaceXRanges(comp, options); - debug5("xrange", comp); - comp = replaceStars(comp, options); - debug5("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(_, M, m, p, pr) { - debug5("tilde", comp, _, 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) { - debug5("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + 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 exec(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.`); } - debug5("tilde return", ret); - return ret; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug5("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug5("caret", comp, _, 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) { - debug5("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"; + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } else { - debug5("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"; + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - debug5("caret return", ret); - return ret; + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; }); } - function replaceXRanges(comp, options) { - debug5("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) { - debug5("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; } - debug5("xRange return", ret); - return ret; + function step(result) { + result.done ? resolve4(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 exec = __importStar2(require_exec2()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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 + }); }); } - function replaceStars(comp, options) { - debug5("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; - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + 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); } - return false; + __setModuleDefault2(result, mod); + return result; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug5(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve4(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_utils5(); + var os3 = __importStar2(require("os")); + var path8 = __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 exportVariable6(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path8.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; + return inputs.map((input) => input.trim()); } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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 && range.test(minver)) { - return minver; - } - return null; + process.stdout.write(os3.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os3.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(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.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); + exports2.getState = getState2; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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/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]; + } }; } - if (satisfies2(version, range, options)) { - return false; + 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); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core13 = __importStar2(require_core2()); + 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; + core13.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core13.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core13.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core13.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core13.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + return result; } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path8 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname2(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + let result = path8.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname2; + 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)}`; } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } 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)}`; } - safeRe[t.COERCERTL].lastIndex = -1; } - if (match === null) { - return null; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path8.sep; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path8.sep)) { + return p; + } + if (p === path8.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -32574,313 +31992,871 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); - }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ value: v2, done: d }); - }, reject); } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core13 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob = __importStar4(require_glob()); - var io6 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs9 = __importStar4(require("fs")); - var path8 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path8.join(baseLocation, "actions", "temp"); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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); } - const dest = path8.join(tempDirectory, crypto.randomUUID()); - yield io6.mkdirP(dest); - return dest; - }); + } + return result; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs9.statSync(filePath).size; + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const paths = []; - const workspace = (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const globber = yield glob.create(patterns.join("\n"), { - implicitDescendants: false - }); - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path8.relative(workspace, file).replace(new RegExp(`\\${path8.sep}`, "g"), "/"); - core13.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; + }; + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs9.unlink)(filePath); - }); + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core13.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - }); - } catch (err) { - core13.debug(err.message); + bi = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - versionOutput = versionOutput.trim(); - core13.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core13.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + if (begs.length) { + result = [left, right]; } - }); + } + return result; } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs9.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; - }); + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + parts.push.apply(parts, p); + return parts; } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - return token; + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } else { - return void 0; + N = concatMap(n, function(el) { + return expand(el, false); + }); + } + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } + return expansions; } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path8 = (function() { + try { + return require("path"); + } catch (e) { } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + })() || { + sep: "/" + }; + minimatch.sep = path8.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { 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}`); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - 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; - } + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path8.sep !== "/") { + pattern = pattern.split(path8.sep).join("/"); } - 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]"); + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern = this.pattern; + var options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; } - get username() { - return this._decodedUsername; + if (!pattern) { + this.empty = true; + return; } - get password() { - return this._decodedPassword; + this.parseNegate(); + var set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug5() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = 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++) { + negate = !negate; + negateOffset++; } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); }; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + 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 && reSpecials[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; + } + 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 (reSpecials[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(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = 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 (addPatternStart) { + 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; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path8.sep !== "/") { + f = f.split(path8.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + 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 regExpEscape(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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -32893,613 +32869,615 @@ var require_lib3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 path8 = __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(path8.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path8.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); + } + this.segments.unshift(remaining); } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + } 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(path8.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } } } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path8.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path8.sep; + } + result += this.segments[i]; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 || 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.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(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", () => { - resolve4(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve4(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(userAgent, 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 = userAgent; - 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; + exports2.Pattern = void 0; + var os3 = __importStar2(require("os")); + var path8 = __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, homedir) { + 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}`; } } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path8.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); } /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + * Matches the pattern against the specified path */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(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 __awaiter4(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); - }); + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path8.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path8.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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * Escapes glob patterns within a path + */ + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * Normalizes slashes and ensures absolute root */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + static fixupPattern(pattern, homedir) { + (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(`.${path8.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path8.sep}`)) { + homedir = homedir || os3.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 += "\\"; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, data); + 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; } else { - return response; + set2 += c2; } } - 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."); + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + if (set2) { + literal += set2; + i = closed; + continue; } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + } + literal += c; } - this._disposed = true; + return literal; } /** - * Raw request. - * @param info - * @param data + * Escapes regexp special characters + * https://javascript.info/regexp-escaping */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve4(res); - } - } - this.requestRawWithCallback(info6, data, callbackForResult); - }); + 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(path8, level) { + this.path = path8; + 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 || 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(resolve4) { + resolve4(value); }); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - const req = info6.httpModule.request(info6.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(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - handleResult(new Error(`Request timeout: ${info6.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(); + function step(result) { + result.done ? resolve4(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(resolve4, reject) { + v = o[n](v), settle(resolve4, reject, v.done, v.value); + }); + }; } - /** - * 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); + function settle(resolve4, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve4({ value: v2, done: d }); + }, reject); } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } - } - return info6; + }; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - return lowercaseKeys(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + function fulfill(value) { + resume("next", value); } - _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; + function reject(value) { + resume("throw", value); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); + 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 core13 = __importStar2(require_core2()); + var fs9 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path8 = __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() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } + } + return result; }); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve4(response); + 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("**"))); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + } + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core13.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs9.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } - return value; + throw err; } - let obj; - let contents; + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !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 && path8.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & 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(fs9.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path8.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & 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 { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); + stats = yield fs9.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core13.debug(`Broken symlink '${item.path}'`); + return void 0; } - response.result = obj; + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); } - response.headers = res.message.headers; - } catch (err) { + throw 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 { - resolve4(response); + } else { + stats = yield fs9.promises.lstat(item.path); + } + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs9.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); } - })); + if (traversalChain.some((x) => x === realPath)) { + core13.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -33526,4390 +33504,3087 @@ var require_auth2 = __commonJS({ 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; + 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(resolve4, reject) { + v = o[n](v), settle(resolve4, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve4, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve4({ value: v2, done: d }); + }, reject); } }; - 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"); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core13 = __importStar2(require_core2()); + var fs9 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path8 = __importStar2(require("path")); + function hashFiles(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core13.info : core13.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path8.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs9.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(fs9.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; + } } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + result.end(); + if (hasMatch) { + writeDelegate(`Found ${count} files to hash.`); + return result.digest("hex"); + } else { + writeDelegate(`No matches found for glob`); + return ""; } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + }); + } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - addPolicy(policy, options = {}) { - if (options.phase && options.afterPhase) { - throw new Error("Policies inside a phase cannot specify afterPhase."); + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (options.phase && !ValidPhaseNames.has(options.phase)) { - throw new Error(`Invalid phase name: ${options.phase}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { - throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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; - } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - function createEmptyPipeline() { - return HttpPipeline.create(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = exports2.create = void 0; + var internal_globber_1 = require_internal_globber(); + var internal_hash_files_1 = require_internal_hash_files(); + function create(patterns, options) { + return __awaiter2(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); + } + exports2.create = create; + function hashFiles(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create(patterns, { followSymbolicLinks }); + return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); + }); } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os3 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os3.EOL}`); +// 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 debug5; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug5 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug5 = function() { + }; } - var debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; - var enabledString; - var enabledNamespaces = []; - var skippedNamespaces = []; - var debuggers = []; - if (debugEnvVariable) { - enable(debugEnvVariable); + 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 debugObj = Object.assign((namespace) => { - return createDebugger(namespace); - }, { - enable, - enabled, - disable, - log - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } + 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 + "}"); } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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++) { + debug5(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); } } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + if (version instanceof SemVer) { + return version; } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; - } + if (typeof version !== "string") { + return null; } - return false; - } - 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: extend3 - }); - function debug6(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); + if (version.length > MAX_LENGTH) { + return null; } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; + 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; } - return false; } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - var debug5 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug5("azure"); - AzureLogger.log = (...args) => { - debug5.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); + 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); } - debug5.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); + } + if (!(this instanceof SemVer)) { + return new SemVer(version, options); + } + debug5("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(); } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 + SemVer.prototype.format = function() { + this.version = this.major + "." + this.minor + "." + this.patch; + if (this.prerelease.length) { + this.version += "-" + this.prerelease.join("."); + } + return this.version; }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug5.disable(); - debug5.enable(enabledNamespaces2 + "," + logger.namespace); + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug5("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __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"; + 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); }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve4, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); + 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]; + debug5("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); } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + } 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]; + debug5("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); } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + } 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 = parse(version1); + var v2 = parse(version2); + var prefix = ""; + if (v1.prerelease.length || v2.prerelease.length) { + prefix = "pre"; + var defaultResult = "prerelease"; } - try { - buildPromise((x) => { - removeListeners(); - resolve4(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + for (var key in v1) { + if (key === "major" || key === "minor" || key === "patch") { + if (v1[key] !== v2[key]) { + return prefix + key; + } + } } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); + return defaultResult; + } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/delay.js -var require_delay = __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 random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve4) => { - token = setTimeout(resolve4, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage - }); + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - 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 }; + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } -}); - -// 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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + exports2.compare = compare2; + function compare2(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - function getErrorMessage2(e) { - if (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}`; - } + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare2(a, b, true); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + 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); } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare2(b, a, loose); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; + exports2.gt = gt; + function gt(a, b, loose) { + return compare2(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID2; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID2() { - return uuidFunction(); + exports2.lt = lt; + function lt(a, b, loose) { + return compare2(a, b, loose) < 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.eq = eq; + function eq(a, b, loose) { + return compare2(a, b, loose) === 0; } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); + exports2.neq = neq; + function neq(a, b, loose) { + return compare2(a, b, loose) !== 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare2(a, b, loose) >= 0; + } + exports2.lte = lte; + function lte(a, b, loose) { + return compare2(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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); + } + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url = new URL(value); - if (!url.search) { - return value; - } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); - } + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - return url.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; + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - 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; + comp = comp.trim().split(/\s+/).join(" "); + debug5("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; + } + debug5("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); } }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug5("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; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); + } + 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; } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; + rangeTmp = new Range2(comp.value, options); + return satisfies2(this.value, rangeTmp, options); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + rangeTmp = new Range2(this.value, options); + return satisfies2(comp.semver, rangeTmp, options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); + 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; }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - 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(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + exports2.Range = Range2; + function Range2(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); + } } + if (range instanceof Comparator) { + return new Range2(range.value, options); + } + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { 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]); + Range2.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(" ").trim(); + }).join("||").trim(); + return this.range; }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } 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 (error4) { - e = { error: error4 }; - } 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); + Range2.prototype.toString = function() { + return this.range; }; - } - 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); + Range2.prototype.parseRange = function(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug5("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); }); - }; - 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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); - }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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); } + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; }; - 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); + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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); + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { + return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); }; - __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]; - } }; + 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(); } - 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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os3 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + return result; } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os3.arch()}-${os3.type()}-${os3.release()})`); + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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 parseComparator(comp, options) { + debug5("comp", comp, options); + comp = replaceCarets(comp, options); + debug5("caret", comp); + comp = replaceTildes(comp, options); + debug5("tildes", comp); + comp = replaceXRanges(comp, options); + debug5("xrange", comp); + comp = replaceStars(comp, options); + debug5("stars", comp); + return comp; } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + function isX(id) { + return !id || id.toLowerCase() === "x" || id === "*"; } - 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; + function replaceTildes(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceTilde(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); + function replaceTilde(comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("tilde", comp, _, 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) { + debug5("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - 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"); + debug5("tilde return", ret); + return ret; + }); } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); } - function isBlob(x) { - return typeof x.stream === "function"; - } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; - } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); - } - } - function createFileFromStream(stream2, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream2(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + function replaceCaret(comp, options) { + debug5("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("caret", comp, _, 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) { + debug5("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 { + debug5("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"; + } } - return s; - }, [rawContent]: stream2 }); + debug5("caret return", ret); + return ret; + }); } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); - } + function replaceXRanges(comp, options) { + debug5("replaceXRanges", comp, options); + return comp.split(/\s+/).map(function(comp2) { + return replaceXRange(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); + 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) { + debug5("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; } - yield yield tslib_1.__await(value); } - } finally { - reader.releaseLock(); + 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; } + debug5("xRange return", ret); + return ret; }); } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } + function replaceStars(comp, options) { + debug5("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return node_stream_1.Readable.fromWeb(stream2); + 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 { - return stream2; + from = ">=" + from; } - } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); + 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 { - return ensureNodeStream(source); + to = "<=" + to; } + return (from + " " + to).trim(); } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream2 of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream2)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } + 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(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug5(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; + } + } + return false; + } + return true; } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - return result; + return range.test(version); } - 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; + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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; } - 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; + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - return total; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 && range.test(minver)) { + return minver; + } + return null; } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; } - request.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`); + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + if (satisfies2(version, range, options)) { + return false; } - } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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}`); + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.set[i2]; + var high = null; + var low = null; + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); } - 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`); + 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; } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); + }); + 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 = parse(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 match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } - }; + safeRe[t.COERCERTL].lastIndex = -1; + } + if (match === null) { + return null; + } + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { +// 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.decompressResponsePolicyName = void 0; - exports2.decompressResponsePolicy = decompressResponsePolicy; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; - } + 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); } }); -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/cache/lib/internal/cacheUtils.js +var require_cacheUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/cacheUtils.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"; + 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]; + } }; } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve4, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); + 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; }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); } - timer = setTimeout(() => { - removeListeners(); - resolve4(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - 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/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { - "use strict"; + }; + 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(resolve4, reject) { + v = o[n](v), settle(resolve4, reject, v.done, v.value); + }); + }; + } + function settle(resolve4, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve4({ value: v2, done: d }); + }, reject); + } + }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; - exports2.throttlingRetryStrategy = throttlingRetryStrategy; - var helpers_js_1 = require_helpers(); - 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; + 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 core13 = __importStar2(require_core()); + var exec = __importStar2(require_exec()); + var glob = __importStar2(require_glob()); + var io6 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs9 = __importStar2(require("fs")); + var path8 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 = path8.join(baseLocation, "actions", "temp"); } - 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 (_a) { - return void 0; - } - } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + const dest = path8.join(tempDirectory, crypto2.randomUUID()); + yield io6.mkdirP(dest); + return dest; + }); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; - } - return { - retryAfterInMs - }; - } - }; + function getArchiveFileSizeInBytes(filePath) { + return fs9.statSync(filePath).size; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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 glob.create(patterns.join("\n"), { + implicitDescendants: false + }); + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path8.relative(workspace, file).replace(new RegExp(`\\${path8.sep}`, "g"), "/"); + core13.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); + } else { + paths.push(`${relativeFile}`); + } } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + return paths; + }); } - 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"; + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs9.unlink)(filePath); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.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; + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core13.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() } - } + }); + } catch (err) { + core13.debug(err.message); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + versionOutput = versionOutput.trim(); + core13.debug(versionOutput); + return versionOutput; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core13.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; + } + }); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + function getCacheFileName(compressionMethod) { + return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); - } + function getGnuTarPathOnWindows() { + return __awaiter2(this, void 0, void 0, function* () { + if (fs9.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - /** - * 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() }); + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - /** - * 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)); + components.push(versionSalt); + return crypto2.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"); } - /** - * 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); + return token; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __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 core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); - } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); - } - }; - } - 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, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); - } - } - } - request.multipartBody = { parts }; +// 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; } -}); - -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); + 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 _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.addInitializer = function(f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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; - } + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; } - 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"; + } + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return ms + " ms"; } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { 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]); + }; } -}); - -// 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 hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug5(...args) { - if (!debug5.enabled) { - return; + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) 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: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; } - const self2 = debug5; - 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"); + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug5.namespace = namespace; - debug5.useColors = createDebug.useColors(); - debug5.color = createDebug.selectColor(namespace); - debug5.extend = extend3; - debug5.destroy = createDebug.destroy; - Object.defineProperty(debug5, "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 (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug5); - } - return debug5; - } - function extend3(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); + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; } - } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } - 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(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; - } - 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; + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; } - module2.exports = setup; + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } -}); - -// 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`."); - } +} +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); + }); }; - })(); - 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+)/); + if (f) i[n] = f(i[n]); } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } + } + 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(resolve4, reject) { + v = o[n](v), settle(resolve4, reject, v.done, v.value); }); - args.splice(lastC, 0, c); + }; + } + function settle(resolve4, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve4({ 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]; } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { - } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function load2() { - let r; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + inner.call(this); + } catch (e) { + return Promise.reject(e); } - return r; - } - function localstorage() { + }; + 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 { - return localStorage; - } catch (error4) { + 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); } } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.message; + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path8, preserveJsx) { + if (typeof path8 === "string" && /^\.\.?\//.test(path8)) { + return path8.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path8; +} +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/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports2, module2) { +// 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"; - 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); + 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/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { +// 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"; - var os3 = 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; + 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}`); } - 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); - } + } +}); + +// 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); } - function translateLevel(level) { - if (level === 0) { - return false; + 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); + } } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - if (hasFlag("color=256")) { - return 2; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; + } } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; + } } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - if (process.platform === "win32") { - const osRelease = os3.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; + 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; } - 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; + 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(debug5, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug5(...args) { + if (!newDebugger.enabled) { + return; } - return min; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; } - if (env.COLORTERM === "truecolor") { - return 3; + return false; + } + function extend3(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 ("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 (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(", ")}.`); } } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; + function createLogger(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; } - if ("COLORTERM" in env) { - return 1; + function contextGetLogLevel() { + return logLevel; } - return min; + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); - return translateLevel(level); + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - 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 util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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 (error4) { +// 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(); } - 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, (_, k) => { - return k.toUpperCase(); - }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - obj[prop] = val2; - 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]; + 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]); + } + } } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; + /** + * 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() }); } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; + /** + * 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; } - } - function load2() { - return process.env.DEBUG; - } - function init(debug5) { - debug5.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug5.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + /** + * 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); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); + } } }); -// 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/@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/agent-base/dist/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(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 json2(stream2) { - const buf = await toBuffer(stream2); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; - } - } - exports2.json = json2; - function req(url, opts = {}) { - const href = typeof url === "string" ? url : url.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); - const promise = new Promise((resolve4, reject) => { - req2.once("response", resolve4).once("error", reject).end(); - }); - req2.then = promise.then.bind(promise); - return req2; + } +}); + +// 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 = randomUUID2; + function randomUUID2() { + return crypto.randomUUID(); } - exports2.req = req; } }); -// node_modules/agent-base/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/agent-base/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); }; + 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.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers2(), exports2); - var INTERNAL = 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; + 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; } - decrementSockets(name, socket) { - if (!this.sockets[name] || socket === null) { - return; + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - const sockets = this.sockets[name]; - const index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - } - // 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); + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - return super.getName(options); + this._policies.push({ + policy, + options + }); + this._orderedPolicies = void 0; } - 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); - } + 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[INTERNAL].currentSocket = socket; - super.createSocket(req, options, cb); - }, (err) => { - this.decrementSockets(name, fakeSocket); - cb(err); }); + this._orderedPolicies = void 0; + return removedPolicies; } - 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); + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + clone() { + return new _HttpPipeline(this._policies); } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; - } + static create() { + return new _HttpPipeline(); } - }; - 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 __importDefault4 = 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 = __importDefault4(require_src()); - var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve4, 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); + orderPolicies() { + const result = []; + const policyMap = /* @__PURE__ */ new Map(); + function createPhase(name) { + return { + name, + policies: /* @__PURE__ */ new Set(), + hasRun: false, + hasAfterPolicies: false + }; } - function onend() { - cleanup(); - debug5("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + 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; + } } - function onerror(err) { - cleanup(); - debug5("onerror %o", err); - reject(err); + 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); } - 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) { - debug5("have not received end of HTTP headers yet..."); - read(); - return; + 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}`); } - 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")); + if (options.afterPolicies) { + for (const afterPolicyName of options.afterPolicies) { + const afterNode = policyMap.get(afterPolicyName); + if (afterNode) { + node.dependsOn.add(afterNode); + afterNode.dependants.add(node); + } + } } - const firstLineParts = firstLine.split(" "); - const statusCode = +firstLineParts[1]; - const statusText = firstLineParts.slice(2).join(" "); - const headers = {}; - for (const header of headerParts) { - if (!header) + 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; - 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; + 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); } } - debug5("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve4({ - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug5 = (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 HttpsProxyAgent = 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 ?? {}; - debug5("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 ? omit(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:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); - } else { - debug5("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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 -`; + 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); + } + } } - 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) { - debug5("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + 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 socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug5("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + return result; } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); - } - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + function createEmptyPipeline() { + return HttpPipeline.create(); } } }); -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug5 = (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 ?? {}; - debug5("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 ? omit(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 url = new url_1.URL(req.path, base); - if (opts.port !== 80) { - url.port = String(opts.port); - } - req.path = String(url); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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; - debug5("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug5("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); - debug5("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug5("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 omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { +// 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.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_log(); - 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; + 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; } - const httpsProxy = getEnvironmentValue(HTTPS_PROXY); - const allProxy = getEnvironmentValue(ALL_PROXY); - const httpProxy = getEnvironmentValue(HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; + return false; } - function isBypassed(uri, noProxyList, bypassedMap) { - if (noProxyList.length === 0) { - return false; - } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + } +}); + +// 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())); } - 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; - } + /** + * 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 + }; } - } else { - if (host === pattern) { - isBypassedFlag = true; + 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); } - } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 value; + }, 2); } - return []; - } - function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return void 0; + /** + * 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 parsedUrl = new URL(proxyUrl); - const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + const url = new URL(value); + if (!url.search) { + return value; } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } } - request.agent = cachedAgents.httpsProxyAgent; - } - } - function proxyPolicy(proxySettings, options) { - if (!noProxyListLoaded) { - exports2.globalNoProxyList.push(...loadNoProxy()); + return url.toString(); } - const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); - const cachedAgents = {}; - return { - name: exports2.proxyPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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 next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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 next(request); } - }; - } + return sanitized; + } + }; + exports2.Sanitizer = Sanitizer; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { +// 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.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); - } - }; + 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/@azure/core-tracing/dist/commonjs/tracingContext.js -var require_tracingContext = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js"(exports2) { +// 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.TracingContextImpl = exports2.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; + 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); } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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) { +// 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.state = void 0; - exports2.state = { - instrumenterImplementation: void 0 - }; + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; - } - exports2.getInstrumenter = getInstrumenter; - } -}); - -// 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 = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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 - }; - } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __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 core_util_1 = require_commonjs2(); - 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 { - 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 }); - Object.setPrototypeOf(this, _RestError.prototype); - } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } - }; - exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - function isRestError(e) { - if (e instanceof RestError) { - return true; - } - return (0, core_util_1.isError)(e) && e.name === "RestError"; - } - } -}); - -// 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_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.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); - } - span.setStatus({ - status: "success" - }); - 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/createPipelineFromOptions.js -var require_createPipelineFromOptions = __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_logPolicy(); - var pipeline_js_1 = require_pipeline(); - var redirectPolicy_js_1 = require_redirectPolicy(); - var userAgentPolicy_js_1 = require_userAgentPolicy(); - var multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { +// 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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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((resolve4) => { const handler = () => { resolve4(); @@ -37926,6 +36601,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -37939,25 +36616,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -37966,13 +36640,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -37996,8 +36673,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -38019,7 +36699,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -38037,9 +36717,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -38048,29 +36727,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url = new URL(request.url); const isInsecure = url.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url.hostname, path: `${url.pathname}${url.search}`, port: url.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve4, reject) => { - const req = isInsecure ? http.request(options, resolve4) : https2.request(options, resolve4); + const req = isInsecure ? node_http_1.default.request(options, resolve4) : node_https_1.default.request(options, resolve4); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -38091,30 +36769,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -38137,11 +36816,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream2, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream2.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream2.pipe(inflate); return inflate; } @@ -38161,7 +36840,7 @@ var require_nodeHttpClient = __commonJS({ resolve4(Buffer.concat(buffer).toString("utf8")); }); stream2.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -38192,9 +36871,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -38205,1760 +36884,1368 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; - } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + logger(`Response status code: ${response.status}`); + logger(`Headers: ${sanitizer.sanitize(response.headers)}`); + return response; + } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); + } + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.throttlingRetryPolicyName = void 0; - exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; - function throttlingRetryPolicy(options = {}) { - var _a; - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; - } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + } +}); + +// 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(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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(); + return next(request); } }; - function refresh(scopes, getTokenOptions) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + } + } +}); + +// 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_helpers = __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((resolve4, 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(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve4(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; + exports2.throttlingRetryStrategy = throttlingRetryStrategy; + var helpers_js_1 = require_helpers(); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + exports2.retryPolicy = retryPolicy; + var helpers_js_1 = require_helpers(); + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; } - } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + return void 0; } - op = body.call(thisArg, _); - } 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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 }; + 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"; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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"; } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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]; + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); +}); + +// 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]; }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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); + createDebug.names = []; + createDebug.skips = []; + createDebug.formatters = {}; + function selectColor(namespace) { + let hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(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(); + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug5(...args) { + if (!debug5.enabled) { + return; + } + const self2 = debug5; + 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 index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; }); - } 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(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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]; + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); } - return t; - }; - return __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 - }; - } -}); - -// 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 { - /** - * 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"); + debug5.namespace = namespace; + debug5.useColors = createDebug.useColors(); + debug5.color = createDebug.selectColor(namespace); + debug5.extend = extend3; + debug5.destroy = createDebug.destroy; + Object.defineProperty(debug5, "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(debug5); } - 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_commonjs2(); - 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + return debug5; } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + function extend3(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; } - /** - * 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"); + 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); + } } - 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"); + 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; + } } - this._name = newName; - this._key = newKey; + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; } - /** - * 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"); + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } } - this._signature = signature; + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + return false; } - /** - * 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"); + function coerce3(val) { + if (val instanceof Error) { + return val.stack || val.message; } - this._signature = newSignature; + return val; } - }; - 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); + 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/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); +// 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+)/); } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); - } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; - } -}); - -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); + exports2.log = console.debug || console.log || (() => { }); - } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { + function save(namespaces) { try { - step(generator.next(value)); - } catch (e) { - reject(e); + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { } } - function rejected(value) { + function load2() { + let r; try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + function localstorage() { + try { + return localStorage; + } catch (error3) { + } } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(thisArg, body) { - var _ = { 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]); + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; + } }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; +}); + +// 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 os3 = 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); } - op = body.call(thisArg, _); - } 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 }; + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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 = os3.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; } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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]; + function getSupportLevel(stream2) { + const level = supportsColor(stream2, stream2 && stream2.isTTY); + return translateLevel(level); } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; } - 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) { +}); + +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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 { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve4, reject) { - v = o[n](v), settle(resolve4, reject, v.done, v.value); + 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, (_, k) => { + return k.toUpperCase(); }); - }; - } - function settle(resolve4, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve4({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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]; + 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); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + 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]; + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); + function load2() { + return process.env.DEBUG; + } + function init(debug5) { + debug5.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug5.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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 __assign3.apply(this, arguments); + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; - __createBinding3 = Object.create ? (function(o, m, k, k2) { + } +}); + +// 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_helpers2 = __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)) { @@ -39970,5397 +38257,9755 @@ var init_tslib_es63 = __esm({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { + })); + 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; }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 - }; - } -}); - -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __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.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); + exports2.toBuffer = toBuffer; + async function json2(stream2) { + const buf = await toBuffer(stream2); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); + exports2.json = json2; + function req(url, opts = {}) { + const href = typeof url === "string" ? url : url.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); + const promise = new Promise((resolve4, reject) => { + req2.once("response", resolve4).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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 = "_"; + exports2.req = req; } }); -// node_modules/@azure/core-client/dist/commonjs/utils.js -var require_utils5 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { +// node_modules/agent-base/dist/index.js +var require_dist = __commonJS({ + "node_modules/agent-base/dist/index.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; + 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]; + } }; } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); + 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); } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, parsedHeaders), { blobBody: fullResponse.blobBody, readableStreamBody: fullResponse.readableStreamBody }); + __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_helpers2(), exports2); + var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState"); + var Agent = class extends http.Agent { + constructor(opts) { + super(opts); + this[INTERNAL] = {}; } - const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {}; - const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); - if (expectedBodyTypeName === "Sequence" || isPageableResponse) { - const arrayResponse = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; + /** + * 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:"; } } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } } - 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) - }); - } - exports2.flattenResponse = flattenResponse; - } -}); - -// 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 = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + // 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); } - /** - * @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}.`); + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options) }; - 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); + 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); + } } - 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); - } - } + this[INTERNAL].currentSocket = socket; + super.createSocket(req, options, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); } - /** - * 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, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - } - }; - let payload = {}; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = void 0; + if (!socket) { + throw new Error("No socket was returned in the `connect()` function"); } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; + return socket; + } + get defaultPort() { + return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; } - if (mapper.isConstant) { - object = mapper.defaultValue; + } + get protocol() { + return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); + } + }; + 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 debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve4, reject) => { + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once("readable", read); } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); + function cleanup() { + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("readable", read); } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + function onend() { + cleanup(); + debug5("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); } - if (object === void 0 || object === null) { - payload = object; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + function onerror(err) { + cleanup(); + debug5("onerror %o", err); + reject(err); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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) { + debug5("have not received end of HTTP headers yet..."); + read(); + return; } - 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]; - } + 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")); } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; + 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}"`)); } - } else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; - } else if (responseBody === "false") { - payload = false; + 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 { - payload = responseBody; + headers[key] = value; } - } 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); } + debug5("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve4({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - } - }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); - } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; - } - return str2.substr(0, len); + socket.on("error", onerror); + socket.on("end", onend); + read(); + }); } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + exports2.parseProxyResponse = parseProxyResponse; + } +}); + +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug5 = (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 + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port + }; } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; - } + /** + * 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'); } - } - 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.`); - } + let socket; + if (proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + } else { + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - } - 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(); + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - 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.`); + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - value = base64.encodeByteArray(value); + 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) { + debug5("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; + } + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug5("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } - return value; + }; + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - function serializeBase64UrlType(objectName, value) { - if (value !== void 0 && value !== null) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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_dist(); + var url_1 = require("url"); + var debug5 = (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 ?? {}; + debug5("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 ? omit(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 url = new url_1.URL(req.path, base); + if (opts.port !== 80) { + url.port = String(opts.port); + } + req.path = String(url); + const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - return value; + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); + } + let first; + let endOfHeaders; + debug5("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug5("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); + debug5("Output buffer: %o", req.outputData[0].data); + } + let socket; + if (this.proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug5("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 omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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()]; } - 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}.`); + return void 0; + } + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + 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 tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + 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 { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream2) { + if (stream2 instanceof ReadableStream) { + makeAsyncIterable(stream2); + return stream_1.Readable.fromWeb(stream2); + } else { + return stream2; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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 { - 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; - } + total += partLength; } } - 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 total; + } + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); } - return instance; + request.body = await (0, concat_js_1.concat)(sources); } - 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}`); + 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 (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; + if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { + throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); } - return responseBody; } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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]; + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); + } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); + } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + }; + } + } +}); + +// 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); } - return tempArray; + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); - } - } - } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return void 0; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); - } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + } +}); + +// 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 url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; } + return next(req); } - } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; - } + exports2.ensureSecureConnection = ensureSecureConnection; + var log_js_1 = require_log2(); + var insecureConnectionWarningEmmitted = false; + function allowInsecureConnection(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url = new URL(request.url); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; } } - return value; + return false; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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]; + function emitInsecureConnectionWarning() { + const warning9 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning9); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning9); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } else { - break; + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info6 = state_js_1.state.operationRequestMap.get(request); - if (!info6) { - info6 = {}; - state_js_1.state.operationRequestMap.set(request, info6); - } - return info6; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; + } + } +}); + +// 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.deserializationPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } } - return result; + return pipeline; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); } - return result; + return cachedHttpClient; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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]; + } } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if (descriptor.contentType === null) { + return void 0; } - 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 }); - } + if (descriptor.contentType) { + return descriptor.contentType; } - return parsedResponse; + 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 isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escapeDispositionField(value) { + return JSON.stringify(value); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; - } + function getContentDisposition(descriptor) { + const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); + if (contentDispositionHeader) { + return contentDispositionHeader; } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (descriptor.dispositionType === void 0 && descriptor.name === void 0 && descriptor.filename === void 0) { + return void 0; } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + const dispositionType = descriptor.dispositionType ?? "form-data"; + let disposition = dispositionType; + if (descriptor.name) { + disposition += `; name=${escapeDispositionField(descriptor.name)}`; } - return { error: error4, shouldReturnResponse: false }; - } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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; } } - return operationResponse; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; + } + return disposition; } - } -}); - -// 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); } - return result; + 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}`); } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + 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); } - return result; + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } + 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_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + 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, rawHeaders: headers, parsedBody }); } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + return { + request, + 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, rawHeaders }, e); } + throw e; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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; + 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 { - if (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; } } + return "application/json"; } - exports2.serializeRequestBody = serializeRequestBody; - 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 buildPipelineRequest(method, url, 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, + 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 prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - 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_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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) }; } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; } - exports2.createClientPipeline = createClientPipeline; - } -}); - -// 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 = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; + 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 + }); } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path8 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path8.startsWith("/")) { - path8 = path8.substring(1); - } - if (isAbsoluteUrl(path8)) { - requestUrl = path8; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path8); - } + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.toString().replace(/([^:]\/)\/+/g, "$1"); + } + function getQueryParamValue(key, allowReserved, style, param) { + let separator; + if (style === "pipeDelimited") { + separator = "|"; + } else if (style === "spaceDelimited") { + separator = "%20"; + } else { + separator = ","; } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + 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]; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; } - } - return result; - } - function isAbsoluteUrl(url) { - return url.includes("://"); + 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 appendPath(url, pathToAppend) { - if (!pathToAppend) { + function appendQueryParams(url, options = {}) { + if (!options.queryParameters) { return url; } const parsedUrl = new URL(url); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path8 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path8; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } + 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)); } - if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "CSV" || queryParameter.collectionFormat === "Pipes")) { - queryParameterValue = queryParameterValue.join(delimiter); + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); } - result.set(queryParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter), queryParameterValue); + } 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)); } } - return { - queryParams: result, - sequenceParams - }; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return result; + return endpoint; } - function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url; + 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)); } - const parsedUrl = new URL(url); - 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); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - 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}`); + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path8, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path8, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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."); } - } else { - searchPieces.push(`${name}=${value}`); } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); + }; } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, options), { credentialOptions })); + 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 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; + 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/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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)(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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 getLogLevel() { + return context2.getLogLevel(); } - 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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + } +}); + +// 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 + }); } - 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) => Object.assign(Object.assign({}, a), b), {}); + } +}); + +// 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 + }; } - function requestToOptions(request) { + } +}); + +// 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 { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions + 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/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } + 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 + }); } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); + } +}); + +// 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); } - var HttpHeaders = class _HttpHeaders { - 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } + 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"; } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - exports2.toPipelineResponse = toPipelineResponse; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.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) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + 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-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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.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); } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); + 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.requestPolicyFactoryPolicyName, + name: exports2.userAgentPolicyName, async sendRequest(request, 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); + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; + 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); } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + 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/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } +// 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(); } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + 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.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; + exports2.AbortError = AbortError; } }); -// node_modules/fast-xml-parser/src/validator.js -var require_validator = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { - "use strict"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); +// 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((resolve4, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } + if (abortSignal?.aborted) { + return rejectOnAbort(); } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } + try { + buildPromise((x) => { + removeListeners(); + resolve4(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } - } - return i; + 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)((resolve4) => { + token = setTimeout(resolve4, 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 }; } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { + } +}); + +// 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 { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; + stringified = String(e); } + } catch (err) { + stringified = "[unable to stringify input]"; } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); - } + return `Unknown error ${stringified}`; } - return true; } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; + } +}); + +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; } - return i; - } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col - } - }; - } - function validateAttrName(attrName) { - return util.isName(attrName); - } - function validateTagName(tagname) { - return util.isName(tagname); - } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; - } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } - } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); } - return { entities, i }; + return true; } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; - } - return [entityName2, val2, i]; + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; + } +}); + +// 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 = randomUUID2; + 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 isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; + function isError(e) { + return tspRuntime.isError(e); } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; - } - } else { - return str2; - } - } + function isObject2(input) { + return tspRuntime.isObject(input); } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; + function randomUUID2() { + 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); } - module2.exports = toNumber; - } -}); - -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; - } - return () => false; + function stringToUint8Array(value, format) { + return tspRuntime.stringToUint8Array(value, format); } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + 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 replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); + 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"); } - return val2; }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; - } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; - } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - function findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); } else { - return closingIndex + str2.length - 1; + return blob; } } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + function createFileFromStream(stream2, name, options = {}) { return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName + ...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 readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } - } - } + 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 parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } + return source.map((x) => x); } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; + 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } + return tspPolicy.sendRequest(request, next); } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + }; } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; +// 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/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; +// 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); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; + } +}); + +// 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)(); } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + } +}); + +// 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 replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; - } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; - } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } + }; } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; - } - } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); + } +}); + +// 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); } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; - } + } +}); + +// 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); } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder + 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; + } + 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-xml/dist/commonjs/xml.common.js -var require_xml_common = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.common.js"(exports2) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + exports2.state = void 0; + exports2.state = { + instrumenterImplementation: void 0 + }; } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false + end: () => { + }, + isRecording: () => false, + recordException: () => { + }, + setAttribute: () => { + }, + setStatus: () => { + }, + addEvent: () => { + } }; } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + 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 getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - 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, ""); + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); + } + return state_js_1.state.instrumenterImplementation; } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); + } +}); + +// 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 + }; } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; + 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(); + } } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; - } + function parseTraceparentHeader(traceparentHeader) { + return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); } - return parsedXml; + function createRequestHeaders(tracingContext) { + return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + } + return { + startSpan, + withSpan, + withContext, + parseTraceparentHeader, + createRequestHeaders + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; + 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; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return xml_common_js_1.XML_CHARKEY; + var tracingClient_js_1 = require_tracingClient(); + Object.defineProperty(exports2, "createTracingClient", { enumerable: true, get: function() { + return tracingClient_js_1.createTracingClient; } }); } }); -// 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_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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(request, next) { + if (!tracingClient) { + return next(request); + } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; + } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); + } + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; + } } - return abortedMap.get(this); + }; + } + 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; } - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - static get none() { - return new _AbortSignal(); + } + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { + request.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; } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - listeners.push(listener); + span.end(); + } catch (e) { + log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + 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)}`); } - /** - * 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."); + } + } +}); + +// 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 }; } - }; - function abortSignal(signal) { - if (signal.aborted) { - return; + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; } - if (signal.onabort) { - signal.onabort.call(signal); + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; + } } - const listeners = listenersMap.get(signal); - if (listeners) { - listeners.slice().forEach((listener) => { - listener.call(signal, { type: "abort" }); - }); + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); } - abortedMap.set(signal, true); + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; } - 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(); - }); + } +}); + +// 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); } } - } - /** - * 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/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - throw error4; - }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return { - code, - message - }; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - 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}`; + } +}); + +// 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(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - 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, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; - } - } - return { response, status }; + } +}); + +// 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); } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); - } + } +}); + +// 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); } - function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; + } +}); + +// 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); } - function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; + } +}); + +// 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); } - function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; + } +}); + +// 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); } - function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; + } +}); + +// 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 + }); } - function findResourceLocation(inputs) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } + } +}); + +// 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; } } - } - 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; + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } + return token; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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; + }; } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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"; + } +}); + +// 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(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - 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; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true + }; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - return void 0; } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error4; + function isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { + const { scopes } = onChallengeOptions; + const accessToken = await onChallengeOptions.getAccessToken(scopes, { + enableCae: true, + claims: caeClaims + }); + if (!accessToken) { + return false; } - return void 0; + onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); + return true; } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return initOperation({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig + 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(request, next) { + if (!request.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, + getAccessToken, + logger }); - 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 - }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } + } + }; } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + } + } + return next(request); } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + }; + } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - case "Body": - default: { - return void 0; + }; + } + } +}); + +// 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); + } +}); + +// 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"); } - case "Body": { - return getProvisioningState(rawResponse); + 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + 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"; } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + } +}); + +// 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; } - return state.config.resourceLocation; - } - function isOperationError(e) { - return e.name === "RestError"; - } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); - } - var createStateProxy$1 = () => ({ /** - * 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. + * 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 */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => state.status = "canceled", - setError: (state, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } + }; + } + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.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_utils6 = __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_utils6(); + 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, object, 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) { + object = mapper.defaultValue; + } + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, 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 }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } + 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 (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`); - } + } + if (mapperType.match(/^Number$/i) !== null) { + payload = parseFloat(responseBody); + if (isNaN(payload)) { + payload = responseBody; } - })().finally(() => { - resultPromise = void 0; - }), - async poll(pollOptions) { - if (resolveOnUnsuccessful) { - if (poller.isDone()) - return; + } else if (mapperType.match(/^Boolean$/i) !== null) { + if (responseBody === "true") { + payload = true; + } else if (responseBody === "false") { + payload = false; } else { - switch (state.status) { - case "succeeded": - return; - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - await pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; - } + 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); } - }; - return poller; - }; + } + if (mapper.isConstant) { + payload = mapper.defaultValue; + } + return payload; + } + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; + } + return str2.substr(0, len); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - setResult: (state, result) => state.result = result, - setRunning: (state) => state.isStarted = true, - setSucceeded: (state) => state.isCompleted = true, - setFailed: () => { + 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 str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + 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 < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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, object, objectName, isXml, options) { + if (typeof object !== "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(object)) { + const serializedValue = serializer.serialize(valueType, object[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, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + } + if (object !== void 0 && object !== 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) && (object[key] !== void 0 && object[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 = object[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 object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + } + } + return payload; + } + return object; + } + 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, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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(request) { + return originalRequestSymbol in request; + } + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); + } + let info6 = state_js_1.state.operationRequestMap.get(request); + if (!info6) { + info6 = {}; + state_js_1.state.operationRequestMap.set(request, info6); + } + return info6; + } + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; + } + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + 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 request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + 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 parse(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 parse(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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.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)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.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) { + request.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); + request.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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path8 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path8.startsWith("/")) { + path8 = path8.substring(1); + } + if (isAbsoluteUrl(path8)) { + requestUrl = path8; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path8); + } + } + 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(url) { + return url.includes("://"); + } + function appendPath(url, pathToAppend) { + if (!pathToAppend) { + return url; + } + const parsedUrl = new URL(url); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; + } + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); + } + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path8 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path8; + 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 pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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(url, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url; + } + const parsedUrl = new URL(url); + 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_utils6(); + 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(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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 request; + } 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") { + request.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)) { + request[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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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_util8(); + 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) { }, - 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; + shouldLog(_logLevel) { + return false; + } + }; + exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; + function createRequestPolicyFactoryPolicy(factories) { + const orderedFactories = factories.slice().reverse(); + return { + name: exports2.requestPolicyFactoryPolicyName, + async sendRequest(request, 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)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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 = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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(url) { + const urlParsed = new URL(url); + let path8 = urlParsed.pathname; + path8 = path8 || "/"; + path8 = escape(path8); + urlParsed.pathname = path8; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path8 = urlParsed.pathname; + path8 = path8 ? path8.endsWith("/") ? `${path8}${name}` : `${path8}/${name}` : name; + urlParsed.pathname = path8; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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((resolve4, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve4(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + /** + * Signs request. + * + * @param request - + */ + signRequest(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + /** + * 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(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; - } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + return value; } /** - * Serializes the Poller operation. + * 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 - */ - toString() { - return JSON.stringify({ - state: this.state + getCanonicalizedHeadersString(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; }); + return canonicalizedHeadersStringToSign; } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); + /** + * Retrieves the webResource canonicalized resource string. + * + * @param request - + */ + getCanonicalizedResourceString(request) { + const path8 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path8}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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; } }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); } }; - var Poller = class { + exports2.Credential = Credential; + } +}); + +// 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 { /** - * 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: + * 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. * - * ```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 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 operation - Must contain the basic properties of `PollOperation`. + * @param stringToSign - */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve4, reject) => { - this.resolve = resolve4; - this.reject = reject; - }); - this.promise.catch(() => { - }); + 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 { /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. + * Creates an instance of AnonymousCredentialPolicy. + * @param nextPolicy - + * @param options - */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); - } + // 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 { /** - * pollOnce does one polling, by calling to the update method of the underlying - * poll operation to make any relevant change effective. + * Creates an {@link AnonymousCredentialPolicy} object. * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @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 options - Optional properties passed to the operation's update method. + * @param buffers - Array of buffers containing the data + * @param byteLength - The total length of data contained in the buffers */ - async pollOnce(options = {}) { - if (!this.isDone()) { - this.operation = await this.operation.update({ - abortSignal: options.abortSignal, - fireProgress: this.fireProgress.bind(this) - }); + 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."); } - 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. + * Internal _read() that will be called when the stream wants to pull more data in. * - * @param state - The current operation state. + * @param size - Optional. The size of data to be read */ - fireProgress(state) { - for (const callback of this.pollProgressCallbacks) { - callback(state); + _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 { /** - * Invokes the underlying operation's cancel method. + * Internal buffers used to keep the data. + * Each buffer has a length of the maxBufferLength except last one. */ - async cancelOnce(options = {}) { - this.operation = await this.operation.cancel(options); + 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); + } } /** - * 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. + * 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. * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @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. * - * @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; + 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 (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + if (targetOffset === target.length) { + j++; + targetOffset = 0; } } - if (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + buffers.splice(0, i); + if (buffers.length > 0) { + buffers[0] = buffers[0].slice(sourceOffset); } } /** - * Returns a promise that will resolve once the underlying operation is completed. + * Get the readable stream assembled from all the data in the internal buffers. + * */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); - } - this.processUpdatedState(); - return this.promise; + 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 { /** - * 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. + * 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. */ - onProgress(callback) { - this.pollProgressCallbacks.push(callback); - return () => { - this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); - }; - } + incoming = []; /** - * Returns true if the poller has finished polling. + * The array (queue) includes all the buffers filled from stream data. */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); - } + outgoing = []; /** - * Stops the poller from continuing to poll. + * 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 */ - stopPolling() { - if (!this.stopped) { - this.stopped = true; - if (this.reject) { - this.reject(new PollerStoppedError("This poller is already stopped")); - } + 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; } /** - * Returns true if the poller is stopped. + * Start the scheduler, will return error when stream of any of the outgoingHandlers + * returns error. + * */ - isStopped() { - return this.stopped; + async do() { + return new Promise((resolve4, 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(resolve4).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve4(); + } + } + }); + }); } /** - * Attempts to cancel the underlying operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * Insert a new data into unresolved array. * - * If it's called again before it finishes, it will throw an error. + * @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. * - * @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"); + shiftBufferFromUnresolvedDataArray(buffer) { + if (!buffer) { + buffer = new PooledBuffer_js_1.PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); + } else { + buffer.fill(this.unresolvedDataArray, this.unresolvedLength); } - return this.cancelPromise; + this.unresolvedLength -= buffer.size; + return buffer; } /** - * 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, + * 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. * - * // The only other property needed by PublicState. - * publicProperty: state.publicProperty - * } - * } - * } - * ``` + * Return false when available buffers in incoming are not enough, else true. * - * You can see this in the tests of this repository, go to the file: - * `../test/utils/testPoller.ts` - * and look for the getOperationState implementation. + * @returns Return false when buffers in incoming are not enough, else true. */ - getOperationState() { - return this.operation.state; + 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; } /** - * 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. + * Try to trigger a outgoing handler for every buffer in outgoing. Stop when + * concurrency reaches. */ - getResult() { - const state = this.operation.state; - return state.result; + async triggerOutgoingHandlers() { + let buffer; + do { + if (this.executingOutgoingHandlers >= this.concurrency) { + return; + } + buffer = this.outgoing.shift(); + if (buffer) { + this.triggerOutgoingHandler(buffer); + } + } while (buffer); } /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. + * Trigger a outgoing handler for a buffer shifted from outgoing. + * + * @param buffer - */ - toString() { - return this.operation.toString(); - } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + 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"); } /** - * The method used by the poller to wait before attempting to update its operation. + * Return buffer used by outgoing handler into incoming. + * + * @param buffer - */ - delay() { - return new Promise((resolve4) => setTimeout(() => resolve4(), this.config.intervalInMs)); + reuseBuffer(buffer) { + this.incoming.push(buffer); + if (!this.isError && this.resolveData() && !this.isStreamEnd) { + this.readable.resume(); + } } }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; + exports2.BufferScheduler = BufferScheduler; } }); -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { +// 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 }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream2 = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs9 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); - } - }); + exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; + var core_rest_pipeline_1 = require_commonjs6(); + var _defaultHttpClient; + function getCachedDefaultHttpClient() { + if (!_defaultHttpClient) { + _defaultHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); } - n.default = e; - return Object.freeze(n); + return _defaultHttpClient; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs9); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); + } +}); + +// 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. */ @@ -45386,17 +48031,18 @@ var require_dist7 = __commonJS({ this._options.log(logLevel, message); } }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { + 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", @@ -45405,14 +48051,7 @@ var require_dist7 = __commonJS({ TIMEOUT: "timeout" } }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var HeaderConstants = { + exports2.HeaderConstants = { AUTHORIZATION: "Authorization", AUTHORIZATION_SCHEME: "Bearer", CONTENT_ENCODING: "Content-Encoding", @@ -45438,151 +48077,8 @@ var require_dist7 = __commonJS({ X_MS_VERSION: "x-ms-version", X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code" }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ + exports2.DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; + exports2.PathStylePorts = [ "10000", "10001", "10002", @@ -45604,8 +48100,46 @@ var require_dist7 = __commonJS({ "11103", "11104" ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); + } +}); + +// 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(url) { + const urlParsed = new URL(url); let path8 = urlParsed.pathname; path8 = path8 || "/"; path8 = escape(path8); @@ -45637,7 +48171,7 @@ var require_dist7 = __commonJS({ let proxyUri = ""; if (connectionString.startsWith("UseDevelopmentStorage=true")) { proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + connectionString = constants_js_1.DevelopmentConnectionString; } let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; @@ -45692,15 +48226,15 @@ var require_dist7 = __commonJS({ function escape(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); + function appendToURLPath(url, name) { + const urlParsed = new URL(url); let path8 = urlParsed.pathname; path8 = path8 ? path8.endsWith("/") ? `${path8}${name}` : `${path8}/${name}` : name; urlParsed.pathname = path8; return urlParsed.toString(); } - function setURLParameter(url2, name, value) { - const urlParsed = new URL(url2); + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); const encodedName = encodeURIComponent(name); const encodedValue = value ? encodeURIComponent(value) : void 0; const searchString = urlParsed.search === "" ? "?" : urlParsed.search; @@ -45719,34 +48253,33 @@ var require_dist7 = __commonJS({ urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; return urlParsed.toString(); } - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : void 0; + function getURLParameter(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; } - function setURLHost(url2, host) { - const urlParsed = new URL(url2); + function setURLHost(url, host) { + const urlParsed = new URL(url); urlParsed.hostname = host; return urlParsed.toString(); } - function getURLPath(url2) { + function getURLPath(url) { try { - const urlParsed = new URL(url2); + const urlParsed = new URL(url); return urlParsed.pathname; } catch (e) { return void 0; } } - function getURLScheme(url2) { + function getURLScheme(url) { try { - const urlParsed = new URL(url2); + const urlParsed = new URL(url); return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; } catch (e) { return void 0; } } - function getURLPathAndQuery(url2) { - const urlParsed = new URL(url2); + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); const pathString = urlParsed.pathname; if (!pathString) { throw new RangeError("Invalid url without valid path."); @@ -45758,8 +48291,8 @@ var require_dist7 = __commonJS({ } return `${pathString}${queryString}`; } - function getURLQueries(url2) { - let queryString = new URL(url2).search; + function getURLQueries(url) { + let queryString = new URL(url).search; if (!queryString) { return {}; } @@ -45780,8 +48313,8 @@ var require_dist7 = __commonJS({ } return queries; } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); + function appendToURLQuery(url, queryParts) { + const urlParsed = new URL(url); let query = urlParsed.search; if (query) { query += "&" + queryParts; @@ -45796,7 +48329,10 @@ var require_dist7 = __commonJS({ return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z"; } function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + 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; @@ -45819,242 +48355,80 @@ var require_dist7 = __commonJS({ }; const resolveHandler = () => { if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve4(); - }; - 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 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 (error4) { - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; - } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); - } - } - return tagPairs.join("&"); - } - function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; - } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); - } - } - return res; - } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; - } - const res = {}; - for (const blobTag of tags2.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."); - } + aborter.removeEventListener("abort", abortHandler); + } + resolve4(); + }; + timeout = setTimeout(resolveHandler, timeInMs); + if (aborter !== void 0) { + aborter.addEventListener("abort", abortHandler); + } + }); } - function parseObjectReplicationRecord(objectReplicationRecord) { - if (!objectReplicationRecord) { - return void 0; - } - if ("policy-id" in objectReplicationRecord) { - return void 0; + function padStart2(currentString, targetLength, padString = " ") { + if (String.prototype.padStart) { + return currentString.padStart(targetLength, padString); } - 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] - }); + 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; } - return orProperties; - } - 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 sanitizeURL(url) { + let safeURL = url; + if (getURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE)) { + safeURL = setURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE, "*****"); } + return safeURL; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + 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 ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + function iEqual(str1, str2) { + return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); } - 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; + function getAccountNameFromUrl(url) { + const parsedUrl = new URL(url); + let accountName; + try { + if (parsedUrl.hostname.split(".")[1] === "blob") { + accountName = parsedUrl.hostname.split(".")[0]; + } else if (isIpEndpointStyle(parsedUrl)) { + accountName = parsedUrl.pathname.split("/")[1]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + accountName = ""; } + return accountName; + } catch (error3) { + throw new Error("Unable to extract accountName with provided information."); } - 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 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("/"); @@ -46069,178 +48443,84 @@ var require_dist7 = __commonJS({ } throw new TypeError(`Unexpected response object ${response}`); } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { + } +}); + +// 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 RetryPolicy. - * + * Creates an instance of StorageBrowserPolicy. * @param nextPolicy - * @param options - - * @param retryOptions - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { + // 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); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; } /** - * Sends request. + * Sends out request. * * @param request - */ async sendRequest(request) { - return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); - } - if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); - } - let response; - try { - 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) { - 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, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; - } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - 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) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); } }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; - } + 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 StorageRetryPolicy object. + * Creates a StorageBrowserPolicyFactory object. * * @param nextPolicy - * @param options - */ create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); } }; - var CredentialPolicy = class extends BaseRequestPolicy { + 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. * @@ -46259,6 +48539,83 @@ var require_dist7 = __commonJS({ return request; } }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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, @@ -46682,81 +49039,735 @@ var require_dist7 = __commonJS({ } return false; } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path8 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path8}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 { /** - * Creates an instance of StorageSharedKeyCredentialPolicy. + * RetryOptions. + */ + retryOptions; + /** + * Creates an instance of RetryPolicy. + * * @param nextPolicy - * @param options - - * @param factory - + * @param retryOptions - */ - constructor(nextPolicy, options, factory) { + constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { super(nextPolicy, options); - this.factory = factory; + 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 + }; } /** - * Signs request. + * Sends request. * * @param request - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; + async sendRequest(request) { + return this.attemptSendRequest(request, false, 1); } /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key + * Decide and perform next retry. Won't mutate request parameter. * * @param request - - * @param headerName - + * @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. */ - getHeaderValueToSign(request, headerName) { + async attemptSendRequest(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { const value = request.headers.get(headerName); if (!value) { return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { + 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.headers) { + if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { + headersArray.push({ name, value }); + } + } headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); }); headersArray = headersArray.filter((value, index, array) => { if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { @@ -46771,16 +49782,11 @@ var require_dist7 = __commonJS({ }); return canonicalizedHeadersStringToSign; } - /** - * Retrieves the webResource canonicalized resource string. - * - * @param request - - */ - getCanonicalizedResourceString(request) { - const path8 = getURLPath(request.url) || "/"; + function getCanonicalizedResourceString(request) { + const path8 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path8}`; - const queries = getURLQueries(request.url); + canonicalizedResourceString += `/${options.accountName}${path8}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -46799,105 +49805,132 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return canonicalizedResourceString; } - }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); - } - }; - var StorageSharedKeyCredential = class extends Credential { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); - } - }; - var AnonymousCredentialPolicy = class extends 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); - } - }; - var AnonymousCredential = class extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); - } - }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; + return { + name: exports2.storageSharedKeyCredentialPolicyName, + async sendRequest(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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; + } + } + }; } - var storageBrowserPolicyName = "storageBrowserPolicy"; + } +}); + +// 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: storageBrowserPolicyName, + name: exports2.storageBrowserPolicyName, async sendRequest(request, next) { - if (coreUtil.isNode) { + if (core_util_1.isNodeLike) { return next(request); } if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); return next(request); } }; } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); + } +}); + +// 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: StorageRetryPolicyType.EXPONENTIAL, + retryPolicyType: StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL, secondaryHost: "", tryTimeoutInMs: void 0 // Use server side default timeout strategy @@ -46913,137 +49946,162 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; "EPIPE", "REQUEST_SEND_ERROR" ]; - var RETRY_ABORT_ERROR = new abortController.AbortError("The operation was aborted."); + var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; + 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); + log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); return false; } - if (error4) { + if (error3) { for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); + 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 ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); + 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 || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; + if (response || error3) { + const statusCode = response?.status ?? error3?.statusCode ?? 0; if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); + log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); return true; } if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + 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 StorageRetryPolicyType.EXPONENTIAL: + case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL: delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); break; - case StorageRetryPolicyType.FIXED: + case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.FIXED: delayTimeInMs = retryDelayInMs; break; } } else { delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); return delayTimeInMs; } return { - name: storageRetryPolicyName, + name: exports2.storageRetryPolicyName, async sendRequest(request, next) { if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); } const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.url, secondaryHost) : void 0; let secondaryHas404 = false; let attempt = 1; let retryAgain = true; let response; - let error4; + let error3; while (retryAgain) { const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; response = void 0; - error4 = void 0; + error3 = void 0; try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); + log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); response = await next(request); secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = 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 { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${(0, core_util_1.getErrorMessage)(e)}`); throw e; } } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); + retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error3 }); if (retryAgain) { - await delay2(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); } attempt++; } if (response) { return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); + throw error3 ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error."); } }; } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; + } +}); + +// 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(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } const stringToSign = [ request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } function getHeaderValueToSign(request, headerName) { const value = request.headers.get(headerName); if (!value) { return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { return ""; } return value; @@ -47051,12 +50109,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; function getCanonicalizedHeadersString(request) { let headersArray = []; for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { + if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { headersArray.push({ name, value }); } } headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); }); headersArray = headersArray.filter((value, index, array) => { if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { @@ -47072,10 +50130,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request) { - const path8 = getURLPath(request.url) || "/"; + const path8 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; let canonicalizedResourceString = ""; canonicalizedResourceString += `/${options.accountName}${path8}`; - const queries = getURLQueries(request.url); + const queries = (0, utils_common_js_1.getURLQueries)(request.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -47095,14 +50153,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return canonicalizedResourceString; } return { - name: storageSharedKeyCredentialPolicyName, + name: exports2.storageSharedKeyCredentialPolicyName, async sendRequest(request, next) { signRequest(request); return next(request); } }; } - var StorageBrowserPolicy = class extends BaseRequestPolicy { + } +}); + +// 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 - @@ -47119,17 +50190,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param request - */ async sendRequest(request) { - if (coreUtil.isNode) { + if (core_util_1.isNodeLike) { return this._nextPolicy.sendRequest(request); } if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); return this._nextPolicy.sendRequest(request); } }; + 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. @@ -47138,24 +50223,68 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); + return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; + 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(request) { if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } } return { - name: storageCorrectContentLengthPolicyName, + name: exports2.storageCorrectContentLengthPolicyName, async sendRequest(request, next) { correctContentLength(request); return next(request); } }; } + } +}); + +// 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(pipeline) { if (!pipeline || typeof pipeline !== "object") { return false; @@ -47164,6 +50293,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. * @@ -47187,9 +50324,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + exports2.Pipeline = Pipeline; function newPipeline(credential, pipelineOptions = {}) { if (!credential) { - credential = new AnonymousCredential(); + credential = new AnonymousCredential_js_1.AnonymousCredential(); } const pipeline = new Pipeline([], pipelineOptions); pipeline._credential = credential; @@ -47212,7 +50350,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (novelFactories.length) { const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), + wrappedPolicies: (0, core_http_compat_1.createRequestPolicyFactoryPolicy)(novelFactories), afterRetry: hasInjector }; } @@ -47220,75 +50358,86 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return void 0; } function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); + const { httpClient: v1Client, ...restOptions } = pipeline.options; let httpClient = pipeline._coreHttpClient; if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); pipeline._coreHttpClient = httpClient; } let corePipeline = pipeline._corePipeline; if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; + 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 = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + 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: coreXml.parseXML, - 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: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); + 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(pipeline); if (downlevelResults) { corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); } const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: restOptions.audience ?? constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } pipeline._corePipeline = corePipeline; } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; } function getCredentialFromPipeline(pipeline) { if (pipeline._credential) { return pipeline._credential; } - let credential = new AnonymousCredential(); + let credential = new AnonymousCredential_js_1.AnonymousCredential(); for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { + if ((0, core_auth_1.isTokenCredential)(factory.credential)) { credential = factory.credential; } else if (isStorageSharedKeyCredential(factory)) { return factory; @@ -47297,28 +50446,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return credential; } function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { + if (factory instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { return true; } return factory.constructor.name === "StorageSharedKeyCredential"; } function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { + if (factory instanceof AnonymousCredential_js_1.AnonymousCredential) { return true; } return factory.constructor.name === "AnonymousCredential"; } function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); + return (0, core_auth_1.isTokenCredential)(factory.credential); } function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { + if (factory instanceof StorageBrowserPolicyFactory_js_1.StorageBrowserPolicyFactory) { return true; } return factory.constructor.name === "StorageBrowserPolicyFactory"; } function isStorageRetryPolicyFactory(factory) { - if (factory instanceof StorageRetryPolicyFactory) { + if (factory instanceof StorageRetryPolicyFactory_js_1.StorageRetryPolicyFactory) { return true; } return factory.constructor.name === "StorageRetryPolicyFactory"; @@ -47361,7 +50510,160 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return policyName.startsWith(knownPolicyName); }); } - var BlobServiceProperties = { + } +}); + +// 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: { @@ -47433,7 +50735,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Logging = { + exports2.Logging = { serializedName: "Logging", type: { name: "Composite", @@ -47482,7 +50784,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var RetentionPolicy = { + exports2.RetentionPolicy = { serializedName: "RetentionPolicy", type: { name: "Composite", @@ -47509,7 +50811,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Metrics = { + exports2.Metrics = { serializedName: "Metrics", type: { name: "Composite", @@ -47548,7 +50850,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var CorsRule = { + exports2.CorsRule = { serializedName: "CorsRule", type: { name: "Composite", @@ -47600,7 +50902,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var StaticWebsite = { + exports2.StaticWebsite = { serializedName: "StaticWebsite", type: { name: "Composite", @@ -47638,7 +50940,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var StorageError = { + exports2.StorageError = { serializedName: "StorageError", type: { name: "Composite", @@ -47651,6 +50953,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -47668,7 +50991,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobServiceStatistics = { + exports2.BlobServiceStatistics = { serializedName: "BlobServiceStatistics", xmlName: "StorageServiceStats", type: { @@ -47686,7 +51009,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var GeoReplication = { + exports2.GeoReplication = { serializedName: "GeoReplication", type: { name: "Composite", @@ -47712,7 +51035,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListContainersSegmentResponse = { + exports2.ListContainersSegmentResponse = { serializedName: "ListContainersSegmentResponse", xmlName: "EnumerationResults", type: { @@ -47775,7 +51098,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { + exports2.ContainerItem = { serializedName: "ContainerItem", xmlName: "Container", type: { @@ -47823,7 +51146,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerProperties = { + exports2.ContainerProperties = { serializedName: "ContainerProperties", type: { name: "Composite", @@ -47935,7 +51258,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var KeyInfo = { + exports2.KeyInfo = { serializedName: "KeyInfo", type: { name: "Composite", @@ -47960,7 +51283,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { + exports2.UserDelegationKey = { serializedName: "UserDelegationKey", type: { name: "Composite", @@ -48025,7 +51348,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobSegment = { + exports2.FilterBlobSegment = { serializedName: "FilterBlobSegment", xmlName: "EnumerationResults", type: { @@ -48075,7 +51398,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobItem = { + exports2.FilterBlobItem = { serializedName: "FilterBlobItem", xmlName: "Blob", type: { @@ -48109,7 +51432,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobTags = { + exports2.BlobTags = { serializedName: "BlobTags", xmlName: "Tags", type: { @@ -48135,7 +51458,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobTag = { + exports2.BlobTag = { serializedName: "BlobTag", xmlName: "Tag", type: { @@ -48161,7 +51484,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var SignedIdentifier = { + exports2.SignedIdentifier = { serializedName: "SignedIdentifier", xmlName: "SignedIdentifier", type: { @@ -48187,7 +51510,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AccessPolicy = { + exports2.AccessPolicy = { serializedName: "AccessPolicy", type: { name: "Composite", @@ -48217,7 +51540,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsFlatSegmentResponse = { + exports2.ListBlobsFlatSegmentResponse = { serializedName: "ListBlobsFlatSegmentResponse", xmlName: "EnumerationResults", type: { @@ -48281,7 +51604,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobFlatListSegment = { + exports2.BlobFlatListSegment = { serializedName: "BlobFlatListSegment", xmlName: "Blobs", type: { @@ -48306,7 +51629,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobItemInternal = { + exports2.BlobItemInternal = { serializedName: "BlobItemInternal", xmlName: "Blob", type: { @@ -48393,7 +51716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobName = { + exports2.BlobName = { serializedName: "BlobName", type: { name: "Composite", @@ -48418,7 +51741,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { + exports2.BlobPropertiesInternal = { serializedName: "BlobPropertiesInternal", xmlName: "Properties", type: { @@ -48745,7 +52068,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsHierarchySegmentResponse = { + exports2.ListBlobsHierarchySegmentResponse = { serializedName: "ListBlobsHierarchySegmentResponse", xmlName: "EnumerationResults", type: { @@ -48816,7 +52139,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobHierarchyListSegment = { + exports2.BlobHierarchyListSegment = { serializedName: "BlobHierarchyListSegment", xmlName: "Blobs", type: { @@ -48855,7 +52178,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPrefix = { + exports2.BlobPrefix = { serializedName: "BlobPrefix", type: { name: "Composite", @@ -48872,7 +52195,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockLookupList = { + exports2.BlockLookupList = { serializedName: "BlockLookupList", xmlName: "BlockList", type: { @@ -48921,7 +52244,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockList = { + exports2.BlockList = { serializedName: "BlockList", type: { name: "Composite", @@ -48960,7 +52283,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Block = { + exports2.Block = { serializedName: "Block", type: { name: "Composite", @@ -48985,7 +52308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageList = { + exports2.PageList = { serializedName: "PageList", type: { name: "Composite", @@ -49029,7 +52352,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageRange = { + exports2.PageRange = { serializedName: "PageRange", xmlName: "PageRange", type: { @@ -49055,7 +52378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ClearRange = { + exports2.ClearRange = { serializedName: "ClearRange", xmlName: "ClearRange", type: { @@ -49081,7 +52404,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QueryRequest = { + exports2.QueryRequest = { serializedName: "QueryRequest", xmlName: "QueryRequest", type: { @@ -49123,7 +52446,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QuerySerialization = { + exports2.QuerySerialization = { serializedName: "QuerySerialization", type: { name: "Composite", @@ -49140,7 +52463,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QueryFormat = { + exports2.QueryFormat = { serializedName: "QueryFormat", type: { name: "Composite", @@ -49190,7 +52513,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var DelimitedTextConfiguration = { + exports2.DelimitedTextConfiguration = { serializedName: "DelimitedTextConfiguration", xmlName: "DelimitedTextConfiguration", type: { @@ -49235,7 +52558,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var JsonTextConfiguration = { + exports2.JsonTextConfiguration = { serializedName: "JsonTextConfiguration", xmlName: "JsonTextConfiguration", type: { @@ -49252,7 +52575,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ArrowConfiguration = { + exports2.ArrowConfiguration = { serializedName: "ArrowConfiguration", xmlName: "ArrowConfiguration", type: { @@ -49278,7 +52601,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ArrowField = { + exports2.ArrowField = { serializedName: "ArrowField", xmlName: "Field", type: { @@ -49317,7 +52640,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesHeaders = { + exports2.ServiceSetPropertiesHeaders = { serializedName: "Service_setPropertiesHeaders", type: { name: "Composite", @@ -49354,7 +52677,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesExceptionHeaders = { + exports2.ServiceSetPropertiesExceptionHeaders = { serializedName: "Service_setPropertiesExceptionHeaders", type: { name: "Composite", @@ -49370,7 +52693,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { + exports2.ServiceGetPropertiesHeaders = { serializedName: "Service_getPropertiesHeaders", type: { name: "Composite", @@ -49407,7 +52730,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesExceptionHeaders = { + exports2.ServiceGetPropertiesExceptionHeaders = { serializedName: "Service_getPropertiesExceptionHeaders", type: { name: "Composite", @@ -49423,7 +52746,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsHeaders = { + exports2.ServiceGetStatisticsHeaders = { serializedName: "Service_getStatisticsHeaders", type: { name: "Composite", @@ -49467,7 +52790,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsExceptionHeaders = { + exports2.ServiceGetStatisticsExceptionHeaders = { serializedName: "Service_getStatisticsExceptionHeaders", type: { name: "Composite", @@ -49483,7 +52806,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentHeaders = { + exports2.ServiceListContainersSegmentHeaders = { serializedName: "Service_listContainersSegmentHeaders", type: { name: "Composite", @@ -49520,7 +52843,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentExceptionHeaders = { + exports2.ServiceListContainersSegmentExceptionHeaders = { serializedName: "Service_listContainersSegmentExceptionHeaders", type: { name: "Composite", @@ -49536,7 +52859,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { + exports2.ServiceGetUserDelegationKeyHeaders = { serializedName: "Service_getUserDelegationKeyHeaders", type: { name: "Composite", @@ -49580,7 +52903,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyExceptionHeaders = { + exports2.ServiceGetUserDelegationKeyExceptionHeaders = { serializedName: "Service_getUserDelegationKeyExceptionHeaders", type: { name: "Composite", @@ -49596,7 +52919,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoHeaders = { + exports2.ServiceGetAccountInfoHeaders = { serializedName: "Service_getAccountInfoHeaders", type: { name: "Composite", @@ -49675,7 +52998,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { + exports2.ServiceGetAccountInfoExceptionHeaders = { serializedName: "Service_getAccountInfoExceptionHeaders", type: { name: "Composite", @@ -49691,7 +53014,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { + exports2.ServiceSubmitBatchHeaders = { serializedName: "Service_submitBatchHeaders", type: { name: "Composite", @@ -49735,7 +53058,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { + exports2.ServiceSubmitBatchExceptionHeaders = { serializedName: "Service_submitBatchExceptionHeaders", type: { name: "Composite", @@ -49751,7 +53074,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { + exports2.ServiceFilterBlobsHeaders = { serializedName: "Service_filterBlobsHeaders", type: { name: "Composite", @@ -49795,7 +53118,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { + exports2.ServiceFilterBlobsExceptionHeaders = { serializedName: "Service_filterBlobsExceptionHeaders", type: { name: "Composite", @@ -49811,7 +53134,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { + exports2.ContainerCreateHeaders = { serializedName: "Container_createHeaders", type: { name: "Composite", @@ -49869,7 +53192,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateExceptionHeaders = { + exports2.ContainerCreateExceptionHeaders = { serializedName: "Container_createExceptionHeaders", type: { name: "Composite", @@ -49885,7 +53208,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { + exports2.ContainerGetPropertiesHeaders = { serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", @@ -50025,7 +53348,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { + exports2.ContainerGetPropertiesExceptionHeaders = { serializedName: "Container_getPropertiesExceptionHeaders", type: { name: "Composite", @@ -50041,7 +53364,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { + exports2.ContainerDeleteHeaders = { serializedName: "Container_deleteHeaders", type: { name: "Composite", @@ -50085,7 +53408,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteExceptionHeaders = { + exports2.ContainerDeleteExceptionHeaders = { serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", @@ -50101,7 +53424,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { + exports2.ContainerSetMetadataHeaders = { serializedName: "Container_setMetadataHeaders", type: { name: "Composite", @@ -50159,7 +53482,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataExceptionHeaders = { + exports2.ContainerSetMetadataExceptionHeaders = { serializedName: "Container_setMetadataExceptionHeaders", type: { name: "Composite", @@ -50175,7 +53498,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { + exports2.ContainerGetAccessPolicyHeaders = { serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", @@ -50241,7 +53564,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyExceptionHeaders = { + exports2.ContainerGetAccessPolicyExceptionHeaders = { serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", @@ -50257,7 +53580,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { + exports2.ContainerSetAccessPolicyHeaders = { serializedName: "Container_setAccessPolicyHeaders", type: { name: "Composite", @@ -50315,7 +53638,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { + exports2.ContainerSetAccessPolicyExceptionHeaders = { serializedName: "Container_setAccessPolicyExceptionHeaders", type: { name: "Composite", @@ -50331,7 +53654,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { + exports2.ContainerRestoreHeaders = { serializedName: "Container_restoreHeaders", type: { name: "Composite", @@ -50375,7 +53698,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreExceptionHeaders = { + exports2.ContainerRestoreExceptionHeaders = { serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", @@ -50391,7 +53714,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { + exports2.ContainerRenameHeaders = { serializedName: "Container_renameHeaders", type: { name: "Composite", @@ -50435,7 +53758,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameExceptionHeaders = { + exports2.ContainerRenameExceptionHeaders = { serializedName: "Container_renameExceptionHeaders", type: { name: "Composite", @@ -50451,7 +53774,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { + exports2.ContainerSubmitBatchHeaders = { serializedName: "Container_submitBatchHeaders", type: { name: "Composite", @@ -50481,7 +53804,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchExceptionHeaders = { + exports2.ContainerSubmitBatchExceptionHeaders = { serializedName: "Container_submitBatchExceptionHeaders", type: { name: "Composite", @@ -50497,7 +53820,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsHeaders = { + exports2.ContainerFilterBlobsHeaders = { serializedName: "Container_filterBlobsHeaders", type: { name: "Composite", @@ -50534,7 +53857,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsExceptionHeaders = { + exports2.ContainerFilterBlobsExceptionHeaders = { serializedName: "Container_filterBlobsExceptionHeaders", type: { name: "Composite", @@ -50550,7 +53873,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { + exports2.ContainerAcquireLeaseHeaders = { serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", @@ -50608,7 +53931,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseExceptionHeaders = { + exports2.ContainerAcquireLeaseExceptionHeaders = { serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", @@ -50624,7 +53947,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { + exports2.ContainerReleaseLeaseHeaders = { serializedName: "Container_releaseLeaseHeaders", type: { name: "Composite", @@ -50675,7 +53998,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseExceptionHeaders = { + exports2.ContainerReleaseLeaseExceptionHeaders = { serializedName: "Container_releaseLeaseExceptionHeaders", type: { name: "Composite", @@ -50691,7 +54014,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { + exports2.ContainerRenewLeaseHeaders = { serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", @@ -50749,7 +54072,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseExceptionHeaders = { + exports2.ContainerRenewLeaseExceptionHeaders = { serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", @@ -50765,7 +54088,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { + exports2.ContainerBreakLeaseHeaders = { serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", @@ -50823,7 +54146,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseExceptionHeaders = { + exports2.ContainerBreakLeaseExceptionHeaders = { serializedName: "Container_breakLeaseExceptionHeaders", type: { name: "Composite", @@ -50839,7 +54162,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { + exports2.ContainerChangeLeaseHeaders = { serializedName: "Container_changeLeaseHeaders", type: { name: "Composite", @@ -50897,7 +54220,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseExceptionHeaders = { + exports2.ContainerChangeLeaseExceptionHeaders = { serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", @@ -50913,7 +54236,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentHeaders = { + exports2.ContainerListBlobFlatSegmentHeaders = { serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", @@ -50964,7 +54287,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", @@ -50980,7 +54303,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { + exports2.ContainerListBlobHierarchySegmentHeaders = { serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", @@ -51031,7 +54354,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", type: { name: "Composite", @@ -51047,7 +54370,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { + exports2.ContainerGetAccountInfoHeaders = { serializedName: "Container_getAccountInfoHeaders", type: { name: "Composite", @@ -51119,7 +54442,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { + exports2.ContainerGetAccountInfoExceptionHeaders = { serializedName: "Container_getAccountInfoExceptionHeaders", type: { name: "Composite", @@ -51135,7 +54458,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { + exports2.BlobDownloadHeaders = { serializedName: "Blob_downloadHeaders", type: { name: "Composite", @@ -51475,7 +54798,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadExceptionHeaders = { + exports2.BlobDownloadExceptionHeaders = { serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", @@ -51491,7 +54814,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesHeaders = { + exports2.BlobGetPropertiesHeaders = { serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", @@ -51722,132 +55045,588 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", + 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" } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", + } + } + } + }; + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetHttpHeadersExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", + } + } + } + }; + 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: "Boolean" + name: "String" } }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - accessTierInferred: { - serializedName: "x-ms-access-tier-inferred", - xmlName: "x-ms-access-tier-inferred", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - archiveStatus: { - serializedName: "x-ms-archive-status", - xmlName: "x-ms-archive-status", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "String" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } - }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", + } + } + } + }; + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetImmutabilityPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", + } + } + } + }; + 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" } }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - expiresOn: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + } + } + } + }; + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + type: { + name: "Composite", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", + } + } + } + }; + 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: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "DateTimeRfc1123" } }, legalHold: { @@ -51856,22 +55635,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "Boolean" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51883,12 +55655,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "BlobDeleteHeaders", + 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", @@ -51910,6 +55696,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51917,6 +55710,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51927,11 +55741,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteExceptionHeaders", + className: "BlobSetMetadataExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51943,12 +55757,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + 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", @@ -51976,22 +55811,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteExceptionHeaders", + className: "BlobAcquireLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52003,11 +55831,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "BlobReleaseLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52054,11 +55882,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobSetExpiryExceptionHeaders", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52070,11 +55898,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersHeaders", + className: "BlobRenewLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52090,11 +55918,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { - name: "Number" + name: "String" } }, clientRequestId: { @@ -52124,22 +55952,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52151,12 +55972,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", + 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", @@ -52171,6 +56006,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52184,30 +56026,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } }, - immutabilityPolicyExpiry: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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" } } } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52219,12 +56120,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", + 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", @@ -52246,21 +56168,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52272,12 +56215,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldHeaders", + 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", @@ -52299,28 +56256,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + 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: "DateTimeRfc1123" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52328,15 +56307,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "BlobSetMetadataHeaders", + className: "BlobCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52387,20 +56380,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { - name: "Boolean" + name: "String" } }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", + 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", @@ -52418,11 +56426,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobSetMetadataExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52430,37 +56438,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseHeaders", + className: "BlobAbortCopyFromURLHeaders", 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", @@ -52488,15 +56489,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52508,26 +56516,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseHeaders", + className: "BlobSetTierHeaders", 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", @@ -52549,21 +56543,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } } } } }; - var BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52575,33 +56569,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "BlobRenewLeaseHeaders", + className: "BlobGetAccountInfoHeaders", 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", @@ -52629,15 +56602,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52649,12 +56657,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlobChangeLeaseHeaders", + 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", @@ -52662,13 +56707,129 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + 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", @@ -52683,16 +56844,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } @@ -52703,15 +56864,64 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", + className: "BlobQueryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52723,33 +56933,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", + exports2.BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", type: { name: "Composite", - className: "BlobBreakLeaseHeaders", + className: "BlobGetTagsHeaders", 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", @@ -52777,15 +56966,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52797,33 +56993,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotHeaders", + className: "BlobSetTagsHeaders", 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", @@ -52845,25 +57020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, errorCode: { @@ -52876,11 +57037,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52892,11 +57053,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLHeaders", + className: "PageBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52912,6 +57073,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52947,19 +57115,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -52972,11 +57146,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52988,11 +57162,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "BlobCopyFromURLHeaders", + className: "PageBlobUploadPagesHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53008,6 +57182,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53029,13 +57224,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -53043,35 +57231,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", @@ -53089,11 +57262,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53105,12 +57278,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAbortCopyFromURLHeaders = { - serializedName: "Blob_abortCopyFromURLHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "BlobAbortCopyFromURLHeaders", + 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", @@ -53149,11 +57357,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAbortCopyFromURLExceptionHeaders = { - serializedName: "Blob_abortCopyFromURLExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "BlobAbortCopyFromURLExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53165,19 +57373,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierHeaders = { - serializedName: "Blob_setTierHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "BlobSetTierHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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", @@ -53192,6 +57428,34 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53202,11 +57466,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierExceptionHeaders = { - serializedName: "Blob_setTierExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobSetTierExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53214,16 +57478,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobGetAccountInfoHeaders = { - serializedName: "Blob_getAccountInfoHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "BlobGetAccountInfoHeaders", + 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", @@ -53252,49 +57551,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobGetAccountInfoExceptionHeaders = { - serializedName: "Blob_getAccountInfoExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "BlobGetAccountInfoExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53306,11 +57577,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQueryHeaders = { - serializedName: "Blob_queryHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "BlobQueryHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { lastModified: { serializedName: "last-modified", @@ -53319,36 +57590,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53356,127 +57597,92 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "String" + name: "Number" } }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", 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", + date: { + serializedName: "date", + xmlName: "date", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + } + } + } + }; + 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" } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + } + } + } + }; + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", + type: { + name: "Composite", + className: "PageBlobResizeHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "Number" } }, clientRequestId: { @@ -53487,66 +57693,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }, 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", + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } }, errorCode: { @@ -53555,22 +57719,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } } } } }; - var BlobQueryExceptionHeaders = { - serializedName: "Blob_queryExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "BlobQueryExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53582,12 +57739,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetTagsHeaders = { - serializedName: "Blob_getTagsHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "BlobGetTagsHeaders", + 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", @@ -53626,11 +57804,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetTagsExceptionHeaders = { - serializedName: "Blob_getTagsExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "BlobGetTagsExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53642,12 +57820,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTagsHeaders = { - serializedName: "Blob_setTagsHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "BlobSetTagsHeaders", + 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", @@ -53676,6 +57868,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53686,11 +57893,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "BlobSetTagsExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53702,11 +57909,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateHeaders = { - serializedName: "PageBlob_createHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "PageBlobCreateHeaders", + className: "AppendBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53795,11 +58002,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateExceptionHeaders = { - serializedName: "PageBlob_createExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "PageBlobCreateExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53811,11 +58018,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesHeaders = { - serializedName: "PageBlob_uploadPagesHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53845,13 +58052,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53880,6 +58080,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53911,11 +58125,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesExceptionHeaders = { - serializedName: "PageBlob_uploadPagesExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53927,11 +58141,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobClearPagesHeaders = { - serializedName: "PageBlob_clearPagesHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "PageBlobClearPagesHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53961,20 +58175,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53996,6 +58196,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54006,11 +58241,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobClearPagesExceptionHeaders = { - serializedName: "PageBlob_clearPagesExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "PageBlobClearPagesExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54018,15 +58253,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var PageBlobUploadPagesFromURLHeaders = { - serializedName: "PageBlob_uploadPagesFromURLHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesFromURLHeaders", + className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54042,25 +58291,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, requestId: { @@ -54084,42 +58319,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", 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" - } } } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54131,19 +58345,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesHeaders = { - serializedName: "PageBlob_getPageRangesHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "PageBlobGetPageRangesHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, etag: { serializedName: "etag", xmlName: "etag", @@ -54151,11 +58358,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Number" + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, clientRequestId: { @@ -54179,6 +58393,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -54186,6 +58407,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54196,11 +58438,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesExceptionHeaders = { - serializedName: "PageBlob_getPageRangesExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "PageBlobGetPageRangesExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54212,19 +58454,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesDiffHeaders = { - serializedName: "PageBlob_getPageRangesDiffHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "PageBlobGetPageRangesDiffHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, etag: { serializedName: "etag", xmlName: "etag", @@ -54232,11 +58467,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Number" + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, clientRequestId: { @@ -54260,6 +58502,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -54267,6 +58516,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54277,11 +58547,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesDiffExceptionHeaders = { - serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "PageBlobGetPageRangesDiffExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54289,35 +58559,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var PageBlobResizeHeaders = { - serializedName: "PageBlob_resizeHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "PageBlobResizeHeaders", + className: "BlockBlobStageBlockHeaders", 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", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Number" + name: "ByteArray" } }, clientRequestId: { @@ -54348,6 +58618,34 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54358,11 +58656,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobResizeExceptionHeaders = { - serializedName: "PageBlob_resizeExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "PageBlobResizeExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54374,31 +58672,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUpdateSequenceNumberHeaders = { - serializedName: "PageBlob_updateSequenceNumberHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "PageBlobUpdateSequenceNumberHeaders", + className: "BlockBlobStageBlockFromURLHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Number" + name: "ByteArray" } }, clientRequestId: { @@ -54429,6 +58720,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54439,11 +58751,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUpdateSequenceNumberExceptionHeaders = { - serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "PageBlobUpdateSequenceNumberExceptionHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54451,15 +58763,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var PageBlobCopyIncrementalHeaders = { - serializedName: "PageBlob_copyIncrementalHeaders", + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", type: { name: "Composite", - className: "PageBlobCopyIncrementalHeaders", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54468,11 +58794,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + 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: "DateTimeRfc1123" + name: "ByteArray" } }, clientRequestId: { @@ -54496,6 +58836,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -54503,19 +58850,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -54528,11 +58881,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCopyIncrementalExceptionHeaders = { - serializedName: "PageBlob_copyIncrementalExceptionHeaders", + exports2.BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", type: { name: "Composite", - className: "PageBlobCopyIncrementalExceptionHeaders", + className: "BlockBlobCommitBlockListExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54544,12 +58897,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobCreateHeaders = { - serializedName: "AppendBlob_createHeaders", + exports2.BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", type: { name: "Composite", - className: "AppendBlobCreateHeaders", + className: "BlockBlobGetBlockListHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -54557,18 +58917,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "ByteArray" + name: "Number" } }, clientRequestId: { @@ -54592,13 +58952,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54606,27 +58959,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + 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", @@ -54637,1182 +58985,899 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobCreateExceptionHeaders = { - serializedName: "AppendBlob_createExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobCreateExceptionHeaders", - 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" } } }; - var 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.comp10 = { + parameterPath: "comp", + mapper: { + defaultValue: "lease", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.action = { + parameterPath: "action", + mapper: { + defaultValue: "acquire", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.duration = { + parameterPath: ["options", "duration"], + mapper: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Number" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.proposedLeaseId = { + parameterPath: ["options", "proposedLeaseId"], + mapper: { + serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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.action1 = { + parameterPath: "action", + mapper: { + defaultValue: "release", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.leaseId1 = { + parameterPath: "leaseId", + mapper: { + serializedName: "x-ms-lease-id", + required: true, + xmlName: "x-ms-lease-id", + type: { + name: "String" } } }; - var 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", + 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: "String" + 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" + } } }; - var 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.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], + mapper: { + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", + type: { + name: "Boolean" } } }; - var 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.rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], + mapper: { + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", + type: { + name: "Boolean" } } }; - var 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.encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], + mapper: { + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", + type: { + name: "String" } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var 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.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" } } }; - var 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.blobCacheControl = { + parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], + mapper: { + serializedName: "x-ms-blob-cache-control", + xmlName: "x-ms-blob-cache-control", + type: { + name: "String" } } }; - var 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.blobContentType = { + parameterPath: ["options", "blobHttpHeaders", "blobContentType"], + mapper: { + serializedName: "x-ms-blob-content-type", + xmlName: "x-ms-blob-content-type", + type: { + name: "String" } } }; - var BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], + exports2.blobContentEncoding = { + parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Content-Type", + serializedName: "x-ms-blob-content-encoding", + xmlName: "x-ms-blob-content-encoding", type: { name: "String" } } }; - var blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties - }; - var accept = { - parameterPath: "accept", + exports2.blobContentLanguage = { + parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", + serializedName: "x-ms-blob-content-language", + xmlName: "x-ms-blob-content-language", type: { name: "String" } } }; - var url = { - parameterPath: "url", + exports2.blobContentDisposition = { + parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], mapper: { - serializedName: "url", - required: true, - xmlName: "url", + serializedName: "x-ms-blob-content-disposition", + xmlName: "x-ms-blob-content-disposition", type: { name: "String" } - }, - skipEncoding: true + } }; - var restype = { - parameterPath: "restype", + exports2.comp12 = { + parameterPath: "comp", mapper: { - defaultValue: "service", + defaultValue: "immutabilityPolicies", isConstant: true, - serializedName: "restype", + serializedName: "comp", type: { name: "String" } } }; - var comp = { + 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: "properties", + defaultValue: "legalhold", isConstant: true, serializedName: "comp", type: { @@ -55820,132 +59885,235 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], + exports2.legalHold = { + parameterPath: "legalHold", mapper: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "timeout", - xmlName: "timeout", + serializedName: "x-ms-legal-hold", + required: true, + xmlName: "x-ms-legal-hold", type: { - name: "Number" + name: "Boolean" } } }; - var version = { - parameterPath: "version", + 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: "2024-11-04", + defaultValue: "snapshot", isConstant: true, - serializedName: "x-ms-version", + serializedName: "comp", type: { name: "String" } } }; - var requestId = { - parameterPath: ["options", "requestId"], + exports2.tier = { + parameterPath: ["options", "tier"], mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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" } } }; - var accept1 = { - parameterPath: "accept", + exports2.sourceIfNoneMatch = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfNoneMatch" + ], mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", + serializedName: "x-ms-source-if-none-match", + xmlName: "x-ms-source-if-none-match", type: { name: "String" } } }; - var comp1 = { - parameterPath: "comp", + exports2.sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", type: { name: "String" } } }; - var comp2 = { - parameterPath: "comp", + exports2.copySource = { + parameterPath: "copySource", mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { name: "String" } } }; - var prefix = { - parameterPath: ["options", "prefix"], + exports2.blobTagsString = { + parameterPath: ["options", "blobTagsString"], mapper: { - serializedName: "prefix", - xmlName: "prefix", + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", type: { name: "String" } } }; - var marker = { - parameterPath: ["options", "marker"], + exports2.sealBlob = { + parameterPath: ["options", "sealBlob"], mapper: { - serializedName: "marker", - xmlName: "marker", + 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" } } }; - var maxPageSize = { - parameterPath: ["options", "maxPageSize"], + exports2.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], mapper: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "maxresults", - xmlName: "maxresults", + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", type: { - name: "Number" + name: "ByteArray" } } }; - var include = { - parameterPath: ["options", "include"], + exports2.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + name: "String" } - }, - collectionFormat: "CSV" + } }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + 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" + } + } }; - var comp3 = { + exports2.comp15 = { parameterPath: "comp", mapper: { - defaultValue: "userdelegationkey", + defaultValue: "copy", isConstant: true, serializedName: "comp", type: { @@ -55953,32 +60121,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var restype1 = { - parameterPath: "restype", + exports2.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", mapper: { - defaultValue: "account", + defaultValue: "abort", isConstant: true, - serializedName: "restype", + serializedName: "x-ms-copy-action", type: { name: "String" } } }; - var body = { - parameterPath: "body", + exports2.copyId = { + parameterPath: "copyId", mapper: { - serializedName: "body", + serializedName: "copyid", required: true, - xmlName: "body", + xmlName: "copyid", type: { - name: "Stream" + name: "String" } } }; - var comp4 = { + exports2.comp16 = { parameterPath: "comp", mapper: { - defaultValue: "batch", + defaultValue: "tier", isConstant: true, serializedName: "comp", type: { @@ -55986,32 +60154,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var contentLength = { - parameterPath: "contentLength", + exports2.tier1 = { + parameterPath: "tier", mapper: { - serializedName: "Content-Length", + serializedName: "x-ms-access-tier", required: true, - xmlName: "Content-Length", + xmlName: "x-ms-access-tier", type: { - name: "Number" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive", + "Cold" + ] } } }; - var multipartContentType = { - parameterPath: "multipartContentType", + exports2.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", + defaultValue: "query", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - var comp5 = { + exports2.comp18 = { parameterPath: "comp", mapper: { - defaultValue: "blobs", + defaultValue: "tags", isConstant: true, serializedName: "comp", type: { @@ -56019,152 +60208,218 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var where = { - parameterPath: ["options", "where"], + exports2.tags = { + parameterPath: ["options", "tags"], + mapper: mappers_js_1.BlobTags + }; + exports2.transactionalContentMD5 = { + parameterPath: ["options", "transactionalContentMD5"], mapper: { - serializedName: "where", - xmlName: "where", + 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" } } }; - var restype2 = { - parameterPath: "restype", + exports2.blobContentLength = { + parameterPath: "blobContentLength", mapper: { - defaultValue: "container", + 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: "restype", + serializedName: "Content-Type", type: { name: "String" } } }; - var metadata = { - parameterPath: ["options", "metadata"], + exports2.body1 = { + parameterPath: "body", mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", + serializedName: "body", + required: true, + xmlName: "body", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Stream" } } }; - var access = { - parameterPath: ["options", "access"], + exports2.accept2 = { + parameterPath: "accept", mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", type: { - name: "Enum", - allowedValues: ["container", "blob"] + 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" } } }; - var defaultEncryptionScope = { + exports2.ifSequenceNumberLessThanOrEqualTo = { parameterPath: [ "options", - "containerEncryptionScope", - "defaultEncryptionScope" + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" ], mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", type: { - name: "String" + name: "Number" } } }; - var preventEncryptionScopeOverride = { + exports2.ifSequenceNumberLessThan = { parameterPath: [ "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThan" ], mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", + serializedName: "x-ms-if-sequence-number-lt", + xmlName: "x-ms-if-sequence-number-lt", type: { - name: "Boolean" + name: "Number" } } }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], + exports2.ifSequenceNumberEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberEqualTo" + ], mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + serializedName: "x-ms-if-sequence-number-eq", + xmlName: "x-ms-if-sequence-number-eq", type: { - name: "String" + name: "Number" } } }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], + exports2.pageWrite1 = { + parameterPath: "pageWrite", mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", + defaultValue: "clear", + isConstant: true, + serializedName: "x-ms-page-write", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], + exports2.sourceUrl = { + parameterPath: "sourceUrl", mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - var comp6 = { - parameterPath: "comp", + exports2.sourceRange = { + parameterPath: "sourceRange", mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", type: { name: "String" } } }; - var comp7 = { - parameterPath: "comp", + exports2.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", type: { - name: "String" + name: "ByteArray" } } }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], + exports2.range1 = { + parameterPath: "range", mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } + name: "String" } } }; - var comp8 = { + exports2.comp20 = { parameterPath: "comp", mapper: { - defaultValue: "undelete", + defaultValue: "pagelist", isConstant: true, serializedName: "comp", type: { @@ -56172,62 +60427,64 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], + exports2.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", type: { name: "String" } } }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], + exports2.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", type: { name: "String" } } }; - var comp9 = { - parameterPath: "comp", + exports2.sequenceNumberAction = { + parameterPath: "sequenceNumberAction", mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-sequence-number-action", + required: true, + xmlName: "x-ms-sequence-number-action", type: { - name: "String" + name: "Enum", + allowedValues: ["max", "update", "increment"] } } }; - var sourceContainerName = { - parameterPath: "sourceContainerName", + exports2.comp21 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - var sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], + exports2.blobType1 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var comp10 = { + exports2.comp22 = { parameterPath: "comp", mapper: { - defaultValue: "lease", + defaultValue: "appendblock", isConstant: true, serializedName: "comp", type: { @@ -56235,9496 +60492,12211 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var action = { - parameterPath: "action", + exports2.maxSize = { + parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "x-ms-blob-condition-maxsize", + xmlName: "x-ms-blob-condition-maxsize", type: { - name: "String" + name: "Number" } } }; - var duration = { - parameterPath: ["options", "duration"], + exports2.appendPosition = { + parameterPath: [ + "options", + "appendPositionAccessConditions", + "appendPosition" + ], mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", type: { name: "Number" } } }; - var proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], + exports2.sourceRange1 = { + parameterPath: ["options", "sourceRange"], mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", type: { name: "String" } } }; - var action1 = { - parameterPath: "action", + exports2.comp23 = { + parameterPath: "comp", mapper: { - defaultValue: "release", + defaultValue: "seal", isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "comp", type: { name: "String" } } }; - var leaseId1 = { - parameterPath: "leaseId", + exports2.blobType2 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var action2 = { - parameterPath: "action", + exports2.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", type: { - name: "String" + name: "Boolean" } } }; - var action3 = { - parameterPath: "action", + exports2.comp24 = { + parameterPath: "comp", mapper: { - defaultValue: "break", + defaultValue: "block", isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "comp", type: { name: "String" } } }; - var breakPeriod = { - parameterPath: ["options", "breakPeriod"], + exports2.blockId = { + parameterPath: "blockId", mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", + serializedName: "blockid", + required: true, + xmlName: "blockid", type: { - name: "Number" + name: "String" } } }; - var action4 = { - parameterPath: "action", + exports2.blocks = { + parameterPath: "blocks", + mapper: mappers_js_1.BlockLookupList + }; + exports2.comp25 = { + parameterPath: "comp", mapper: { - defaultValue: "change", + defaultValue: "blocklist", isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "comp", type: { name: "String" } } }; - var proposedLeaseId1 = { - parameterPath: "proposedLeaseId", + exports2.listType = { + parameterPath: "listType", mapper: { - serializedName: "x-ms-proposed-lease-id", + defaultValue: "committed", + serializedName: "blocklisttype", required: true, - xmlName: "x-ms-proposed-lease-id", + xmlName: "blocklisttype", type: { - name: "String" + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; - var 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" - ] - } - } + } +}); + +// 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 } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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); } - }; - var rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" - } + /** + * Restores a previously-deleted container. + * @param options The options parameters. + */ + restore(options) { + return this.client.sendOperationRequest({ options }, restoreOperationSpec); } - }; - var encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } + /** + * 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); } - }; - var encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" - } + /** + * 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); } - }; - var ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" - } + /** + * 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); } - }; - var ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" - } + /** + * [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); } - }; - var ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" - } + /** + * [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); } - }; - var deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } + /** + * [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); } - }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + /** + * [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); } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * [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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * [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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" + 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 blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" + 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 blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" + 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 blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" + 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 blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" + 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 comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" + 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 immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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 comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" + 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 comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + 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 rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + var breakLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.ContainerBreakLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerBreakLeaseExceptionHeaders } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } - }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" + urlParameters: [Parameters.url], + headerParameters: [ + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.action3, + Parameters.breakPeriod ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" + var changeLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerChangeLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerChangeLeaseExceptionHeaders } - } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" + }, + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } - } + 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 sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" + 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 copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + 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 blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" + 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 }; - var sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } + } +}); + +// 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; } - }; - var legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var 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"] - } + /** + * 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); } - }; - var comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" - } + /** + * 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); } - }; - var copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" - } + /** + * 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); } - }; - var comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var 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" - ] - } + /** + * 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); } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest - }; - var comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags - }; - var transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" - } + /** + * [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); } - }; - var transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } + /** + * [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); } - }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } + /** + * [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); } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } + /** + * 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); } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } + /** + * 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); } - }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } + /** + * 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); } - }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } + /** + * 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); } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } + /** + * 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); } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } + /** + * 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); } }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + 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 } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" + }, + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" - } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" + 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 ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" - } - } + isXML: true, + serializer: xmlSerializer }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + 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 sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + 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 sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + 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 sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + 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 range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + 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 comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + 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 prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + 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 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"] + 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 comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + var changeLeaseOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.BlobChangeLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobChangeLeaseExceptionHeaders } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" + }, + 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 ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + 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 sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + 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 comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + 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 comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + 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 blocks = { - parameterPath: "blocks", - mapper: BlockLookupList + 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 comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + 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 }; - var ServiceImpl = class { + } +}); + +// 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 Service class. + * Initialize a new instance of the class PageBlob 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. + * 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. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); + create(contentLength, blobContentLength, options) { + return this.client.sendOperationRequest({ contentLength, blobContentLength, options }, createOperationSpec); } /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. + * 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. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); + uploadPages(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, uploadPagesOperationSpec); } /** - * 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. + * 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. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); + clearPages(contentLength, options) { + return this.client.sendOperationRequest({ contentLength, options }, clearPagesOperationSpec); } /** - * The List Containers Segment operation returns a list of the containers under the specified account + * 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. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); + uploadPagesFromURL(sourceUrl, sourceRange, contentLength, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * @param keyInfo Key information + * 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. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); + getPageRanges(options) { + return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); } /** - * Returns the sku name and account kind + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); + getPageRangesDiff(options) { + return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); } /** - * 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 + * 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. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); + resize(blobContentLength, options) { + return this.client.sendOperationRequest({ blobContentLength, options }, resizeOperationSpec); } /** - * 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. + * 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. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); + 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); } }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( + exports2.PageBlobImpl = PageBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var setPropertiesOperationSpec = { - path: "/", + var createOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders + 201: { + headersMapper: Mappers.PageBlobCreateHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCreateExceptionHeaders } }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds + 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 ], - urlParameters: [url], + 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: [ - contentType, - accept, - version, - requestId + 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: "xml", - serializer: xmlSerializer$5 + mediaType: "binary", + serializer: xmlSerializer }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", + var clearPagesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders + 201: { + headersMapper: Mappers.PageBlobClearPagesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobClearPagesExceptionHeaders } }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", + var uploadPagesFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders + 201: { + headersMapper: Mappers.PageBlobUploadPagesFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUploadPagesFromURLExceptionHeaders } }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var listContainersSegmentOperationSpec = { - path: "/", + var getPageRangesOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders + bodyMapper: Mappers.PageList, + headersMapper: Mappers.PageBlobGetPageRangesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobGetPageRangesExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include + Parameters.timeoutInSeconds, + Parameters.marker, + Parameters.maxPageSize, + Parameters.snapshot, + Parameters.comp20 ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", + var getPageRangesDiffOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders + bodyMapper: Mappers.PageList, + headersMapper: Mappers.PageBlobGetPageRangesDiffHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobGetPageRangesDiffExceptionHeaders } }, - requestBody: keyInfo, queryParameters: [ - restype, - timeoutInSeconds, - comp3 + Parameters.timeoutInSeconds, + Parameters.marker, + Parameters.maxPageSize, + Parameters.snapshot, + Parameters.comp20, + Parameters.prevsnapshot ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.prevSnapshotUrl ], isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", + var resizeOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - headersMapper: ServiceGetAccountInfoHeaders + headersMapper: Mappers.PageBlobResizeHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobResizeExceptionHeaders } }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], + queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", + var updateSequenceNumberOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders + 200: { + headersMapper: Mappers.PageBlobUpdateSequenceNumberHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUpdateSequenceNumberExceptionHeaders } }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], + queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobSequenceNumber, + Parameters.sequenceNumberAction ], isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", + var copyIncrementalOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders + 202: { + headersMapper: Mappers.PageBlobCopyIncrementalHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCopyIncrementalExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp21], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.copySource ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var ContainerImpl = class { + } +}); + +// 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 Container class. + * Initialize a new instance of the class AppendBlob 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$2); - } - /** - * 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$1); - } - /** - * 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$1); - } - /** - * 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$1); - } - /** - * 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. + * The Create Append Blob operation creates a new append blob. + * @param contentLength The length of the request. * @param options The options parameters. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); + create(contentLength, options) { + return this.client.sendOperationRequest({ contentLength, options }, createOperationSpec); } /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * 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 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(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); + appendBlock(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, appendBlockOperationSpec); } /** - * 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. + * 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. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); + appendBlockFromUrl(sourceUrl, contentLength, options) { + return this.client.sendOperationRequest({ sourceUrl, contentLength, options }, appendBlockFromUrlOperationSpec); } /** - * [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 + * 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. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); + 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; /** - * [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. + * Initialize a new instance of the class BlockBlob class. + * @param client Reference to the service client */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); + constructor(client) { + this.client = client; } /** - * [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. + * 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. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); + upload(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, uploadOperationSpec); } /** - * [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 + * 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. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); + putBlobFromUrl(contentLength, copySource, options) { + return this.client.sendOperationRequest({ contentLength, copySource, options }, putBlobFromUrlOperationSpec); } /** - * [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. + * 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. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); + stageBlock(blockId, contentLength, body, options) { + return this.client.sendOperationRequest({ blockId, contentLength, body, options }, stageBlockOperationSpec); } /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container + * 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. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); + stageBlockFromURL(blockId, contentLength, sourceUrl, options) { + return this.client.sendOperationRequest({ blockId, contentLength, sourceUrl, options }, stageBlockFromURLOperationSpec); } /** - * [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. + * 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. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); + commitBlockList(blocks, options) { + return this.client.sendOperationRequest({ blocks, options }, commitBlockListOperationSpec); } /** - * Returns the sku name and account kind + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); + getBlockList(listType, options) { + return this.client.sendOperationRequest({ listType, options }, getBlockListOperationSpec); } }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( + exports2.BlockBlobImpl = BlockBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", + var uploadOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders + 201: { + headersMapper: Mappers.BlockBlobUploadHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobUploadExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], + requestBody: Parameters.body1, + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - leaseId + 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, - serializer: xmlSerializer$4 + contentType: "application/xml; charset=utf-8", + mediaType: "binary", + serializer: xmlSerializer }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", + var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 202: { - headersMapper: ContainerDeleteHeaders + 201: { + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince + 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$4 + serializer: xmlSerializer }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", + var stageBlockOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockExceptionHeaders } }, + requestBody: Parameters.body1, queryParameters: [ - timeoutInSeconds, - restype2, - comp6 + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince + 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, - serializer: xmlSerializer$4 + contentType: "application/xml; charset=utf-8", + mediaType: "binary", + serializer: xmlSerializer }; - var getAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", + var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { name: "Composite", className: "SignedIdentifier" } - } - }, - serializedName: "SignedIdentifiers", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier" - }, - headersMapper: ContainerGetAccessPolicyHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp7 + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - leaseId + 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$4 + serializer: xmlSerializer }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", + var commitBlockListOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders + 201: { + headersMapper: Mappers.BlockBlobCommitBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobCommitBlockListExceptionHeaders } }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], + requestBody: Parameters.blocks, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp25], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince + 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$4 + serializer: xmlSerializer }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", + var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { - 201: { - headersMapper: ContainerRestoreHeaders + 200: { + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp8 + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.comp25, + Parameters.listType ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + } +}); + +// 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(url, options) { + if (url === void 0) { + throw new Error("'url' cannot be null"); + } + if (!options) { + options = {}; + } + const defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; + super(optionsWithDefaults); + this.url = url; + 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(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + 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"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + if (this.move) { + permissions.push("m"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + if (this.execute) { + permissions.push("e"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + if (this.permanentDelete) { + permissions.push("y"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 + if (this.filterByTags) { + permissions.push("f"); + } + return permissions.join(""); + } }; - var BlobImpl = class { + 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 { /** - * Initialize a new instance of the class Blob class. - * @param client Reference to the service client + * Azure Storage account name; readonly. */ - constructor(client) { - this.client = client; - } + accountName; /** - * 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. + * Azure Storage user delegation key; readonly. */ - download(options) { - return this.client.sendOperationRequest({ options }, downloadOperationSpec); - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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 { /** - * Sets the time a blob will expire and be deleted. - * @param expiryOptions Required. Indicates mode of the expiry time - * @param options The options parameters. + * The storage API version. */ - setExpiry(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); - } + version; /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); - } + protocol; /** - * The Set Immutability Policy operation sets the immutability policy on the blob - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - setImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, setImmutabilityPolicyOperationSpec); - } + startsOn; /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob - * @param options The options parameters. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - deleteImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, deleteImmutabilityPolicyOperationSpec); - } + expiresOn; /** - * 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. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - setLegalHold(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); - } + permissions; /** - * 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. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec); - } + services; /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec); - } + resourceTypes; /** - * [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. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); - } + identifier; /** - * [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. + * 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. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + 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; + } + } } /** - * [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. + * Encodes all SAS query parameters into a string that can be appended to a URL. + * */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + 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("&"); } /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. + * A private helper method used to filter and append query key/value pairs into an array. + * + * @param queries - + * @param key - + * @param value - */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec); + tryAppendQueryParameter(queries, key, value) { + if (!value) { + return; + } + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); + } } - /** - * 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); + }; + 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); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { + throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + 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); + } + } } - /** - * 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(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + 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); + } + } } - /** - * 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(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + 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."); + } } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + 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."); } - /** - * 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); + let resource = "c"; + if (blobSASSignatureValues.blobName) { + resource = "b"; } - /** - * 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); + 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(); + } } - /** - * 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); + 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."); } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders + } + 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(); } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders + } + 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, + timestamp2, + 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; } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders + if (!leaseId) { + leaseId = (0, core_util_1.randomUUID)(); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders + 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."); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders + 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."); } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders + 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."); } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders + 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."); } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 + 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)); + }); + } }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders + 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; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + if (!this.push(data)) { + this.source.pause(); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + }; + 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; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + 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}`)); } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 + }; + _destroy(error3, callback) { + this.removeSourceEventHandlers(); + this.source.destroy(); + callback(error3 === null ? void 0 : error3); + } }; - var PageBlobImpl = class { + 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; + } /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - constructor(client) { - this.client = client; + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } /** - * 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. + * 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 */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * 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. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } /** - * 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. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get contentType() { + return this.originalResponse.contentType; } /** - * 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. + * 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 */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + get copyId() { + return this.originalResponse.copyId; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get copyProgress() { + return this.originalResponse.copyProgress; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * 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 */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get copySource() { + return this.originalResponse.copySource; } /** - * 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. + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + 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; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. + * + * @readonly */ - constructor(client) { - this.client = client; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * 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. + * Indicates the version of the Blob service used + * to execute the request. + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get version() { + return this.originalResponse.version; } /** - * 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. + * Indicates the versionId of the downloaded blob version. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get versionId() { + return this.originalResponse.versionId; } /** - * 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. + * Indicates whether version of this blob is a current version. + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; } /** - * 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. + * 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 */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } /** - * 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. + * 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) */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get contentCrc64() { + return this.originalResponse.contentCrc64; } /** - * 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. + * Object Replication Policy Id of the destination blob. + * + * @readonly */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * + * @readonly */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * If this blob has been sealed. + * + * @readonly + */ + get isSealed() { + return this.originalResponse.isSealed; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } /** - * 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. + * Indicates if a legal hold is present on the blob. * - * @param permissions - + * @readonly */ - 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; + get legalHold() { + return this.originalResponse.legalHold; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * The response body as a browser Blob. + * Always undefined in node.js. * - * @param permissionLike - + * @readonly */ - 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; + get contentAsBlob() { + return this.originalResponse.blobBody; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * The response body as a node.js Readable stream. + * Always undefined in the browser. * - * @returns A string which represents the BlobSASPermissions + * It will automatically retry when internal read stream unexpected ends. + * + * @readonly */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); + 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."); } - if (this.add) { - permissions.push("a"); + 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; } - if (this.create) { - permissions.push("c"); + 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."); } - if (this.write) { - permissions.push("w"); + } + 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."); } - if (this.delete) { - permissions.push("d"); + 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 pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } - if (this.deleteVersion) { - permissions.push("x"); + 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); + } } - if (this.tag) { - permissions.push("t"); + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); + } else { + return _AvroType.fromObjectSchema(schema2); } - if (this.move) { - permissions.push("m"); + } + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); } - if (this.execute) { - permissions.push("e"); + } + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); + } + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { } - if (this.setImmutabilityPolicy) { - permissions.push("i"); + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); } - if (this.permanentDelete) { - permissions.push("y"); + } + }; + 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"); } - return permissions.join(""); } }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - /** - * 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}`); + // 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(types) { + super(); + this._types = types; + } + 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 containerSASPermissions; + return record; } - /** - * 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; + }; + } +}); + +// 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."); } - if (permissionLike.create) { - containerSASPermissions.create = true; + 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"); } - if (permissionLike.write) { - containerSASPermissions.write = true; + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + }); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - if (permissionLike.delete) { - containerSASPermissions.delete = true; + 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--; + } } - if (permissionLike.list) { - containerSASPermissions.list = true; + } + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); } - if (permissionLike.deleteVersion) { - containerSASPermissions.deleteVersion = true; + 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; } - if (permissionLike.tag) { - containerSASPermissions.tag = true; + } + }; + 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); } - if (permissionLike.move) { - containerSASPermissions.move = true; + 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 (permissionLike.execute) { - containerSASPermissions.execute = true; + if (size < 0) { + throw new Error(`size parameter should be positive: ${size}`); } - if (permissionLike.setImmutabilityPolicy) { - containerSASPermissions.setImmutabilityPolicy = true; + if (size === 0) { + return new Uint8Array(); } - if (permissionLike.permanentDelete) { - containerSASPermissions.permanentDelete = true; + if (!this._readable.readable) { + throw new Error("Stream no longer readable."); } - if (permissionLike.filterByTags) { - containerSASPermissions.filterByTags = true; + const chunk = this._readable.read(size); + if (chunk) { + this._position += chunk.length; + return this.toUint8Array(chunk); + } else { + return new Promise((resolve4, 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(); + resolve4(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); + } + }); } - return containerSASPermissions; } + }; + 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; /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * Creates an instance of BlobQuickQueryStream. * + * @param source - The current ReadableStream returned from getter + * @param options - */ - 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"); + 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); + }); } - return permissions.join(""); + } + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var UserDelegationKeyCredential = class { + 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 { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Returns if it was previously specified + * for the file. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get cacheControl() { + return this.originalResponse.cacheControl; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * Returns the value that was specified + * for the Content-Encoding request header. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * Returns the value that was specified + * for the Content-Language request header. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } - } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version2 >= "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.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + get contentLanguage() { + return this.originalResponse.contentLanguage; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + /** + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly + */ + get blobType() { + return this.originalResponse.blobType; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * The number of bytes present in the + * response body. + * + * @readonly + */ + get contentLength() { + return this.originalResponse.contentLength; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + /** + * 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; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly + */ + get contentType() { + return this.originalResponse.contentType; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + /** + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly + */ + get copyId() { + return this.originalResponse.copyId; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * 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; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + /** + * 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; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * 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; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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}`); + /** + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly + */ + get leaseState() { + return this.originalResponse.leaseState; } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); + /** + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly + */ + get leaseStatus() { + return this.originalResponse.leaseStatus; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); + /** + * 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; } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + /** + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly + */ + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + */ + get etag() { + return this.originalResponse.etag; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + /** + * The error code. + * + * @readonly + */ + get errorCode() { + return this.originalResponse.errorCode; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + /** + * 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 (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + /** + * 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; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + /** + * 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; } - if (version2 < "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."); + /** + * A name-value pair + * to associate with a file storage object. + * + * @readonly + */ + get metadata() { + return this.originalResponse.metadata; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + /** + * 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 (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + /** + * 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; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + /** + * Indicates the version of the File service used + * to execute the request. + * + * @readonly + */ + get version() { + return this.originalResponse.version; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; - } - var BlobLeaseClient = class { /** - * Gets the lease Id. + * 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 leaseId() { - return this._leaseId; + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } /** - * Gets the url. + * 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 url() { - return this._url; + get blobBody() { + return void 0; } /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. + * The response body as a node.js Readable stream. + * Always undefined in the browser. + * + * It will parse avor data returned by blob query. + * + * @readonly */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + get readableStreamBody() { + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; + } + originalResponse; + blobDownloadStream; + /** + * Creates an instance of BlobQueryResponse. * - * @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. + * @param originalResponse - + * @param options - */ - async acquireLease(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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 + } } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + }; + } + } +}); + +// 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, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 }); - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; - }); + updateState === null || updateState === void 0 ? void 0 : updateState(state, 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + case "DELETE": { + return void 0; } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } - }; - var RetriableReadableStream = class extends stream2.Readable { - /** - * 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.retries = 0; - this.sourceDataHandler = (data) => { - if (this.options.doInjectErrorOnce) { - this.options.doInjectErrorOnce = void 0; - this.source.pause(); - this.sourceErrorOrEndHandler(); - this.source.destroy(); - return; + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; } - this.offset += data.length; - if (this.onProgress) { - this.onProgress({ loadedBytes: this.offset - this.start }); + case "original-uri": { + return requestPath; } - if (!this.push(data)) { - this.source.pause(); + 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 + }) }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); + } else if (location !== void 0) { + return { + mode: "ResourceLocation", + operationLocation: location }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } + } else if (normalizedRequestMethod === "PUT" && requestPath) { + return { + mode: "Body", + operationLocation: requestPath }; - 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); - } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); - } - }; - 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; + } else { + return void 0; } - /** - * 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; + } + 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.`); } - /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; + 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; + } } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - /** - * 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; + } + 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; } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; + 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; } - /** - * The number of bytes present in the - * response body. - * - * @readonly - */ - get contentLength() { - return this.originalResponse.contentLength; + 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; } - /** - * 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; + 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; } - /** - * 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; + return void 0; + } + function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly - */ - get contentType() { - return this.originalResponse.contentType; + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return void 0; + } } - /** - * 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; + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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}`); } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly - */ - get copyId() { - return this.originalResponse.copyId; + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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 = () => ({ /** - * 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 + * 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. */ - get copyProgress() { - return this.originalResponse.copyProgress; + 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, 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, + 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; } - /** - * 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; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * 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; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * 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; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly + * Serializes the Poller operation. */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; + }; + 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); } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly - */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + }; + 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 UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * 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. * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The number of tags associated with the blob + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } - /** - * The error code. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @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). + * // You can assign more local properties here. + * } + * } + * ``` * - * @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. + * 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. * - * @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. + * 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: * - * @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. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get lastAccessed() { - return this.originalResponse.lastAccessed; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve4, reject) => { + this.resolve = resolve4; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * Returns the date and time the blob was created. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get createdOn() { - return this.originalResponse.createdOn; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * A name-value pair - * to associate with a file storage object. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get requestId() { - return this.originalResponse.requestId; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the Blob service used - * to execute the request. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get version() { - return this.originalResponse.version; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * Indicates the versionId of the downloaded blob version. - * - * @readonly + * Invokes the underlying operation's cancel method. */ - get versionId() { - return this.originalResponse.versionId; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Indicates whether version of this blob is a current version. + * 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. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + 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; } - /** - * 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; + 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()); + } } /** - * Object Replication Policy Id of the destination blob. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get objectReplicationDestinationPolicyId() { - return this.originalResponse.objectReplicationDestinationPolicyId; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get objectReplicationSourceProperties() { - return this.originalResponse.objectReplicationSourceProperties; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * If this blob has been sealed. - * - * @readonly + * Returns true if the poller has finished polling. */ - get isSealed() { - return this.originalResponse.isSealed; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. - * - * @readonly + * Stops the poller from continuing to poll. */ - get immutabilityPolicyExpiresOn() { - return this.originalResponse.immutabilityPolicyExpiresOn; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * Indicates immutability policy mode. - * - * @readonly + * Returns true if the poller is stopped. */ - get immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; + isStopped() { + return this.stopped; } /** - * Indicates if a legal hold is present on the blob. + * Attempts to cancel the underlying operation. * - * @readonly - */ - get legalHold() { - return this.originalResponse.legalHold; - } - /** - * The response body as a browser Blob. - * Always undefined in node.js. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * If it's called again before it finishes, it will throw an error. + * + * @param options - Optional properties passed to the operation's update method. */ - get contentAsBlob() { - return this.originalResponse.blobBody; + 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; } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * Returns the state of the operation. * - * It will automatically retry when internal read stream unexpected ends. + * 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. * - * @readonly + * 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. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobDownloadResponse. - * - * @param originalResponse - - * @param getter - - * @param offset - - * @param count - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, getter, offset, count, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + toString() { + return this.operation.toString(); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - var AvroParser = class _AvroParser { - /** - * Reads a fixed number of bytes from the stream. - * - * @param stream - - * @param length - - * @param options - - */ - static async readFixedBytes(stream3, length, options = {}) { - const bytes = await stream3.read(length, { abortSignal: options.abortSignal }); - if (bytes.length !== length) { - throw new Error("Hit stream end."); - } - return bytes; + 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); } /** - * Reads a single byte from the stream. - * - * @param stream - - * @param options - + * The method used by the poller to wait before attempting to update its operation. */ - static async readByte(stream3, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream3, 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(stream3, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await _AvroParser.readByte(stream3, 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(stream3, 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(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readInt(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readNull() { - return null; + delay() { + return new Promise((resolve4) => setTimeout(() => resolve4(), this.config.intervalInMs)); } - static async readBoolean(stream3, options = {}) { - const b = await _AvroParser.readByte(stream3, options); - if (b === 1) { - return true; - } else if (b === 0) { - return false; - } else { - throw new Error("Byte was not a boolean."); + }; + 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; } - } - static async readFloat(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); - } - static async readDouble(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); - } - static async readBytes(stream3, options = {}) { - const size = await _AvroParser.readLong(stream3, options); - if (size < 0) { - throw new Error("Bytes size was negative."); + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, + blobClient, + copySource, + startCopyFromURLOptions + }); + super(operation); + if (typeof onProgress === "function") { + this.onProgress(onProgress); } - return stream3.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream3, options = {}) { - const u8arr = await _AvroParser.readBytes(stream3, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); + this.intervalInMs = intervalInMs; } - static async readMapPair(stream3, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream3, options); - const value = await readItemMethod(stream3, options); - return { key, value }; + delay() { + return (0, core_util_1.delay)(this.intervalInMs); } - static async readMap(stream3, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream3, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; - } - return dict; + }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; + var cancel = async function cancel2(options = {}) { + const state = this.state; + const { copyId } = state; + if (state.isCompleted) { + return makeBlobBeginCopyFromURLPollOperation(state); } - static async readArray(stream3, readItemMethod, options = {}) { - const items = []; - for (let count = await _AvroParser.readLong(stream3, options); count !== 0; count = await _AvroParser.readLong(stream3, options)) { - if (count < 0) { - await _AvroParser.readLong(stream3, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream3, options); - items.push(item); - } - } - return items; + if (!copyId) { + state.isCancelled = true; + return makeBlobBeginCopyFromURLPollOperation(state); } + await state.blobClient.abortCopyFromURL(copyId, { + abortSignal: options.abortSignal + }); + state.isCancelled = true; + return makeBlobBeginCopyFromURLPollOperation(state); }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); - } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); + 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; } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; + } else if (!state.isCompleted) { try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { - } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + 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 AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream3, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream3, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream3, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream3, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream3, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream3, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream3, options); - default: - throw new Error("Unknown Avro Primitive"); + var toString2 = function toString3() { + return JSON.stringify({ state: this.state }, (key, value) => { + if (key === "blobClient") { + return void 0; } - } - }; - var AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, options = {}) { - const value = await AvroParser.readInt(stream3, options); - return this._symbols[value]; - } + return value; + }); }; - var AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; + 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.`); } - async read(stream3, options = {}) { - const typeIndex = await AvroParser.readInt(stream3, options); - return this._types[typeIndex].read(stream3, options); + 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.`); } - }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + 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(); } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - const readItemMethod = (s, opts) => { - return this._itemType.read(s, opts); - }; - return AvroParser.readMap(stream3, readItemMethod, options); + /** + * 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); + } + }); } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; + /** + * Start execute operations in the queue. + * + */ + async do() { + if (this.operations.length === 0) { + return Promise.resolve(); + } + this.parallelExecute(); + return new Promise((resolve4, reject) => { + this.emitter.on("finish", resolve4); + this.emitter.on("error", (error3) => { + this.state = BatchStates.Error; + reject(error3); + }); + }); } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, 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(stream3, options); + /** + * 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; } } - return record; } }; - 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; + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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((resolve4, 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); + resolve4(); + 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}`)); + } + resolve4(); + }); + stream2.on("error", (msg) => { + clearTimeout(timeout); + reject(msg); + }); + }); } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; - } - get objectIndex() { - return this._objectIndex; - } - 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.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal + async function streamToBuffer2(stream2, buffer, encoding) { + let pos = 0; + const bufferSize = buffer.length; + return new Promise((resolve4, 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; }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal + stream2.on("end", () => { + resolve4(pos); }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); - } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal + stream2.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve4, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + readableStream.on("end", () => { + resolve4(Buffer.concat(chunks)); }); - await 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--; - } - } + readableStream.on("error", reject); + }); + } + async function readStreamToLocalFile(rs, file) { + return new Promise((resolve4, reject) => { + const ws = node_fs_1.default.createWriteStream(file); + rs.on("error", (err) => { + reject(err); + }); + ws.on("error", (err) => { + reject(err); + }); + ws.on("close", resolve4); + 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_utils7(); + 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; } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + /** + * The name of the storage container the blob is associated with. + */ + get containerName() { + return this._containerName; } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + options = options || {}; + let pipeline; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = 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)) { + url = urlOrConnectionString; + options = blobNameOrOptions; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); + pipeline = (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); + url = (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); } + pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); } - yield yield tslib.__await(result); + } else if (extractedCreds.kind === "SASConnString") { + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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"); } - }); - } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); + } else { + throw new Error("Expecting non-empty strings for containerName and blobName parameters"); } - return data; - } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + super(url, pipeline); + ({ 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); } - get position() { - return this._position; + /** + * 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); } - async read(size, options = {}) { - var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.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((resolve4, 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(); - resolve4(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); - } - }); - } + /** + * 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); } - }; - var BlobQuickQueryStream = class extends stream2.Readable { /** - * Creates an instance of BlobQuickQueryStream. + * Creates a AppendBlobClient object. * - * @param source - The current ReadableStream returned from getter - * @param options - */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); + getAppendBlobClient() { + return new AppendBlobClient(this.url, this.pipeline); } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); - } + /** + * Creates a BlockBlobClient object. + * + */ + getBlockBlobClient() { + return new BlockBlobClient(this.url, this.pipeline); } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); + /** + * Creates a PageBlobClient object. + * + */ + getPageBlobClient() { + return new PageBlobClient(this.url, this.pipeline); } - }; - var BlobQueryResponse = class { /** - * Indicates that the service supports - * requests for partial file content. + * Reads or downloads a blob from the system, including its metadata and properties. + * You can also call Get Blob to read a snapshot. * - * @readonly + * * 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}`); + * } + * ``` */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + 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 if it was previously specified - * for the file. + * Returns true if the Azure blob resource represented by this client exists; false otherwise. * - * @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. + * 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. * - * @readonly + * @param options - options to Exists operation. */ - get contentDisposition() { - return this.originalResponse.contentDisposition; + 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 the value that was specified - * for the Content-Encoding request header. + * 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 * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. + * 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. * - * @readonly + * @param options - Optional options to Get Properties operation. */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + 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) + }; + }); } /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. + * 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 * - * @readonly + * @param options - Optional options to Blob Delete operation. */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; + 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 + })); + }); } /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * 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 * - * @readonly + * @param options - Optional options to Blob Delete operation. */ - get blobType() { - return this.originalResponse.blobType; + 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; + } + }); } /** - * The number of bytes present in the - * response body. + * 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 * - * @readonly + * @param options - Optional options to Blob Undelete operation. */ - get contentLength() { - return this.originalResponse.contentLength; + 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 + })); + }); } /** - * 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. + * Sets system properties on the blob. * - * @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. + * 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 * - * @readonly + * @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. */ - get contentRange() { - return this.originalResponse.contentRange; + 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 + })); + }); } /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * Sets user-defined metadata for the specified blob as one or more name-value pairs. * - * @readonly + * 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. */ - get contentType() { - return this.originalResponse.contentType; + 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 + })); + }); } /** - * 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. + * 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 ('_'). * - * @readonly + * @param tags - + * @param options - */ - get copyCompletedOn() { - return void 0; + 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) + })); + }); } /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * Gets the tags associated with the underlying blob. * - * @readonly + * @param options - */ - get copyId() { - return this.originalResponse.copyId; + 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; + }); } /** - * 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. + * Get a {@link BlobLeaseClient} that manages leases on the blob. * - * @readonly + * @param proposeLeaseId - Initial proposed lease Id. + * @returns A new BlobLeaseClient object for managing leases on the blob. */ - get copyProgress() { - return this.originalResponse.copyProgress; + getBlobLeaseClient(proposeLeaseId) { + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** - * 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. + * Creates a read-only snapshot of a blob. + * @see https://learn.microsoft.com/rest/api/storageservices/snapshot-blob * - * @readonly + * @param options - Optional options to the Blob Create Snapshot operation. */ - get copySource() { - return this.originalResponse.copySource; + 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 + })); + }); } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' + * 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. * - * @readonly + * 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. */ - get copyStatus() { - return this.originalResponse.copyStatus; + 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; } /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. + * 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 * - * @readonly + * @param copyId - Id of the Copy From URL operation. + * @param options - Optional options to the Blob Abort Copy From URL operation. */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; + 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 + })); + }); } /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. + * 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 * - * @readonly + * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication + * @param options - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + 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 + })); + }); } /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * 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 * - * @readonly + * @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. */ - get leaseState() { - return this.originalResponse.leaseState; + 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; + }); } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @readonly + * 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. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + 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."); + } } /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * 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 * - * @readonly + * @param copySource - url to the source Azure Blob/File. + * @param options - Optional options to the Blob Start Copy From URL operation. */ - get date() { - return this.originalResponse.date; + 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 + })); + }); } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * Only available for BlobClient constructed with a shared key credential. * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * 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. * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The error code. + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas * - * @readonly + * @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. */ - get errorCode() { - return this.originalResponse.errorCode; + generateSasUrl(options) { + return new Promise((resolve4) => { + 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(); + resolve4((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); } /** - * 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). + * Only available for BlobClient constructed with a shared key credential. * - * @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. + * 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. * - * @readonly + * @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. */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; + /* 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; } /** - * 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 + * 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. */ - get lastModified() { - return this.originalResponse.lastModified; + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve4) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve4((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); } /** - * A name-value pair - * to associate with a file storage object. + * Only available for BlobClient constructed with a shared key credential. * - * @readonly + * 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. */ - get metadata() { - return this.originalResponse.metadata; + 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; } /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * Delete the immutablility policy on the blob. * - * @readonly + * @param options - Optional options to delete immutability policy on the blob. */ - get requestId() { - return this.originalResponse.requestId; + 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 + })); + }); } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * Set immutability policy on the blob. * - * @readonly + * @param options - Optional options to set immutability policy on the blob. */ - get clientRequestId() { - return this.originalResponse.clientRequestId; + 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 + })); + }); } /** - * Indicates the version of the File service used - * to execute the request. + * Set legal hold on the blob. * - * @readonly + * @param options - Optional options to set legal hold on the blob. */ - get version() { - return this.originalResponse.version; + 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 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. + * 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 * - * @readonly + * @param options - Options to the Service Get Account Info operation. + * @returns Response data for the Service Get Account Info operation. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + 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 { /** - * 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) + * appendBlobsContext provided by protocol layer. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + appendBlobContext; + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + let pipeline; + let url; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = 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)) { + url = urlOrConnectionString; + options = blobNameOrOptions; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url = urlOrConnectionString; + pipeline = (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); + url = (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); + } + pipeline = (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") { + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url, pipeline); + this.appendBlobContext = this.storageClientContext.appendBlob; } /** - * The response body as a browser Blob. - * Always undefined in node.js. + * 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. * - * @readonly + * @param snapshot - The snapshot timestamp. + * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - get blobBody() { - return void 0; + 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); } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * 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 * - * It will parse avor data returned by blob query. + * @param options - Options to the Append Block Create operation. * - * @readonly - */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - /** - * Creates an instance of BlobQueryResponse. * - * @param originalResponse - - * @param options - - */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; - } - return tier2; - } - 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 = EncryptionAlgorithmAES25; - } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { - constructor(options) { - const { blobClient, copySource: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; - let state; - if (resumeFrom) { - state = JSON.parse(resumeFrom).state; - } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { - blobClient, - copySource: copySource2, - startCopyFromURLOptions - })); - super(operation); - if (typeof onProgress === "function") { - this.onProgress(onProgress); - } - this.intervalInMs = intervalInMs; - } - delay() { - return coreUtil.delay(this.intervalInMs); - } - }; - var cancel = async function cancel2(options = {}) { - const state = this.state; - const { copyId: copyId2 } = state; - if (state.isCompleted) { - return makeBlobBeginCopyFromURLPollOperation(state); - } - if (!copyId2) { - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - } - await state.blobClient.abortCopyFromURL(copyId2, { - abortSignal: options.abortSignal - }); - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - }; - var update = async function update2(options = {}) { - const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; - if (!state.isStarted) { - state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, 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: Object.assign({}, state), - cancel, - toString: toString2, - update - }; - } - 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}-`; - } - var BatchStates; - (function(BatchStates2) { - BatchStates2[BatchStates2["Good"] = 0] = "Good"; - BatchStates2[BatchStates2["Error"] = 1] = "Error"; - })(BatchStates || (BatchStates = {})); - var Batch = class { - /** - * Creates an instance of Batch. - * @param concurrency - + * 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(); + * ``` */ - constructor(concurrency = 5) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; - if (concurrency < 1) { - throw new RangeError("concurrency must be larger than 0"); - } - this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + 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 + })); + }); } /** - * Add a operation into queue. + * 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 operation - + * @param options - */ - addOperation(operation) { - this.operations.push(async () => { + async createIfNotExists(options = {}) { + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - this.actives++; - await operation(); - this.actives--; - this.completed++; - this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + 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; } }); } /** - * Start execute operations in the queue. + * Seals the append blob, making it read only. * + * @param options - */ - async do() { - if (this.operations.length === 0) { - return Promise.resolve(); - } - this.parallelExecute(); - return new Promise((resolve4, reject) => { - this.emitter.on("finish", resolve4); - this.emitter.on("error", (error4) => { - this.state = BatchStates.Error; - reject(error4); - }); + 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 + })); }); } /** - * Get next operation to be executed. Return null when reaching ends. + * Commits a new block of data to the end of the existing append blob. + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * - */ - 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. + * @param body - Data to be appended. + * @param contentLength - Length of the body in bytes. + * @param options - Options to the Append Block operation. * - */ - 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; - } - } - } - }; - var BuffersStream = class extends stream2.Readable { - /** - * 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 + * 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); + * ``` */ - 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."); - } + 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 + })); + }); } /** - * Internal _read() that will be called when the stream wants to pull more data in. + * 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 size - Optional. The size of data to be read + * @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 - */ - _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++; + 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 pipeline; + let url; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = 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)) { + url = urlOrConnectionString; + options = blobNameOrOptions; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; + } + pipeline = (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); + url = (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); + } + pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); } else { - this.byteOffsetInCurrentBuffer = end; + throw new Error("Account connection string is only supported in Node.js environment"); } - this.pushedBytesLength += remaining; - i += remaining; + } else if (extractedCreds.kind === "SASConnString") { + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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"); } - if (outBuffers.length > 1) { - this.push(Buffer.concat(outBuffers)); - } else if (outBuffers.length === 1) { - this.push(outBuffers[0]); - } + super(url, pipeline); + this.blockBlobContext = this.storageClientContext.blockBlob; + this._blobContext = this.storageClientContext.blob; } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { /** - * The size of the data contained in the pooled buffers. + * 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. */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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); - } + 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); } /** - * 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. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @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. + * 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 - */ - 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); + 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 + }); + }); } /** - * Get the readable stream assembled from all the data in the internal buffers. + * 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); + * ``` */ - getReadableStream() { - return new BuffersStream(this.buffers, this.size); + 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 + })); + }); } - }; - var BufferScheduler = class { /** - * Creates an instance of BufferScheduler. + * 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 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 + * @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. */ - constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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; + 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 + })); + }); } /** - * Start the scheduler, will return error when stream of any of the outgoingHandlers - * returns error. + * 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 do() { - return new Promise((resolve4, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve4).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve4(); - } - } - }); + 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 + })); }); } /** - * Insert a new data into unresolved array. + * 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 data - + * @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. */ - appendUnresolvedData(data) { - this.unresolvedDataArray.push(data); - this.unresolvedLength += data.length; + 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 + })); + }); } /** - * 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. + * 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. */ - shiftBufferFromUnresolvedDataArray(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; + 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 + })); + }); } /** - * 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 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 * - * @returns Return false when buffers in incoming are not enough, else true. + * @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. */ - resolveData() { - while (this.unresolvedLength >= this.bufferSize) { - let buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } + 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 = []; } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; + if (!res.uncommittedBlocks) { + res.uncommittedBlocks = []; + } + return res; + }); } + // High level functions /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. + * 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 triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); + 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); } - } while (buffer2); + }); } /** - * Trigger a outgoing handler for a buffer shifted from outgoing. + * ONLY AVAILABLE IN BROWSERS. * - * @param buffer - + * 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 triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); + 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); + }); } /** - * Return buffer used by outgoing handler into incoming. * - * @param buffer - + * 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. */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); + 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}`); } - } - }; - async function streamToBuffer(stream3, buffer2, offset, end, encoding) { - let pos = 0; - const count = end - offset; - return new Promise((resolve4, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream3.on("readable", () => { - if (pos >= count) { - clearTimeout(timeout); - resolve4(); - return; - } - let chunk = stream3.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); + 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.`); } - const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); - pos += chunkLength; - }); - stream3.on("end", () => { - clearTimeout(timeout); - if (pos < count) { - reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); + 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; + } } - resolve4(); - }); - stream3.on("error", (msg) => { - clearTimeout(timeout); - reject(msg); - }); - }); - } - async function streamToBuffer2(stream3, buffer2, encoding) { - let pos = 0; - const bufferSize = buffer2.length; - return new Promise((resolve4, reject) => { - stream3.on("readable", () => { - let chunk = stream3.read(); - if (!chunk) { - return; + } + 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)); } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); + 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}`); } - if (pos + chunk.length > bufferSize) { - reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); - return; + 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 + }); + } + }); } - buffer2.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - stream3.on("end", () => { - resolve4(pos); - }); - stream3.on("error", reject); - }); - } - async function readStreamToLocalFile(rs, file) { - return new Promise((resolve4, reject) => { - const ws = fs__namespace.createWriteStream(file); - rs.on("error", (err) => { - reject(err); - }); - ws.on("error", (err) => { - reject(err); + await batch.do(); + return this.commitBlockList(blockList, updatedOptions); }); - ws.on("close", resolve4); - rs.pipe(ws); - }); - } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + } /** - * The name of the blob. + * 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. */ - get name() { - return this._name; + 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 + }); + }); } /** - * The name of the storage container the blob is associated with. + * 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. */ - get containerName() { - return this._containerName; + 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) { - options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); - ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); - this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + super(url, pipeline); + this.pageBlobContext = this.storageClientContext.pageBlob; } /** - * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp. + * 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 BlobClient object identical to the source but with the specified snapshot timestamp - */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), 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(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), 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. - * + * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - getPageBlobClient() { - return new PageBlobClient(this.url, this.pipeline); + 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); } /** - * 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://docs.microsoft.com/en-us/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): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` - * - * Example usage (browser): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded - * ); + * 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 * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(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 download(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; + async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress - // for Node.js, progress is reported by RetriableReadableStream + metadata: options.metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), - rangeGetContentMD5: options.rangeGetContentMD5, - rangeGetContentCRC64: options.rangeGetContentCrc64, - snapshot: options.snapshot, 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 })); - const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { - return wrappedRes; - } - if (options.maxRetryRequests === void 0 || options.maxRetryRequests < 0) { - options.maxRetryRequests = 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(wrappedRes, async (start) => { - var _a2; - 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: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions - }, - range: 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(Object.assign({ 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. + * 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 options - options to Exists operation. + * @param size - size of the page blob. + * @param options - */ - async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + async createIfNotExists(size, options = {}) { + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - await this.getProperties({ - abortSignal: options.abortSignal, - customerProvidedKey: options.customerProvidedKey, - conditions: options.conditions, + 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 true; + })); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (e.statusCode === 404) { - return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { - return true; + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } 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://docs.microsoft.com/en-us/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. + * 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 options - Optional options to Get Properties operation. + * @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 getProperties(options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * 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 options - Optional options to Blob Delete operation. + * @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 delete(options = {}) { + async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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, - deleteSnapshots: options.deleteSnapshots, + sourceContentMD5: options.sourceContentMD5, + sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * Frees the specified pages from the page blob. + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * - * @param options - Optional options to Blob Delete operation. + * @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 deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } + 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 + })); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * 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 options - Optional options to Blob Undelete operation. + * @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 undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * 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 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. + * @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 setHTTPHeaders(blobHTTPHeaders, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + 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, - blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger. + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, + maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); } /** - * Sets user-defined metadata for the specified blob as one or more name-value pairs. + * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel} * - * If no option provided, or no metadata defined in the parameter, the blob - * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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 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. + * @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. */ - async setMetadata(metadata2, options = {}) { + listPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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 + }); + } + }; } /** - * 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 ('_'). + * 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 tags - - * @param options - + * @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 setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + 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); }); } /** - * Gets the tags associated with the underlying blob. + * 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 options - + * @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 getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); - return wrappedResponse; }); } /** - * Get a {@link BlobLeaseClient} that manages leases on the blob. + * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} * - * @param proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the blob. + * + * @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. */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + 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); + } } /** - * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob + * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects * - * @param options - Optional options to the Blob Create Snapshot operation. + * @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 createSnapshot(options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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); + } } /** - * 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. + * 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 * - * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. * - * Example using automatic polling: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); + * 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}`); * } - * const result = copyPoller.getResult(); - * ``` * - * Example using progress updates: + * // 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()); + * } * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * onProgress(state) { - * console.log(`Progress: ${state.copyProgress}`); + * // 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}`); * } - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: + * } * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * // cancel operation after starting it. - * try { - * await copyPoller.cancelOperation(); - * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * // 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 copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. + * @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. */ - async beginCopyFromURL(copySource2, options = {}) { - const client = { - abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), - getProperties: (...args) => this.getProperties(...args), - startCopyFromURL: (...args) => this.startCopyFromURL(...args) - }; - const poller = new BlobBeginCopyFromUrlPoller({ - blobClient: client, - copySource: copySource2, - intervalInMs: options.intervalInMs, - onProgress: options.onProgress, - resumeFrom: options.resumeFrom, - startCopyFromURLOptions: options + listPageRangesDiff(offset, count, prevSnapshot, options = {}) { + options.conditions = options.conditions || {}; + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options }); - await poller.poll(); - return poller; + 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 + }); + } + }; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * 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 copyId - Id of the Copy From URL operation. - * @param options - Optional options to the Blob Abort Copy From URL operation. + * @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 abortCopyFromURL(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * 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 copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication - * @param options - + * @param size - Target size + * @param options - Options to the Page Blob Resize operation. + * @returns Response data for the Page Blob Resize operation. */ - async syncCopyFromURL(copySource2, options = {}) { + async resize(size, options = {}) { options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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, - metadata: options.metadata, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions }, - sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, - legalHold: options.legalHold, encryptionScope: options.encryptionScope, - copySourceTags: options.copySourceTags, 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * Sets a page blob's sequence number. + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * - * @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. + * @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 setAccessTier(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - rehydratePriority: options.rehydratePriority, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); } - async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; - let offset = 0; - let count = 0; - let options = param4; - if (param1 instanceof Buffer) { - buffer2 = param1; - offset = param2 || 0; - count = typeof param3 === "number" ? param3 : 0; + /** + * 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_utils7(); + 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(str2) { + return Buffer.byteLength(str2); + } + } +}); + +// 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 index = 0; index < subResponseCount; index++) { + const subResponse = subResponses[index]; + 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[${index}] 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((resolve4) => { + if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { + this.keys[key] = MutexLockStatus.LOCKED; + resolve4(); + } else { + this.onUnlockEvent(key, () => { + this.keys[key] = MutexLockStatus.LOCKED; + resolve4(); + }); + } + }); + } + /** + * Unlock a key. + * + * @param key - + */ + static async unlock(key) { + return new Promise((resolve4) => { + if (this.keys[key] === MutexLockStatus.LOCKED) { + this.emitUnlockEvent(key); + } + delete this.keys[key]; + resolve4(); + }); + } + static keys = {}; + static listeners = {}; + static onUnlockEvent(key, handler) { + if (this.listeners[key] === void 0) { + this.listeners[key] = [handler]; } else { - offset = typeof param1 === "number" ? param1 : 0; - count = typeof param2 === "number" ? param2 : 0; - options = param3 || {}; + this.listeners[key].push(handler); } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0) { - throw new RangeError("blockSize option must be >= 0"); + } + static emitUnlockEvent(key) { + if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { + const handler = this.listeners[key].shift(); + setImmediate(() => { + handler.call(this); + }); } - if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + } + }; + 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); } - if (offset < 0) { - throw new RangeError("offset option must be >= 0"); + } + setBatchType(batchType) { + if (!this.batchType) { + this.batchType = batchType; } - if (count && count <= 0) { - throw new RangeError("count option must be greater than 0"); + 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 url; + 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))) { + url = urlOrBlobClient; + credential = credentialOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = 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, + credential + }, async () => { + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + }); + }); + } + async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { + let url; + 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))) { + url = urlOrBlobClient; + credential = credentialOrTier; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = 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, + credential + }, async () => { + await new Clients_js_1.BlobClient(url, 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 pipeline = new Pipeline_js_1.Pipeline([]); + pipeline._credential = credential; + pipeline._corePipeline = corePipeline; + return pipeline; + } + appendSubRequestToBody(request) { + 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 + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.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 request.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 path8 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path8 || path8 === "") { + throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } - if (!options.conditions) { - options.conditions = {}; + } + 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(request) { + batchRequest.appendSubRequestToBody(request); + return { + request, + status: 200, + headers: (0, core_rest_pipeline_1.createHttpHeaders)() + }; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { - if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, 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 (!buffer2) { - try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + }; + } + function batchHeaderFilterPolicy() { + return { + name: "batchHeaderFilterPolicy", + async sendRequest(request, next) { + let xMsHeaderName = ""; + for (const [name] of request.headers) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { + xMsHeaderName = name; } } - if (buffer2.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(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 stream3 = response.readableStreamBody; - await streamToBuffer(stream3, buffer2, off - offset, chunkEnd - offset); - transferProgress += chunkEnd - off; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }); + if (xMsHeaderName !== "") { + request.headers.delete(xMsHeaderName); } - await batch.do(); - return buffer2; - }); + return next(request); + } + }; + } + } +}); + +// 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(url, credentialOrPipeline, options) { + let pipeline; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { + pipeline = credentialOrPipeline; + } else if (!credentialOrPipeline) { + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } else { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); + } + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path8 = (0, utils_common_js_1.getURLPath)(url); + if (path8 && path8 !== "/") { + this.serviceOrContainerContext = storageClientContext.container; + } else { + this.serviceOrContainerContext = storageClientContext.service; + } } /** - * 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. + * Creates a {@link BlobBatch}. + * A BlobBatch represents an aggregated set of operations on blobs. */ - async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); - if (response.readableStreamBody) { - await readStreamToLocalFile(response.readableStreamBody, filePath); - } - response.blobDownloadStream = void 0; - return response; - }); + createBatch() { + return new BlobBatch_js_1.BlobBatch(); } - 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 (isIpEndpointStyle(parsedUrl)) { - const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); - containerName = pathComponents[2]; - blobName = pathComponents[4]; + 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 { - const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); - containerName = pathComponents[1]; - blobName = pathComponents[3]; + await batch.deleteBlob(urlOrBlobClient, credentialOrOptions); } - containerName = decodeURIComponent(containerName); - blobName = decodeURIComponent(blobName); - blobName = blobName.replace(/\\/g, "/"); - if (!containerName) { - throw new Error("Provided containerName is invalid."); + } + 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 { blobName, containerName }; - } catch (error4) { - throw new Error("Unable to extract blobName and containerName with provided information."); } + return this.submitBatch(batch); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * Submit batch request which consists of multiple subrequests. * - * @param copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. - */ - async startCopyFromURL(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - sourceIfTags: options.sourceConditions.tagConditions - }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - sealBlob: options.sealBlob, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Only available for BlobClient constructed with a shared key credential. + * Get `blobBatchClient` and other details before running the snippets. + * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` * - * 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. + * Example usage: * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * ```ts snippet:BlobBatchClientSubmitBatch + * import { DefaultAzureCredential } from "@azure/identity"; + * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; * - * @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((resolve4) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve4(appendToURLQuery(this.url, sas)); - }); - } - /** - * Only available for BlobClient constructed with a shared key credential. + * const account = ""; + * const credential = new DefaultAzureCredential(); + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * 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. + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobBatchClient = containerClient.getBlobBatchClient(); * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * const batchRequest = new BlobBatch(); + * await batchRequest.deleteBlob("", credential); + * await batchRequest.deleteBlob("", credential, { + * deleteSnapshots: "include", + * }); + * const batchResp = await blobBatchClient.submitBatch(batchRequest); + * console.log(batchResp.subResponsesSucceededCount); + * ``` * - * @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)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; - } - /** - * Delete the immutablility policy on the blob. + * Example using a lease: * - * @param options - Optional options to delete immutability policy on the blob. - */ - async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Set immutability policy on the blob. + * ```ts snippet:BlobBatchClientSubmitBatchWithLease + * import { DefaultAzureCredential } from "@azure/identity"; + * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; * - * @param options - Optional options to set immutability policy on the blob. - */ - async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ - immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, - immutabilityPolicyMode: immutabilityPolicy.policyMode, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Set legal hold on the blob. + * const account = ""; + * const credential = new DefaultAzureCredential(); + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * credential, + * ); * - * @param options - Optional options to set legal hold on the blob. + * 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 setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { - tracingOptions: updatedOptions.tracingOptions + 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 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://docs.microsoft.com/en-us/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. + * The name of the container. */ - async getAccountInfo(options = {}) { - return tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + get containerName() { + return this._containerName; } - }; - var AppendBlobClient = class _AppendBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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"); + throw new Error("Expecting non-empty strings for containerName parameter"); } - super(url2, pipeline); - 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(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + super(url, pipeline); + this._containerName = this.getContainerNameFromUrl(); + this.containerContext = this.storageClientContext.container; } /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 the Append Block Create operation. + * @param options - Options to Container Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); - * await appendBlobClient.create(); + * ```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 = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); + 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 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://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + const res = await this.create(updatedOptions); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } - }); - } - /** - * Seals the append blob, making it read only. - * - * @param options - - */ - async seal(options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ - abortSignal: options.abortSignal, - appendPositionAccessConditions: options.conditions, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Commits a new block of data to the end of the existing append blob. - * @see https://docs.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: - * - * ```js - * const content = "Hello World!"; - * - * // Create a new append blob and append data to the blob. - * const newAppendBlobClient = containerClient.getAppendBlobClient(""); - * await newAppendBlobClient.create(); - * await newAppendBlobClient.appendBlock(content, content.length); - * - * // Append data to an existing append blob. - * const existingAppendBlobClient = containerClient.getAppendBlobClient(""); - * await existingAppendBlobClient.appendBlock(content, content.length); - * ``` - */ - async appendBlock(body2, contentLength2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { - abortSignal: options.abortSignal, - appendPositionAccessConditions: options.conditions, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.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://docs.microsoft.com/en-us/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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { - abortSignal: options.abortSignal, - sourceRange: rangeToString({ offset: sourceOffset, count }), - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - leaseAccessConditions: options.conditions, - appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince - }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - }; - var BlockBlobClient = class _BlockBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline; - let url2; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { - throw new Error("Account connection string is only supported in Node.js environment"); + throw e; } - } else if (extractedCreds.kind === "SASConnString") { - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new 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, pipeline); - 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(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + }); } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Quick query for a JSON or CSV formatted blob. - * - * Example usage (Node.js): - * - * ```js - * // Query and convert a blob to a string - * const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * Returns true if the Azure container resource represented by this client exists; false otherwise. * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` + * 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 query - * @param options - */ - async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { - throw new Error("This operation currently is only supported in Node.js."); - } - return tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ - abortSignal: options.abortSignal, - queryRequest: { - queryType: "SQL", - expression: query, - inputSerialization: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) - }, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - tracingOptions: updatedOptions.tracingOptions - })); - return new BlobQueryResponse(response, { - abortSignal: options.abortSignal, - onProgress: options.onProgress, - onError: options.onError - }); + 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 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}. + * Creates a {@link BlobClient} * - * This is a non-parallel uploading method, please use {@link uploadFile}, - * {@link uploadStream} or {@link uploadBrowserData} for better performance - * with concurrency uploading. + * @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} * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 * - * @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: * - * ```js + * ```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(body2, contentLength2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onUploadProgress: options.onProgress - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); - }); + 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); } /** - * Uploads the specified block to the block blob's "staging area" to be later - * committed by a call to commitBlockList. - * @see https://docs.microsoft.com/rest/api/storageservices/put-block + * Creates a {@link PageBlobClient} * - * @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. + * @param blobName - A page blob name */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { - 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 - })); - }); + 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); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * 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 * - * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - sourceRange: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * 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 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. + * @param options - Options to Container Get Properties operation. */ - async commitBlockList(blocks2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + 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, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + ...options.conditions, 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://docs.microsoft.com/rest/api/storageservices/get-block-list + * 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 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. + * @param options - Options to Container Delete operation. */ - async getBlockList(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: options.conditions, 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. + * 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 data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView - * @param options - + * @param options - Options to Container Delete operation. */ - async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; - if (data instanceof Buffer) { - buffer2 = data; - } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); - } else { - data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + 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 + }; } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); - } else { - const browserBlob = new Blob([data]); - return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); + throw e; } }); } /** - * 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 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); - }); - } - /** + * Sets one or more user-defined name-value pairs for the specified container. * - * 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. + * If no option provided, or no metadata defined in the parameter, the container + * metadata will be removed. * - * 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. + * @see https://learn.microsoft.com/rest/api/storageservices/set-container-metadata * - * @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. + * @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 uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); - } - const maxSingleShotSize = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); - } - if (blockSize === 0) { - if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`${size} is too larger to upload to a block blob.`); - } - if (size > maxSingleShotSize) { - blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - } - } - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } + async setMetadata(metadata, options = {}) { if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { - if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); - } - const numBlocks = Math.floor((size - 1) / blockSize) + 1; - if (numBlocks > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); - } - const blockList = []; - const blockIDPrefix = coreUtil.randomUUID(); - let transferProgress = 0; - const batch = new Batch(options.concurrency); - for (let i = 0; i < numBlocks; i++) { - batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); - const start = blockSize * i; - const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; - blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { - abortSignal: options.abortSignal, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += contentLength2; - 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 tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; - return this.uploadSeekableInternal((offset, count) => { - return () => fsCreateReadStream(filePath, { - autoClose: true, - end: count ? offset + count - 1 : Infinity, - start: offset - }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 + })); }); } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. + * Gets the permissions for the specified container. The permissions indicate + * whether container data may be accessed publicly. * - * Uploads a Node.js Readable stream into block blob. + * 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". * - * PERFORMANCE IMPROVEMENT TIPS: - * * Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * - * @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. + * @param options - Options to Container Get Access Policy operation. */ - async uploadStream(stream3, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } + async getAccessPolicy(options = {}) { if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { - let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); - let transferProgress = 0; - const blockList = []; - const scheduler = new BufferScheduler( - stream3, - bufferSize, - maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); - blockList.push(blockID); - blockNum++; - await this.stageBlock(blockID, body2, length, { - customerProvidedKey: options.customerProvidedKey, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += length; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); + 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); } - }, - // 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 assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); - }); - } - }; - var PageBlobClient = class _PageBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline; - let url2; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + if (identifier.accessPolicy.startsOn) { + accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn); } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); } - } else if (extractedCreds.kind === "SASConnString") { - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + res.signedIdentifiers.push({ + accessPolicy, + id: identifier.id + }); } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url2, pipeline); - this.pageBlobContext = this.storageClientContext.pageBlob; + return res; + }); } /** - * 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. + * Sets the permissions for the specified container. The permissions indicate + * whether blobs in a container may be accessed publicly. * - * @param snapshot - The snapshot timestamp. - * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); - } - /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * 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. * - * @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. + * 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 create(size, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + 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, - blobHttpHeaders: options.blobHTTPHeaders, - blobSequenceNumber: options.blobSequenceNumber, + access, + containerAcl: acl, leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + modifiedAccessConditions: options.conditions, 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://docs.microsoft.com/rest/api/storageservices/put-blob + * Get a {@link BlobLeaseClient} that manages leases on the container. * - * @param size - size of the page blob. - * @param options - + * @param proposeLeaseId - Initial proposed lease Id. + * @returns A new BlobLeaseClient object for managing leases on the container. */ - async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; - try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } - }); + getBlobLeaseClient(proposeLeaseId) { + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** - * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * Creates a new block blob, or updates the content of an existing block blob. * - * @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(body2, offset, count, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onUploadProgress: options.onProgress - }, - range: 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://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-url + * 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}. * - * @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 - + * 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 uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { - abortSignal: options.abortSignal, - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - leaseAccessConditions: options.conditions, - sequenceNumberAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tracingOptions: updatedOptions.tracingOptions - })); + 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 + }; }); } /** - * Frees the specified pages from the page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * 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 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. + * @param blobName - + * @param options - Options to Blob Delete operation. + * @returns Block blob deletion response data. */ - async clearPages(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - sequenceNumberAccessConditions: options.conditions, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); + 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); }); } /** - * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * 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 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. + * @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 getPageRanges(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + 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 })); - return rangeResponseFromModel(response); + 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; }); } /** - * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * 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 offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. + * @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 PageBlob Get Page Ranges Segment operation. + * @param options - Options to Container List Blob Hierarchy Segment operation. */ - async listPageRangesSegment(offset = 0, count, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, - maxPageSize: options.maxPageSize, + 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 {@link PageBlobGetPageRangesResponseModel} + * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse * - * @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 + * the list of blobs to be returned with the next listing 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 + * 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 Page Ranges operation. + * @param options - Options to list blobs operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 PageRangeInfo} objects + * Returns an AsyncIterableIterator of {@link BlobItem} 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. + * @param options - Options to list blobs operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 of page ranges for a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * Returns an async iterable iterator to list all the blobs + * under the specified account. * - * .byPage() returns an async iterable iterator to list of page ranges for a page blob. + * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRanges()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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: * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 }); + * // Example using paging with a marker + * i = 1; + * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; - * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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 = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // Prints 10 blob names + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` - * @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. + * + * @param options - Options to list blobs. * @returns An asyncIterableIterator that supports paging. */ - listPageRanges(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - const iter = this.listPageRangeItems(offset, count, options); + 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 @@ -65742,205 +72714,202 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.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 tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), - tracingOptions: updatedOptions.tracingOptions - })); - return 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://docs.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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevsnapshot: prevSnapshotOrUrl, - range: rangeToString({ - offset, - count - }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} - * + * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse * - * @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 delimiter - The character or string used to define the virtual hierarchy * @param marker - A string value that identifies the portion of - * the get of page ranges to be returned with the next getting operation. The + * the list of blobs to be returned with the next listing 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 + * 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 the Page Blob Get Page Ranges Diff operation. + * @param options - Options to list blobs operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 of {@link PageRangeInfo} objects + * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} 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. + * @param delimiter - The character or string used to define the virtual hierarchy + * @param options - Options to list blobs operation. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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 of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * Returns an async iterable iterator to list all the blobs by hierarchy. + * under the specified account. * - * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. + * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobsByHierarchy + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * 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 `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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 paging with a marker: + * // 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}`); + * } + * } * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // Example using paging with a marker + * i = 1; + * let iterator = containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; - * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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 = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = containerClient + * .listBlobsByHierarchy("/") + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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 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. + * + * @param delimiter - The character or string used to define the virtual hierarchy + * @param options - Options to list blobs operation. */ - listPageRangesDiff(offset, count, prevSnapshot, options = {}) { - options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + 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 */ - next() { + async next() { return iter.next(); }, /** @@ -65953,1194 +72922,1181 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * The Filter Blobs operation enables callers to list blobs in the container whose tags + * match a given search expression. * - * @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. + * @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 getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl2, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + where: tagFilterSqlExpression, + marker, + maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + 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; }); } /** - * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse. * - * @param size - Target size - * @param options - Options to the Page Blob Resize operation. - * @returns Response data for the Page Blob Resize operation. + * @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 resize(size, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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); + } } /** - * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * 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 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. + * @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. */ - async updateSequenceNumber(sequenceNumberAction2, sequenceNumber, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { - abortSignal: options.abortSignal, - blobSequenceNumber: sequenceNumber, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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 + }); + } + }; } /** - * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * 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 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. + * @param options - Options to the Service Get Account Info operation. + * @returns Response data for the Service Get Account Info operation. */ - async startCopyIncremental(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), tracingOptions: updatedOptions.tracingOptions })); }); } - }; - async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); - } - function utf8ByteLength(str2) { - return Buffer.byteLength(str2); - } - var HTTP_HEADER_DELIMITER = ": "; - var SPACE_DELIMITER = " "; - var NOT_FOUND = -1; - var BatchResponseParser = class { - 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}${HTTP_LINE_ENDING}`; - this.batchResponseEnding = `--${this.responseBatchBoundary}--`; - } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response - async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { - throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`); - } - const responseBodyAsText = await 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 index = 0; index < subResponseCount; index++) { - const subResponse = subResponses[index]; - const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${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(HeaderConstants.CONTENT_ID)) { - contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); - } - if (responseLine.startsWith(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] === 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; + 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 { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + containerName = parsedUrl.pathname.split("/")[1]; } - if (subRespFailed) { - subResponsesFailedCount++; - } else { - subResponsesSucceededCount++; + 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."); } - return { - subResponses: deserializedSubResponses, - subResponsesSucceededCount, - subResponsesFailedCount - }; } - }; - 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. + * Only available for ContainerClient constructed with a shared key credential. * - * @param key - lock key + * 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. */ - static async lock(key) { + generateSasUrl(options) { return new Promise((resolve4) => { - if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { - this.keys[key] = MutexLockStatus.LOCKED; - resolve4(); - } else { - this.onUnlockEvent(key, () => { - this.keys[key] = MutexLockStatus.LOCKED; - resolve4(); - }); + 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(); + resolve4((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** - * Unlock a key. + * Only available for ContainerClient constructed with a shared key credential. * - * @param key - + * 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. */ - static async unlock(key) { - return new Promise((resolve4) => { - if (this.keys[key] === MutexLockStatus.LOCKED) { - this.emitUnlockEvent(key); - } - delete this.keys[key]; - resolve4(); - }); - } - static onUnlockEvent(key, handler) { - if (this.listeners[key] === void 0) { - this.listeners[key] = [handler]; - } else { - this.listeners[key].push(handler); - } - } - static emitUnlockEvent(key) { - if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { - const handler = this.listeners[key].shift(); - setImmediate(() => { - handler.call(this); - }); + /* 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"); } - } - }; - Mutex.keys = {}; - Mutex.listeners = {}; - var BlobBatch = class { - constructor() { - this.batch = "batch"; - this.batchRequest = new InnerBatchRequest(); + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + ...options + }, this.credential).stringToSign; } /** - * 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 + * 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. */ - getMultiPartContentType() { - return this.batchRequest.getMultipartContentType(); + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve4) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve4((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); } /** - * Get assembled HTTP request body for sub requests. + * 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. */ - getHttpRequestBody() { - return this.batchRequest.getHttpRequestBody(); + generateUserDelegationSasStringToSign(options, userDelegationKey) { + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).stringToSign; } /** - * Get sub requests that are added into the batch request. + * 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. */ - getSubRequests() { - return this.batchRequest.getSubRequests(); + getBlobBatchClient() { + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } - async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); - try { - this.batchRequest.preAddSubRequest(subRequest); - await assembleSubRequestFunc(); - this.batchRequest.postAddSubRequest(subRequest); - } finally { - await Mutex.unlock(this.batch); + }; + 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; } - 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.`); + /** + * 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; } - } - async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; - let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; - credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof 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 (permissionLike.write) { + accountSASPermissions.write = true; } - if (!options) { - options = {}; + if (permissionLike.delete) { + accountSASPermissions.delete = true; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { - this.setBatchType("delete"); - await this.addSubRequestInternal({ - url: url2, - credential - }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); - }); - }); - } - async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; - let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; - credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; - options = tierOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + if (permissionLike.deleteVersion) { + accountSASPermissions.deleteVersion = true; } - if (!options) { - options = {}; + if (permissionLike.filter) { + accountSASPermissions.filter = true; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { - this.setBatchType("setAccessTier"); - await this.addSubRequestInternal({ - url: url2, - credential - }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); - }); - }); - } - }; - var InnerBatchRequest = class { - constructor() { - this.operationCount = 0; - this.body = ""; - const tempGuid = coreUtil.randomUUID(); - this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - xmlCharKey: "#" - } - } - }), { phase: "Serialize" }); - corePipeline.addPolicy(batchHeaderFilterPolicy()); - corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); + if (permissionLike.tag) { + accountSASPermissions.tag = true; } - const pipeline = new Pipeline([]); - pipeline._credential = credential; - pipeline._corePipeline = corePipeline; - return pipeline; - } - appendSubRequestToBody(request) { - this.body += [ - this.subRequestPrefix, - // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, - // sub request's content ID - "", - // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` - // sub request start line with method - ].join(HTTP_LINE_ENDING); - for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + if (permissionLike.list) { + accountSASPermissions.list = true; } - this.body += HTTP_LINE_ENDING; - } - preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + if (permissionLike.add) { + accountSASPermissions.add = true; } - const path8 = getURLPath(subRequest.url); - if (!path8 || path8 === "") { - throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); + if (permissionLike.create) { + accountSASPermissions.create = true; } - } - 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}${HTTP_LINE_ENDING}`; - } - getMultipartContentType() { - return this.multipartContentType; - } - getSubRequests() { - return this.subRequests; - } - }; - function batchRequestAssemblePolicy(batchRequest) { - return { - name: "batchRequestAssemblePolicy", - async sendRequest(request) { - batchRequest.appendSubRequestToBody(request); - return { - request, - status: 200, - headers: coreRestPipeline.createHttpHeaders() - }; + if (permissionLike.update) { + accountSASPermissions.update = true; } - }; - } - function batchHeaderFilterPolicy() { - return { - name: "batchHeaderFilterPolicy", - async sendRequest(request, next) { - let xMsHeaderName = ""; - for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { - xMsHeaderName = name; - } - } - if (xMsHeaderName !== "") { - request.headers.delete(xMsHeaderName); - } - return next(request); + if (permissionLike.process) { + accountSASPermissions.process = true; } - }; - } - var BlobBatchClient = class { - constructor(url2, credentialOrPipeline, options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - pipeline = newPipeline(credentialOrPipeline, options); + if (permissionLike.setImmutabilityPolicy) { + accountSASPermissions.setImmutabilityPolicy = true; } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path8 = getURLPath(url2); - if (path8 && path8 !== "/") { - this.serviceOrContainerContext = storageClientContext.container; - } else { - this.serviceOrContainerContext = storageClientContext.service; + if (permissionLike.permanentDelete) { + accountSASPermissions.permanentDelete = true; } + return accountSASPermissions; } /** - * Creates a {@link BlobBatch}. - * A BlobBatch represents an aggregated set of operations on blobs. + * 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. */ - createBatch() { - return new BlobBatch(); - } - async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new 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(); - 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); - } + permanentDelete = false; /** - * Submit batch request which consists of multiple subrequests. - * - * Get `blobBatchClient` and other details before running the snippets. - * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` - * - * Example usage: - * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` - * - * Example using a lease: + * Produces the SAS permissions string for an Azure Storage account. + * Call this method to set AccountSASSignatureValues Permissions field. * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` + * Using this method will guarantee the resource types are in + * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * - * @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."); + toString() { + const permissions = []; + if (this.read) { + permissions.push("r"); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { - const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new 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; - }); + 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(""); } }; - var ContainerClient = class extends StorageClient { + 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 { /** - * The name of the container. + * 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 - */ - get containerName() { - return this._containerName; - } - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { - let pipeline; - let url2; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { - const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + 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}`); } - } else { - throw new Error("Expecting non-empty strings for containerName parameter"); } - super(url2, pipeline); - this._containerName = this.getContainerNameFromUrl(); - this.containerContext = this.storageClientContext.container; + return accountSASResourceTypes; } /** - * Creates a new container under the specified account. If the container with - * the same name already exists, the operation fails. - * @see https://docs.microsoft.com/en-us/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. - * + * 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. * - * Example usage: + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * const createContainerResponse = await containerClient.create(); - * console.log("Container was created successfully", createContainerResponse.requestId); - * ``` */ - async create(options = {}) { - return tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); - }); + 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 a new container under the specified account. If the container with - * the same name already exists, it is not changed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata + * 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 options - + * @param services - */ - async createIfNotExists(options = {}) { - return tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } else { - throw e; - } + 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; } /** - * 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 - + * Permission to access blob resources granted. */ - async exists(options = {}) { - return 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; - } - }); - } + blob = false; /** - * Creates a {@link BlobClient} - * - * @param blobName - A blob name - * @returns A new BlobClient object for the given blob name. + * Permission to access file resources granted. */ - getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } + file = false; /** - * Creates an {@link AppendBlobClient} - * - * @param blobName - An append blob name + * Permission to access queue resources granted. */ - getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } + queue = false; /** - * Creates a {@link BlockBlobClient} - * - * @param blobName - A block blob name - * - * - * Example usage: - * - * ```js - * const content = "Hello world!"; - * - * const blockBlobClient = containerClient.getBlockBlobClient(""); - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` + * Permission to access table resources granted. */ - getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } + table = false; /** - * Creates a {@link PageBlobClient} + * Converts the given services to a string. * - * @param blobName - A page blob name */ - getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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; /** - * 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://docs.microsoft.com/en-us/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. + * Creates an instance of BlobServiceClient from connection string. * - * @param options - Options to Container Get Properties operation. + * @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. */ - async getProperties(options = {}) { - if (!options.conditions) { - options.conditions = {}; + 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 pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); + return new _BlobServiceClient(extractedCreds.url, pipeline); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); + } + } else if (extractedCreds.kind === "SASConnString") { + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); + } else { + throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); - }); + } + constructor(url, credentialOrPipeline, options) { + let pipeline; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { + pipeline = 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)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); + } else { + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } + super(url, pipeline); + this.serviceContext = this.storageClientContext.service; } /** - * Marks the specified container for deletion. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * Creates a {@link ContainerClient} object * - * @param options - Options to Container Delete operation. + * @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(""); + * ``` */ - async delete(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); + getContainerClient(containerName) { + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container * - * @param options - Options to Container Delete operation. + * @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 deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } + 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 + }; }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * Deletes a Blob container. * - * @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. + * @param containerName - Name of the container to delete. + * @param options - Options to configure Container Delete operation. + * @returns Container deletion response. */ - async setMetadata(metadata2, 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: metadata2, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); + async deleteContainer(containerName, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + const containerClient = this.getContainerClient(containerName); + return containerClient.delete(updatedOptions); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl - * - * @param options - Options to Container Get Access Policy operation. - */ - async getAccessPolicy(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = 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; + * 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 }; }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * 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 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. + * @param options - Options to the Service Get Properties operation. + * @returns Response data for the Service Get Properties operation. */ - async setAccessPolicy(access2, containerAcl2, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { - const acl = []; - for (const identifier of containerAcl2 || []) { - acl.push({ - accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", - permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" - }, - id: identifier.id - }); - } - return assertResponse(await this.containerContext.setAccessPolicy({ + 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, - access: access2, - containerAcl: acl, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); }); } /** - * Get a {@link BlobLeaseClient} that manages leases on the container. + * 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 proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the container. + * @param properties - + * @param options - Options to the Service Set Properties operation. + * @returns Response data for the Service Set Properties operation. */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + 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 + })); + }); } /** - * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 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. + * @param options - Options to the Service Get Statistics operation. + * @returns Response data for the Service Get Statistics operation. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { - const blockBlobClient = this.getBlockBlobClient(blobName); - const response = await blockBlobClient.upload(body2, contentLength2, updatedOptions); - return { - blockBlobClient, - response - }; + 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 + })); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * 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 blobName - - * @param options - Options to Blob Delete operation. - * @returns Block blob deletion response data. + * @param options - Options to the Service Get Account Info operation. + * @returns Response data for the Service Get Account Info operation. */ - async deleteBlob(blobName, options = {}) { - return tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { - let blobClient = this.getBlobClient(blobName); - if (options.versionId) { - blobClient = blobClient.withVersion(options.versionId); - } - return blobClient.delete(updatedOptions); + 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 + })); }); } /** - * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * 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 to be returned with the next list operation. - * @param options - Options to Container List Blob Flat Segment operation. + * @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 listBlobFlatSegment(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); - return wrappedResponse; + 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 + })); }); } /** - * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * 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 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. + * @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 listBlobHierarchySegment(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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 ContainerListBlobFlatSegmentResponse + * 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 + * 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 + * 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. + * @param options - Options to find blobs by tags. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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 of {@link BlobItem} objects + * Returns an AsyncIterableIterator for blobs. * - * @param options - Options to list blobs operation. + * @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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 list all the 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. * - * Example using `for await` syntax: + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `iter.next()`: + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * ```js + * // Use for await to iterate the blobs * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = blobServiceClient + * .findBlobsByTags("tagkey='tagvalue'") + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; * - * // Prints 10 blob names - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * // Prints blob names + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * - * @param options - Options to list blobs. - * @returns An asyncIterableIterator that supports paging. + * @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. */ - listBlobsFlat(options = {}) { - const include2 = []; - if (options.includeCopy) { - include2.push("copy"); - } - if (options.includeDeleted) { - include2.push("deleted"); - } - if (options.includeMetadata) { - include2.push("metadata"); - } - if (options.includeSnapshots) { - include2.push("snapshots"); - } - if (options.includeVersions) { - include2.push("versions"); - } - if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); - } - if (options.includeTags) { - include2.push("tags"); - } - if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include2.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; - } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItems(updatedOptions); + findBlobsByTags(tagFilterSqlExpression, options = {}) { + const listSegmentOptions = { + ...options + }; + const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** * The next method, part of the iteration protocol @@ -67158,387 +74114,136 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } /** - * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse + * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses * - * @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. - */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); - } - /** - * 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. - */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); - } - /** - * 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. - * - * Example using `for await` syntax: - * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * entity = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. + * 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. */ - listBlobsByHierarchy(delimiter2, options = {}) { - if (delimiter2 === "") { - throw new RangeError("delimiter should contain one or more characters"); - } - const include2 = []; - if (options.includeCopy) { - include2.push("copy"); - } - if (options.includeDeleted) { - include2.push("deleted"); - } - if (options.includeMetadata) { - include2.push("metadata"); - } - if (options.includeSnapshots) { - include2.push("snapshots"); - } - if (options.includeVersions) { - include2.push("versions"); - } - if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); - } - if (options.includeTags) { - include2.push("tags"); - } - if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include2.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; + 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); } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, 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(delimiter2, settings.continuationToken, Object.assign({ 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, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ - abortSignal: options.abortSignal, - where: tagFilterSqlExpression, - marker: marker2, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); - return wrappedResponse; - }); - } - /** - * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse. + * Returns an AsyncIterableIterator for Container Items * - * @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. + * @param options - Options to list containers operation. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + async *listItems(options = {}) { + let marker; + for await (const segment of this.listSegments(marker, options)) { + yield* segment.containerItems; + } } /** - * Returns an AsyncIterableIterator for blobs. + * Returns an async iterable iterator to list all the containers + * under the specified account. * - * @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. - */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); - } - /** - * 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 containers in pages. * - * .byPage() returns an async iterable iterator to list the blobs in pages. + * ```ts snippet:BlobServiceClientListContainers + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `for await` syntax: + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * ```js + * // Use for await to iterate the containers * let i = 1; - * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${blob.name}`); + * for await (const container of blobServiceClient.listContainers()) { + * console.log(`Container ${i++}: ${container.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * // 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()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); + * // Use paging with a marker + * i = 1; + * let iterator = blobServiceClient.listContainers().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}`); + * // 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 = containerClient - * .findBlobsByTags("tagkey='tagvalue'") + * iterator = blobServiceClient + * .listContainers() * .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}`); + * // Prints 10 container names + * if (response.containerItems) { + * for (const container of response.containerItems) { + * console.log(`Container ${i++}: ${container.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. + * @param options - Options to list containers. + * @returns An asyncIterableIterator that supports paging. */ - findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); - const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); + 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 @@ -67556,6115 +74261,6656 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(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://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential). * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. + * 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 getAccountInfo(options = {}) { - return tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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; }); } - getContainerNameFromUrl() { - let containerName; + /** + * 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.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"); + }; + } +}); + +// 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 core13 = __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); + core13.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 _a; + const blobClient = new storage_blob_1.BlobClient(signedUploadURL); + const blockBlobClient = blobClient.getBlockBlobClient(); + const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { - const parsedUrl = new URL(this.url); - if (parsedUrl.hostname.split(".")[1] === "blob") { - containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { - containerName = parsedUrl.pathname.split("/")[2]; - } else { - containerName = parsedUrl.pathname.split("/")[1]; + uploadProgress.startDisplayTimer(); + core13.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) { + core13.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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core13 = __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((resolve4) => setTimeout(resolve4, milliseconds)); + }); + } + function retry3(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; + } } - containerName = decodeURIComponent(containerName); - if (!containerName) { - throw new Error("Provided containerName is invalid."); + if (statusCode) { + isRetryable = isRetryableStatusCode(statusCode); + errorMessage = `Cache service responded with ${statusCode}`; } - return containerName; - } catch (error4) { - throw new Error("Unable to extract containerName with provided information."); + core13.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + if (!isRetryable) { + core13.debug(`${name} - Error is not retryable`); + break; + } + yield sleep(delay2); + attempt++; } - } - /** - * 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://docs.microsoft.com/en-us/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((resolve4) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + 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 retry3( + 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; + } } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve4(appendToURLQuery(this.url, sas)); - }); + ); + }); + } + 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 retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); + }); + } + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * Status of whether aborted or not. * - * @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. + * @readonly */ - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - generateSasStringToSign(options) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + get aborted() { + if (!abortedMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } - return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + return abortedMap.get(this); } /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * Creates a new AbortSignal instance that will never be aborted. * - * @returns A new BlobBatchClient object for this container. + * @readonly */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); - } - }; - var AccountSASPermissions = class _AccountSASPermissions { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + static get none() { + return new _AbortSignal(); } /** - * Parse initializes the AccountSASPermissions fields from a string. + * Added new "abort" event listener, only support "abort" event. * - * @param permissions - + * @param _type - Only support "abort" event + * @param listener - The listener to be added */ - 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}`); - } + addEventListener(_type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } - return accountSASPermissions; + const listeners = listenersMap.get(this); + listeners.push(listener); } /** - * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Remove "abort" event listener, only support "abort" event. * - * @param permissionLike - + * @param _type - Only support "abort" event + * @param listener - The listener to be removed */ - 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; + removeEventListener(_type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } - if (permissionLike.permanentDelete) { - accountSASPermissions.permanentDelete = true; + const listeners = listenersMap.get(this); + const index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 1); } - return accountSASPermissions; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas - * + * Dispatches a synthetic event to the AbortSignal. */ - 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(""); + dispatchEvent(_event) { + throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); } }; - var AccountSASResourceTypes = class _AccountSASResourceTypes { - constructor() { - this.service = false; - this.container = false; - this.object = false; + function abortSignal(signal) { + if (signal.aborted) { + return; } - /** - * 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}`); + 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(); + }); } } - return accountSASResourceTypes; } /** - * Converts the given resource types to a string. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * The AbortSignal associated with this controller that will signal aborted + * when the abort method is called on this controller. * + * @readonly */ - toString() { - const resourceTypes = []; - if (this.service) { - resourceTypes.push("s"); - } - if (this.container) { - resourceTypes.push("c"); - } - if (this.object) { - resourceTypes.push("o"); - } - return resourceTypes.join(""); - } - }; - var AccountSASServices = class _AccountSASServices { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; + get signal() { + return this._signal; } /** - * 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 - + * Signal that any operations passed this controller's associated abort signal + * to cancel any remaining work and throw an `AbortError`. */ - 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; + abort() { + abortSignal(this._signal); } /** - * Converts the given services to a string. - * + * Creates a new AbortSignal instance that will abort after the provided ms. + * @param ms - Elapsed time in milliseconds to trigger an abort. */ - 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"); + static timeout(ms) { + const signal = new AbortSignal2(); + const timer = setTimeout(abortSignal, ms, signal); + if (typeof timer.unref === "function") { + timer.unref(); } - return services.join(""); + return signal; } }; - function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { - return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential).sasQueryParameters; - } - function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) { - const version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); - } - if (accountSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); - } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); - let stringToSign; - if (version2 >= "2020-12-06") { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version2, - accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", - "" - // Account SAS requires an additional newline character - ].join("\n"); - } else { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version2, - "" - // Account SAS requires an additional newline character - ].join("\n"); + 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]; + } }; } - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters(version2, 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 + 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); }; - } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { - /** - * - * 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 = extractConnectionStringParts(connectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); - } - const pipeline = newPipeline(sharedKeyCredential, options); - return new _BlobServiceClient(extractedCreds.url, pipeline); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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); } - } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); - return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } - } - constructor(url2, credentialOrPipeline, options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); - } else { - pipeline = newPipeline(new AnonymousCredential(), options); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); } - super(url2, pipeline); - this.serviceContext = this.storageClientContext.service; + 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 core13 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs9 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); + var constants_1 = require_constants7(); + var requestUtils_1 = require_requestUtils(); + var abort_controller_1 = require_dist4(); + function pipeResponseToStream(response, output) { + return __awaiter2(this, void 0, void 0, function* () { + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(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(); } /** - * Creates a {@link ContainerClient} object - * - * @param containerName - A container name - * @returns A new ContainerClient object for the given container name. - * - * Example usage: + * Progress to the next segment. Only call this method when the previous segment + * is complete. * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * ``` + * @param segmentSize the length of the next segment */ - getContainerClient(containerName) { - return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + nextSegment(segmentSize) { + this.segmentOffset = this.segmentOffset + this.segmentSize; + this.segmentIndex = this.segmentIndex + 1; + this.segmentSize = segmentSize; + this.receivedBytes = 0; + core13.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * Sets the number of bytes received for the current segment. * - * @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. + * @param receivedBytes the number of bytes received */ - async createContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(containerName); - const containerCreateResponse = await containerClient.create(updatedOptions); - return { - containerClient, - containerCreateResponse - }; - }); + setReceivedBytes(receivedBytes) { + this.receivedBytes = receivedBytes; } /** - * Deletes a Blob container. - * - * @param containerName - Name of the container to delete. - * @param options - Options to configure Container Delete operation. - * @returns Container deletion response. + * Returns the total number of bytes transferred. */ - async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(containerName); - return containerClient.delete(updatedOptions); - }); + getTransferredBytes() { + return this.segmentOffset + this.receivedBytes; } /** - * 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. + * Returns true if the download is complete. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); - const containerContext = containerClient["storageClientContext"].container; - const containerUndeleteResponse = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, - tracingOptions: updatedOptions.tracingOptions - })); - return { containerClient, containerUndeleteResponse }; - }); + isDone() { + return this.getTransferredBytes() === this.contentLength; } /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. + * Prints the current download stats. Once the download completes, this will print one + * last line and then stop. */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); + 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); + core13.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + if (this.isDone()) { + this.displayedComplete = true; + } } /** - * Gets the properties of a storage account’s Blob service, including properties - * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/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. + * Returns a function used to handle TransferProgressEvents. */ - async getProperties(options = {}) { - return tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + onProgress() { + return (progress) => { + this.setReceivedBytes(progress.loadedBytes); + }; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * Starts the timer that displays the stats. * - * @param properties - - * @param options - Options to the Service Set Properties operation. - * @returns Response data for the Service Set Properties operation. + * @param delayInMs the delay between each write */ - async setProperties(properties, options = {}) { - return tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + startDisplayTimer(delayInMs = 1e3) { + const displayCallback = () => { + this.display(); + if (!this.isDone()) { + this.timeoutHandle = setTimeout(displayCallback, delayInMs); + } + }; + this.timeoutHandle = setTimeout(displayCallback, delayInMs); } /** - * 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://docs.microsoft.com/en-us/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. + * 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. */ - async getStatistics(options = {}) { - return tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + stopDisplayTimer() { + if (this.timeoutHandle) { + clearTimeout(this.timeoutHandle); + this.timeoutHandle = void 0; + } + this.display(); } - /** - * 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://docs.microsoft.com/en-us/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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions + }; + exports2.DownloadProgress = DownloadProgress; + function downloadCacheHttpClient(archiveLocation, archivePath) { + return __awaiter2(this, void 0, void 0, function* () { + const writeStream = fs9.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(); + core13.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 { + core13.debug("Unable to validate download, no Content-Length header"); + } + }); + } + function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const archiveDescriptor = yield fs9.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 >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 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 _a; + 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 = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; + if (contentLength < 0) { + core13.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 = fs9.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)) { + fs9.writeFileSync(fd, result); + } + } + } finally { + downloadProgress.stopDisplayTimer(); + fs9.closeSync(fd); + } + } + }); + } + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { + let timeoutHandle; + const timeoutPromise = new Promise((resolve4) => { + timeoutHandle = setTimeout(() => resolve4("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]; + } }; } - /** - * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/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(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); - }); + 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 core13 = __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; + core13.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core13.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core13.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; + } + core13.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core13.debug(`Download concurrency: ${result.downloadConcurrency}`); + core13.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core13.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core13.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core13.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.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"; + } + 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_package2 = __commonJS({ + "node_modules/@actions/cache/package.json"(exports2, module2) { + module2.exports = { + name: "@actions/cache", + version: "5.0.1", + 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.0", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "@actions/http-client": "^3.0.0", + "@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" } - /** - * 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, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ - abortSignal: options.abortSignal, - where: tagFilterSqlExpression, - marker: marker2, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); - return wrappedResponse; - }); + }; + } +}); + +// 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_package2(); + 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]; + } }; } - /** - * 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. - */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } + 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(resolve4) { + resolve4(value); }); } - /** - * 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. - */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } + step(generator.next(value)); + } catch (e) { + reject(e); } - }); - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let 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 = Object.assign({}, 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, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - }; + } + function step(result) { + result.done ? resolve4(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 = saveCache3; + var core13 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs9 = __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 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."); } - /** - * 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. - */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); + const url = `${baseUrl}_apis/artifactcache/${resource}`; + core13.debug(`Resource Url: ${url}`); + return url; + } + function createAcceptHeader(type2, apiVersion) { + return `${type2};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* () { + 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 (core13.isDebug()) { + yield printCachesListForDiagnostics(keys[0], httpClient, version); } - }); - } - /** - * Returns an AsyncIterableIterator for Container Items - * - * @param options - Options to list containers operation. - */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + return null; + } + if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { + 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."); + } + core13.setSecret(cacheDownloadUrl); + core13.debug(`Cache Result:`); + core13.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) { + core13.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) || []) { + core13.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}`); } } - }); - } - /** - * 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. - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const container of blobServiceClient.listContainers()) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let 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 include2 = []; - if (options.includeDeleted) { - include2.push("deleted"); } - if (options.includeMetadata) { - include2.push("metadata"); + }); + } + 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); } - if (options.includeSystem) { - include2.push("system"); + }); + } + 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* () { + core13.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.`); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - 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, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + }); + } + 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 = fs9.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()]; + core13.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, () => fs9.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 { + fs9.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 saveCache3(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."); } - }; - } - /** - * 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://docs.microsoft.com/en-us/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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, 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 = Object.assign({ _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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this service. - */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); + } else { + const httpClient = createHttpClient(); + core13.debug("Upload cache"); + yield uploadFile(httpClient, cacheId, archivePath, options); + core13.debug("Commiting cache"); + const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.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.`); + } + core13.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"; } - /** - * 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://docs.microsoft.com/en-us/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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); + 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.`); + } } - if (expiresOn2 === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + 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; } - const sas = generateAccountSASQueryParameters(Object.assign({ - permissions, - expiresOn: expiresOn2, - resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return 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://docs.microsoft.com/en-us/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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); + 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 (expiresOn2 === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + } + 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; } - return generateAccountSASQueryParametersInternal(Object.assign({ - permissions, - expiresOn: expiresOn2, - resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; } - }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; + if (parts.length) { + if (i) + parts.push(fromCharCodes(chunk.slice(0, i))); + return parts.join(""); } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; - exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + return fromCharCodes(chunk.slice(0, i)); + } + exports2.utf8read = utf8read; } }); -// node_modules/@actions/cache/lib/internal/shared/errors.js -var require_errors2 = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/errors.js"(exports2) { +// 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.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(", ")}`; + 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]; } - super(message); - this.files = files; - this.name = "FilesNotFoundError"; } - }; - exports2.FilesNotFoundError = FilesNotFoundError; - var InvalidResponseError = class extends Error { - constructor(message) { - super(message); - this.name = "InvalidResponseError"; + let middleByte = this.buf[this.pos++]; + lowBits |= (middleByte & 15) << 28; + highBits = (middleByte & 112) >> 4; + if ((middleByte & 128) == 0) { + this.assertBounds(); + return [lowBits, highBits]; } - }; - exports2.InvalidResponseError = InvalidResponseError; - var CacheNotFoundError = class extends Error { - constructor(message = "Cache not found") { - super(message); - this.name = "CacheNotFoundError"; + 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]; + } } - }; - 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"; + 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_DBL = (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_DBL) { + highBits = highBits + (lowBits / TWO_PWR_32_DBL | 0); + lowBits = lowBits % TWO_PWR_32_DBL; + } + } + 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_DBL * 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; } - }; - 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"; + b = this.buf[this.pos++]; + result |= (b & 127) << 7; + if ((b & 128) == 0) { + this.assertBounds(); + return result; } - }; - 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"; + b = this.buf[this.pos++]; + result |= (b & 127) << 14; + if ((b & 128) == 0) { + this.assertBounds(); + return result; } - }; - exports2.UsageError = UsageError; - UsageError.isUsageErrorMessage = (msg) => { - if (!msg) - return false; - return msg.includes("insufficient usage"); - }; + 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/@actions/cache/lib/internal/uploadUtils.js -var require_uploadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core13 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); - var errors_1 = require_errors2(); - var UploadProgress = class { - constructor(contentLength) { - this.contentLength = contentLength; - this.sentBytes = 0; - this.displayedComplete = false; - this.startTime = Date.now(); - } + 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_DBL = 4294967296; + var HALF_2_PWR_32 = 2147483648; + var SharedPbLong = class { /** - * Sets the number of bytes sent - * - * @param sentBytes the number of bytes sent + * Create a new instance with the given bits. */ - setSentBytes(sentBytes) { - this.sentBytes = sentBytes; + constructor(lo, hi) { + this.lo = lo | 0; + this.hi = hi | 0; } /** - * Returns the total number of bytes transferred. + * Is this instance equal to 0? */ - getTransferredBytes() { - return this.sentBytes; + isZero() { + return this.lo == 0 && this.hi == 0; } /** - * Returns true if the upload is complete. + * Convert to a native number. */ - isDone() { - return this.getTransferredBytes() === this.contentLength; + toNumber() { + let result = this.hi * TWO_PWR_32_DBL + (this.lo >>> 0); + if (!Number.isSafeInteger(result)) + throw new Error("cannot convert to safe number"); + return result; } + }; + var PbULong = class _PbULong extends SharedPbLong { /** - * Prints the current upload stats. Once the upload completes, this will print one - * last line and then stop. + * Create instance from a `string`, `number` or `bigint`. */ - 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); - core13.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); - if (this.isDone()) { - this.displayedComplete = true; - } + 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_DBL); + } + throw new Error("unknown value " + typeof value); } /** - * Returns a function used to handle TransferProgressEvents. + * Convert to decimal string. */ - onProgress() { - return (progress) => { - this.setSentBytes(progress.loadedBytes); - }; + toString() { + return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); } /** - * Starts the timer that displays the stats. - * - * @param delayInMs the delay between each write + * Convert to native bigint. */ - startDisplayTimer(delayInMs = 1e3) { - const displayCallback = () => { - this.display(); - if (!this.isDone()) { - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - }; - this.timeoutHandle = setTimeout(displayCallback, delayInMs); + 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 { /** - * 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. + * Create instance from a `string`, `number` or `bigint`. */ - stopDisplayTimer() { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - this.timeoutHandle = void 0; - } - this.display(); - } - }; - exports2.UploadProgress = UploadProgress; - function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const blobClient = new storage_blob_1.BlobClient(signedUploadURL); - const blockBlobClient = blobClient.getBlockBlobClient(); - const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 0); - const uploadOptions = { - blockSize: options === null || options === void 0 ? void 0 : options.uploadChunkSize, - concurrency: options === null || options === void 0 ? void 0 : options.uploadConcurrency, - maxSingleShotSize: 128 * 1024 * 1024, - onProgress: uploadProgress.onProgress() - }; - try { - uploadProgress.startDisplayTimer(); - core13.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 (error4) { - core13.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; - } finally { - uploadProgress.stopDisplayTimer(); - } - }); - } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - } -}); - -// node_modules/@actions/cache/lib/internal/requestUtils.js -var require_requestUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core13 = __importStar4(require_core()); - var http_client_1 = require_lib3(); - var constants_1 = require_constants7(); - function isSuccessStatusCode(statusCode) { - if (!statusCode) { - return false; - } - return statusCode >= 200 && statusCode < 300; - } - exports2.isSuccessStatusCode = isSuccessStatusCode; - function isServerErrorStatusCode(statusCode) { - if (!statusCode) { - return true; - } - return statusCode >= 500; - } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; - 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); - } - exports2.isRetryableStatusCode = isRetryableStatusCode; - function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => setTimeout(resolve4, milliseconds)); - }); - } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { - let errorMessage = ""; - let attempt = 1; - while (attempt <= maxAttempts) { - let response = void 0; - let statusCode = void 0; - let isRetryable = false; - try { - response = yield method(); - } catch (error4) { - if (onError) { - response = onError(error4); - } - isRetryable = true; - errorMessage = error4.message; - } - if (response) { - statusCode = getStatusCode(response); - if (!isServerErrorStatusCode(statusCode)) { - return response; - } - } - if (statusCode) { - isRetryable = isRetryableStatusCode(statusCode); - errorMessage = `Cache service responded with ${statusCode}`; - } - core13.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); - if (!isRetryable) { - core13.debug(`${name} - Error is not retryable`); - break; - } - yield sleep(delay2); - attempt++; - } - throw Error(`${name} failed: ${errorMessage}`); - }); - } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3( - 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. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { - return { - statusCode: error4.statusCode, - result: null, - headers: {}, - error: error4 - }; - } else { - return void 0; - } + 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)); } - ); - }); - } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); - }); - } - exports2.retryHttpClientResponse = retryHttpClientResponse; - } -}); - -// node_modules/@actions/cache/lib/internal/downloadUtils.js -var require_downloadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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_DBL) : new _PbLong(-value, -value / TWO_PWR_32_DBL).negate(); + } + throw new Error("unknown value " + typeof value); } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + /** + * Do we have a minus sign? + */ + isNegative() { + return (this.hi & HALF_2_PWR_32) !== 0; } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + /** + * 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); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core13 = __importStar4(require_core()); - var http_client_1 = require_lib3(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs9 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); - function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { - const pipeline = util.promisify(stream2.pipeline); - yield pipeline(response.message, output); - }); + 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; } - 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(); + 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 + }); } /** - * Progress to the next segment. Only call this method when the previous segment - * is complete. - * - * @param segmentSize the length of the next segment + * Reads a tag - field number and wire type. */ - nextSegment(segmentSize) { - this.segmentOffset = this.segmentOffset + this.segmentSize; - this.segmentIndex = this.segmentIndex + 1; - this.segmentSize = segmentSize; - this.receivedBytes = 0; - core13.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + 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]; } /** - * Sets the number of bytes received for the current segment. - * - * @param receivedBytes the number of bytes received + * Skip one element on the wire and return the skipped data. + * Supports WireType.StartGroup since v2.0.0-alpha.23. */ - setReceivedBytes(receivedBytes) { - this.receivedBytes = receivedBytes; + 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); } /** - * Returns the total number of bytes transferred. + * Throws error if position in byte array is out of range. */ - getTransferredBytes() { - return this.segmentOffset + this.receivedBytes; + assertBounds() { + if (this.pos > this.len) + throw new RangeError("premature EOF"); } /** - * Returns true if the download is complete. + * Read a `int32` field, a signed 32 bit varint. */ - isDone() { - return this.getTransferredBytes() === this.contentLength; + int32() { + return this.uint32() | 0; } /** - * Prints the current download stats. Once the download completes, this will print one - * last line and then stop. + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. */ - 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); - core13.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); - if (this.isDone()) { - this.displayedComplete = true; - } + sint32() { + let zze = this.uint32(); + return zze >>> 1 ^ -(zze & 1); } /** - * Returns a function used to handle TransferProgressEvents. + * Read a `int64` field, a signed 64-bit varint. */ - onProgress() { - return (progress) => { - this.setReceivedBytes(progress.loadedBytes); - }; + int64() { + return new pb_long_1.PbLong(...this.varint64()); } /** - * Starts the timer that displays the stats. - * - * @param delayInMs the delay between each write + * Read a `uint64` field, an unsigned 64-bit varint. */ - startDisplayTimer(delayInMs = 1e3) { - const displayCallback = () => { - this.display(); - if (!this.isDone()) { - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - }; - this.timeoutHandle = setTimeout(displayCallback, delayInMs); + uint64() { + return new pb_long_1.PbULong(...this.varint64()); } /** - * 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. + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. */ - stopDisplayTimer() { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - this.timeoutHandle = void 0; - } - this.display(); + 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); } - }; - exports2.DownloadProgress = DownloadProgress; - function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { - const writeStream = fs9.createWriteStream(archivePath); - const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.get(archiveLocation); - })); - downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { - downloadResponse.message.destroy(); - core13.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 { - core13.debug("Unable to validate download, no Content-Length header"); - } - }); - } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; - function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs9.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", () => __awaiter4(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: () => __awaiter4(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 = () => __awaiter4(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 >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 10)) { - yield waitAndWrite(); - } - } - while (actives > 0) { - yield waitAndWrite(); - } - } finally { - httpClient.dispose(); - yield archiveDescriptor.close(); - } - }); - } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; - function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(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) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - 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 = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; - if (contentLength < 0) { - core13.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 = fs9.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)) { - fs9.writeFileSync(fd, result); - } - } - } finally { - downloadProgress.stopDisplayTimer(); - fs9.closeSync(fd); - } - } - }); - } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { - let timeoutHandle; - const timeoutPromise = new Promise((resolve4) => { - timeoutHandle = setTimeout(() => resolve4("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 __createBinding4 = 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]; - } }; + /** + * Read a `bool` field, a variant. + */ + bool() { + let [lo, hi] = this.varint64(); + return lo !== 0 || hi !== 0; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32() { + return this.view.getUint32((this.pos += 4) - 4, true); } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getDownloadOptions = exports2.getUploadOptions = void 0; - var core13 = __importStar4(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; - } + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32() { + return this.view.getInt32((this.pos += 4) - 4, true); } - 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; - core13.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core13.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core13.debug(`Upload chunk size: ${result.uploadChunkSize}`); - return result; - } - exports2.getUploadOptions = getUploadOptions; - 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; - } + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64() { + return new pb_long_1.PbULong(this.sfixed32(), this.sfixed32()); } - const segmentDownloadTimeoutMins = process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]; - if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { - result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64() { + return new pb_long_1.PbLong(this.sfixed32(), this.sfixed32()); } - core13.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core13.debug(`Download concurrency: ${result.downloadConcurrency}`); - core13.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core13.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core13.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core13.debug(`Lookup only: ${result.lookupOnly}`); - return result; - } - exports2.getDownloadOptions = getDownloadOptions; + /** + * 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/@actions/cache/lib/internal/config.js -var require_config = __commonJS({ - "node_modules/@actions/cache/lib/internal/config.js"(exports2) { +// 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.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; - 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.assertFloat32 = exports2.assertUInt32 = exports2.assertInt32 = exports2.assertNever = exports2.assert = void 0; + function assert(condition, msg) { + if (!condition) { + throw new Error(msg); + } } - exports2.isGhes = isGhes; - function getCacheServiceVersion() { - if (isGhes()) - return "v1"; - return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; + exports2.assert = assert; + function assertNever2(value, msg) { + throw new Error(msg !== null && msg !== void 0 ? msg : "Unexpected object: " + value); } - exports2.getCacheServiceVersion = getCacheServiceVersion; - 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}`); - } + 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.getCacheServiceURL = getCacheServiceURL; - } -}); - -// node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ - "node_modules/@actions/cache/package.json"(exports2, module2) { - module2.exports = { - name: "@actions/cache", - version: "4.1.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": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", - "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", - "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", - semver: "^6.3.1" - }, - devDependencies: { - "@types/node": "^22.13.9", - "@types/semver": "^6.0.0", - "@protobuf-ts/plugin": "^2.9.4", - typescript: "^5.2.2" - } - }; + 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/@actions/cache/lib/internal/shared/user-agent.js -var require_user_agent = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/user-agent.js"(exports2) { +// 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.getUserAgentString = void 0; - var packageJson = require_package2(); - function getUserAgentString() { - return `@actions/cache-${packageJson.version}`; + 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.getUserAgentString = getUserAgentString; - } -}); - -// node_modules/@actions/cache/lib/internal/cacheHttpClient.js -var require_cacheHttpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + exports2.binaryWriteOptions = binaryWriteOptions; + var BinaryWriter = class { + constructor(textEncoder) { + this.stack = []; + this.textEncoder = textEncoder !== null && textEncoder !== void 0 ? textEncoder : new TextEncoder(); + this.chunks = []; + this.buf = []; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + /** + * 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + /** + * 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; } - return new (P || (P = Promise))(function(resolve4, 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); - } + /** + * 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, type2) { + return this.uint32((fieldNo << 3 | type2) >>> 0); + } + /** + * Write a chunk of raw bytes. + */ + raw(chunk) { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); + this.buf = []; } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + 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; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core13 = __importStar4(require_core()); - var http_client_1 = require_lib3(); - var auth_1 = require_auth2(); - var fs9 = __importStar4(require("fs")); - var url_1 = require("url"); - var utils = __importStar4(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 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 url = `${baseUrl}_apis/artifactcache/${resource}`; - core13.debug(`Resource Url: ${url}`); - return url; - } - function createAcceptHeader(type2, apiVersion) { - return `${type2};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 __awaiter4(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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.getJson(getCacheApiUrl(resource)); - })); - if (response.statusCode === 204) { - if (core13.isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version); - } - return null; - } - if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { - 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."); - } - core13.setSecret(cacheDownloadUrl); - core13.debug(`Cache Result:`); - core13.debug(JSON.stringify(cacheResult)); - return cacheResult; - }); + 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.getCacheEntry = getCacheEntry; - function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { - const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(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) { - core13.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) || []) { - core13.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}`); - } - } - } - }); + exports2.jsonReadOptions = jsonReadOptions; + function jsonWriteOptions(options) { + return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; } - function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(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); - } + exports2.jsonWriteOptions = jsonWriteOptions; + function mergeJsonOptions(a, b) { + var _a, _b; + let c = Object.assign(Object.assign({}, a), b); + c.typeRegistry = [...(_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : [], ...(_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 { - yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); + sb.push(next); } - }); - } - exports2.downloadCache = downloadCache; - function reserveCache(key, paths, options) { - return __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); - })); - return response; - }); - } - exports2.reserveCache = reserveCache; - function getContentRange(start, end) { - return `bytes ${start}-${end}/*`; + } + return sb.join(""); } - function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { - core13.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})`, () => __awaiter4(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.`); - } - }); + 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 _a, _b, _c, _d; + field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : 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; } - function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { - const fileSize = utils.getArchiveFileSizeInBytes(archivePath); - const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs9.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()]; - core13.debug("Awaiting all uploads"); - let offset = 0; - try { - yield Promise.all(parallelUploads.map(() => __awaiter4(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, () => fs9.createReadStream(archivePath, { - fd, - start, - end, - autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); - }), start, end); - } - }))); - } finally { - fs9.closeSync(fd); - } - return; - }); + exports2.normalizeFieldInfo = normalizeFieldInfo; + function readFieldOptions(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; } - function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { - const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); - })); - }); + exports2.readFieldOptions = readFieldOptions; + function readFieldOption(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; + if (!options) { + return void 0; + } + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; + } + return extensionType ? extensionType.fromJson(optionVal) : optionVal; } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(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(); - core13.debug("Upload cache"); - yield uploadFile(httpClient, cacheId, archivePath, options); - core13.debug("Commiting cache"); - const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.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.`); - } - core13.info("Cache saved successfully"); - } - }); + 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.saveCache = saveCache3; + exports2.readMessageOption = readMessageOption; } }); -// 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) { +// 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.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"; + 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; } - return t; } - exports2.typeofJsonValue = typeofJsonValue; - function isJsonObject(value) { - return value !== null && typeof value == "object" && !Array.isArray(value); + exports2.isOneofGroup = isOneofGroup; + function getOneofValue(oneof, kind) { + return oneof[kind]; } - exports2.isJsonObject = isJsonObject; + 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/base64.js -var require_base642 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/base64.js"(exports2) { +// 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.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.`); + exports2.ReflectionTypeCheck = void 0; + var reflection_info_1 = require_reflection_info(); + var oneof_1 = require_oneof(); + var ReflectionTypeCheck = class { + constructor(info6) { + var _a; + this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; + } + 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; + } } } - 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; + 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; } - 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; + 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; } - if (groupPos) { - base64 += encTable[p]; - base64 += "="; - if (groupPos == 1) - base64 += "="; + message(arg, type2, allowExcessProperties, depth) { + if (allowExcessProperties) { + return type2.isAssignable(arg, depth); + } + return type2.is(arg, depth); } - 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; + messages(arg, type2, 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 (!type2.isAssignable(arg[i], depth - 1)) + return false; + } else { + for (let i = 0; i < arg.length && i < depth; i++) + if (!type2.is(arg[i], depth - 1)) + return false; + } + return true; + } + scalar(arg, type2, longType) { + let argType = typeof arg; + switch (type2) { + 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); } } - if (parts.length) { - if (i) - parts.push(fromCharCodes(chunk.slice(0, i))); - return parts.join(""); + scalars(arg, type2, 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], type2, longType)) + return false; + } + return true; } - return fromCharCodes(chunk.slice(0, i)); - } - exports2.utf8read = utf8read; + mapKeys(map2, type2, depth) { + let keys = Object.keys(map2); + switch (type2) { + 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)), type2, depth); + case reflection_info_1.ScalarType.BOOL: + return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type2, depth); + default: + return this.scalars(keys, type2, depth, reflection_info_1.LongType.STRING); + } + } + }; + exports2.ReflectionTypeCheck = ReflectionTypeCheck; } }); -// 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) { +// 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.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; - var UnknownFieldHandler; - (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = 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.reflectionLongConvert = void 0; + var reflection_info_1 = require_reflection_info(); + function reflectionLongConvert(long, type2) { + switch (type2) { + case reflection_info_1.LongType.BIGINT: + return long.toBigInt(); + case reflection_info_1.LongType.NUMBER: + return long.toNumber(); + default: + return long.toString(); + } } - 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 = {})); + exports2.reflectionLongConvert = reflectionLongConvert; } }); -// 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) { +// 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.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]; - } + 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(info6) { + this.info = info6; } - 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; + prepare() { + var _a; + if (this.fMap === void 0) { + this.fMap = {}; + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + for (const field of fieldsInput) { + this.fMap[field.name] = field; + this.fMap[field.jsonName] = field; + this.fMap[field.localName] = field; + } } } - 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; + // 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}`); } } - bytes.push(hi >>> 31 & 1); - } - exports2.varint64write = varint64write; - var TWO_PWR_32_DBL = (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_DBL) { - highBits = highBits + (lowBits / TWO_PWR_32_DBL | 0); - lowBits = lowBits % TWO_PWR_32_DBL; + /** + * 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; + } + } } } - 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_DBL * 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; + /** + * Returns `false` for unrecognized string representations. + * + * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). + */ + enum(type2, json2, fieldName, ignoreUnknownFields) { + if (type2[0] == "google.protobuf.NullValue") + assert_1.assert(json2 === null || json2 === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); + if (json2 === null) + return 0; + switch (typeof json2) { + case "number": + assert_1.assert(Number.isInteger(json2), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json2}.`); + return json2; + case "string": + let localEnumName = json2; + if (type2[2] && json2.substring(0, type2[2].length) === type2[2]) + localEnumName = json2.substring(type2[2].length); + let enumNumber = type2[1][localEnumName]; + if (typeof enumNumber === "undefined" && ignoreUnknownFields) { + return false; + } + assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json2}".`); + return enumNumber; } - return partial; + assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json2}".`); } - 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; + scalar(json2, type2, longType, fieldName) { + let e; + try { + switch (type2) { + // 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 (json2 === null) + return 0; + if (json2 === "NaN") + return Number.NaN; + if (json2 === "Infinity") + return Number.POSITIVE_INFINITY; + if (json2 === "-Infinity") + return Number.NEGATIVE_INFINITY; + if (json2 === "") { + e = "empty string"; + break; + } + if (typeof json2 == "string" && json2.trim().length !== json2.length) { + e = "extra whitespace"; + break; + } + if (typeof json2 != "string" && typeof json2 != "number") { + break; + } + let float2 = Number(json2); + if (Number.isNaN(float2)) { + e = "not a number"; + break; + } + if (!Number.isFinite(float2)) { + e = "too large or small"; + break; + } + if (type2 == reflection_info_1.ScalarType.FLOAT) + assert_1.assertFloat32(float2); + return float2; + // 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 (json2 === null) + return 0; + let int32; + if (typeof json2 == "number") + int32 = json2; + else if (json2 === "") + e = "empty string"; + else if (typeof json2 == "string") { + if (json2.trim().length !== json2.length) + e = "extra whitespace"; + else + int32 = Number(json2); + } + if (int32 === void 0) + break; + if (type2 == 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 (json2 === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); + if (typeof json2 != "number" && typeof json2 != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json2), longType); + case reflection_info_1.ScalarType.FIXED64: + case reflection_info_1.ScalarType.UINT64: + if (json2 === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); + if (typeof json2 != "number" && typeof json2 != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json2), longType); + // bool: + case reflection_info_1.ScalarType.BOOL: + if (json2 === null) + return false; + if (typeof json2 !== "boolean") + break; + return json2; + // string: + case reflection_info_1.ScalarType.STRING: + if (json2 === null) + return ""; + if (typeof json2 !== "string") { + e = "extra whitespace"; + break; + } + try { + encodeURIComponent(json2); + } catch (e2) { + e2 = "invalid UTF8"; + break; + } + return json2; + // 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 (json2 === null || json2 === "") + return new Uint8Array(0); + if (typeof json2 !== "string") + break; + return base64_1.base64decode(json2); + } + } catch (error3) { + e = error3.message; } - 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; + this.assert(false, fieldName + (e ? " - " + e : ""), json2); } - 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; + }; + exports2.ReflectionJsonReader = ReflectionJsonReader; } }); -// 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) { +// 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.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_DBL = 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; + 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(info6) { + var _a; + this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; } /** - * Convert to a native number. + * Converts the message to a JSON object, based on the field descriptors. */ - toNumber() { - let result = this.hi * TWO_PWR_32_DBL + (this.lo >>> 0); - if (!Number.isSafeInteger(result)) - throw new Error("cannot convert to safe number"); - return result; + write(message, options) { + const json2 = {}, source = message; + for (const field of this.fields) { + if (!field.oneof) { + let jsonValue2 = this.field(field, source[field.localName], options); + if (jsonValue2 !== void 0) + json2[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); + json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; + } + return json2; } - }; - 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)); + 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; } - 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_DBL); + 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; } - throw new Error("unknown value " + typeof value); + 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; } /** - * Convert to decimal string. + * Returns `null` as the default for google.protobuf.NullValue. */ - toString() { - return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); + enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { + if (type2[0] == "google.protobuf.NullValue") + return !emitDefaultValues && !optional ? void 0 : null; + if (value === void 0) { + assert_1.assert(optional); + return void 0; + } + if (value === 0 && !emitDefaultValues && !optional) + return void 0; + assert_1.assert(typeof value == "number"); + assert_1.assert(Number.isInteger(value)); + if (enumAsInteger || !type2[1].hasOwnProperty(value)) + return value; + if (type2[2]) + return type2[2] + type2[1][value]; + return type2[1][value]; } - /** - * 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); + message(type2, value, fieldName, options) { + if (value === void 0) + return options.emitDefaultValues ? null : void 0; + return type2.internalJsonWrite(value, options); + } + scalar(type2, value, fieldName, optional, emitDefaultValues) { + if (value === void 0) { + assert_1.assert(optional); + return void 0; + } + const ed = emitDefaultValues || optional; + switch (type2) { + // 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.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_DBL) : new _PbLong(-value, -value / TWO_PWR_32_DBL).negate(); - } - throw new Error("unknown value " + typeof 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(type2, longType = reflection_info_1.LongType.STRING) { + switch (type2) { + 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; } - /** - * Do we have a minus sign? - */ - isNegative() { - return (this.hi & HALF_2_PWR_32) !== 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(info6) { + this.info = info6; } - /** - * 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); + prepare() { + var _a; + if (!this.fieldNoToField) { + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); + } } /** - * Convert to decimal string. + * 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. */ - toString() { - if (BI) - return this.toBigInt().toString(); - if (this.isNegative()) { - let n = this.negate(); - return "-" + goog_varint_1.int64toString(n.lo, n.hi); + 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; + } } - return goog_varint_1.int64toString(this.lo, this.hi); } /** - * Convert to native bigint. + * Read a map field, expecting key field = 1, value field = 2 */ - toBigInt() { - assertBi(BI); - BI.V.setInt32(0, this.lo, true); - BI.V.setInt32(4, this.hi, true); - return BI.V.getBigInt64(0, true); + 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, type2, longType) { + switch (type2) { + 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.PbLong = PbLong; - PbLong.ZERO = new PbLong(0, 0); + exports2.ReflectionBinaryReader = ReflectionBinaryReader; } }); -// 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) { +// 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.BinaryReader = exports2.binaryReadOptions = void 0; + 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 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 - }); + var ReflectionBinaryWriter = class { + constructor(info6) { + this.info = info6; } - /** - * 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]; + prepare() { + if (!this.fields) { + const fieldsInput = this.info.fields ? this.info.fields.concat() : []; + this.fields = fieldsInput.sort((a, b) => a.no - b.no); + } } /** - * Skip one element on the wire and return the skipped data. - * Supports WireType.StartGroup since v2.0.0-alpha.23. + * Writes the message to binary format. */ - skip(wireType) { - let start = this.pos; - switch (wireType) { - case binary_format_contract_1.WireType.Varint: - while (this.buf[this.pos++] & 128) { - } + 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 binary_format_contract_1.WireType.Bit64: - this.pos += 4; - case binary_format_contract_1.WireType.Bit32: - this.pos += 4; + case reflection_info_1.ScalarType.BOOL: + assert_1.assert(key == "true" || key == "false"); + keyValue = key == "true"; break; - case binary_format_contract_1.WireType.LengthDelimited: - let len = this.uint32(); - this.pos += len; + } + 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 binary_format_contract_1.WireType.StartGroup: - let t; - while ((t = this.tag()[1]) !== binary_format_contract_1.WireType.EndGroup) { - this.skip(t); - } + 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; - 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()); + writer.join(); } - /** - * Read a `fixed64` field, a signed, fixed-length 64-bit integer. - */ - sfixed64() { - return new pb_long_1.PbLong(this.sfixed32(), this.sfixed32()); + message(writer, options, handler, fieldNo, value) { + if (value === void 0) + return; + handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); + writer.join(); } /** - * Read a `float` field, 32-bit floating point number. + * Write a single scalar value. */ - float() { - return this.view.getFloat32((this.pos += 4) - 4, true); + scalar(writer, type2, fieldNo, value, emitDefault) { + let [wireType, method, isDefault] = this.scalarInfo(type2, value); + if (!isDefault || emitDefault) { + writer.tag(fieldNo, wireType); + writer[method](value); + } } /** - * Read a `double` field, a 64-bit floating point number. + * Write an array of scalar values in packed format. */ - double() { - return this.view.getFloat64((this.pos += 8) - 8, true); + packed(writer, type2, fieldNo, value) { + if (!value.length) + return; + assert_1.assert(type2 !== reflection_info_1.ScalarType.BYTES && type2 !== reflection_info_1.ScalarType.STRING); + writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); + writer.fork(); + let [, method] = this.scalarInfo(type2); + for (let i = 0; i < value.length; i++) + writer[method](value[i]); + writer.join(); } /** - * Read a `bytes` field, length-delimited arbitrary data. + * 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. */ - bytes() { - let len = this.uint32(); - let start = this.pos; - this.pos += len; - this.assertBounds(); - return this.buf.subarray(start, start + len); + scalarInfo(type2, value) { + let t = binary_format_contract_1.WireType.Varint; + let m; + let i = value === void 0; + let d = value === 0; + switch (type2) { + 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]; } - /** - * Read a `string` field, length-delimited data converted to UTF-8 text. - */ - string() { - return this.textDecoder.decode(this.bytes()); + }; + 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(type2) { + const msg = type2.messagePrototype ? Object.create(type2.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type2 }); + for (let field of type2.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; + } } - }; - exports2.BinaryReader = BinaryReader; + return msg; + } + exports2.reflectionCreate = reflectionCreate; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/assert.js -var require_assert = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/assert.js"(exports2) { +// 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.assertFloat32 = exports2.assertUInt32 = exports2.assertInt32 = exports2.assertNever = exports2.assert = void 0; - function assert(condition, msg) { - if (!condition) { - throw new Error(msg); + exports2.reflectionMergePartial = void 0; + function reflectionMergePartial(info6, target, source) { + let fieldValue, input = source, output; + for (let field of info6.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.assert = assert; - function assertNever2(value, msg) { - throw new Error(msg !== null && msg !== void 0 ? msg : "Unexpected object: " + value); + 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(info6, a, b) { + if (a === b) + return true; + if (!a || !b) + return false; + for (let field of info6.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.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.reflectionEquals = reflectionEquals; + var objectValues = Object.values; + function primitiveEq(type2, a, b) { + if (a === b) + return true; + if (type2 !== 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; } - 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); + function repeatedPrimitiveEq(type2, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!primitiveEq(type2, a[i], b[i])) + return false; + return true; } - 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); + function repeatedMsgEq(type2, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!type2.equals(a[i], b[i])) + return false; + return true; } - 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) { +// 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.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 = []; + 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); } - /** - * 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; + create(value) { + let message = reflection_create_1.reflectionCreate(this); + if (value !== void 0) { + reflection_merge_partial_1.reflectionMergePartial(this, message, value); } - 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); + return message; } /** - * Writes a tag (field number and wire type). - * - * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * Clone the message. * - * Generated code should compute the tag ahead of time and call `uint32()`. - */ - tag(fieldNo, type2) { - return this.uint32((fieldNo << 3 | type2) >>> 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. + * Unknown fields are discarded. */ - double(value) { - let chunk = new Uint8Array(8); - new DataView(chunk.buffer).setFloat64(0, value, true); - return this.raw(chunk); + clone(message) { + let copy = this.create(); + reflection_merge_partial_1.reflectionMergePartial(this, copy, message); + return copy; } /** - * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + * 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`. */ - fixed32(value) { - assert_1.assertUInt32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setUint32(0, value, true); - return this.raw(chunk); + equals(a, b) { + return reflection_equals_1.reflectionEquals(this, a, b); } /** - * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + * 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)? */ - sfixed32(value) { - assert_1.assertInt32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setInt32(0, value, true); - return this.raw(chunk); + is(arg, depth = this.defaultCheckDepth) { + return this.refTypeCheck.is(arg, depth, false); } /** - * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + * Is the given value assignable to our message type, + * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? */ - sint32(value) { - assert_1.assertInt32(value); - value = (value << 1 ^ value >> 31) >>> 0; - goog_varint_1.varint32write(value, this.buf); - return this; + isAssignable(arg, depth = this.defaultCheckDepth) { + return this.refTypeCheck.is(arg, depth, true); } /** - * Write a `fixed64` value, a signed, fixed-length 64-bit integer. + * Copy partial data into the target message. */ - 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); + mergePartial(target, source) { + reflection_merge_partial_1.reflectionMergePartial(this, target, source); } /** - * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + * Create a new message from binary format. */ - 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); + fromBinary(data, options) { + let opt = binary_reader_1.binaryReadOptions(options); + return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt); } /** - * Write a `int64` value, a signed 64-bit varint. + * Read a new message from a JSON value. */ - int64(value) { - let long = pb_long_1.PbLong.from(value); - goog_varint_1.varint64write(long.lo, long.hi, this.buf); - return this; + fromJson(json2, options) { + return this.internalJsonRead(json2, json_format_contract_1.jsonReadOptions(options)); } /** - * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + * Read a new message from a JSON string. + * This is equivalent to `T.fromJson(JSON.parse(json))`. */ - 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; + fromJsonString(json2, options) { + let value = JSON.parse(json2); + return this.fromJson(value, options); } /** - * Write a `uint64` value, an unsigned 64-bit varint. + * Write the message to canonical JSON value. */ - 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 _a, _b; - let c = Object.assign(Object.assign({}, a), b); - c.typeRegistry = [...(_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : [], ...(_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 = 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); + 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 _a; + let value = this.toJson(message, options); + return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 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(json2, options, target) { + if (json2 !== null && typeof json2 == "object" && !Array.isArray(json2)) { + let message = target !== null && target !== void 0 ? target : this.create(); + this.refJsonReader.read(json2, message, options); + return message; } + throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json2)}.`); } - return sb.join(""); - } - exports2.lowerCamelCase = lowerCamelCase; + /** + * 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-info.js -var require_reflection_info = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-info.js"(exports2) { +// 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.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 _a, _b, _c, _d; - field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : 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 _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readFieldOptions = readFieldOptions; - function readFieldOption(messageType, fieldName, extensionName, extensionType) { - var _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.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.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.readMessageOption = readMessageOption; + exports2.containsMessageType = containsMessageType; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js -var require_oneof = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js"(exports2) { +// 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.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")) { + exports2.listEnumNumbers = exports2.listEnumNames = exports2.listEnumValues = exports2.isEnumObject = void 0; + function isEnumObject(arg) { + if (typeof arg != "object" || arg === null) { 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]; + if (!arg.hasOwnProperty(0)) { + return false; } - oneof.oneofKind = kind; - if (value !== void 0) { - oneof[kind] = value; + 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.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.isEnumObject = isEnumObject; + function listEnumValues(enumObject) { + if (!isEnumObject(enumObject)) + throw new Error("not a typescript enum object"); + let values = []; + for (let [name, number] of Object.entries(enumObject)) + if (typeof number == "number") + values.push({ name, number }); + return values; } - exports2.setUnknownOneofValue = setUnknownOneofValue; - function clearOneofValue(oneof) { - if (oneof.oneofKind !== void 0) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = void 0; + exports2.listEnumValues = listEnumValues; + function listEnumNames(enumObject) { + return listEnumValues(enumObject).map((val) => val.name); } - exports2.clearOneofValue = clearOneofValue; - function getSelectedOneofValue(oneof) { - if (oneof.oneofKind === void 0) { - return void 0; - } - return oneof[oneof.oneofKind]; + exports2.listEnumNames = listEnumNames; + function listEnumNumbers(enumObject) { + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } - exports2.getSelectedOneofValue = getSelectedOneofValue; + exports2.listEnumNumbers = listEnumNumbers; } }); -// 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) { +// 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 }); - exports2.ReflectionTypeCheck = void 0; + 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(); - var oneof_1 = require_oneof(); - var ReflectionTypeCheck = class { - constructor(info6) { - var _a; - this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; - } - 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, type2, allowExcessProperties, depth) { - if (allowExcessProperties) { - return type2.isAssignable(arg, depth); - } - return type2.is(arg, depth); - } - messages(arg, type2, 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 (!type2.isAssignable(arg[i], depth - 1)) - return false; - } else { - for (let i = 0; i < arg.length && i < depth; i++) - if (!type2.is(arg[i], depth - 1)) - return false; - } - return true; + 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 _a, _b, _c; + let m = method; + m.service = service; + m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : 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 _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; + } + exports2.readMethodOptions = readMethodOptions; + function readMethodOption(service, methodName, extensionName, extensionType) { + var _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + if (!options) { + return void 0; } - scalar(arg, type2, longType) { - let argType = typeof arg; - switch (type2) { - 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); - } + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; } - scalars(arg, type2, 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], type2, longType)) - return false; - } - return true; + return extensionType ? extensionType.fromJson(optionVal) : optionVal; + } + exports2.readMethodOption = readMethodOption; + function readServiceOption(service, extensionName, extensionType) { + const options = service.options; + if (!options) { + return void 0; } - mapKeys(map2, type2, depth) { - let keys = Object.keys(map2); - switch (type2) { - 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)), type2, depth); - case reflection_info_1.ScalarType.BOOL: - return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type2, depth); - default: - return this.scalars(keys, type2, depth, reflection_info_1.LongType.STRING); - } + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; } - }; - exports2.ReflectionTypeCheck = ReflectionTypeCheck; + return extensionType ? extensionType.fromJson(optionVal) : optionVal; + } + exports2.readServiceOption = readServiceOption; } }); -// 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) { +// 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.reflectionLongConvert = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionLongConvert(long, type2) { - switch (type2) { - case reflection_info_1.LongType.BIGINT: - return long.toBigInt(); - case reflection_info_1.LongType.NUMBER: - return long.toNumber(); - default: - return long.toString(); + 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.reflectionLongConvert = reflectionLongConvert; + }; + exports2.ServiceType = ServiceType; } }); -// 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) { +// 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.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(info6) { - this.info = info6; + 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 : {}; } - prepare() { - var _a; - if (this.fMap === void 0) { - this.fMap = {}; - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - for (const field of fieldsInput) { - this.fMap[field.name] = field; - this.fMap[field.jsonName] = field; - this.fMap[field.localName] = field; - } + toString() { + const l = [this.name + ": " + this.message]; + if (this.code) { + l.push(""); + l.push("Code: " + this.code); } - } - // 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}`); + if (this.serviceName && this.methodName) { + l.push("Method: " + this.serviceName + "/" + this.methodName); } - } - /** - * 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 val2; - switch (field.V.kind) { - case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); - break; - case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - break; - case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); - break; - } - this.assert(val2 !== 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] = val2; - } - } 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 val2; - switch (field.kind) { - case "message": - val2 = field.T().internalJsonRead(jsonItem, options); - break; - case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - break; - case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); - break; - } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); - } - } 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 val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - target[localName] = val2; - break; - case "scalar": - if (jsonValue === null) - continue; - target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); - break; - } + 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"); } - /** - * Returns `false` for unrecognized string representations. - * - * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). - */ - enum(type2, json2, fieldName, ignoreUnknownFields) { - if (type2[0] == "google.protobuf.NullValue") - assert_1.assert(json2 === null || json2 === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); - if (json2 === null) - return 0; - switch (typeof json2) { - case "number": - assert_1.assert(Number.isInteger(json2), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json2}.`); - return json2; - case "string": - let localEnumName = json2; - if (type2[2] && json2.substring(0, type2[2].length) === type2[2]) - localEnumName = json2.substring(type2[2].length); - let enumNumber = type2[1][localEnumName]; - if (typeof enumNumber === "undefined" && ignoreUnknownFields) { - return false; - } - assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json2}".`); - return enumNumber; - } - assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json2}".`); - } - scalar(json2, type2, longType, fieldName) { - let e; - try { - switch (type2) { - // 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 (json2 === null) - return 0; - if (json2 === "NaN") - return Number.NaN; - if (json2 === "Infinity") - return Number.POSITIVE_INFINITY; - if (json2 === "-Infinity") - return Number.NEGATIVE_INFINITY; - if (json2 === "") { - e = "empty string"; - break; - } - if (typeof json2 == "string" && json2.trim().length !== json2.length) { - e = "extra whitespace"; - break; - } - if (typeof json2 != "string" && typeof json2 != "number") { - break; - } - let float2 = Number(json2); - if (Number.isNaN(float2)) { - e = "not a number"; - break; - } - if (!Number.isFinite(float2)) { - e = "too large or small"; - break; - } - if (type2 == reflection_info_1.ScalarType.FLOAT) - assert_1.assertFloat32(float2); - return float2; - // 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 (json2 === null) - return 0; - let int32; - if (typeof json2 == "number") - int32 = json2; - else if (json2 === "") - e = "empty string"; - else if (typeof json2 == "string") { - if (json2.trim().length !== json2.length) - e = "extra whitespace"; - else - int32 = Number(json2); - } - if (int32 === void 0) - break; - if (type2 == 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 (json2 === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); - if (typeof json2 != "number" && typeof json2 != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json2), longType); - case reflection_info_1.ScalarType.FIXED64: - case reflection_info_1.ScalarType.UINT64: - if (json2 === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); - if (typeof json2 != "number" && typeof json2 != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json2), longType); - // bool: - case reflection_info_1.ScalarType.BOOL: - if (json2 === null) - return false; - if (typeof json2 !== "boolean") - break; - return json2; - // string: - case reflection_info_1.ScalarType.STRING: - if (json2 === null) - return ""; - if (typeof json2 !== "string") { - e = "extra whitespace"; - break; - } - try { - encodeURIComponent(json2); - } catch (e2) { - e2 = "invalid UTF8"; - break; - } - return json2; - // 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 (json2 === null || json2 === "") - return new Uint8Array(0); - if (typeof json2 !== "string") - break; - return base64_1.base64decode(json2); - } - } catch (error4) { - e = error4.message; + }; + 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(defaults, options) { + if (!options) + return defaults; + let o = {}; + copy(defaults, o); + copy(options, o); + for (let key of Object.keys(options)) { + let val = options[key]; + switch (key) { + case "jsonOptions": + o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); + break; + case "binaryOptions": + o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); + break; + case "meta": + o.meta = {}; + copy(defaults.meta, o.meta); + copy(options.meta, o.meta); + break; + case "interceptors": + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); + break; } - this.assert(false, fieldName + (e ? " - " + e : ""), json2); } - }; - exports2.ReflectionJsonReader = ReflectionJsonReader; + 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/build/commonjs/reflection-json-writer.js -var require_reflection_json_writer = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-writer.js"(exports2) { +// 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.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(info6) { - var _a; - this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; - } + 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 { /** - * Converts the message to a JSON object, based on the field descriptors. + * @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. */ - write(message, options) { - const json2 = {}, source = message; - for (const field of this.fields) { - if (!field.oneof) { - let jsonValue2 = this.field(field, source[field.localName], options); - if (jsonValue2 !== void 0) - json2[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); - json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; + constructor(preventUnhandledRejectionWarning = true) { + this._state = DeferredState.PENDING; + this._promise = new Promise((resolve4, reject) => { + this._resolve = resolve4; + this._reject = reject; + }); + if (preventUnhandledRejectionWarning) { + this._promise.catch((_) => { + }); } - return json2; } - 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 val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - break; - case "message": - const messageType = field.V.T(); - for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - 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 val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - break; - case "message": - const messageType = field.T(); - for (let i = 0; i < value.length; i++) { - const val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - 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; + /** + * Get the current state of the promise. + */ + get state() { + return this._state; } /** - * Returns `null` as the default for google.protobuf.NullValue. + * Get the deferred promise. */ - enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { - if (type2[0] == "google.protobuf.NullValue") - return !emitDefaultValues && !optional ? void 0 : null; - if (value === void 0) { - assert_1.assert(optional); - return void 0; - } - if (value === 0 && !emitDefaultValues && !optional) - return void 0; - assert_1.assert(typeof value == "number"); - assert_1.assert(Number.isInteger(value)); - if (enumAsInteger || !type2[1].hasOwnProperty(value)) - return value; - if (type2[2]) - return type2[2] + type2[1][value]; - return type2[1][value]; + get promise() { + return this._promise; } - message(type2, value, fieldName, options) { - if (value === void 0) - return options.emitDefaultValues ? null : void 0; - return type2.internalJsonWrite(value, options); + /** + * 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; } - scalar(type2, value, fieldName, optional, emitDefaultValues) { - if (value === void 0) { - assert_1.assert(optional); - return void 0; - } - const ed = emitDefaultValues || optional; - switch (type2) { - // 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); - } + /** + * 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.ReflectionJsonWriter = ReflectionJsonWriter; + exports2.Deferred = Deferred; } }); -// 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) { +// 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.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(type2, longType = reflection_info_1.LongType.STRING) { - switch (type2) { - 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.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: [] }; } - } - 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(info6) { - this.info = info6; + // --- RpcOutputStream callback API + onNext(callback) { + return this.addLis(callback, this._lis.nxt); } - prepare() { - var _a; - if (!this.fieldNoToField) { - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); - } + 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 /** - * Reads a message from binary format into the target message. + * 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. * - * Repeated fields are appended. Map entries are added, overwriting - * existing keys. + * 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. * - * If a message field is already present, it will be merged with the - * new data. + * Triggers onNext and onError callbacks. */ - 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; - } - } + 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(); } /** - * Read a map field, expecting key field = 1, value field = 2 + * Closes the stream successfully. Throws if stream is closed. + * + * Triggers onNext and onComplete callbacks. */ - mapEntry(field, reader, options) { - let length = reader.uint32(); - let end = reader.pos + length; - let key = void 0; - let val2 = 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": - val2 = this.scalar(reader, field.V.T, field.V.L); - break; - case "enum": - val2 = reader.int32(); - break; - case "message": - val2 = 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 (val2 === void 0) - switch (field.V.kind) { - case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); - break; - case "enum": - val2 = 0; - break; - case "message": - val2 = field.V.T().create(); - break; + 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; } - return [key, val2]; + }; } - scalar(reader, type2, longType) { - switch (type2) { - 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); + // "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.ReflectionBinaryReader = ReflectionBinaryReader; + exports2.RpcOutputStreamController = RpcOutputStreamController; } }); -// 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) { +// 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"; - 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(info6) { - this.info = info6; - } - prepare() { - if (!this.fields) { - const fieldsInput = this.info.fields ? this.info.fields.concat() : []; - this.fields = fieldsInput.sort((a, b) => a.no - b.no); - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - /** - * 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, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); - break; + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - writer.join(); - } - message(writer, options, handler, fieldNo, value) { - if (value === void 0) - return; - handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); - writer.join(); - } - /** - * Write a single scalar value. - */ - scalar(writer, type2, fieldNo, value, emitDefault) { - let [wireType, method, isDefault] = this.scalarInfo(type2, value); - if (!isDefault || emitDefault) { - writer.tag(fieldNo, wireType); - writer[method](value); + function step(result) { + result.done ? resolve4(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + this.headers = headers; + this.response = response; + this.status = status; + this.trailers = trailers; } /** - * Write an array of scalar values in packed format. + * If you are only interested in the final outcome of this call, + * you can await it to receive a `FinishedUnaryCall`. */ - packed(writer, type2, fieldNo, value) { - if (!value.length) - return; - assert_1.assert(type2 !== reflection_info_1.ScalarType.BYTES && type2 !== reflection_info_1.ScalarType.STRING); - writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); - writer.fork(); - let [, method] = this.scalarInfo(type2); - for (let i = 0; i < value.length; i++) - writer[method](value[i]); - writer.join(); + then(onfulfilled, onrejected) { + return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } - /** - * 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(type2, value) { - let t = binary_format_contract_1.WireType.Varint; - let m; - let i = value === void 0; - let d = value === 0; - switch (type2) { - 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]; + 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.ReflectionBinaryWriter = ReflectionBinaryWriter; + exports2.UnaryCall = UnaryCall; } }); -// 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) { +// 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"; - 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(type2) { - const msg = type2.messagePrototype ? Object.create(type2.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type2 }); - for (let field of type2.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - return msg; - } - exports2.reflectionCreate = reflectionCreate; + /** + * 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/build/commonjs/reflection-merge-partial.js -var require_reflection_merge_partial = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-merge-partial.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionMergePartial = void 0; - function reflectionMergePartial(info6, target, source) { - let fieldValue, input = source, output; - for (let field of info6.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } else { - fieldValue = input[name]; - output = target; - if (fieldValue == void 0) { - continue; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - 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; + function step(result) { + result.done ? resolve4(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + 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)); } - } - exports2.reflectionMergePartial = reflectionMergePartial; + 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/build/commonjs/reflection-equals.js -var require_reflection_equals = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-equals.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionEquals = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionEquals(info6, a, b) { - if (a === b) - return true; - if (!a || !b) - return false; - for (let field of info6.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - return true; - } - exports2.reflectionEquals = reflectionEquals; - var objectValues = Object.values; - function primitiveEq(type2, a, b) { - if (a === b) - return true; - if (type2 !== 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(type2, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!primitiveEq(type2, a[i], b[i])) - return false; - return true; - } - function repeatedMsgEq(type2, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!type2.equals(a[i], b[i])) - return false; - return true; - } + /** + * 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/build/commonjs/message-type.js -var require_message_type = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js"(exports2) { +// 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"; - 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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - create(value) { - let message = reflection_create_1.reflectionCreate(this); - if (value !== void 0) { - reflection_merge_partial_1.reflectionMergePartial(this, message, value); + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - return message; - } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve4(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 { /** - * Clone the message. - * - * Unknown fields are discarded. + * Initialize with mock data. Omitted fields have default value. */ - clone(message) { - let copy = this.create(); - reflection_merge_partial_1.reflectionMergePartial(this, copy, message); - return copy; + 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 : {}; } /** - * 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`. + * Sent message(s) during the last operation. */ - equals(a, b) { - return reflection_equals_1.reflectionEquals(this, a, b); + get sentMessages() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.sent; + } else if (typeof this.lastInput == "object") { + return [this.lastInput.single]; + } + return []; } /** - * 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)? + * Sending message(s) completed? */ - is(arg, depth = this.defaultCheckDepth) { - return this.refTypeCheck.is(arg, depth, false); + get sendComplete() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.completed; + } else if (typeof this.lastInput == "object") { + return true; + } + return 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); + // Creates a promise for response headers from the mock data. + promiseHeaders() { + var _a; + const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; + return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); } - /** - * Copy partial data into the target message. - */ - mergePartial(target, source) { - reflection_merge_partial_1.reflectionMergePartial(this, target, source); + // 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); } /** - * Create a new message from binary format. + * 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. */ - fromBinary(data, options) { - let opt = binary_reader_1.binaryReadOptions(options); - return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt); + 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(); + }); } - /** - * Read a new message from a JSON value. - */ - fromJson(json2, options) { - return this.internalJsonRead(json2, json_format_contract_1.jsonReadOptions(options)); + // Creates a promise for response status from the mock data. + promiseStatus() { + var _a; + const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; + return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); } - /** - * Read a new message from a JSON string. - * This is equivalent to `T.fromJson(JSON.parse(json))`. - */ - fromJsonString(json2, options) { - let value = JSON.parse(json2); - return this.fromJson(value, options); + // Creates a promise for response trailers from the mock data. + promiseTrailers() { + var _a; + const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; + return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); } - /** - * Write the message to canonical JSON value. - */ - toJson(message, options) { - return this.internalJsonWrite(message, json_format_contract_1.jsonWriteOptions(options)); + maybeSuppressUncaught(...promise) { + if (this.suppressUncaughtRejections) { + for (let p of promise) { + p.catch(() => { + }); + } + } } - /** - * Convert the message to canonical JSON string. - * This is equivalent to `JSON.stringify(T.toJson(t))` - */ - toJsonString(message, options) { + mergeOptions(options) { + return rpc_options_1.mergeRpcOptions({}, options); + } + unary(method, input, options) { var _a; - let value = this.toJson(message, options); - return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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((resolve4, reject) => { + if (abort === null || abort === void 0 ? void 0 : abort.aborted) { + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + } else { + const id = setTimeout(() => resolve4(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 _a, _b, _c, _d; + if (kind == "unary") { + let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); + for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).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); } - /** - * Write the message to binary format. - */ - toBinary(message, options) { - let opt = binary_writer_1.binaryWriteOptions(options); - return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish(); + 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; } /** - * This is an internal method. If you just want to read a message from - * JSON, use `fromJson()` or `fromJsonString()`. + * Set the call cancelled. * - * 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. + * Invokes all callbacks registered with onCancel() and + * sets `cancelled = true`. */ - internalJsonRead(json2, options, target) { - if (json2 !== null && typeof json2 == "object" && !Array.isArray(json2)) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refJsonReader.read(json2, message, options); - return message; + notifyCancelled() { + if (!this._cancelled) { + this._cancelled = true; + for (let l of this._listeners) { + l(); + } } - throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json2)}.`); } /** - * 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. + * Send response headers. */ - internalJsonWrite(message, options) { - return this.refJsonWriter.write(message, options); + sendResponseHeaders(data) { + this._sendRH(data); } /** - * This is an internal method. If you just want to write a message - * in binary format, use `toBinary()`. + * Is the call cancelled? * - * Serializes the message in binary format and appends it to the given - * writer. Returns passed writer. + * 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. */ - internalBinaryWrite(message, writer, options) { - this.refBinWriter.write(message, writer, options); - return writer; + get cancelled() { + return this._cancelled; } /** - * 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. + * Add a callback for cancellation. */ - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refBinReader.read(reader, message, options, length); - return message; + onCancel(callback) { + const l = this._listeners; + l.push(callback); + return () => { + let i = l.indexOf(callback); + if (i >= 0) + l.splice(i, 1); + }; } }; - 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, number] of Object.entries(enumObject)) - if (typeof number == "number") - values.push({ name, number }); - return values; - } - exports2.listEnumValues = listEnumValues; - function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); - } - exports2.listEnumNames = listEnumNames; - function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); - } - exports2.listEnumNumbers = listEnumNumbers; + exports2.ServerCallContextController = ServerCallContextController; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { +// 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 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 service_type_1 = require_service_type(); + Object.defineProperty(exports2, "ServiceType", { enumerable: true, get: function() { + return service_type_1.ServiceType; } }); - 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_info_1 = require_reflection_info2(); + Object.defineProperty(exports2, "readMethodOptions", { enumerable: true, get: function() { + return reflection_info_1.readMethodOptions; } }); - var reflection_json_reader_1 = require_reflection_json_reader(); - Object.defineProperty(exports2, "ReflectionJsonReader", { enumerable: true, get: function() { - return reflection_json_reader_1.ReflectionJsonReader; + Object.defineProperty(exports2, "readMethodOption", { enumerable: true, get: function() { + return reflection_info_1.readMethodOption; } }); - var reflection_json_writer_1 = require_reflection_json_writer(); - Object.defineProperty(exports2, "ReflectionJsonWriter", { enumerable: true, get: function() { - return reflection_json_writer_1.ReflectionJsonWriter; + Object.defineProperty(exports2, "readServiceOption", { enumerable: true, get: function() { + return reflection_info_1.readServiceOption; } }); - 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 rpc_error_1 = require_rpc_error(); + Object.defineProperty(exports2, "RpcError", { enumerable: true, get: function() { + return rpc_error_1.RpcError; } }); - var oneof_1 = require_oneof(); - Object.defineProperty(exports2, "isOneofGroup", { enumerable: true, get: function() { - return oneof_1.isOneofGroup; + var rpc_options_1 = require_rpc_options(); + Object.defineProperty(exports2, "mergeRpcOptions", { enumerable: true, get: function() { + return rpc_options_1.mergeRpcOptions; } }); - Object.defineProperty(exports2, "setOneofValue", { enumerable: true, get: function() { - return oneof_1.setOneofValue; + var rpc_output_stream_1 = require_rpc_output_stream(); + Object.defineProperty(exports2, "RpcOutputStreamController", { enumerable: true, get: function() { + return rpc_output_stream_1.RpcOutputStreamController; } }); - Object.defineProperty(exports2, "getOneofValue", { enumerable: true, get: function() { - return oneof_1.getOneofValue; + var test_transport_1 = require_test_transport(); + Object.defineProperty(exports2, "TestTransport", { enumerable: true, get: function() { + return test_transport_1.TestTransport; } }); - Object.defineProperty(exports2, "clearOneofValue", { enumerable: true, get: function() { - return oneof_1.clearOneofValue; + var deferred_1 = require_deferred(); + Object.defineProperty(exports2, "Deferred", { enumerable: true, get: function() { + return deferred_1.Deferred; } }); - Object.defineProperty(exports2, "getSelectedOneofValue", { enumerable: true, get: function() { - return oneof_1.getSelectedOneofValue; + Object.defineProperty(exports2, "DeferredState", { enumerable: true, get: function() { + return deferred_1.DeferredState; } }); - var enum_object_1 = require_enum_object(); - Object.defineProperty(exports2, "listEnumValues", { enumerable: true, get: function() { - return enum_object_1.listEnumValues; + var duplex_streaming_call_1 = require_duplex_streaming_call(); + Object.defineProperty(exports2, "DuplexStreamingCall", { enumerable: true, get: function() { + return duplex_streaming_call_1.DuplexStreamingCall; } }); - Object.defineProperty(exports2, "listEnumNames", { enumerable: true, get: function() { - return enum_object_1.listEnumNames; + var client_streaming_call_1 = require_client_streaming_call(); + Object.defineProperty(exports2, "ClientStreamingCall", { enumerable: true, get: function() { + return client_streaming_call_1.ClientStreamingCall; } }); - Object.defineProperty(exports2, "listEnumNumbers", { enumerable: true, get: function() { - return enum_object_1.listEnumNumbers; + var server_streaming_call_1 = require_server_streaming_call(); + Object.defineProperty(exports2, "ServerStreamingCall", { enumerable: true, get: function() { + return server_streaming_call_1.ServerStreamingCall; } }); - Object.defineProperty(exports2, "isEnumObject", { enumerable: true, get: function() { - return enum_object_1.isEnumObject; + var unary_call_1 = require_unary_call(); + Object.defineProperty(exports2, "UnaryCall", { enumerable: true, get: function() { + return unary_call_1.UnaryCall; } }); - var lower_camel_case_1 = require_lower_camel_case(); - Object.defineProperty(exports2, "lowerCamelCase", { enumerable: true, get: function() { - return lower_camel_case_1.lowerCamelCase; + var rpc_interceptor_1 = require_rpc_interceptor(); + Object.defineProperty(exports2, "stackIntercept", { enumerable: true, get: function() { + return rpc_interceptor_1.stackIntercept; } }); - var assert_1 = require_assert(); - Object.defineProperty(exports2, "assert", { enumerable: true, get: function() { - return assert_1.assert; + Object.defineProperty(exports2, "stackDuplexStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackDuplexStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertNever", { enumerable: true, get: function() { - return assert_1.assertNever; + Object.defineProperty(exports2, "stackClientStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackClientStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertInt32", { enumerable: true, get: function() { - return assert_1.assertInt32; + Object.defineProperty(exports2, "stackServerStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackServerStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertUInt32", { enumerable: true, get: function() { - return assert_1.assertUInt32; + Object.defineProperty(exports2, "stackUnaryInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackUnaryInterceptors; } }); - Object.defineProperty(exports2, "assertFloat32", { enumerable: true, get: function() { - return assert_1.assertFloat32; + 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/@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) { +// 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.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); - function normalizeMethodInfo(method, service) { - var _a, _b, _c; - let m = method; - m.service = service; - m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : 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 _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readMethodOptions = readMethodOptions; - function readMethodOption(service, methodName, extensionName, extensionType) { - var _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.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; + 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*/ + } + ]); } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; + 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; } - 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 : {}; + 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.ServiceType = ServiceType; + exports2.CacheScope = new CacheScope$Type(); } }); -// 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) { +// 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.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 : {}; + 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 } + ]); } - 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}`); + 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 l.join("\n"); + 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.RpcError = RpcError; + exports2.CacheMetadata = new CacheMetadata$Type(); } }); -// 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) { +// 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.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs11(); - function mergeRpcOptions(defaults, options) { - if (!options) - return defaults; - let o = {}; - copy(defaults, o); - copy(options, o); - for (let key of Object.keys(options)) { - let val2 = options[key]; - switch (key) { - case "jsonOptions": - o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); - break; - case "binaryOptions": - o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); - break; - case "meta": - o.meta = {}; - copy(defaults.meta, o.meta); - copy(options.meta, o.meta); - break; - case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); - break; - } + 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*/ + } + ]); } - 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; + 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; } - } - } -}); - -// 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((resolve4, reject) => { - this._resolve = resolve4; - this._reject = reject; - }); - if (preventUnhandledRejectionWarning) { - this._promise.catch((_) => { - }); + 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; } - /** - * Get the current state of the promise. - */ - get state() { - return this._state; - } - /** - * Get the deferred promise. - */ - get promise() { - return this._promise; + 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; } - /** - * 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; + }; + 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*/ + } + ]); } - /** - * 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; + 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; } - /** - * Resolve the promise. Ignore if not pending. - */ - resolvePending(val2) { - if (this._state === DeferredState.PENDING) - this.resolve(val2); + 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; } - /** - * Reject the promise. Ignore if not pending. - */ - rejectPending(reason) { - if (this._state === DeferredState.PENDING) - this.reject(reason); + 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.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_commonjs11(); - var RpcOutputStreamController = class { + exports2.CreateCacheEntryResponse = new CreateCacheEntryResponse$Type(); + var FinalizeCacheEntryUploadRequest$Type = class extends runtime_5.MessageType { constructor() { - this._lis = { - nxt: [], - msg: [], - err: [], - cmp: [] - }; - this._closed = false; - this._itState = { q: [] }; + 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*/ + } + ]); } - // --- RpcOutputStream callback API - onNext(callback) { - return this.addLis(callback, this._lis.nxt); + 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; } - onMessage(callback) { - return this.addLis(callback, this._lis.msg); + 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; } - onError(callback) { - return this.addLis(callback, this._lis.err); + 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; } - onComplete(callback) { - return this.addLis(callback, this._lis.cmp); + }; + 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; } - addLis(callback, list) { - list.push(callback); - return () => { - let i = list.indexOf(callback); - if (i >= 0) - list.splice(i, 1); - }; + 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; } - // remove all listeners - clearLis() { - for (let l of Object.values(this._lis)) - l.splice(0, l.length); + }; + 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*/ + } + ]); } - // --- Controller API - /** - * Is this stream already closed by a completion or error? - */ - get closed() { - return this._closed !== false; + 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; } - /** - * 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, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); - if (message) - this.notifyMessage(message); - if (error4) - this.notifyError(error4); - if (complete) - this.notifyComplete(); + 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; } - /** - * 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)); + 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; } - /** - * Closes the stream with an error. Throws if stream is closed. - * - * Triggers onNext and onError callbacks. - */ - notifyError(error4) { - runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); - this.clearLis(); + }; + 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*/ + } + ]); } - /** - * 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(); + 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; } - /** - * 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; + 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); } - }; - } - // "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); } + 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.RpcOutputStreamController = RpcOutputStreamController; + 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/@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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + 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); } - /** - * 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)); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toJson(request, { + 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 + })); } - promiseFinished() { - return __awaiter4(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 - }; + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { + 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 + })); } - }; - 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { + 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 + })); } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; + exports2.CacheServiceClientJSON = CacheServiceClientJSON; + var CacheServiceClientProtobuf = class { + constructor(rpc) { + this.rpc = rpc; + this.CreateCacheEntry.bind(this); + this.FinalizeCacheEntryUpload.bind(this); + this.GetCacheEntryDownloadURL.bind(this); } - /** - * 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)); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); + return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); } - promiseFinished() { - return __awaiter4(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 - }; - }); + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); + 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(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); + 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.ServerStreamingCall = ServerStreamingCall; + exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; } }); -// 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) { +// node_modules/@actions/cache/lib/internal/shared/util.js +var require_util9 = __commonJS({ + "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; + var core_1 = require_core(); + function maskSigUrl(url) { + if (!url) + return; + try { + const parsedUrl = new URL(url); + 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: ${url} ${error3 instanceof Error ? error3.message : String(error3)}`); } - /** - * 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)); + } + function maskSecretUrls(body) { + if (typeof body !== "object" || body === null) { + (0, core_1.debug)("body is not an object or is null"); + return; } - promiseFinished() { - return __awaiter4(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 - }; - }); + if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { + maskSigUrl(body.signed_upload_url); } - }; - exports2.ClientStreamingCall = ClientStreamingCall; + if ("signed_download_url" in body && typeof body.signed_download_url === "string") { + maskSigUrl(body.signed_download_url); + } + } } }); -// 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) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -73692,47 +80938,192 @@ var require_duplex_streaming_call = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DuplexStreamingCall = void 0; - var DuplexStreamingCall = class { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - 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)); + 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_util9(); + var CacheServiceClient = class { + constructor(userAgent, 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(userAgent, [ + new auth_1.BearerCredentialHandler(token) + ]); } - promiseFinished() { - return __awaiter4(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 + // 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 url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; + (0, core_1.debug)(`[Request] ${method} ${url}`); + const headers = { + "Content-Type": contentType }; + try { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { + return this.httpClient.post(url, 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((resolve4) => setTimeout(resolve4, 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); + } }; - exports2.DuplexStreamingCall = DuplexStreamingCall; + 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/@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) { +// node_modules/@actions/cache/lib/internal/tar.js +var require_tar = __commonJS({ + "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -73760,3344 +81151,3358 @@ var require_test_transport = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TestTransport = void 0; - var rpc_error_1 = require_rpc_error(); - var runtime_1 = require_commonjs11(); - 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 _a; - const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _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 __awaiter4(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); + exports2.listTar = listTar; + exports2.extractTar = extractTar2; + exports2.createTar = createTar; + var exec_1 = require_exec(); + var io6 = __importStar2(require_io()); + var fs_1 = require("fs"); + var path8 = __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 }; } - } 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 (error4) { - stream2.notifyError(error4); - return; - } - if (this.data.response instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.response); - return; + break; } - for (let msg of messages) { - stream2.notifyMessage(msg); - try { - yield delay2(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream2.notifyError(error4); - return; + case "darwin": { + const gnuTar = yield io6.which("gtar", false); + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else { + return { + path: yield io6.which("tar", true), + type: constants_1.ArchiveToolType.BSD + }; } } - 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 _a; - const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _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 _a; - const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _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(() => { - }); + default: + break; + } + return { + path: yield io6.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, type2, 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 (type2) { + case "create": + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + break; + case "extract": + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path8.sep}`, "g"), "/")); + break; + case "list": + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path8.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; } } - } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); - } - unary(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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((resolve4, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + return args; + }); + } + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { + let args; + const tarPath = yield getTarPath(); + const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); + const compressionArgs = type2 !== "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 && type2 !== "create") { + args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; } else { - const id = setTimeout(() => resolve4(v), ms); - if (abort) { - abort.addEventListener("abort", (ev) => { - clearTimeout(id); - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + } + if (BSD_TAR_ZSTD) { + return args; + } + return [args.join(" ")]; + }); + } + function getWorkingDirectory() { + var _a; + return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : 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(`\\${path8.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(`\\${path8.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(`\\${path8.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(`\\${path8.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}`); } } }); } - 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)); - } - }; + function listTar(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const commands = yield getCommands(compressionMethod, "list", archivePath); + yield execCommands(commands); + }); + } + function extractTar2(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const workingDirectory = getWorkingDirectory(); + yield io6.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)(path8.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + const commands = yield getCommands(compressionMethod, "create"); + yield execCommands(commands, archiveFolder); + }); + } } }); -// 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) { +// node_modules/@actions/cache/lib/cache.js +var require_cache4 = __commonJS({ + "node_modules/@actions/cache/lib/cache.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_commonjs11(); - function stackIntercept(kind, transport, method, options, input) { - var _a, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); - } - return tail(method, input, options); + 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]; + } }; } - 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); + 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]); } - return tail(method, input, options); + __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(resolve4) { + resolve4(value); + }); } - 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 new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - return tail(method, options); + function step(result) { + result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache3; + exports2.saveCache = saveCache3; + var core13 = __importStar2(require_core()); + var path8 = __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 ValidationError = class _ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + Object.setPrototypeOf(this, _ValidationError.prototype); + } + }; + exports2.ValidationError = ValidationError; + var ReserveCacheError = class _ReserveCacheError extends Error { + constructor(message) { + super(message); + this.name = "ReserveCacheError"; + Object.setPrototypeOf(this, _ReserveCacheError.prototype); + } + }; + exports2.ReserveCacheError = ReserveCacheError; + 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`); } - runtime_1.assertNever(kind); } - exports2.stackIntercept = stackIntercept; - function stackUnaryInterceptors(transport, method, input, options) { - return stackIntercept("unary", transport, method, options, input); + 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.`); + } } - exports2.stackUnaryInterceptors = stackUnaryInterceptors; - function stackServerStreamingInterceptors(transport, method, input, options) { - return stackIntercept("serverStreaming", transport, method, options, input); + 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"]; + } } - exports2.stackServerStreamingInterceptors = stackServerStreamingInterceptors; - function stackClientStreamingInterceptors(transport, method, options) { - return stackIntercept("clientStreaming", transport, method, options); + function restoreCache3(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)(); + core13.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + switch (cacheServiceVersion) { + case "v2": + return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); + case "v1": + default: + return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); + } + }); } - exports2.stackClientStreamingInterceptors = stackClientStreamingInterceptors; - function stackDuplexStreamingInterceptors(transport, method, options) { - return stackIntercept("duplex", transport, method, options); + function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core13.debug("Resolved Keys:"); + core13.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 { + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + return void 0; + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core13.info("Lookup only - skipping download"); + return cacheEntry.cacheKey; + } + archivePath = path8.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core13.debug(`Archive Path: ${archivePath}`); + yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); + if (core13.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core13.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) { + core13.error(`Failed to restore: ${error3.message}`); + } else { + core13.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core13.debug(`Failed to delete archive: ${error3}`); + } + } + return void 0; + }); } - 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(); + function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { + options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core13.debug("Resolved Keys:"); + core13.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 request = { + key: primaryKey, + restoreKeys, + version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) + }; + const response = yield twirpClient.GetCacheEntryDownloadURL(request); + if (!response.ok) { + core13.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); + return void 0; + } + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core13.info(`Cache hit for restore-key: ${response.matchedKey}`); + } else { + core13.info(`Cache hit for: ${response.matchedKey}`); + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core13.info("Lookup only - skipping download"); + return response.matchedKey; + } + archivePath = path8.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core13.debug(`Archive path: ${archivePath}`); + core13.debug(`Starting download of archive to: ${archivePath}`); + yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core13.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core13.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) { + core13.error(`Failed to restore: ${error3.message}`); + } else { + core13.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + if (archivePath) { + yield utils.unlinkFile(archivePath); + } + } catch (error3) { + core13.debug(`Failed to delete archive: ${error3}`); } } - } - /** - * 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_commonjs12 = __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_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ + return void 0; + }); + } + function saveCache3(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + core13.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + checkKey(key); + 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 _a, _b, _c, _d, _e; + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core13.debug("Cache Paths:"); + core13.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 = path8.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core13.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core13.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - ]); - } - 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); + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.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.`); + } + core13.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + } + core13.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 === ReserveCacheError.name) { + core13.info(`Failed to save: ${typedError.message}`); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core13.error(`Failed to save: ${typedError.message}`); + } else { + core13.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core13.debug(`Failed to delete archive: ${error3}`); } } - 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(); + return cacheId; + }); + } + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + 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); + core13.debug("Cache Paths:"); + core13.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 = path8.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core13.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core13.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core13.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core13.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core13.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); + } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core13.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + } + core13.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); + core13.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 === ReserveCacheError.name) { + core13.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core13.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core13.error(`Failed to save: ${typedError.message}`); + } else { + core13.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core13.debug(`Failed to delete archive: ${error3}`); + } + } + return cacheId; + }); + } } }); -// 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) { +// node_modules/jsonschema/lib/helpers.js +var require_helpers3 = __commonJS({ + "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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 } - ]); + var uri = require("url"); + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path8, name, argument) { + if (Array.isArray(path8)) { + this.path = path8; + this.property = path8.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else if (path8 !== void 0) { + this.property = path8; } - 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; + if (message) { + this.message = 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; + if (schema2) { + var id = schema2.$id || schema2.id; + this.schema = id || schema2; } - 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; + if (instance !== void 0) { + this.instance = instance; } + this.name = name; + this.argument = argument; + this.stack = this.toString(); }; - exports2.CacheMetadata = new CacheMetadata$Type(); - } -}); - -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ - } - ]); + ValidationError.prototype.toString = function toString2() { + return this.property + " " + this.message; + }; + var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema2, options, ctx) { + this.instance = instance; + this.schema = schema2; + 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); } - 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; + this.errors.push(err); + if (this.throwFirst) { + throw new ValidatorResultError(this); + } else if (this.throwError) { + throw err; } - 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; + 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); } - 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; + }; + 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 (Error.captureStackTrace) { + 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, schema2) { + this.message = msg; + this.schema = schema2; + Error.call(this, msg); + Error.captureStackTrace(this, SchemaError2); }; - 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*/ - } - ]); + SchemaError.prototype = Object.create( + Error.prototype, + { + constructor: { value: SchemaError, enumerable: false }, + name: { value: "SchemaError", enumerable: false } } - 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; + ); + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path8, base, schemas) { + this.schema = schema2; + this.options = options; + if (Array.isArray(path8)) { + this.path = path8; + this.propertyPath = path8.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else { + this.propertyPath = path8; } - 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); - } + this.base = base; + this.schemas = schemas; + }; + SchemaContext.prototype.resolve = function resolve4(target) { + return uri.resolve(this.base, target); + }; + SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { + var path8 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var id = schema2.$id || schema2.id; + var base = uri.resolve(this.base, id || ""); + var ctx = new SchemaContext(schema2, this.options, path8, base, Object.create(this.schemas)); + if (id && !ctx.schemas[base]) { + ctx.schemas[base] = schema2; + } + 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 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; + 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; }; - 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*/ - } - ]); + var makeSuffix = exports2.makeSuffix = function makeSuffix2(key) { + key = key.toString(); + if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { + return "." + key; } - 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; + if (key.match(/^\d+$/)) { + return "[" + key + "]"; } - 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 "[" + 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; } - return message; + if (a.length !== b.length) { + return false; + } + return a.every(function(v, i) { + return deepCompareStrict(a[i], b[i]); + }); } - 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; + 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; }; - 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*/ - } - ]); + 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); + } } - 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; + } + 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]); + } } - 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); - } + } + function deepMerge(target, src) { + var array = Array.isArray(src); + var dst = array && [] || {}; + if (array) { + 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)); } - return message; + Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); } - 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; + 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; }; - 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; + function pathEncoder(v) { + return "/" + encodeURIComponent(v).replace(/~/g, "%7E"); + } + exports2.encodePath = function encodePointer(a) { + return a.map(pathEncoder).join(""); + }; + exports2.getDecimalPlaces = function getDecimalPlaces(number) { + var decimalPlaces = 0; + if (isNaN(number)) return decimalPlaces; + if (typeof number !== "number") { + number = Number(number); } - 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); - } + var parts = number.toString().split("e"); + if (parts.length === 2) { + if (parts[1][0] !== "-") { + return decimalPlaces; + } else { + decimalPlaces = Number(parts[1].slice(1)); } - 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; + var decimalParts = parts[0].split("."); + if (decimalParts.length === 2) { + decimalPlaces += decimalParts[1].length; } + return decimalPlaces; }; - 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*/ - } - ]); + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; + }; + } +}); + +// node_modules/jsonschema/lib/attribute.js +var require_attribute = __commonJS({ + "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { + "use strict"; + var helpers = require_helpers3(); + 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, schema2, options, ctx) { + if (instance === void 0) { + return null; } - 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; + var result = new ValidatorResult(instance, schema2, options, ctx); + var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; + if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { + var list = types.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 + }); } - 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 result; + }; + function testSchemaNoThrow(instance, options, ctx, callback, schema2) { + var throwError2 = options.throwError; + var throwAll = options.throwAll; + options.throwError = false; + options.throwAll = false; + var res = this.validateSchema(instance, schema2, options, ctx); + options.throwError = throwError2; + options.throwAll = throwAll; + if (!res.valid && callback instanceof Function) { + callback(res); + } + return res.valid; + } + validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + if (!Array.isArray(schema2.anyOf)) { + throw new SchemaError("anyOf must be an array"); + } + if (!schema2.anyOf.some( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); } + ) + )) { + var list = schema2.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); } - 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; + result.addError({ + name: "anyOf", + argument: list, + message: "is not any of " + list.join(",") + }); } + return result; }; - 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_cache2(); - var CacheServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + validators.allOf = function validateAllOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toJson(request, { - 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 - })); + if (!Array.isArray(schema2.allOf)) { + throw new SchemaError("allOf must be an array"); } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { - 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 - })); + var result = new ValidatorResult(instance, schema2, options, ctx); + var self2 = this; + schema2.allOf.forEach(function(v, i) { + var valid3 = self2.validateSchema(instance, v, options, ctx); + if (!valid3.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: valid3.errors.length, valid: valid3 }, + message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" + }); + result.importErrors(valid3); + } + }); + return result; + }; + validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { - useProtoFieldName: true, - emitDefaultValues: false + if (!Array.isArray(schema2.oneOf)) { + throw new SchemaError("oneOf must be an array"); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + var count = schema2.oneOf.filter( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); + } + ) + ).length; + var list = schema2.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(",") }); - 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 - })); } + return result; }; - exports2.CacheServiceClientJSON = CacheServiceClientJSON; - var CacheServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + validators.if = function validateIf(instance, schema2, options, ctx) { + if (instance === void 0) return null; + if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); + var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); + var result = new ValidatorResult(instance, schema2, options, ctx); + var res; + if (ifValid) { + if (schema2.then === void 0) return; + if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); + res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); + result.importErrors(res); + } else { + if (schema2.else === void 0) return; + if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); + res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); + result.importErrors(res); } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); + return result; + }; + function getEnumerableProperty(object, key) { + if (Object.hasOwnProperty.call(object, key)) return object[key]; + if (!(key in object)) return; + while (object = Object.getPrototypeOf(object)) { + if (Object.propertyIsEnumerable.call(object, key)) return object[key]; } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); + } + validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var subschema = schema2.propertyNames !== void 0 ? schema2.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); + } } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/protobuf", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromBinary(data2)); + return result; + }; + validators.properties = function validateProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var properties = schema2.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; }; - 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.maskSecretUrls = exports2.maskSigUrl = void 0; - var core_1 = require_core(); - function maskSigUrl(url) { - if (!url) + function testAdditionalProperty(instance, schema2, options, ctx, property, result) { + if (!this.types.object(instance)) return; + if (schema2.properties && schema2.properties[property] !== void 0) { return; - try { - const parsedUrl = new URL(url); - const signature = parsedUrl.searchParams.get("sig"); - if (signature) { - (0, core_1.setSecret)(signature); - (0, core_1.setSecret)(encodeURIComponent(signature)); + } + if (schema2.additionalProperties === false) { + result.addError({ + name: "additionalProperties", + argument: property, + message: "is not allowed to have the additional property " + JSON.stringify(property) + }); + } else { + var additionalProperties = schema2.additionalProperties || {}; + if (typeof options.preValidateProperty == "function") { + options.preValidateProperty(instance, property, additionalProperties, options, ctx); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + 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); } } - 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; + validators.patternProperties = function validatePatternProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var patternProperties = schema2.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, schema2, options, ctx, property, result); + } } - if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { - maskSigUrl(body.signed_upload_url); + return result; + }; + validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + if (schema2.patternProperties) { + return null; } - if ("signed_download_url" in body && typeof body.signed_download_url === "string") { - maskSigUrl(body.signed_download_url); + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in instance) { + testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); } - } - exports2.maskSecretUrls = maskSecretUrls; - } -}); - -// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); + return result; + }; + validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length >= schema2.minProperties)) { + result.addError({ + name: "minProperties", + argument: schema2.minProperties, + message: "does not meet minimum property length of " + schema2.minProperties }); } - return new (P || (P = Promise))(function(resolve4, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + return result; + }; + validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length <= schema2.maxProperties)) { + result.addError({ + name: "maxProperties", + argument: schema2.maxProperties, + message: "does not meet maximum property length of " + schema2.maxProperties + }); + } + return result; + }; + validators.items = function validateItems(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.items === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + instance.every(function(value, i) { + if (Array.isArray(schema2.items)) { + var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; + } else { + var items = schema2.items; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + if (items === void 0) { + return true; } - function step(result) { - result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + if (items === false) { + result.addError({ + name: "items", + message: "additionalItems not permitted" + }); + return false; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + 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; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; - 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_auth2(); - var http_client_1 = require_lib3(); - var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util10(); - var CacheServiceClient = class { - constructor(userAgent, 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; + validators.contains = function validateContains(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.contains === void 0) return; + if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); + var result = new ValidatorResult(instance, schema2, options, ctx); + var count = instance.some(function(value, i) { + var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); + return res.errors.length === 0; + }); + if (count === false) { + result.addError({ + name: "contains", + argument: schema2.contains, + message: "must contain an item matching given schema" + }); + } + return result; + }; + validators.minimum = function validateMinimum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { + if (!(instance > schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than " + schema2.minimum + }); } - if (baseRetryIntervalMilliseconds) { - this.baseRetryIntervalMilliseconds = baseRetryIntervalMilliseconds; + } else { + if (!(instance >= schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than or equal to " + schema2.minimum + }); } - if (retryMultiplier) { - this.retryMultiplier = retryMultiplier; + } + return result; + }; + validators.maximum = function validateMaximum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { + if (!(instance < schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than " + schema2.maximum + }); + } + } else { + if (!(instance <= schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than or equal to " + schema2.maximum + }); } - this.httpClient = new http_client_1.HttpClient(userAgent, [ - 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 __awaiter4(this, void 0, void 0, function* () { - const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; - (0, core_1.debug)(`[Request] ${method} ${url}`); - const headers = { - "Content-Type": contentType - }; - try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { - return this.httpClient.post(url, JSON.stringify(data), headers); - })); - return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); - } + return result; + }; + validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMinimum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid3 = instance > schema2.exclusiveMinimum; + if (!valid3) { + result.addError({ + name: "exclusiveMinimum", + argument: schema2.exclusiveMinimum, + message: "must be strictly greater than " + schema2.exclusiveMinimum + }); + } + return result; + }; + validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMaximum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid3 = instance < schema2.exclusiveMaximum; + if (!valid3) { + result.addError({ + name: "exclusiveMaximum", + argument: schema2.exclusiveMaximum, + message: "must be strictly less than " + schema2.exclusiveMaximum + }); + } + return result; + }; + var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { + if (!this.types.number(instance)) return; + var validationArgument = schema2[validationType]; + if (validationArgument == 0) { + throw new SchemaError(validationType + " cannot be zero"); + } + var result = new ValidatorResult(instance, schema2, 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, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); + }; + validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); + }; + validators.required = function validateRequired(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (instance === void 0 && schema2.required === true) { + result.addError({ + name: "required", + message: "is required" }); - } - retryableRequest(operation) { - return __awaiter4(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 (error4) { - if (error4 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); - } - if (error4 instanceof errors_1.UsageError) { - throw error4; - } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); - } - isRetryable = true; - errorMessage = error4.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++; + } else if (this.types.object(instance) && Array.isArray(schema2.required)) { + schema2.required.forEach(function(n) { + if (getEnumerableProperty(instance, n) === void 0) { + result.addError({ + name: "required", + argument: n, + message: "requires property " + JSON.stringify(n) + }); } - throw new Error(`Request failed`); }); } - isSuccessStatusCode(statusCode) { - if (!statusCode) - return false; - return statusCode >= 200 && statusCode < 300; + return result; + }; + validators.pattern = function validatePattern(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var pattern = schema2.pattern; + try { + var regexp = new RegExp(pattern, "u"); + } catch (_e) { + regexp = new RegExp(pattern); } - 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); + if (!instance.match(regexp)) { + result.addError({ + name: "pattern", + argument: schema2.pattern, + message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) + }); } - sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => setTimeout(resolve4, milliseconds)); + return result; + }; + validators.format = function validateFormat(instance, schema2, options, ctx) { + if (instance === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { + result.addError({ + name: "format", + argument: schema2.format, + message: "does not conform to the " + JSON.stringify(schema2.format) + " format" }); } - 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); + return result; + }; + validators.minLength = function validateMinLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length >= schema2.minLength)) { + result.addError({ + name: "minLength", + argument: schema2.minLength, + message: "does not meet minimum length of " + schema2.minLength + }); } + return result; }; - 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); - } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; - } -}); - -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length <= schema2.maxLength)) { + result.addError({ + name: "maxLength", + argument: schema2.maxLength, + message: "does not meet maximum length of " + schema2.maxLength + }); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + return result; + }; + validators.minItems = function validateMinItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length >= schema2.minItems)) { + result.addError({ + name: "minItems", + argument: schema2.minItems, + message: "does not meet minimum length of " + schema2.minItems + }); } - __setModuleDefault4(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); + validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length <= schema2.maxItems)) { + result.addError({ + name: "maxItems", + argument: schema2.maxItems, + message: "does not meet maximum length of " + schema2.maxItems }); } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; - var exec_1 = require_exec(); - var io6 = __importStar4(require_io3()); - var fs_1 = require("fs"); - var path8 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { - return __awaiter4(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 io6.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io6.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; - } - } - default: - break; + 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 { - path: yield io6.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); + } + return true; } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - 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 (type2) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path8.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path8.sep}`, "g"), "/"), "-P"); - break; + validators.uniqueItems = function validateUniqueItems(instance, schema2, options, ctx) { + if (schema2.uniqueItems !== true) return; + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!instance.every(testArrays)) { + result.addError({ + name: "uniqueItems", + message: "contains duplicate item" + }); + } + return result; + }; + validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in schema2.dependencies) { + if (instance[property] === void 0) { + continue; } - 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; - } + var dep = schema2.dependencies[property]; + var childContext = ctx.makeChild(dep, property); + if (typeof dep == "string") { + dep = [dep]; } - return args; - }); - } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); - const compressionArgs = type2 !== "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 && type2 !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + 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 { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; - } - if (BSD_TAR_ZSTD) { - return args; + 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 [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a; - return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(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(`\\${path8.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(`\\${path8.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; + } + return result; + }; + validators["enum"] = function validateEnum(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + if (!Array.isArray(schema2["enum"])) { + throw new SchemaError("enum expects an array", schema2); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { + result.addError({ + name: "enum", + argument: schema2["enum"], + message: "is not one of enum values: " + schema2["enum"].map(String).join(",") + }); + } + return result; + }; + validators["const"] = function validateEnum(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!helpers.deepCompareStrict(schema2["const"], instance)) { + result.addError({ + name: "const", + argument: schema2["const"], + message: "does not exactly match expected constant: " + schema2["const"] + }); + } + return result; + }; + validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { + var self2 = this; + if (instance === void 0) return null; + var result = new ValidatorResult(instance, schema2, options, ctx); + var notTypes = schema2.not || schema2.disallow; + if (!notTypes) return null; + if (!Array.isArray(notTypes)) notTypes = [notTypes]; + notTypes.forEach(function(type2) { + if (self2.testType(instance, schema2, options, ctx, type2)) { + var id = type2 && (type2.$id || type2.id); + var schemaId = id || type2; + 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 urilib = require("url"); + var helpers = require_helpers3(); + module2.exports.SchemaScanResult = SchemaScanResult; + function SchemaScanResult(found, ref) { + this.id = found; + this.ref = ref; } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(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(`\\${path8.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(`\\${path8.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; + module2.exports.scan = function scan(base, schema2) { + function scanSchema(baseuri, schema3) { + if (!schema3 || typeof schema3 != "object") return; + if (schema3.$ref) { + var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; + return; } - }); - } - function execCommands(commands, cwd) { - return __awaiter4(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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + var id = schema3.$id || schema3.id; + var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + if (ourBase) { + if (ourBase.indexOf("#") < 0) ourBase += "#"; + if (found[ourBase]) { + if (!helpers.deepCompareStrict(found[ourBase], schema3)) { + throw new Error("Schema <" + ourBase + "> already exists with different definition"); + } + return found[ourBase]; + } + found[ourBase] = schema3; + if (ourBase[ourBase.length - 1] == "#") { + found[ourBase.substring(0, ourBase.length - 1)] = schema3; } } - }); - } - function listTar(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - exports2.listTar = listTar; - function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io6.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - exports2.extractTar = extractTar2; - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path8.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - exports2.createTar = createTar; + scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); + scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); + scanSchema(ourBase + "/additionalItems", schema3.additionalItems); + scanObject(ourBase + "/properties", schema3.properties); + scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); + scanObject(ourBase + "/definitions", schema3.definitions); + scanObject(ourBase + "/patternProperties", schema3.patternProperties); + scanObject(ourBase + "/dependencies", schema3.dependencies); + scanArray(ourBase + "/disallow", schema3.disallow); + scanArray(ourBase + "/allOf", schema3.allOf); + scanArray(ourBase + "/anyOf", schema3.anyOf); + scanArray(ourBase + "/oneOf", schema3.oneOf); + scanSchema(ourBase + "/not", schema3.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, schema2); + return new SchemaScanResult(found, ref); + }; } }); -// node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports2) { +// node_modules/jsonschema/lib/validator.js +var require_validator = __commonJS({ + "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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]; - } }; + var urilib = require("url"); + var attribute = require_attribute(); + var helpers = require_helpers3(); + var scanSchema = require_scan().scan; + var ValidatorResult = helpers.ValidatorResult; + var ValidatorResultError = helpers.ValidatorResultError; + var SchemaError = helpers.SchemaError; + var SchemaContext = helpers.SchemaContext; + var anonymousBase = "/"; + var Validator2 = function Validator3() { + this.customFormats = Object.create(Validator3.prototype.customFormats); + this.schemas = {}; + this.unresolvedRefs = []; + this.types = Object.create(types); + this.attributes = Object.create(attribute.validators); + }; + Validator2.prototype.customFormats = {}; + Validator2.prototype.schemas = null; + Validator2.prototype.types = null; + Validator2.prototype.attributes = null; + Validator2.prototype.unresolvedRefs = null; + Validator2.prototype.addSchema = function addSchema(schema2, base) { + var self2 = this; + if (!schema2) { + return null; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var scan = scanSchema(base || anonymousBase, schema2); + var ourUri = base || schema2.$id || schema2.id; + for (var uri in scan.id) { + this.schemas[uri] = scan.id[uri]; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); + for (var uri in scan.ref) { + this.unresolvedRefs.push(uri); } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + this.unresolvedRefs = this.unresolvedRefs.filter(function(uri2) { + return typeof self2.schemas[uri2] === "undefined"; }); + return this.schemas[ourUri]; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core13 = __importStar4(require_core()); - var path8 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); - var config_1 = require_config(); - var tar_1 = require_tar(); - var http_client_1 = require_lib3(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); + Validator2.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { + if (!Array.isArray(schemas)) return; + for (var i = 0; i < schemas.length; i++) { + this.addSubSchema(baseuri, schemas[i]); } }; - exports2.ValidationError = ValidationError; - var ReserveCacheError = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); + Validator2.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { + if (!schemas || typeof schemas != "object") return; + for (var p in schemas) { + this.addSubSchema(baseuri, schemas[p]); } }; - exports2.ReserveCacheError = ReserveCacheError; - var FinalizeCacheError = class _FinalizeCacheError extends Error { - constructor(message) { - super(message); - this.name = "FinalizeCacheError"; - Object.setPrototypeOf(this, _FinalizeCacheError.prototype); - } + Validator2.prototype.setSchemas = function setSchemas(schemas) { + this.schemas = schemas; }; - 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.`); + Validator2.prototype.getSchema = function getSchema(urn) { + return this.schemas[urn]; + }; + Validator2.prototype.validate = function validate(instance, schema2, options, ctx) { + if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { + throw new SchemaError("Expected `schema` to be an object or boolean"); } - } - 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"]; + if (!options) { + options = {}; } - } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core13.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - switch (cacheServiceVersion) { - case "v2": - return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - case "v1": - default: - return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - } - }); - } - exports2.restoreCache = restoreCache3; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core13.debug("Resolved Keys:"); - core13.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 { - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core13.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path8.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core13.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core13.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to restore: ${error4.message}`); - } else { - core13.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core13.debug(`Failed to delete archive: ${error4}`); - } - } - return void 0; - }); - } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core13.debug("Resolved Keys:"); - core13.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 request = { - key: primaryKey, - restoreKeys, - version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) - }; - const response = yield twirpClient.GetCacheEntryDownloadURL(request); - if (!response.ok) { - core13.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); - return void 0; - } - const isRestoreKeyMatch = request.key !== response.matchedKey; - if (isRestoreKeyMatch) { - core13.info(`Cache hit for restore-key: ${response.matchedKey}`); - } else { - core13.info(`Cache hit for: ${response.matchedKey}`); - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core13.info("Lookup only - skipping download"); - return response.matchedKey; - } - archivePath = path8.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive path: ${archivePath}`); - core13.debug(`Starting download of archive to: ${archivePath}`); - yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core13.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core13.info("Cache restored successfully"); - return response.matchedKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to restore: ${error4.message}`); - } else { - core13.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { - try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error4) { - core13.debug(`Failed to delete archive: ${error4}`); - } + var id = schema2.$id || schema2.id; + var base = urilib.resolve(options.base || anonymousBase, id || ""); + if (!ctx) { + ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); + if (!ctx.schemas[base]) { + ctx.schemas[base] = schema2; } - return void 0; - }); - } - function saveCache3(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core13.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); + var found = scanSchema(base, schema2); + 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, schema2, options, ctx); + result.addError("is required, but is undefined"); + return result; + } + var result = this.validateSchema(instance, schema2, options, ctx); + if (!result) { + throw new Error("Result undefined"); + } else if (options.throwAll && result.errors.length) { + throw new ValidatorResultError(result); + } + return result; + }; + function shouldResolve(schema2) { + var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; + if (typeof ref == "string") return ref; + return false; } - exports2.saveCache = saveCache3; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core13.debug("Cache Paths:"); - core13.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 = path8.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core13.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.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.`); - } - core13.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize - }); - if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); - } - core13.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core13.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to save: ${typedError.message}`); - } else { - core13.warning(`Failed to save: ${typedError.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core13.debug(`Failed to delete archive: ${error4}`); - } + Validator2.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (typeof schema2 === "boolean") { + if (schema2 === true) { + schema2 = {}; + } else if (schema2 === false) { + schema2 = { type: [] }; } - return cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core13.debug("Cache Paths:"); - core13.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.`); + } else if (!schema2) { + throw new Error("schema is undefined"); + } + if (schema2["extends"]) { + if (Array.isArray(schema2["extends"])) { + var schemaobj = { schema: schema2, ctx }; + schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); + schema2 = schemaobj.schema; + schemaobj.schema = null; + schemaobj.ctx = null; + schemaobj = null; + } else { + schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path8.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core13.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core13.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core13.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core13.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; - try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core13.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core13.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); - } - core13.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); - core13.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 (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core13.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core13.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core13.error(`Failed to save: ${typedError.message}`); - } else { - core13.warning(`Failed to save: ${typedError.message}`); - } + } + var switchSchema = shouldResolve(schema2); + if (switchSchema) { + var resolved = this.resolve(schema2, 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 schema2) { + if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { + var validatorErr = null; + var validator = this.attributes[key]; + if (validator) { + validatorErr = validator.call(this, instance, schema2, options, ctx); + } else if (options.allowUnknownAttributes === false) { + throw new SchemaError("Unsupported attribute: " + key, schema2); } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core13.debug(`Failed to delete archive: ${error4}`); + if (validatorErr) { + result.importErrors(validatorErr); } } - return cacheId; - }); - } - } -}); - -// node_modules/jsonschema/lib/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { - "use strict"; - var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path8, name, argument) { - if (Array.isArray(path8)) { - this.path = path8; - this.property = path8.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else if (path8 !== void 0) { - this.property = path8; - } - if (message) { - this.message = message; - } - if (schema2) { - var id = schema2.$id || schema2.id; - this.schema = id || schema2; } - if (instance !== void 0) { - this.instance = instance; + if (typeof options.rewrite == "function") { + var value = options.rewrite.call(this, instance, schema2, options, ctx); + result.instance = value; } - this.name = name; - this.argument = argument; - this.stack = this.toString(); + return result; }; - ValidationError.prototype.toString = function toString2() { - return this.property + " " + this.message; + Validator2.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { + schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); }; - var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema2, options, ctx) { - this.instance = instance; - this.schema = schema2; - 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; + Validator2.prototype.superResolve = function superResolve(schema2, ctx) { + var ref = shouldResolve(schema2); + if (ref) { + return this.resolve(schema2, ref, ctx).subschema; + } + return schema2; }; - 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); + Validator2.prototype.resolve = function resolve4(schema2, switchSchema, ctx) { + switchSchema = ctx.resolve(switchSchema); + if (ctx.schemas[switchSchema]) { + return { subschema: ctx.schemas[switchSchema], switchSchema }; } - this.errors.push(err); - if (this.throwFirst) { - throw new ValidatorResultError(this); - } else if (this.throwError) { - throw err; + var parsed = urilib.parse(switchSchema); + var fragment = parsed && 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 + ">", schema2); } - 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); + var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); + if (subschema === void 0) { + throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); } + return { subschema, switchSchema }; }; - 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 (Error.captureStackTrace) { - Error.captureStackTrace(this, ValidatorResultError); + Validator2.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { + if (type2 === void 0) { + return; + } else if (type2 === null) { + throw new SchemaError('Unexpected null in "type" keyword'); } - 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, schema2) { - this.message = msg; - this.schema = schema2; - Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); - }; - SchemaError.prototype = Object.create( - Error.prototype, - { - constructor: { value: SchemaError, enumerable: false }, - name: { value: "SchemaError", enumerable: false } + if (typeof this.types[type2] == "function") { + return this.types[type2].call(this, instance); } - ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path8, base, schemas) { - this.schema = schema2; - this.options = options; - if (Array.isArray(path8)) { - this.path = path8; - this.propertyPath = path8.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else { - this.propertyPath = path8; + if (type2 && typeof type2 == "object") { + var res = this.validateSchema(instance, type2, options, ctx); + return res === void 0 || !(res && res.errors.length); } - this.base = base; - this.schemas = schemas; + return true; }; - SchemaContext.prototype.resolve = function resolve4(target) { - return uri.resolve(this.base, target); + var types = Validator2.prototype.types = {}; + types.string = function testString(instance) { + return typeof instance == "string"; }; - SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path8 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); - var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path8, base, Object.create(this.schemas)); - if (id && !ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - return ctx; + types.number = function testNumber(instance) { + return typeof instance == "number" && isFinite(instance); }; - 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]+$/ + types.integer = function testInteger(instance) { + return typeof instance == "number" && instance % 1 === 0; }; - 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); - } + types.boolean = function testBoolean(instance) { + return typeof instance == "boolean"; + }; + types.array = function testArray(instance) { + return Array.isArray(instance); + }; + types["null"] = function testNull(instance) { + return instance === null; + }; + types.date = function testDate(instance) { + return instance instanceof Date; + }; + types.any = function testAny(instance) { return true; }; - var makeSuffix = exports2.makeSuffix = function makeSuffix2(key) { - key = key.toString(); - if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { - return "." + key; + types.object = function testObject(instance) { + return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); + }; + module2.exports = Validator2; + } +}); + +// node_modules/jsonschema/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/jsonschema/lib/index.js"(exports2, module2) { + "use strict"; + var Validator2 = module2.exports.Validator = require_validator(); + module2.exports.ValidatorResult = require_helpers3().ValidatorResult; + module2.exports.ValidatorResultError = require_helpers3().ValidatorResultError; + module2.exports.ValidationError = require_helpers3().ValidationError; + module2.exports.SchemaError = require_helpers3().SchemaError; + module2.exports.SchemaScanResult = require_scan().SchemaScanResult; + module2.exports.scan = require_scan().scan; + module2.exports.validate = function(instance, schema2, options) { + var v = new Validator2(); + return v.validate(instance, schema2, options); + }; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/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; } - if (key.match(/^\d+$/)) { - return "[" + key + "]"; + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - return "[" + JSON.stringify(key) + "]"; - }; - exports2.deepCompareStrict = function deepCompareStrict(a, b) { - if (typeof a !== typeof b) { - return false; + 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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - 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]); - }); + 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); } - if (typeof a === "object") { - if (!a || !b) { - return a === b; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.issue = exports2.issueCommand = void 0; + var os3 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os3.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"; } - var aKeys = Object.keys(a); - var bKeys = Object.keys(b); - if (aKeys.length !== bKeys.length) { - return false; + 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)}`; + } + } + } } - return aKeys.every(function(v) { - return deepCompareStrict(a[v], b[v]); - }); + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - 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 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/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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 crypto2 = __importStar2(require("crypto")); + var fs9 = __importStar2(require("fs")); + var os3 = __importStar2(require("os")); + var utils_1 = require_utils8(); + 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 (!fs9.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } + fs9.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { + encoding: "utf8" + }); } - function copyist(src, dst, key) { - dst[key] = src[key]; + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.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}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; } - 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]; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/tool-cache/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 { - dst[key] = deepMerge(target[key], src[key]); + return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + } + })(); + if (proxyVar) { + try { + return new DecodedURL(proxyVar); + } catch (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); } + } else { + return void 0; } } - function deepMerge(target, src) { - var array = Array.isArray(src); - var dst = array && [] || {}; - if (array) { - 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)); + 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; } - Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); } - return dst; + return false; } - 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.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]"); } - exports2.encodePath = function encodePointer(a) { - return a.map(pathEncoder).join(""); - }; - exports2.getDecimalPlaces = function getDecimalPlaces(number) { - var decimalPlaces = 0; - if (isNaN(number)) return decimalPlaces; - if (typeof number !== "number") { - number = Number(number); + var DecodedURL = class extends URL { + constructor(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); } - var parts = number.toString().split("e"); - if (parts.length === 2) { - if (parts[1][0] !== "-") { - return decimalPlaces; - } else { - decimalPlaces = Number(parts[1].slice(1)); - } + get username() { + return this._decodedUsername; } - var decimalParts = parts[0].split("."); - if (decimalParts.length === 2) { - decimalPlaces += decimalParts[1].length; + get password() { + return this._decodedPassword; } - return decimalPlaces; - }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; }; } }); -// node_modules/jsonschema/lib/attribute.js -var require_attribute = __commonJS({ - "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var helpers = require_helpers3(); - 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, schema2, options, ctx) { - if (instance === void 0) { - return null; + 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]; + } }; } - var result = new ValidatorResult(instance, schema2, options, ctx); - var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; - if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { - var list = types.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 - }); + 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; }; - function testSchemaNoThrow(instance, options, ctx, callback, schema2) { - var throwError2 = options.throwError; - var throwAll = options.throwAll; - options.throwError = false; - options.throwAll = false; - var res = this.validateSchema(instance, schema2, options, ctx); - options.throwError = throwError2; - options.throwAll = throwAll; - if (!res.valid && callback instanceof Function) { - callback(res); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - return res.valid; + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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 : ""; } - validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + 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); } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - if (!Array.isArray(schema2.anyOf)) { - throw new SchemaError("anyOf must be an array"); + }; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; } - if (!schema2.anyOf.some( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - )) { - var list = schema2.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 + "]"; + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __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", () => { + resolve4(output.toString()); + }); + })); }); - if (options.nestedErrors) { - result.importErrors(inner); - } - result.addError({ - name: "anyOf", - argument: list, - message: "is not any of " + list.join(",") + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve4(Buffer.concat(chunks)); + }); + })); }); } - return result; }; - validators.allOf = function validateAllOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; + } + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; + } + } } - if (!Array.isArray(schema2.allOf)) { - throw new SchemaError("allOf must be an array"); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - var result = new ValidatorResult(instance, schema2, options, ctx); - var self2 = this; - schema2.allOf.forEach(function(v, i) { - var valid3 = self2.validateSchema(instance, v, options, ctx); - if (!valid3.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: valid3.errors.length, valid: valid3 }, - message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" - }); - result.importErrors(valid3); - } - }); - return result; - }; - validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - if (!Array.isArray(schema2.oneOf)) { - throw new SchemaError("oneOf must be an array"); + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - var count = schema2.oneOf.filter( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - ).length; - var list = schema2.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(",") + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - return result; - }; - validators.if = function validateIf(instance, schema2, options, ctx) { - if (instance === void 0) return null; - if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); - var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); - var result = new ValidatorResult(instance, schema2, options, ctx); - var res; - if (ifValid) { - if (schema2.then === void 0) return; - if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); - res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); - result.importErrors(res); - } else { - if (schema2.else === void 0) return; - if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); - res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); - result.importErrors(res); + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return result; - }; - function getEnumerableProperty(object, key) { - if (Object.hasOwnProperty.call(object, key)) return object[key]; - if (!(key in object)) return; - while (object = Object.getPrototypeOf(object)) { - if (Object.propertyIsEnumerable.call(object, key)) return object[key]; + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - } - validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var subschema = schema2.propertyNames !== void 0 ? schema2.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); - } + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - return result; - }; - validators.properties = function validateProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var properties = schema2.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); + 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - return result; - }; - function testAdditionalProperty(instance, schema2, options, ctx, property, result) { - if (!this.types.object(instance)) return; - if (schema2.properties && schema2.properties[property] !== void 0) { - return; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; } - if (schema2.additionalProperties === false) { - result.addError({ - name: "additionalProperties", - argument: property, - message: "is not allowed to have the additional property " + JSON.stringify(property) + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve4(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); }); - } else { - var additionalProperties = schema2.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, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var patternProperties = schema2.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); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; } - if (!regexp.test(property)) { - continue; + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); } - test = false; - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, subschema, options, ctx); + } + const req = info6.httpModule.request(info6.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(); } - 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); + handleResult(new Error(`Request timeout: ${info6.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); } - if (test) { - testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); } } - return result; - }; - validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - if (schema2.patternProperties) { - return null; + /** + * 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); } - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in instance) { - testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + 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); } - return result; - }; - validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length >= schema2.minProperties)) { - result.addError({ - name: "minProperties", - argument: schema2.minProperties, - message: "does not meet minimum property length of " + schema2.minProperties - }); + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); + } + } + return info6; } - return result; - }; - validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length <= schema2.maxProperties)) { - result.addError({ - name: "maxProperties", - argument: schema2.maxProperties, - message: "does not meet maximum property length of " + schema2.maxProperties - }); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - return result; - }; - validators.items = function validateItems(instance, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.items === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - instance.every(function(value, i) { - if (Array.isArray(schema2.items)) { - var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; - } else { - var items = schema2.items; + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - if (items === void 0) { - return true; + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - if (items === false) { - result.addError({ - name: "items", - message: "additionalItems not permitted" - }); - return false; + if (!useProxy) { + agent = this._agent; } - 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, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.contains === void 0) return; - if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); - var result = new ValidatorResult(instance, schema2, options, ctx); - var count = instance.some(function(value, i) { - var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); - return res.errors.length === 0; - }); - if (count === false) { - result.addError({ - name: "contains", - argument: schema2.contains, - message: "must contain an item matching given schema" - }); - } - return result; - }; - validators.minimum = function validateMinimum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { - if (!(instance > schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than " + schema2.minimum - }); + if (agent) { + return agent; } - } else { - if (!(instance >= schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than or equal to " + schema2.minimum + 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 https2.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false }); } + return agent; } - return result; - }; - validators.maximum = function validateMaximum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { - if (!(instance < schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than " + schema2.maximum - }); + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; } - } else { - if (!(instance <= schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than or equal to " + schema2.maximum + 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; } - return result; - }; - validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMinimum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid3 = instance > schema2.exclusiveMinimum; - if (!valid3) { - result.addError({ - name: "exclusiveMinimum", - argument: schema2.exclusiveMinimum, - message: "must be strictly greater than " + schema2.exclusiveMinimum - }); - } - return result; - }; - validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMaximum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid3 = instance < schema2.exclusiveMaximum; - if (!valid3) { - result.addError({ - name: "exclusiveMaximum", - argument: schema2.exclusiveMaximum, - message: "must be strictly less than " + schema2.exclusiveMaximum - }); - } - return result; - }; - var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { - if (!this.types.number(instance)) return; - var validationArgument = schema2[validationType]; - if (validationArgument == 0) { - throw new SchemaError(validationType + " cannot be zero"); - } - var result = new ValidatorResult(instance, schema2, 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, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); - }; - validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); - }; - validators.required = function validateRequired(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (instance === void 0 && schema2.required === true) { - result.addError({ - name: "required", - message: "is required" - }); - } else if (this.types.object(instance) && Array.isArray(schema2.required)) { - schema2.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, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var pattern = schema2.pattern; - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); - } - if (!instance.match(regexp)) { - result.addError({ - name: "pattern", - argument: schema2.pattern, - message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) - }); - } - return result; - }; - validators.format = function validateFormat(instance, schema2, options, ctx) { - if (instance === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { - result.addError({ - name: "format", - argument: schema2.format, - message: "does not conform to the " + JSON.stringify(schema2.format) + " format" - }); - } - return result; - }; - validators.minLength = function validateMinLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length >= schema2.minLength)) { - result.addError({ - name: "minLength", - argument: schema2.minLength, - message: "does not meet minimum length of " + schema2.minLength + _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((resolve4) => setTimeout(() => resolve4(), ms)); }); } - return result; - }; - validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length <= schema2.maxLength)) { - result.addError({ - name: "maxLength", - argument: schema2.maxLength, - message: "does not meet maximum length of " + schema2.maxLength + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve4(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 { + resolve4(response); + } + })); }); } - return result; }; - validators.minItems = function validateMinItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length >= schema2.minItems)) { - result.addError({ - name: "minItems", - argument: schema2.minItems, - message: "does not meet minimum length of " + schema2.minItems + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve4) { + resolve4(value); }); } - return result; + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length <= schema2.maxItems)) { - result.addError({ - name: "maxItems", - argument: schema2.maxItems, - message: "does not meet maximum length of " + schema2.maxItems - }); + 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; } - 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; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - return true; - } - validators.uniqueItems = function validateUniqueItems(instance, schema2, options, ctx) { - if (schema2.uniqueItems !== true) return; - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!instance.every(testArrays)) { - result.addError({ - name: "uniqueItems", - message: "contains duplicate item" + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - return result; }; - validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in schema2.dependencies) { - if (instance[property] === void 0) { - continue; - } - var dep = schema2.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); - } - } + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - return result; - }; - validators["enum"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + // 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}`; } - if (!Array.isArray(schema2["enum"])) { - throw new SchemaError("enum expects an array", schema2); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { - result.addError({ - name: "enum", - argument: schema2["enum"], - message: "is not one of enum values: " + schema2["enum"].map(String).join(",") + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - return result; }; - validators["const"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!helpers.deepCompareStrict(schema2["const"], instance)) { - result.addError({ - name: "const", - argument: schema2["const"], - message: "does not exactly match expected constant: " + schema2["const"] + // 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"); }); } - return result; - }; - validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { - var self2 = this; - if (instance === void 0) return null; - var result = new ValidatorResult(instance, schema2, options, ctx); - var notTypes = schema2.not || schema2.disallow; - if (!notTypes) return null; - if (!Array.isArray(notTypes)) notTypes = [notTypes]; - notTypes.forEach(function(type2) { - if (self2.testType(instance, schema2, options, ctx, type2)) { - var id = type2 && (type2.$id || type2.id); - var schemaId = id || type2; - result.addError({ - name: "not", - argument: schemaId, - message: "is of prohibited type " + schemaId - }); - } - }); - return result; }; - module2.exports = attribute; + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/jsonschema/lib/scan.js -var require_scan = __commonJS({ - "node_modules/jsonschema/lib/scan.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var urilib = require("url"); - var helpers = require_helpers3(); - module2.exports.SchemaScanResult = SchemaScanResult; - function SchemaScanResult(found, ref) { - this.id = found; - this.ref = ref; - } - module2.exports.scan = function scan(base, schema2) { - function scanSchema(baseuri, schema3) { - if (!schema3 || typeof schema3 != "object") return; - if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); - ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; - return; - } - var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; - if (ourBase) { - if (ourBase.indexOf("#") < 0) ourBase += "#"; - if (found[ourBase]) { - if (!helpers.deepCompareStrict(found[ourBase], schema3)) { - throw new Error("Schema <" + ourBase + "> already exists with different definition"); - } - return found[ourBase]; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - found[ourBase] = schema3; - if (ourBase[ourBase.length - 1] == "#") { - found[ourBase.substring(0, ourBase.length - 1)] = schema3; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); - scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); - scanSchema(ourBase + "/additionalItems", schema3.additionalItems); - scanObject(ourBase + "/properties", schema3.properties); - scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); - scanObject(ourBase + "/definitions", schema3.definitions); - scanObject(ourBase + "/patternProperties", schema3.patternProperties); - scanObject(ourBase + "/dependencies", schema3.dependencies); - scanArray(ourBase + "/disallow", schema3.disallow); - scanArray(ourBase + "/allOf", schema3.allOf); - scanArray(ourBase + "/anyOf", schema3.anyOf); - scanArray(ourBase + "/oneOf", schema3.oneOf); - scanSchema(ourBase + "/not", schema3.not); + function step(result) { + result.done ? resolve4(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_auth3(); + 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); } - function scanArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - scanSchema(baseuri + "/" + i, schemas[i]); + 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; } - function scanObject(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - scanSchema(baseuri + "/" + p, schemas[p]); + 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 _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.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}`); + } + }); } - var found = {}; - var ref = {}; - scanSchema(base, schema2); - return new SchemaScanResult(found, ref); }; + exports2.OidcClient = OidcClient; } }); -// node_modules/jsonschema/lib/validator.js -var require_validator2 = __commonJS({ - "node_modules/jsonschema/lib/validator.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var urilib = require("url"); - var attribute = require_attribute(); - var helpers = require_helpers3(); - var scanSchema = require_scan().scan; - var ValidatorResult = helpers.ValidatorResult; - var ValidatorResultError = helpers.ValidatorResultError; - var SchemaError = helpers.SchemaError; - var SchemaContext = helpers.SchemaContext; - var anonymousBase = "/"; - var Validator2 = function Validator3() { - this.customFormats = Object.create(Validator3.prototype.customFormats); - this.schemas = {}; - this.unresolvedRefs = []; - this.types = Object.create(types); - this.attributes = Object.create(attribute.validators); - }; - Validator2.prototype.customFormats = {}; - Validator2.prototype.schemas = null; - Validator2.prototype.types = null; - Validator2.prototype.attributes = null; - Validator2.prototype.unresolvedRefs = null; - Validator2.prototype.addSchema = function addSchema(schema2, base) { - var self2 = this; - if (!schema2) { - return null; - } - var scan = scanSchema(base || anonymousBase, schema2); - var ourUri = base || schema2.$id || schema2.id; - for (var uri in scan.id) { - this.schemas[uri] = scan.id[uri]; - } - for (var uri in scan.ref) { - this.unresolvedRefs.push(uri); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve4) { + resolve4(value); + }); } - this.unresolvedRefs = this.unresolvedRefs.filter(function(uri2) { - return typeof self2.schemas[uri2] === "undefined"; + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - return this.schemas[ourUri]; }; - Validator2.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - this.addSubSchema(baseuri, schemas[i]); + 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 = ""; } - }; - Validator2.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - this.addSubSchema(baseuri, schemas[p]); + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - }; - Validator2.prototype.setSchemas = function setSchemas(schemas) { - this.schemas = schemas; - }; - Validator2.prototype.getSchema = function getSchema(urn) { - return this.schemas[urn]; - }; - Validator2.prototype.validate = function validate(instance, schema2, options, ctx) { - if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { - throw new SchemaError("Expected `schema` to be an object or boolean"); + /** + * 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}`; } - if (!options) { - options = {}; + /** + * 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(); + }); } - var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); - if (!ctx) { - ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); - if (!ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - var found = scanSchema(base, schema2); - for (var n in found.id) { - var sch = found.id[n]; - ctx.schemas[n] = sch; - } + /** + * 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 }); + }); } - if (options.required && instance === void 0) { - var result = new ValidatorResult(instance, schema2, options, ctx); - result.addError("is required, but is undefined"); - return result; + /** + * 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; } - var result = this.validateSchema(instance, schema2, options, ctx); - if (!result) { - throw new Error("Result undefined"); - } else if (options.throwAll && result.errors.length) { - throw new ValidatorResultError(result); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - return result; - }; - function shouldResolve(schema2) { - var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; - if (typeof ref == "string") return ref; - return false; - } - Validator2.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (typeof schema2 === "boolean") { - if (schema2 === true) { - schema2 = {}; - } else if (schema2 === false) { - schema2 = { type: [] }; - } - } else if (!schema2) { - throw new Error("schema is undefined"); + /** + * 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; } - if (schema2["extends"]) { - if (Array.isArray(schema2["extends"])) { - var schemaobj = { schema: schema2, ctx }; - schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); - schema2 = schemaobj.schema; - schemaobj.schema = null; - schemaobj.ctx = null; - schemaobj = null; - } else { - schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); - } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - var switchSchema = shouldResolve(schema2); - if (switchSchema) { - var resolved = this.resolve(schema2, switchSchema, ctx); - var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas); - return this.validateSchema(instance, resolved.subschema, options, subctx); + /** + * 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(); } - var skipAttributes = options && options.skipAttributes || []; - for (var key in schema2) { - if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { - var validatorErr = null; - var validator = this.attributes[key]; - if (validator) { - validatorErr = validator.call(this, instance, schema2, options, ctx); - } else if (options.allowUnknownAttributes === false) { - throw new SchemaError("Unsupported attribute: " + key, schema2); - } - if (validatorErr) { - result.importErrors(validatorErr); - } - } + /** + * 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(); } - if (typeof options.rewrite == "function") { - var value = options.rewrite.call(this, instance, schema2, options, ctx); - result.instance = value; + /** + * 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(); } - return result; - }; - Validator2.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { - schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); - }; - Validator2.prototype.superResolve = function superResolve(schema2, ctx) { - var ref = shouldResolve(schema2); - if (ref) { - return this.resolve(schema2, ref, ctx).subschema; + /** + * 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(); } - return schema2; - }; - Validator2.prototype.resolve = function resolve4(schema2, switchSchema, ctx) { - switchSchema = ctx.resolve(switchSchema); - if (ctx.schemas[switchSchema]) { - return { subschema: ctx.schemas[switchSchema], switchSchema }; + /** + * 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(); } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && 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 + ">", schema2); + /** + * 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(); } - var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); - if (subschema === void 0) { - throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); + /** + * 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(); } - return { subschema, switchSchema }; - }; - Validator2.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { - if (type2 === void 0) { - return; - } else if (type2 === null) { - throw new SchemaError('Unexpected null in "type" keyword'); + /** + * 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(); } - if (typeof this.types[type2] == "function") { - return this.types[type2].call(this, instance); + /** + * 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(); } - if (type2 && typeof type2 == "object") { - var res = this.validateSchema(instance, type2, options, ctx); - return res === void 0 || !(res && res.errors.length); + /** + * 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(); } - return true; - }; - var types = Validator2.prototype.types = {}; - types.string = function testString(instance) { - return typeof instance == "string"; - }; - types.number = function testNumber(instance) { - return typeof instance == "number" && isFinite(instance); - }; - types.integer = function testInteger(instance) { - return typeof instance == "number" && instance % 1 === 0; - }; - types.boolean = function testBoolean(instance) { - return typeof instance == "boolean"; - }; - types.array = function testArray(instance) { - return Array.isArray(instance); - }; - types["null"] = function testNull(instance) { - return instance === null; - }; - types.date = function testDate(instance) { - return instance instanceof Date; - }; - types.any = function testAny(instance) { - return true; - }; - types.object = function testObject(instance) { - return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); }; - module2.exports = Validator2; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/jsonschema/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/jsonschema/lib/index.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var Validator2 = module2.exports.Validator = require_validator2(); - module2.exports.ValidatorResult = require_helpers3().ValidatorResult; - module2.exports.ValidatorResultError = require_helpers3().ValidatorResultError; - module2.exports.ValidationError = require_helpers3().ValidationError; - module2.exports.SchemaError = require_helpers3().SchemaError; - module2.exports.SchemaScanResult = require_scan().SchemaScanResult; - module2.exports.scan = require_scan().scan; - module2.exports.validate = function(instance, schema2, options) { - var v = new Validator2(); - return v.validate(instance, schema2, options); + 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 path8 = __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, path8.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ +var require_io_util3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77106,21 +84511,21 @@ var require_io_util4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -77150,14 +84555,14 @@ var require_io_util4 = __commonJS({ var _a; 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 fs9 = __importStar4(require("fs")); - var path8 = __importStar4(require("path")); + var fs9 = __importStar2(require("fs")); + var path8 = __importStar2(require("path")); _a = fs9.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs9.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -77171,7 +84576,7 @@ var require_io_util4 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -77189,7 +84594,7 @@ var require_io_util4 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -77267,10 +84672,10 @@ var require_io_util4 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ +var require_io3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77279,21 +84684,21 @@ var require_io4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -77323,10 +84728,10 @@ var require_io4 = __commonJS({ 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 path8 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); + var path8 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -77353,7 +84758,7 @@ var require_io4 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -77374,7 +84779,7 @@ var require_io4 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -77394,14 +84799,14 @@ var require_io4 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77425,7 +84830,7 @@ var require_io4 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77473,7 +84878,7 @@ var require_io4 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -77483,290 +84888,65 @@ var require_io4 = __commonJS({ 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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve4) { - resolve4(value); - }); - } - return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os3 = require("os"); - var cp = require("child_process"); - var fs9 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os3.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os3.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; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs9.existsSync(lsbReleaseFile)) { - contents = fs9.readFileSync(lsbReleaseFile).toString(); - } else if (fs9.existsSync(osReleaseFile)) { - contents = fs9.readFileSync(osReleaseFile).toString(); - } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/tool-cache/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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + if (srcFileStat.isDirectory()) { + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } else { + yield copyFile(srcFile, destFile, force); + } } - } else { - return void 0; - } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - 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; + function copyFile(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); } - } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -77794,598 +84974,463 @@ var require_lib5 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(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", () => { - resolve4(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve4(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(userAgent, 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 = userAgent; - 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; - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os3 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path8 = __importStar2(require("path")); + var io6 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + _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}`; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - } 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(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve4(res); - } + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info6.httpModule.request(info6.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: ${info6.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; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + return cmd; } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os3.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os3.EOL.length); + n = s.indexOf(os3.EOL); } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - return info6; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } } - return lowercaseKeys(headers || {}); + return this.toolPath; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + _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 additionalHeaders[header] || clientHeader || _default2; + return this.args; } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + _endsWith(str2, end) { + return str2.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 (!useProxy) { - agent = this._agent; + if (!arg) { + return '""'; } - if (agent) { - return agent; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; + } } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (!needsQuotes) { + return arg; } - 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; + 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 { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + quoteHit = false; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + reverse += '"'; + return reverse.split("").reverse().join(""); } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - if (proxyAgent) { - return proxyAgent; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - 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 - }); + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; } - return proxyAgent; + 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(""); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); - }); + _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; } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve4(response); + _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 = path8.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve4, 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}`); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.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); } - } - return value; + 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 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); + 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); } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { + 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); + } + }); + }); } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; + 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 { - msg = `Failed request: (${statusCode})`; + resolve4(exitCode); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve4(response); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } })); }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.ToolRunner = ToolRunner6; + 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/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -78413,58 +85458,63 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core13 = __importStar4(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"); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + function exec(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.`); } - } - execute(action, isRetryable) { - return __awaiter4(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; - } - core13.info(err.message); - } - const seconds = this.getSleepAmount(); - core13.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => setTimeout(resolve4, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + }; + 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 exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78477,21 +85527,21 @@ var require_tool_cache = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve4) { resolve4(value); @@ -78518,613 +85568,301 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core13 = __importStar4(require_core()); - var io6 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs9 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os3 = __importStar4(require("os")); - var path8 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver8 = __importStar4(require_semver2()); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(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); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path8.join(_getTempDirectory(), crypto.randomUUID()); - yield io6.mkdirP(path8.dirname(dest)); - core13.debug(`Downloading ${url}`); - core13.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs9.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core13.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core13.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream2.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs9.createWriteStream(dest)); - core13.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core13.debug("download failed"); - try { - yield io6.rmRF(dest); - } catch (err) { - core13.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core13.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path8.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 io6.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core13.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() - } - }); - core13.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core13.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core13.isDebug()) { - args.push("-v"); - } - const xarPath = yield io6.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io6.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 - ]; - core13.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 io6.which("powershell", true); - core13.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io6.which("unzip", true); - const args = [file]; - if (!core13.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os3.arch(); - core13.debug(`Caching tool ${tool} ${version} ${arch2}`); - core13.debug(`source dir: ${sourceDir}`); - if (!fs9.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs9.readdirSync(sourceDir)) { - const s = path8.join(sourceDir, itemName); - yield io6.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch2); - return destPath; - }); - } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os3.arch(); - core13.debug(`Caching tool ${tool} ${version} ${arch2}`); - core13.debug(`source file: ${sourceFile}`); - if (!fs9.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path8.join(destFolder, targetFile); - core13.debug(`destination file ${destPath}`); - yield io6.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); - return destFolder; - }); - } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch2) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch2 = arch2 || os3.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path8.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core13.debug(`checking cache: ${cachePath}`); - if (fs9.existsSync(cachePath) && fs9.existsSync(`${cachePath}.complete`)) { - core13.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); - toolPath = cachePath; - } else { - core13.debug("not found"); - } - } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch2) { - const versions = []; - arch2 = arch2 || os3.arch(); - const toolPath = path8.join(_getCacheDirectory(), toolName); - if (fs9.existsSync(toolPath)) { - const children = fs9.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path8.join(toolPath, child, arch2 || ""); - if (fs9.existsSync(fullPath) && fs9.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } - } - return versions; - } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core13.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core13.debug("Invalid json"); - } - } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os3.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path8.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io6.mkdirP(dest); - return dest; + 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 exec = __importStar2(require_exec3()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true }); - } - function _createToolPath(tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path8.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - core13.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io6.rmRF(folderPath); - yield io6.rmRF(markerPath); - yield io6.mkdirP(folderPath); - return folderPath; + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true }); - } - function _completeToolPath(tool, version, arch2) { - const folderPath = path8.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - const markerPath = `${folderPath}.complete`; - fs9.writeFileSync(markerPath, ""); - core13.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core13.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core13.debug(`explicit? ${valid3}`); - return valid3; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core13.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; - } - return -1; + return { + name: name.trim(), + version: version.trim() + }; + }); + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core13.debug(`matched: ${version}`); - } else { - core13.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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; - }; + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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/http-client/lib/proxy.js -var require_proxy5 = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.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; + 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]; + } }; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + 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(resolve4) { + resolve4(value); + }); + } + return new (P || (P = Promise))(function(resolve4, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } else { - return void 0; + function step(result) { + result.done ? resolve4(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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os3 = __importStar2(require("os")); + var path8 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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 checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + process.env["PATH"] = `${inputPath}${path8.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + if (options && options.trimWhitespace === false) { + return val; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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; } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - 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; + process.stdout.write(os3.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os3.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } + return result; + }); + } + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return false; + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - 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]"); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -79137,31 +85875,21 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve4) { resolve4(value); @@ -79189,628 +85917,780 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(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", () => { - resolve4(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve4(Buffer.concat(chunks)); + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os3 = require("os"); + var cp = require("child_process"); + var fs9 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os3.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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 (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); + } + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os3.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; + } } } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs9.existsSync(lsbReleaseFile)) { + contents = fs9.readFileSync(lsbReleaseFile).toString(); + } else if (fs9.existsSync(osReleaseFile)) { + contents = fs9.readFileSync(osReleaseFile).toString(); + } + return contents; + } + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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 || 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); } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); + __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(resolve4) { + resolve4(value); }); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(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 core13 = __importStar2(require_core3()); + 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"); + } } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); + 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; + } + core13.info(err.message); + } + const seconds = this.getSleepAmount(); + core13.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); }); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + getSleepAmount() { + return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); + sleep(seconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve4) => setTimeout(resolve4, seconds * 1e3)); }); } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + 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]; + } }; } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + 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); } - /** - * 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 __awaiter4(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); + __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(resolve4) { + resolve4(value); }); } - postJson(requestUrl_1, obj_1) { - return __awaiter4(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); - }); + return new (P || (P = Promise))(function(resolve4, 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 ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core13 = __importStar2(require_core3()); + var io6 = __importStar2(require_io3()); + var crypto2 = __importStar2(require("crypto")); + var fs9 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os3 = __importStar2(require("os")); + var path8 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver9 = __importStar2(require_semver2()); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + 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); } - putJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }; + exports2.HTTPError = HTTPError2; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path8.join(_getTempDirectory(), crypto2.randomUUID()); + yield io6.mkdirP(path8.dirname(dest)); + core13.debug(`Downloading ${url}`); + core13.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(url, dest || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; }); - } - patchJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }); + } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs9.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false }); - } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + if (auth) { + core13.debug("set auth"); + if (headers === void 0) { + headers = {}; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + headers.authorization = auth; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve4(res); - } + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core13.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream2.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs9.createWriteStream(dest)); + core13.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core13.debug("download failed"); + try { + yield io6.rmRF(dest); + } catch (err) { + core13.debug(`Failed to delete '${dest}'. ${err.message}`); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + }); + } + 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 = core13.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } + } else { + const escapedScript = path8.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 io6.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - const req = info6.httpModule.request(info6.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(); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core13.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() } - handleResult(new Error(`Request timeout: ${info6.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + core13.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; + } + if (core13.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 (core13.isDebug()) { + args.push("-v"); + } + const xarPath = yield io6.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io6.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 + ]; + core13.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 io6.which("powershell", true); + core13.debug(`Using powershell at path: ${powershellPath}`); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + }); + } + function extractZipNix(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + const unzipPath = yield io6.which("unzip", true); + const args = [file]; + if (!core13.isDebug()) { + args.unshift("-q"); } - } - /** - * 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; + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os3.arch(); + core13.debug(`Caching tool ${tool} ${version} ${arch2}`); + core13.debug(`source dir: ${sourceDir}`); + if (!fs9.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; + const destPath = yield _createToolPath(tool, version, arch2); + for (const itemName of fs9.readdirSync(sourceDir)) { + const s = path8.join(sourceDir, itemName); + yield io6.cp(s, destPath, { recursive: true }); } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } + _completeToolPath(tool, version, arch2); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os3.arch(); + core13.debug(`Caching tool ${tool} ${version} ${arch2}`); + core13.debug(`source file: ${sourceFile}`); + if (!fs9.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); } - return info6; + const destFolder = yield _createToolPath(tool, version, arch2); + const destPath = path8.join(destFolder, targetFile); + core13.debug(`destination file ${destPath}`); + yield io6.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch2); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch2) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + arch2 = arch2 || os3.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch2); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path8.join(_getCacheDirectory(), toolName, versionSpec, arch2); + core13.debug(`checking cache: ${cachePath}`); + if (fs9.existsSync(cachePath) && fs9.existsSync(`${cachePath}.complete`)) { + core13.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + toolPath = cachePath; + } else { + core13.debug("not found"); } - return _default2; } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch2) { + const versions = []; + arch2 = arch2 || os3.arch(); + const toolPath = path8.join(_getCacheDirectory(), toolName); + if (fs9.existsSync(toolPath)) { + const children = fs9.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path8.join(toolPath, child, arch2 || ""); + if (fs9.existsSync(fullPath) && fs9.existsSync(`${fullPath}.complete`)) { + versions.push(child); } } } - 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 _default2; } - _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; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core13.debug("set auth"); + headers.authorization = auth; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; } - 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; + let manifestUrl = ""; + for (const item of response.result.tree) { + if (item.path === "versions-manifest.json") { + manifestUrl = item.url; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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 (_a) { + core13.debug("Invalid json"); + } } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os3.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path8.join(_getTempDirectory(), crypto2.randomUUID()); } - if (proxyAgent) { - return proxyAgent; + yield io6.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path8.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + core13.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io6.rmRF(folderPath); + yield io6.rmRF(markerPath); + yield io6.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch2) { + const folderPath = path8.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const markerPath = `${folderPath}.complete`; + fs9.writeFileSync(markerPath, ""); + core13.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core13.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core13.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core13.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve4) => setTimeout(() => resolve4(), ms)); - }); + if (version) { + core13.debug(`matched: ${version}`); + } else { + core13.debug("match not found"); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve4, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve4(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 { - resolve4(response); - } - })); - }); + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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; }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ +var require_debug3 = __commonJS({ "node_modules/follow-redirects/debug.js"(exports2, module2) { var debug5; module2.exports = function() { if (!debug5) { try { debug5 = require_src()("follow-redirects"); - } catch (error4) { + } catch (error3) { } if (typeof debug5 !== "function") { debug5 = function() { @@ -79831,7 +86711,7 @@ var require_follow_redirects = __commonJS({ var https2 = require("https"); var Writable = require("stream").Writable; var assert = require("assert"); - var debug5 = require_debug2(); + var debug5 = require_debug3(); (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; @@ -79843,8 +86723,8 @@ var require_follow_redirects = __commonJS({ var useNativeURL = false; try { assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; } var preservedUrlFields = [ "auth", @@ -79918,9 +86798,9 @@ var require_follow_redirects = __commonJS({ this._currentRequest.abort(); this.emit("abort"); }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); + RedirectableRequest.prototype.destroy = function(error3) { + destroyRequest(this._currentRequest, error3); + destroy.call(this, error3); return this; }; RedirectableRequest.prototype.write = function(data, encoding, callback) { @@ -80087,10 +86967,10 @@ var require_follow_redirects = __commonJS({ var i = 0; var self2 = this; var buffers = this._requestBodyBuffers; - (function writeNext(error4) { + (function writeNext(error3) { if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); + if (error3) { + self2.emit("error", error3); } else if (i < buffers.length) { var buffer = buffers[i++]; if (!request.finished) { @@ -80289,12 +87169,12 @@ var require_follow_redirects = __commonJS({ }); return CustomError; } - function destroyRequest(request, error4) { + function destroyRequest(request, error3) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); - request.destroy(error4); + request.destroy(error3); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); @@ -80381,15 +87261,14 @@ var path2 = __toESM(require("path")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var fs = __toESM(require("fs")); var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -80406,14 +87285,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs9.lstat(itemPath, { bigint: true }) : await fs9.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs9.lstat(itemPath, { bigint: true }) : await fs9.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 fs9.readdir(itemPath) : await fs9.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs9.readdir(itemPath) : await fs9.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -80424,13 +87303,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -81310,6 +88189,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -81429,7 +88320,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -81469,16 +88360,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -83033,7 +89915,7 @@ var safeDump = renamed("safeDump", "dump"); var semver = __toESM(require_semver2()); // src/api-compatibility.json -var maximumVersion = "3.19"; +var maximumVersion = "3.20"; var minimumVersion = "3.14"; // src/util.ts @@ -83049,9 +89931,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -83089,7 +89971,7 @@ function parseGitHubUrl(inputUrl) { var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; var hasBeenWarnedAboutVersion = false; function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== 1 /* GHES */) { + if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { return; } const disallowedAPIVersionReason = apiVersionInRange( @@ -83210,11 +90092,11 @@ async function checkForTimeout() { process.exit(); } } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } async function checkDiskUsage(logger) { try { @@ -83237,22 +90119,22 @@ async function checkDiskUsage(logger) { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, numTotalBytes: diskUsage.blocks * blockSizeInBytes }; - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to check available disk space: ${getErrorMessage(error4)}` + `Failed to check available disk space: ${getErrorMessage(error3)}` ); return void 0; } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + 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 === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( + 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.11" + ">=3.20" )) { - core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + core3.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/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } @@ -83490,17 +90372,17 @@ function getAuthorizationHeaderFor(logger, apiDetails, url) { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -83584,25 +90466,29 @@ function wrapApiConfigurationError(e) { // src/feature-flags.ts var fs4 = __toESM(require("fs")); var path4 = __toESM(require("path")); -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.23.3"; -var cliVersion = "2.23.3"; +var bundleVersion = "codeql-bundle-v2.23.8"; +var cliVersion = "2.23.8"; // src/overlay-database-utils.ts var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); -// src/git-utils.ts +// src/caching-utils.ts var core6 = __toESM(require_core()); + +// src/git-utils.ts +var core7 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver2 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core6.debug(`Running git command: git ${args.join(" ")}`); + core7.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -83617,13 +90503,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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 error4; + core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -83733,7 +90619,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core6.debug( + core7.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -83759,16 +90645,16 @@ async function isAnalyzingDefaultBranch() { } // src/logging.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); function getActionsLogger() { return { - debug: core7.debug, - info: core7.info, - warning: core7.warning, - error: core7.error, - isDebug: core7.isDebug, - startGroup: core7.startGroup, - endGroup: core7.endGroup + debug: core8.debug, + info: core8.info, + warning: core8.warning, + error: core8.error, + isDebug: core8.isDebug, + startGroup: core8.startGroup, + endGroup: core8.endGroup }; } function formatDuration(durationMs) { @@ -83784,7 +90670,7 @@ function formatDuration(durationMs) { } // src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -83845,7 +90731,7 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { } // src/tools-features.ts -var semver2 = __toESM(require_semver2()); +var semver3 = __toESM(require_semver2()); function isSupportedToolsFeature(versionInfo, feature) { return !!versionInfo.features && versionInfo.features[feature]; } @@ -83860,11 +90746,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -83876,6 +90757,16 @@ var featureConfig = { 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", @@ -83904,12 +90795,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -84010,6 +90895,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -84021,21 +90911,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -84149,7 +91040,7 @@ var GitHubFeatureFlags = class { DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length, f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length ).replace(/_/g, "."); - if (!semver3.valid(version)) { + if (!semver4.valid(version)) { this.logger.warning( `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.` ); @@ -84158,15 +91049,15 @@ var GitHubFeatureFlags = class { return version; } async getDefaultCliVersion(variant) { - if (variant === 0 /* DOTCOM */) { - return await this.getDefaultDotcomCliVersion(); + if (supportsFeatureFlags(variant)) { + return await this.getDefaultCliVersionFromFlags(); } return { cliVersion, tagName: bundleVersion }; } - async getDefaultDotcomCliVersion() { + async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( ([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : void 0 @@ -84255,7 +91146,7 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (this.gitHubVersion.type !== 0 /* DOTCOM */ && this.gitHubVersion.type !== 2 /* GHE_DOTCOM */) { + if (!supportsFeatureFlags(this.gitHubVersion.type)) { this.logger.debug( "Not running against github.com. Disabling all toggleable features." ); @@ -84308,10 +91199,13 @@ var GitHubFeatureFlags = class { } } }; +function supportsFeatureFlags(githubVariant) { + return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; +} // src/init.ts var toolrunner4 = __toESM(require_toolrunner()); -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); // src/codeql.ts var fs8 = __toESM(require("fs")); @@ -84349,19 +91243,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -84377,9 +91271,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -84567,12 +91461,9 @@ var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { })(AnalysisKind || {}); var supportedAnalysisKinds = new Set(Object.values(AnalysisKind)); -// src/caching-utils.ts -var core8 = __toESM(require_core()); - // src/config/db-config.ts var jsonschema = __toESM(require_lib4()); -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -84581,9 +91472,12 @@ var PACK_IDENTIFIER_PATTERN = (function() { })(); // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -84632,16 +91526,16 @@ var fs7 = __toESM(require("fs")); var path6 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // src/tar.ts var import_child_process = require("child_process"); var fs5 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; async function getTarVersion() { @@ -84683,9 +91577,9 @@ async function isZstdAvailable(logger) { case "gnu": return { available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver5.gte( - semver5.coerce(version), - semver5.coerce(MIN_REQUIRED_GNU_TAR_VERSION) + semver6.gte( + semver6.coerce(version), + semver6.coerce(MIN_REQUIRED_GNU_TAR_VERSION) ), foundZstdBinary, version: tarVersion @@ -84694,7 +91588,7 @@ async function isZstdAvailable(logger) { return { available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain // a patch version number. - semver5.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), + semver6.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), foundZstdBinary, version: tarVersion }; @@ -84798,10 +91692,10 @@ var os = __toESM(require("os")); var path5 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; var TOOLCACHE_TOOL_NAME = "CodeQL"; function makeDownloadFirstToolsDownloadDurations(downloadDurationMs, extractionDurationMs) { @@ -84931,7 +91825,7 @@ function getToolcacheDirectory(version) { return path5.join( getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, - semver6.clean(version) || version, + semver7.clean(version) || version, os.arch() || "" ); } @@ -85056,13 +91950,13 @@ function tryGetTagNameFromUrl(url, logger) { return match[1]; } function convertToSemVer(version, logger) { - if (!semver7.valid(version)) { + if (!semver8.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 = semver7.clean(version); + const s = semver8.clean(version); if (!s) { throw new Error(`Bundle version ${version} is not in SemVer format.`); } @@ -85170,7 +92064,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian url = toolsInput; if (tagName) { const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver7.valid(bundleVersion3)) { + if (bundleVersion3 && semver8.valid(bundleVersion3)) { cliVersion2 = convertToSemVer(bundleVersion3, logger); } } @@ -85253,7 +92147,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: cliVersion2 ?? humanReadableVersion }; } - if (variant !== 0 /* DOTCOM */ && !forceShippedTools && !toolsInput) { + if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { const result = await findOverridingToolsInCache( humanReadableVersion, logger @@ -85441,7 +92335,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau async function useZstdBundle(cliVersion2, tarSupportsZstd) { return ( // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver7.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) + process.platform !== "win32" && tarSupportsZstd && semver8.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) ); } function getTempExtractionDir(tempDir) { @@ -85473,7 +92367,7 @@ async function getNightlyToolsUrl(logger) { } } function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver7.compare(b, a)); + const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver8.compare(b, a)); logger.debug( `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( allVersions @@ -85956,6 +92850,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -86130,9 +93041,9 @@ function isFirstPartyAnalysis(actionName) { } return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; } -function getActionsStatus(error4, otherFailureCause) { - if (error4 || otherFailureCause) { - return error4 instanceof ConfigurationError ? "user-error" : "failure"; +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; } else { return "success"; } @@ -86303,16 +93214,16 @@ async function sendStatusReport(statusReport) { } // src/setup-codeql-action.ts -async function sendCompletedStatusReport(startedAt, toolsDownloadStatusReport, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger, error4) { +async function sendCompletedStatusReport(startedAt, toolsDownloadStatusReport, toolsFeatureFlagsValid, toolsSource, toolsVersion, logger, error3) { const statusReportBase = await createStatusReportBase( "setup-codeql" /* SetupCodeQL */, - getActionsStatus(error4), + getActionsStatus(error3), startedAt, void 0, await checkDiskUsage(logger), logger, - error4?.message, - error4?.stack + error3?.message, + error3?.stack ); if (statusReportBase === void 0) { return; @@ -86394,17 +93305,17 @@ async function run() { core12.setOutput("codeql-version", (await codeql.getVersion()).version); core12.exportVariable("CODEQL_ACTION_SETUP_CODEQL_HAS_RUN" /* SETUP_CODEQL_ACTION_HAS_RUN */, "true"); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); - core12.setFailed(error4.message); + const error3 = wrapError(unwrappedError); + core12.setFailed(error3.message); const statusReportBase = await createStatusReportBase( "setup-codeql" /* SetupCodeQL */, - error4 instanceof ConfigurationError ? "user-error" : "failure", + error3 instanceof ConfigurationError ? "user-error" : "failure", startedAt, void 0, await checkDiskUsage(logger), logger, - error4.message, - error4.stack + error3.message, + error3.stack ); if (statusReportBase !== void 0) { await sendStatusReport(statusReportBase); @@ -86423,8 +93334,8 @@ async function run() { async function runWrapper() { try { await run(); - } catch (error4) { - core12.setFailed(`setup-codeql action failed: ${getErrorMessage(error4)}`); + } catch (error3) { + core12.setFailed(`setup-codeql action failed: ${getErrorMessage(error3)}`); } await checkForTimeout(); } @@ -86438,5 +93349,5 @@ undici/lib/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) */ diff --git a/lib/start-proxy-action-post.js b/lib/start-proxy-action-post.js index 6171b2cc57..815bbda6fd 100644 --- a/lib/start-proxy-action-post.js +++ b/lib/start-proxy-action-post.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os = __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() + os.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs2 = __importStar4(require("fs")); - var os = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs2 = __importStar2(require("fs")); + var os = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug4("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay, persist } = mockDispatch2; + const { data: { statusCode, data, headers, trailers, error: error3 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay === "number" && delay > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve2({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path2 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path2 = __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, path2.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs2 = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); + _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs2.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs2.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path2.dirname(filePath); const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path2.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which6; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path2 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path2 = __importStar4(require("path")); - var io6 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path2 = __importStar2(require("path")); + var io6 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner5 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io6.which(this.toolPath, true); - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve2(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + 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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = exportVariable6; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed; + exports2.isDebug = isDebug3; + exports2.debug = debug4; + exports2.error = error3; + exports2.warning = warning9; + exports2.notice = notice; + exports2.info = info7; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState3; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os = __importStar4(require("os")); - var path2 = __importStar4(require("path")); + var os = __importStar2(require("os")); + var path2 = __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 exportVariable5(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable6(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable5; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19681,18 +19872,16 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,19 +19889,17 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { @@ -19721,50 +19908,39 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.stdout.write(os.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed; function isDebug3() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug3; function debug4(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug4; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning8(message, properties = {}) { + function warning9(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning8; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info7(message) { process.stdout.write(message + os.EOL); } - exports2.info = info7; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState3(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState3; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter4(this, void 0, void 0, function* () { + const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,532 +25406,74 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs2.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs2.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path2.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 = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path2.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = which6; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path2.join(dest, path2.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 (path2.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.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(path2.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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 __awaiter4(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(path2.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(path2.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug4; - } -}); - -// 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 debug4 = 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}}`); + var debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug4; + } +}); + +// 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 debug4 = 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; }; @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare2 = require_compare(); - var gte5 = (a, b, loose) => compare2(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare2(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } } doExpire(clearGlobalState, run, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve2, returned, task; + var args, cb, error3, reject, resolve2, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve2, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve2(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info7) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info7) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29565,8 +29279,8 @@ var require_helpers = __commonJS({ } return decimalPlaces; }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; }; } }); @@ -30548,1424 +30262,1097 @@ var require_lib3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path2 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname2(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs2 = __importStar2(require("fs")); + var os = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path2.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs2.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname2; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path2.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path2.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path2.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __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", () => { + resolve2(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + })); + }); + } }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var 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 expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path2 = (function() { - try { - return require("path"); - } catch (e) { + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path2.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + /** + * 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); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path2.sep !== "/") { - pattern = pattern.split(path2.sep).join("/"); + 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); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + 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); + }); } - if (!pattern) { - this.empty = true; - return; + 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); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug4() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = 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++) { - negate = !negate; - negateOffset++; + /** + * 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 info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, 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; + }); } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve2(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; + } + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.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: ${info7.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(); + } } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + /** + * 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); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + _prepareRequest(method, requestUrl, headers) { + const info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; } + return info7; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + return additionalHeaders[header] || clientHeader || _default2; + } + _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; } - 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; - } - 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve2) => setTimeout(() => resolve2(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve2(response); } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } - var cs = pattern.substring(classStart + 1, i); + let obj; + let contents; 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; + 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) { } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + 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 { + resolve2(response); } - 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]; + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); } - 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 new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(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; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - 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 = "$"; + 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"); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + options.headers["Authorization"] = `Bearer ${this.token}`; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - if (addPatternStart) { - re = patternStart + re; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - if (!hasMagic) { - return globUnescape(pattern); + // 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")}`; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path2.sep !== "/") { - f = f.split(path2.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - 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] === ""; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - throw new Error("wtf?"); }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path2.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path2.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path2.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path2.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path2.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os = __importStar4(require("os")); - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path2.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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path2.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path2.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; + 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 internal_match_kind_1.MatchKind.None; + return token; } - /** - * 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); + 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 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, "[*]"); + return runtimeUrl; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path2.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path2.sep}`)) { - homedir = homedir || os.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path2, level) { - this.path = path2; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -31992,263 +31379,323 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); + 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 = ""; } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + /** + * 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}`; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * 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(); + }); } - function fulfill(value) { - resume("next", value); + /** + * 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 }); + }); } - function reject(value) { - resume("throw", value); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core14 = __importStar4(require_core()); - var fs2 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path2 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs2.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs2.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path2.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; - }); + 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(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs2.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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 fs2.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs2.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + /** + * 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); } - traversalChain.push(realPath); - } - return stats; - }); + 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create3(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path2 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.create = create3; + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path2.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32257,21 +31704,21 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -32301,14 +31748,14 @@ var require_io_util3 = __commonJS({ var _a; 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 fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); + var fs2 = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs2.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -32322,7 +31769,7 @@ var require_io_util3 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -32340,7 +31787,7 @@ var require_io_util3 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -32417,11 +31864,11 @@ var require_io_util3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32430,21 +31877,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -32474,10 +31921,10 @@ var require_io3 = __commonJS({ 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 path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); + var path2 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -32504,7 +31951,7 @@ var require_io3 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -32525,7 +31972,7 @@ var require_io3 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -32545,14 +31992,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32576,7 +32023,7 @@ var require_io3 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32624,7 +32071,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -32644,7 +32091,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -32665,1200 +32112,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug4; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug4 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug4 = 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 + "}"); +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - 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++) { - debug4(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; + __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(resolve2) { + resolve2(value); + }); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 os = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path2 = __importStar2(require("path")); + var io6 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + _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 { - version = version.version; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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); - } - debug4("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"); + return cmd; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - 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; + _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 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) { - debug4("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 this.args; } - 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug4("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); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } 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]; - debug4("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); + if (!arg) { + return '""'; } - } while (++i2); - }; - SemVer.prototype.inc = function(release, identifier) { - switch (release) { - 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++; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - 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]; + } + 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 { - 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]; - } + quoteHit = false; } - break; - default: - throw new Error("invalid increment argument: " + release); - } - this.format(); - this.raw = this.version; - return this; - }; - exports2.inc = inc; - function inc(version, release, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; - } - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.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 = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(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 = rcompare; - function rcompare(a, b, loose) { - return compare2(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 compare2(a, b, loose) > 0; - } - exports2.lt = lt; - function lt(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports2.gte = gte5; - function gte5(a, b, loose) { - return compare2(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(a, b, loose) { - return compare2(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + 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(""); } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _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; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug4("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; - } - debug4("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); + /** + * 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 = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve2, 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) + os.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 { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug4("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; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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; }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug4("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - 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(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug4("comp", comp, options); - comp = replaceCarets(comp, options); - debug4("caret", comp); - comp = replaceTildes(comp, options); - debug4("tildes", comp); - comp = replaceXRanges(comp, options); - debug4("xrange", comp); - comp = replaceStars(comp, options); - debug4("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) { - debug4("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) { - debug4("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + 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.`); } - debug4("tilde return", ret); - return ret; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug4("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_2, M, m, p, pr) { - debug4("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) { - debug4("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"; + exports2.exec = exec3; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } else { - debug4("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"; + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - debug4("caret return", ret); - return ret; + }; + 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 + }; }); } - function replaceXRanges(comp, options) { - debug4("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) { - debug4("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; } - debug4("xRange return", ret); - return ret; + function step(result) { + result.done ? resolve2(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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 + }); }); } - function replaceStars(comp, options) { - debug4("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; - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + 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); } - return false; + __setModuleDefault2(result, mod); + return result; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug4(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve2(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_utils5(); + var os = __importStar2(require("os")); + var path2 = __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 exportVariable6(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; - } - return range.test(version); + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - 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(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + if (options && options.trimWhitespace === false) { + return val; } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; + 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; } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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 && range.test(minver)) { - return minver; + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return null; + process.stdout.write(os.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed; + function isDebug3() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug3; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(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.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); + exports2.saveState = saveState2; + function getState3(name) { + return process.env[`STATE_${name}`] || ""; } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); + exports2.getState = getState3; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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/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]; + } }; } - if (satisfies2(version, range, options)) { - return false; + 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); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core14 = __importStar2(require_core2()); + 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; + core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core14.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + return result; } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path2 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname2(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + let result = path2.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname2; + 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)}`; } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } 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)}`; } - safeRe[t.COERCERTL].lastIndex = -1; } - if (match === null) { - return null; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path2.sep; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path2.sep)) { + return p; + } + if (p === path2.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -33871,932 +33289,1220 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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); + } } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob2 = __importStar4(require_glob()); - var io6 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path2.join(baseLocation, "actions", "temp"); - } - const dest = path2.join(tempDirectory, crypto.randomUUID()); - yield io6.mkdirP(dest); - return dest; - }); + return result; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs2.statSync(filePath).size; + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - 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 = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path2.relative(workspace, file).replace(new RegExp(`\\${path2.sep}`, "g"), "/"); - core14.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; + }; + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs2.unlink)(filePath); - }); + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - }); - } catch (err) { - core14.debug(err.message); + bi = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - versionOutput = versionOutput.trim(); - core14.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core14.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + if (begs.length) { + result = [left, right]; } - }); + } + return result; } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs2.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; - }); + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + parts.push.apply(parts, p); + return parts; } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - return token; + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } 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}`); + N = concatMap(n, function(el) { + return expand(el, false); + }); } - 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; + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); } } - 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]"); + return expansions; } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path2 = (function() { + try { + return require("path"); + } catch (e) { } - __setModuleDefault4(result, mod); - return result; + })() || { + sep: "/" }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + minimatch.sep = path2.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } }; - 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); } - 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); + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path2.sep !== "/") { + pattern = pattern.split(path2.sep).join("/"); } + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); + } + Minimatch.prototype.debug = function() { }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + Minimatch.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 set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug4() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = 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++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + hasMagic = true; + break; + default: + re += "\\" + stateChar; + break; } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + 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 && reSpecials[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; + } + 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 (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); + 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 === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + clearStateChar(); + if (escaping) { + re += "\\\\"; } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + 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; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + if (re !== "" && hasMagic) { + re = "(?=.)" + re; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + if (addPatternStart) { + re = patternStart + re; } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + if (isSub === SUBPARSE) { + return [re, hasMagic]; } - /** - * 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 __awaiter4(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); - }); + if (!hasMagic) { + return globUnescape(pattern); } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re + "$", flags); + } catch (er) { + return new RegExp("$."); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + regExp._glob = pattern; + regExp._src = re; + return regExp; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; + }).join("\\/"); + }).join("|"); + re = "^(?:" + re + ")$"; + if (this.negate) re = "^(?!" + re + ").*$"; + try { + this.regexp = new RegExp(re, flags); + } catch (ex) { + this.regexp = false; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, data); - } else { - return response; - } + return this.regexp; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path2.sep !== "/") { + f = f.split(path2.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; } - 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) { + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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); + this.debug("globstar swallow a segment, and continue"); + fr++; } - } 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(); + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + return false; } - this._disposed = true; + 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 regExpEscape(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 || 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.Path = void 0; + var path2 = __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 { /** - * Raw request. - * @param info - * @param data + * Constructs a Path + * @param itemPath Path or array of segments */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } + 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(path2.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path2.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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(path2.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } } /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * Converts the path to it's string representation */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path2.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path2.sep; } + result += this.segments[i]; } - const req = info7.httpModule.request(info7.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(); + 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 || 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.Pattern = void 0; + var os = __importStar2(require("os")); + var path2 = __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, homedir) { + 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}`; } - handleResult(new Error(`Request timeout: ${info7.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(); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path2.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); } /** - * 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 + * Matches the pattern against the specified path */ - 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 info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path2.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path2.sep}`; } + } else { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); } - return info7; + 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; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + /** + * 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 lowercaseKeys(headers || {}); + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + /** + * 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, homedir) { + (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(`.${path2.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path2.sep}`)) { + homedir = homedir || os.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 additionalHeaders[header] || clientHeader || _default2; + return pathHelper.normalizeSeparators(pattern); } - _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 https2.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 __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(response); - } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + /** + * 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; + } else { + set2 += c2; } - 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; + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - 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})`; + if (set2) { + literal += set2; + i = closed; + continue; } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve2(response); } - })); - }); + } + literal += c; + } + return literal; + } + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.Pattern = Pattern; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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(path2, level) { + this.path = path2; + 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -34823,3172 +34529,2309 @@ var require_auth2 = __commonJS({ 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; + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d }); + }, reject); } }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - // 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"); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - // 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")}`; + function fulfill(value) { + resume("next", value); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + function reject(value) { + resume("throw", value); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + exports2.DefaultGlobber = void 0; + var core14 = __importStar2(require_core2()); + var fs2 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path2 = __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); } - 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; + getSearchPaths() { + return this.searchPaths.slice(); } - 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; + glob() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } } + return result; }); - this._orderedPolicies = void 0; - return removedPolicies; - } - sendRequest(httpClient, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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); - } + 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("**"))); } } - if (options.beforePolicies) { - for (const beforePolicyName of options.beforePolicies) { - const beforeNode = policyMap.get(beforePolicyName); - if (beforeNode) { - beforeNode.dependsOn.add(node); - node.dependants.add(beforeNode); + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core14.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs2.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } + throw err; } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); } - } - function walkPhase(phase) { - phase.hasRun = true; - for (const node of phase.policies) { - if (node.afterPhase && (!node.afterPhase.hasRun || node.afterPhase.policies.size)) { + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !partialMatch) { continue; } - if (node.dependsOn.size === 0) { - result.push(node.policy); - for (const dependant of node.dependants) { - dependant.dependsOn.delete(node); + 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 && path2.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await2(item.path); + } else if (!partialMatch) { + continue; } - policyMap.delete(node.policy.name); - phase.policies.delete(node); + const childLevel = item.level + 1; + const childItems = (yield __await2(fs2.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path2.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); } } - } - function walkPhases() { - for (const phase of orderedPhases) { - walkPhase(phase); - if (phase.policies.size > 0 && phase !== noPhase) { - if (!noPhase.hasRun) { - walkPhase(noPhase); - } - return; + }); + } + /** + * 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)); } - if (phase.hasAfterPolicies) { - walkPhase(noPhase); + } + 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 fs2.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core14.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 fs2.promises.lstat(item.path); } - } - 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."); + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs2.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + if (traversalChain.some((x) => x === realPath)) { + core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); } - } - return result; + return stats; + }); } }; - function createEmptyPipeline() { - return HttpPipeline.create(); - } + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os.EOL}`); - } - 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 - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } - } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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]; + } }; } - } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + 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); } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + __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(resolve2) { + resolve2(value); + }); } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - } - return false; - } - function disable() { - const result = enabledString || ""; - enable(""); - return result; - } - function createDebugger(namespace) { - const newDebugger = Object.assign(debug5, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend: extend3 - }); - function debug5(...args) { - if (!newDebugger.enabled) { - return; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - newDebugger.log(...args); - } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; - } - return false; - } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; - } - var debug4 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug4("azure"); - AzureLogger.log = (...args) => { - debug4.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } - } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); + }); + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); - } + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d }); + }, reject); } - debug4.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; - } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core14 = __importStar2(require_core2()); + var fs2 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path2 = __importStar2(require("path")); + function hashFiles2(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core14.info : core14.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path2.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs2.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs2.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_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 ""; + } }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug4.disable(); - debug4.enable(enabledNamespaces2 + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); + exports2.hashFiles = hashFiles2; } }); -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __commonJS({ - "node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve2, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - try { - buildPromise((x) => { - removeListeners(); - resolve2(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/delay.js -var require_delay = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/delay.js"(exports2) { - "use strict"; + }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.calculateRetryDelay = calculateRetryDelay; - var createAbortablePromise_js_1 = require_createAbortablePromise(); - var random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve2) => { - token = setTimeout(resolve2, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage + exports2.hashFiles = exports2.create = void 0; + 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 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 }; + exports2.create = create3; + function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + 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); + }); } + exports2.hashFiles = hashFiles2; } }); -// 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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } +// 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 debug4; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug4 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug4 = function() { + }; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + 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++; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + 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 false; + return value; } - function getErrorMessage2(e) { - if (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}`; + 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++) { + debug4(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + var i; + exports2.parse = parse; + function parse(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; + } } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return 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); } - return true; - } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID() { - return uuidFunction(); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; + if (!(this instanceof SemVer)) { + return new SemVer(version, options); + } + debug4("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; } - seen.add(value); } - return value; - }, 2); + return id; + }); } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url = new URL(value); - if (!url.search) { - return value; - } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); - } - } - return url.toString(); + 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("."); } - 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; + return this.version; + }; + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug4("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - 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; + 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); }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); - } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; - } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - 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(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var i2 = 0; + do { + var a = this.prerelease[i2]; + var b = other.prerelease[i2]; + debug4("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); } - } - function step(result) { - result.done ? resolve2(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]); + var i2 = 0; + do { + var a = this.build[i2]; + var b = other.build[i2]; + debug4("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); }; - } - 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; + SemVer.prototype.inc = function(release, identifier) { + switch (release) { + case "premajor": + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; + this.inc("pre", identifier); 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; + 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); } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _2.label = op[1]; - break; + this.inc("pre", identifier); + break; + case "major": + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { + this.major++; } - if (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; + case "minor": + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++; } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + this.patch = 0; + this.prerelease = []; + break; + case "patch": + if (this.prerelease.length === 0) { + this.patch++; } - if (t[2]) _2.ops.pop(); - _2.trys.pop(); - continue; + 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: " + release); + } + this.format(); + this.raw = this.version; + return this; + }; + exports2.inc = inc; + function inc(version, release, loose, identifier) { + if (typeof loose === "string") { + identifier = loose; + loose = void 0; + } + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; } - 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 }; + exports2.diff = diff; + function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(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; + } } - }; - 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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } - 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]; + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - } - 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]); + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } - 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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; + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - 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); - } + exports2.compare = compare2; + function compare2(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare2(a, b, true); } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os.arch()}-${os.type()}-${os.release()})`); + 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); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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(" "); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare2(b, a, loose); } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - 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; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); - } - }; + exports2.gt = gt; + function gt(a, b, loose) { + return compare2(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - exports2.isReadableStream = isReadableStream; - exports2.isBlob = isBlob; - function isNodeReadableStream(x) { - return Boolean(x && typeof x["pipe"] === "function"); + exports2.lt = lt; + function lt(a, b, loose) { + return compare2(a, b, loose) < 0; } - function isWebReadableStream(x) { - return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); + exports2.eq = eq; + function eq(a, b, loose) { + return compare2(a, b, loose) === 0; } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + exports2.neq = neq; + function neq(a, b, loose) { + return compare2(a, b, loose) !== 0; } - function isBlob(x) { - return typeof x.stream === "function"; + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare2(a, b, loose) >= 0; } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; + exports2.lte = lte; + function lte(a, b, loose) { + return compare2(a, b, loose) <= 0; } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); + 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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } } - function createFileFromStream(stream, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); - } - return s; - }, [rawContent]: stream }); - } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); - } - yield yield tslib_1.__await(value); - } - } finally { - reader.releaseLock(); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - }); - } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - } - function ensureNodeStream(stream) { - if (stream instanceof ReadableStream) { - makeAsyncIterable(stream); - return node_stream_1.Readable.fromWeb(stream); + comp = comp.trim().split(/\s+/).join(" "); + debug4("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; } else { - return stream; + this.value = this.operator + this.semver.version; } + debug4("comp", this); } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); - } else { - return ensureNodeStream(source); + 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); } - } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } - } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; - } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + this.operator = m[1] !== void 0 ? m[1] : ""; + if (this.operator === "=") { + this.operator = ""; } - 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; + if (!m[2]) { + this.semver = ANY; } else { - return void 0; + this.semver = new SemVer(m[2], this.options.loose); } - } - function getTotalLength(sources) { - let total = 0; - for (const source of sources) { - const partLength = getLength(source); - if (partLength === void 0) { - return void 0; + }; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug4("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(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; } else { - total += partLength; + return new Range2(range.raw, options); } } - return total; - } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + if (range instanceof Comparator) { + return new Range2(range.value, options); } - request.body = await (0, concat_js_1.concat)(sources); + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - 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`); + 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(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug4("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); + }); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; + }; + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); + } + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.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; } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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}`); + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); + } + function parseComparator(comp, options) { + debug4("comp", comp, options); + comp = replaceCarets(comp, options); + debug4("caret", comp); + comp = replaceTildes(comp, options); + debug4("tildes", comp); + comp = replaceXRanges(comp, options); + debug4("xrange", comp); + comp = replaceStars(comp, options); + debug4("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) { + debug4("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) { + debug4("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + } + debug4("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) { + debug4("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_2, M, m, p, pr) { + debug4("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"; } - 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`); + } else if (pr) { + debug4("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"; } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); + } else { + debug4("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 { - boundary = generateBoundary(); + ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); } - }; + debug4("caret return", ret); + return ret; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __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; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); + function replaceXRanges(comp, options) { + debug4("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) { + debug4("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 = "*"; } - return next(request); + } 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; } - }; + debug4("xRange return", ret); + return ret; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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"; + function replaceStars(comp, options) { + debug4("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; }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay(delayInMs, value, options) { - return new Promise((resolve2, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); - }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); + function testSet(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug4(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve2(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : 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; + return false; + } + return true; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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; + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { 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 (_a) { - return void 0; + range = new Range2(range, options); + } catch (er) { + return false; } + return range.test(version); } - 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 }; + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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 { - retryAfterInMs - }; } - }; + }); + return max; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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); } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + }); + return min; } - function isSystemError(err) { - if (!err) { - return false; + exports2.minVersion = minVersion; + function minVersion(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 { - 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; + compver.prerelease.push(0); } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.url = redirectTo; - continue retryRequest; + compver.raw = compver.format(); + /* fallthrough */ + case "": + case ">=": + if (!minver || gt(minver, compver)) { + minver = compver; } - } - 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; - } + break; + case "<": + case "<=": + break; + /* istanbul ignore next */ + default: + throw new Error("Unexpected operation: " + comparator.operator); } - } - }; + }); + } + if (minver && range.test(minver)) { + return minver; + } + return null; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; + } } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies2(version, range, options)) { + return false; + } + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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; } } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + return true; + } + exports2.prerelease = prerelease; + function prerelease(version, options) { + var parsed = parse(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; } - /** - * 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)); + if (typeof version === "number") { + version = String(version); } - /** - * Remove the header with the provided headerName. - * @param name - The name of the header to remove. - */ - delete(name) { - this._headersMap.delete(normalizeName(name)); + if (typeof version !== "string") { + return null; } - /** - * 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; + options = options || {}; + var match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } - return result; - } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJSON({ preserveCase: true })); + safeRe[t.COERCERTL].lastIndex = -1; } - /** - * Iterate over tuples of header [name, value] pairs. - */ - [Symbol.iterator]() { - return headerIterator(this._headersMap); + if (match === null) { + return null; } - }; - function createHttpHeaders(rawHeaders) { - return new HttpHeadersImpl(rawHeaders); + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js"(exports2) { +// 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.formDataPolicyName = void 0; - exports2.formDataPolicy = formDataPolicy; - var core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); + 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); + } +}); + +// 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]; + } }; } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); + 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; }; - } - 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()); + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } else { - urlSearchParams.append(key, value.toString()); } - } - return urlSearchParams.toString(); - } - async function prepareFormData(formData, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - } - request.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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); - }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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 hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug4(...args) { - if (!debug4.enabled) { - return; - } - const self2 = debug4; - 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 index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug4.namespace = namespace; - debug4.useColors = createDebug.useColors(); - debug4.color = createDebug.selectColor(namespace); - debug4.extend = extend3; - debug4.destroy = createDebug.destroy; - Object.defineProperty(debug4, "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(debug4); - } - return debug4; + }; } - function extend3(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d }); + }, reject); } - 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)); + }; + 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 core14 = __importStar2(require_core()); + var exec3 = __importStar2(require_exec()); + var glob2 = __importStar2(require_glob()); + var io6 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs2 = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 { - createDebug.names.push(ns); + if (process.platform === "darwin") { + baseLocation = "/Users"; + } else { + baseLocation = "/home"; + } } + tempDirectory = path2.join(baseLocation, "actions", "temp"); } - } - 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++; + const dest = path2.join(tempDirectory, crypto2.randomUUID()); + yield io6.mkdirP(dest); + return dest; + }); + } + function getArchiveFileSizeInBytes(filePath) { + return fs2.statSync(filePath).size; + } + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path2.relative(workspace, file).replace(new RegExp(`\\${path2.sep}`, "g"), "/"); + core14.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); } else { - searchIndex++; - templateIndex++; + paths.push(`${relativeFile}`); } - } else if (starIndex !== -1) { - templateIndex = starIndex + 1; - matchIndex++; - searchIndex = matchIndex; - } else { - return false; + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } } - while (templateIndex < template.length && template[templateIndex] === "*") { - templateIndex++; + return paths; + }); + } + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs2.unlink)(filePath); + }); + } + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core14.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) { + core14.debug(err.message); } - 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; - } + versionOutput = versionOutput.trim(); + core14.debug(versionOutput); + return versionOutput; + }); + } + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core14.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; } - for (const ns of createDebug.names) { - if (matchesTemplate(name, ns)) { - return true; - } + }); + } + 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 (fs2.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } - return false; + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - function coerce3(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - 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`."); + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - createDebug.enable(createDebug.load()); - return createDebug; + components.push(versionSalt); + return crypto2.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; } - 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+)/); +// 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]]; } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - args.splice(lastC, 0, c); + 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 context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.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], context2); + 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; } - exports2.log = console.debug || console.log || (() => { + } + 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(resolve2) { + resolve2(value); }); - function save(namespaces) { + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { + step(generator.next(value)); + } catch (e) { + reject(e); } } - function load2() { - let r; + function rejected(value) { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return r; } - function localstorage() { - try { - return localStorage; - } catch (error4) { - } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.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); + 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]); }; } -}); - -// node_modules/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { - "use strict"; - var os = 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 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; } - function translateLevel(level) { - if (level === 0) { - return false; - } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; + 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 }; } - 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 = os.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; + }; + 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; } - function getSupportLevel(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); + } + 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]; } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) + } + 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); }; } -}); - -// node_modules/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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]; + 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 { - 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 (error4) { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - 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(); + } + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); - } - obj[prop] = val2; - 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(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } + }; + } + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ 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]; } - function load2() { - return process.env.DEBUG; + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function init(debug4) { - debug4.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug4.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { + try { + inner.call(this); + } catch (e) { + return Promise.reject(e); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + env.stack.push({ value, dispose, async }); + } else if (async) { + env.stack.push({ async: true }); } -}); - -// 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(); + 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; } -}); - -// node_modules/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + return next(); +} +function __rewriteRelativeImportExtension(path2, preserveJsx) { + if (typeof path2 === "string" && /^\.\.?\//.test(path2)) { + return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path2; +} +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)) { @@ -38000,980 +36843,760 @@ var require_helpers3 = __commonJS({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + }); + __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; }; + 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.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - async function toBuffer(stream) { - let length = 0; - const chunks = []; - for await (const chunk of stream) { - length += chunk.length; - chunks.push(chunk); - } - return Buffer.concat(chunks, length); - } - exports2.toBuffer = toBuffer; - async function json2(stream) { - const buf = await toBuffer(stream); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; + 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}`); } - exports2.json = json2; - function req(url, opts = {}) { - const href = typeof url === "string" ? url : url.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); - const promise = new Promise((resolve2, reject) => { - req2.once("response", resolve2).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) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + 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 }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); + } } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = Symbol("AgentBaseInternalState"); - var Agent = class extends http.Agent { - constructor(opts) { - super(opts); - this[INTERNAL] = {}; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - /** - * 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); + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - // 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] = []; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; } - 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 index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; } } - // 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); + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - 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); + 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; } } - 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"); + 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; } - return socket; } - get defaultPort() { - return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); - } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + 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(debug4, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug4(...args) { + if (!newDebugger.enabled) { + return; } - } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); - } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; } + newDebugger.log(...args); } - }; - exports2.Agent = Agent; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; + } + return false; + } + function extend3(namespace) { + const newDebugger = createDebugger(`${this.namespace}:${namespace}`); + newDebugger.log = this.log; + return newDebugger; + } + exports2.default = debugObj; } }); -// 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) { +// 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"; - var __importDefault4 = 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 = __importDefault4(require_src()); - var debug4 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve2, 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); + 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(",")}`); } - function onend() { - cleanup(); - debug4("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + logLevel = level; + const enabledNamespaces = []; + for (const logger of registeredLoggers) { + if (shouldEnable(logger)) { + enabledNamespaces.push(logger.namespace); + } } - function onerror(err) { - cleanup(); - debug4("onerror %o", err); - reject(err); + 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 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) { - debug4("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; - } - } - debug4("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve2({ - connect: { - statusCode, - statusText, - headers - }, - buffered - }); + } + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); + } + function createLogger(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); } - socket.on("error", onerror); - socket.on("end", onend); - read(); - }); + registeredLoggers.add(logger); + return logger; + } + function contextGetLogLevel() { + return logLevel; + } + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; + } + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/https-proxy-agent/dist/index.js -var require_dist3 = __commonJS({ - "node_modules/https-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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(exports2, "__esModule", { value: true }); + exports2.createHttpHeaders = createHttpHeaders; + function normalizeName(name) { + return name.toLowerCase(); + } + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + } + 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]); + } + } } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug4 = (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 - }; + /** + * 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() }); } - return options; - }; - var HttpsProxyAgent = 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 ?? {}; - debug4("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 ? omit(opts, "headers") : null, - host, - port - }; + /** + * 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; } /** - * Called when the node-core HTTP client library is creating a - * new HTTP request. + * 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. */ - async connect(req, opts) { - const { proxy } = this; - if (!opts.host) { - throw new TypeError('No "host" provided'); - } - let socket; - if (proxy.protocol === "https:") { - debug4("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + 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 { - debug4("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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) { - debug4("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + for (const [normalizedName, entry] of this._headersMap) { + result[normalizedName] = entry.value; } - return socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug4("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + 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); } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); } - function omit(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/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/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; }; + 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.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug4 = (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 ?? {}; - debug4("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 ? omit(opts, "headers") : null, - host, - port - }; - } - addRequest(req, opts) { - req._header = null; - this.setRequestProps(req, opts); - super.addRequest(req, opts); + 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; } - setRequestProps(req, opts) { - const { proxy } = this; - const protocol = opts.secureEndpoint ? "https:" : "http:"; - const hostname = req.getHeader("host") || "localhost"; - const base = `${protocol}//${hostname}`; - const url = new url_1.URL(req.path, base); - if (opts.port !== 80) { - url.port = String(opts.port); + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - req.path = String(url); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - for (const name of Object.keys(headers)) { - const value = headers[name]; - if (value) { - req.setHeader(name, value); + 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; } - async connect(req, opts) { - req._header = null; - if (!req.path.includes("://")) { - this.setRequestProps(req, opts); - } - let first; - let endOfHeaders; - debug4("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug4("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); - debug4("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug4("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug4("Creating `net.Socket`: %o", this.connectOpts); - socket = net.connect(this.connectOpts); - } - await (0, events_1.once)(socket, "connect"); - return socket; + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); } - }; - HttpProxyAgent.protocols = ["http", "https"]; - exports2.HttpProxyAgent = HttpProxyAgent; - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - return ret; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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_log(); - 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; + clone() { + return new _HttpPipeline(this._policies); } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + static create() { + return new _HttpPipeline(); } - let isBypassedFlag = false; - for (const pattern of noProxyList) { - if (pattern[0] === ".") { - if (host.endsWith(pattern)) { - isBypassedFlag = true; + 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 { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; - } - } - } else { - if (host === pattern) { - isBypassedFlag = true; + return noPhase; } } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + 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); } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + 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); + } + } + } } - request.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(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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); + } } - return next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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); + } } - return next(request); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __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; - exports2.tlsPolicyName = "tlsPolicy"; - function tlsPolicy(tlsSettings) { - return { - name: exports2.tlsPolicyName, - sendRequest: async (req, next) => { - if (!req.tlsSettings) { - req.tlsSettings = tlsSettings; + 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 next(req); } - }; - } - } -}); - -// 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.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; - } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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; + return result; } }; - 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 - }; + function createEmptyPipeline() { + return HttpPipeline.create(); + } } }); -// node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js -var require_instrumenter = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js"(exports2) { +// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } - exports2.getInstrumenter = getInstrumenter; } }); -// node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js -var require_tracingClient = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js"(exports2) { +// 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.createTracingClient = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); - } - function parseTraceparentHeader(traceparentHeader) { - return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); - } - function createRequestHeaders(tracingContext) { - return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + 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 { - startSpan, - withSpan, - withContext, - parseTraceparentHeader, - createRequestHeaders - }; + return false; } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/inspect.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/inspect.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.custom = void 0; @@ -38982,18 +37605,196 @@ var require_inspect = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { +// 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.RestError = void 0; - exports2.isRestError = isRestError; - var core_util_1 = require_commonjs2(); + 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 url = new URL(value); + if (!url.search) { + return value; + } + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } + } + return url.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"; @@ -39001,212 +37802,86 @@ var require_restError = __commonJS({ 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); } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } }; exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; function isRestError(e) { if (e instanceof RestError) { return true; } - return (0, core_util_1.isError)(e) && e.name === "RestError"; + return (0, error_js_1.isError)(e) && e.name === "RestError"; } } }); -// 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) { +// 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.tracingPolicyName = void 0; - exports2.tracingPolicy = tracingPolicy; - var core_tracing_1 = require_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.statusCode); - } - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + exports2.uint8ArrayToString = uint8ArrayToString; + exports2.stringToUint8Array = stringToUint8Array; + function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); } - 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); - } - span.setStatus({ - status: "success" - }); - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); - } + function stringToUint8Array(value, format) { + return Buffer.from(value, format); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { +// 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.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 multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/nodeHttpClient.js var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { + "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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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(stream) { + if (stream.readable === false) { + return Promise.resolve(); + } return new Promise((resolve2) => { const handler = () => { resolve2(); @@ -39223,6 +37898,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -39236,25 +37913,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -39263,13 +37937,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -39293,8 +37970,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -39316,7 +37996,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -39334,9 +38014,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -39345,29 +38024,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url = new URL(request.url); const isInsecure = url.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url.hostname, path: `${url.pathname}${url.search}`, port: url.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve2, reject) => { - const req = isInsecure ? http.request(options, resolve2) : https2.request(options, resolve2); + const req = isInsecure ? node_http_1.default.request(options, resolve2) : node_https_1.default.request(options, resolve2); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -39388,30 +38066,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -39434,11 +38113,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream.pipe(inflate); return inflate; } @@ -39458,7 +38137,7 @@ var require_nodeHttpClient = __commonJS({ resolve2(Buffer.concat(buffer).toString("utf8")); }); stream.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -39489,9 +38168,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -39502,8111 +38181,11789 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.systemErrorRetryPolicyName = void 0; - exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; - function systemErrorRetryPolicy(options = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; + 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.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest + name: exports2.userAgentPolicyName, + async sendRequest(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } }; } } }); -// 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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + exports2.decompressResponsePolicyName = void 0; + exports2.decompressResponsePolicy = decompressResponsePolicy; + exports2.decompressResponsePolicyName = "decompressResponsePolicy"; + function decompressResponsePolicy() { + return { + name: exports2.decompressResponsePolicyName, + async sendRequest(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; + } +}); + +// 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 = delay; + exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; + var AbortError_js_1 = require_AbortError(); + var StandardAbortMessage = "The operation was aborted."; + function delay(delayInMs, value, options) { + return new Promise((resolve2, 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); } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + }; + onAborted = () => { + if (timer) { + clearTimeout(timer); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + removeListeners(); + return rejectOnAbort(); + }; + if (options?.abortSignal && options.abortSignal.aborted) { + return rejectOnAbort(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve2(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - 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; + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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; + } } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(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; +}); + +// 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 hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; + } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug4(...args) { + if (!debug4.enabled) { + return; } - if (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + const self2 = debug4; + 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"); } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + debug4.namespace = namespace; + debug4.useColors = createDebug.useColors(); + debug4.color = createDebug.selectColor(namespace); + debug4.extend = extend3; + debug4.destroy = createDebug.destroy; + Object.defineProperty(debug4, "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 (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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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 __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); + if (typeof createDebug.init === "function") { + createDebug.init(debug4); + } + return debug4; + } + function extend3(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; } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); +}); + +// 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 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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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]; + args.splice(lastC, 0, c); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { + function load2() { + let r; try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error3) { } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; + } + return r; + } + function localstorage() { 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); + return localStorage; + } catch (error3) { } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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 __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - } }; + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 }; } }); -// node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js -var require_azureKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js"(exports2) { +// node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "node_modules/has-flag/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.AzureKeyCredential = void 0; - var AzureKeyCredential = class { - /** - * 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; - } + 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); }; - 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) { +// node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs2(); - function isKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; + var os = 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; } - } -}); - -// 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + 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); } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + } + function translateLevel(level) { + if (level === 0) { + return false; } - /** - * 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"); + 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 = os.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } - this._name = name; - this._key = key; + return 1; } - /** - * 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"); + if ("CI" in env) { + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; } - this._name = newName; - this._key = newKey; + return min; } - }; - exports2.AzureNamedKeyCredential = AzureNamedKeyCredential; - function isNamedKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["name", "key"]) && typeof credential.key === "string" && typeof credential.name === "string"; + 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(stream) { + const level = supportsColor(stream, stream && stream.isTTY); + return translateLevel(level); } + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) + }; } }); -// 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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 + ]; } - /** - * 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; + } 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); } - /** - * 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; + 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]; } - }; - exports2.AzureSASCredential = AzureSASCredential; - function isSASCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; } + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; + } + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log(...args) { + return process.stderr.write(util.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 init(debug4) { + debug4.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug4.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); + }; } }); -// 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); +// 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/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/index.js"(exports2) { +// 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.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; - } }); + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + async function toBuffer(stream) { + let length = 0; + const chunks = []; + for await (const chunk of stream) { + length += chunk.length; + chunks.push(chunk); + } + return Buffer.concat(chunks, length); + } + exports2.toBuffer = toBuffer; + async function json2(stream) { + const buf = await toBuffer(stream); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } + } + exports2.json = json2; + function req(url, opts = {}) { + const href = typeof url === "string" ? url : url.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url, opts); + const promise = new Promise((resolve2, reject) => { + req2.once("response", resolve2).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; + } + exports2.req = req; } }); -// 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) { +// node_modules/agent-base/dist/index.js +var require_dist = __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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); + 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:"; + } } - }; - } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); - } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; - } -}); - -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - 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 __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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); } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + // 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; } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(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; + decrementSockets(name, socket) { + if (!this.sockets[name] || socket === null) { + return; + } + const sockets = this.sockets[name]; + const index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } - 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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 __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + // 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); }); - }; - 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 __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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 __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + 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; } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); - }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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]; + 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; } - return t; - }; - return __assign3.apply(this, arguments); - }; - __createBinding3 = 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]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 }; + exports2.Agent = Agent; } }); -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); - } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); - } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); - } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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) { +// 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.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; - } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); - } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, 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 = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; - } + exports2.parseProxyResponse = void 0; + var debug_1 = __importDefault2(require_src()); + var debug4 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve2, reject) => { + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once("readable", read); } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + function cleanup() { + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("readable", read); + } + function onend() { + cleanup(); + debug4("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); + } + function onerror(err) { + cleanup(); + debug4("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) { + debug4("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; + } } + debug4("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve2({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - 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) + socket.on("error", onerror); + socket.on("end", onend); + read(); }); } - exports2.flattenResponse = flattenResponse; + exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/@azure/core-client/dist/commonjs/serializer.js -var require_serializer = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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.MapperTypeNames = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + 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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug4 = (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 + }; } - /** - * @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}.`); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug4("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 ? omit(opts, "headers") : null, + host, + port }; - 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 + * Called when the node-core HTTP client library is creating a + * new HTTP request. */ - serialize(mapper, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : 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) { - object = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + async connect(req, opts) { + const { proxy } = this; + if (!opts.host) { + throw new TypeError('No "host" provided'); } - if (object === void 0 || object === null) { - payload = object; + let socket; + if (proxy.protocol === "https:") { + debug4("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + debug4("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - let payload; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - 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); - } + for (const name of Object.keys(headers)) { + payload += `${name}: ${headers[name]}\r +`; } - if (mapper.isConstant) { - payload = mapper.defaultValue; + 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) { + debug4("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; } - return payload; + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug4("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } } - return str2.substr(0, len); + return ret; } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var debug4 = (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 ?? {}; + debug4("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 ? omit(opts, "headers") : null, + host, + port + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + addRequest(req, opts) { + req._header = null; + this.setRequestProps(req, opts); + super.addRequest(req, opts); } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; + setRequestProps(req, opts) { + const { proxy } = this; + const protocol = opts.secureEndpoint ? "https:" : "http:"; + const hostname = req.getHeader("host") || "localhost"; + const base = `${protocol}//${hostname}`; + const url = new url_1.URL(req.path, base); + if (opts.port !== 80) { + url.port = String(opts.port); + } + req.path = String(url); + const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - 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.`); - } + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); } - } - 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(); + let first; + let endOfHeaders; + debug4("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug4("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); + debug4("Output buffer: %o", req.outputData[0].data); } - 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.`); + let socket; + if (this.proxy.protocol === "https:") { + debug4("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug4("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - value = base64.encodeByteArray(value); + await (0, events_1.once)(socket, "connect"); + return socket; } - 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.`); + }; + HttpProxyAgent.protocols = ["http", "https"]; + exports2.HttpProxyAgent = HttpProxyAgent; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); - } - } + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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 value; + return void 0; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - 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}.`); + 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; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + const host = new URL(uri).hostname; + if (bypassedMap?.has(host)) { + return bypassedMap.get(host); } - const tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + let isBypassedFlag = false; + for (const pattern of noProxyList) { + if (pattern[0] === ".") { + if (host.endsWith(pattern)) { + isBypassedFlag = true; } else { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); + } else { + return stream; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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 stream of streams) { + for await (const chunk of stream) { + yield chunk; } } - } 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]; - } - } + })()); + }; + } + } +}); + +// 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 instance; + return result; } - 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}`); + 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; } - if (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); + } + 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 tempDictionary; } - return responseBody; + return total; } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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 = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; - } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); - } - return tempArray; + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); } - return responseBody; + request.body = await (0, concat_js_1.concat)(sources); } - 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); - } - } - } + 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`); } - return void 0; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); + } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } } }); -// node_modules/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; + exports2.apiVersionPolicyName = void 0; + exports2.apiVersionPolicy = apiVersionPolicy; + exports2.apiVersionPolicyName = "ApiVersionPolicy"; + function apiVersionPolicy(options) { + return { + name: exports2.apiVersionPolicyName, + sendRequest: (req, next) => { + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; } + return next(req); } - } 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; - } + }; + } + } +}); + +// 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(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url = new URL(request.url); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; } } - return value; + return false; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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]; + function emitInsecureConnectionWarning() { + const warning9 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning9); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning9); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } else { - break; + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info7 = state_js_1.state.operationRequestMap.get(request); - if (!info7) { - info7 = {}; - state_js_1.state.operationRequestMap.set(request, info7); - } - return info7; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; + } + } +}); + +// 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.deserializationPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } } - return result; + return pipeline; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); } - return result; + return cachedHttpClient; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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]; + } } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if (descriptor.contentType === null) { + return void 0; } - 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 }); - } + if (descriptor.contentType) { + return descriptor.contentType; } - return parsedResponse; + 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 isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escapeDispositionField(value) { + return JSON.stringify(value); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; - } + function getContentDisposition(descriptor) { + const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); + if (contentDispositionHeader) { + return contentDispositionHeader; } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (descriptor.dispositionType === void 0 && descriptor.name === void 0 && descriptor.filename === void 0) { + return void 0; } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + const dispositionType = descriptor.dispositionType ?? "form-data"; + let disposition = dispositionType; + if (descriptor.name) { + disposition += `; name=${escapeDispositionField(descriptor.name)}`; } - return { error: error4, shouldReturnResponse: false }; - } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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; } } - return operationResponse; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; + } + return disposition; } - } -}); - -// 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); } - return result; + 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}`); } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + 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); } - return result; + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } + 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_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + const headers = response.headers.toJSON(); + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; + if (options?.onResponse) { + options.onResponse({ ...response, request, rawHeaders: headers, parsedBody }); } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + return { + request, + 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, rawHeaders }, e); } + throw e; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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; + 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 { - if (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; } } + return "application/json"; } - exports2.serializeRequestBody = serializeRequestBody; - 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 buildPipelineRequest(method, url, 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, + 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 prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - 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_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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) }; } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; } - exports2.createClientPipeline = createClientPipeline; - } -}); - -// 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 = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; + 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 + }); } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path2 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path2.startsWith("/")) { - path2 = path2.substring(1); - } - if (isAbsoluteUrl(path2)) { - requestUrl = path2; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path2); - } + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.toString().replace(/([^:]\/)\/+/g, "$1"); + } + function getQueryParamValue(key, allowReserved, style, param) { + let separator; + if (style === "pipeDelimited") { + separator = "|"; + } else if (style === "spaceDelimited") { + separator = "%20"; + } else { + separator = ","; } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + 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]; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; } - } - return result; - } - function isAbsoluteUrl(url) { - return url.includes("://"); + 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 appendPath(url, pathToAppend) { - if (!pathToAppend) { + function appendQueryParams(url, options = {}) { + if (!options.queryParameters) { return url; } const parsedUrl = new URL(url); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path2 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path2; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); + 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)); } - if (!queryParameter.skipEncoding) { - if (Array.isArray(queryParameterValue)) { - queryParameterValue = queryParameterValue.map((item) => { - return encodeURIComponent(item); - }); - } else { - queryParameterValue = encodeURIComponent(queryParameterValue); - } + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); } - 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); + } 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)); } } - return { - queryParams: result, - sequenceParams - }; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return result; + return endpoint; } - function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url; + 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)); } - const parsedUrl = new URL(url); - 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); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - 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}`); + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path2, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path2, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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."); } - } else { - searchPieces.push(`${name}=${value}`); } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); + }; } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, options), { credentialOptions })); + 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 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; + 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/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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)(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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 getLogLevel() { + return context2.getLogLevel(); } - 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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + } +}); + +// 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 + }); } - 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) => Object.assign(Object.assign({}, a), b), {}); + } +}); + +// 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 + }; } - function requestToOptions(request) { + } +}); + +// 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 { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions + 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/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } + 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 + }); } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); + } +}); + +// 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); } - var HttpHeaders = class _HttpHeaders { - 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } + 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"; } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - exports2.toPipelineResponse = toPipelineResponse; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.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) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + 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-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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.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); } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); + 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.requestPolicyFactoryPolicyName, + name: exports2.userAgentPolicyName, async sendRequest(request, 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); + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; + 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); } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + 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/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); +// 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(); } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } + 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); } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + } + } +}); + +// 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.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; + exports2.AbortError = AbortError; } }); -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { +// 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"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } - return i; - } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } + 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((resolve2, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - return true; - } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; - } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; - } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - }; - } - function validateAttrName(attrName) { - return util.isName(attrName); - } - function validateTagName(tagname) { - return util.isName(tagname); - } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; - } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } + if (abortSignal?.aborted) { + return rejectOnAbort(); } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); + try { + buildPromise((x) => { + removeListeners(); + resolve2(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); - } - return { entities, i }; - } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; - } - return [entityName2, val2, i]; - } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; - } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; - } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; - } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; - } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; - } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); + abortSignal?.addEventListener("abort", onAbort); + }); } - module2.exports = readDocType; } }); -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; +// 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 = delay; + exports2.calculateRetryDelay = calculateRetryDelay; + var createAbortablePromise_js_1 = require_createAbortablePromise(); + var util_1 = require_internal3(); + var StandardAbortMessage = "The delay was aborted."; + function delay(timeInMs, options) { + let token; + const { abortSignal, abortErrorMsg } = options ?? {}; + return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve2) => { + token = setTimeout(resolve2, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage + }); } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; + 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 }; } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); + } +}); + +// 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 { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; + let stringified; + try { + if (typeof e === "object" && e) { + stringified = JSON.stringify(e); + } else { + stringified = String(e); } - } else { - return str2; + } catch (err) { + stringified = "[unable to stringify input]"; } + return `Unknown error ${stringified}`; } } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; - } - module2.exports = toNumber; } }); -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } } - return () => false; + return true; + } + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_2, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_2, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } + 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 parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - var replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); + 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"); } - return val2; }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); + } else { + return blob; } - return false; } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; + function createFileFromStream(stream, 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 = stream(); + if (isNodeReadableStream(s)) { + throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } + return s; + }, + [rawContent]: stream + }; } - function findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); + 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 closingIndex + str2.length - 1; + return new File([toArrayBuffer(content)], name, options); } } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } - return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName - }; + return source.map((x) => x); } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; + } +}); + +// 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); } - i = tagData.closeIndex; } } + return tspPolicy.sendRequest(request, next); } - } - } - function parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } - } + }; } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); + 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)(); } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; - } - } - } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; + } +}); + +// 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); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } + } +}); + +// 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)(); } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } + } +}); + +// 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 isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); +// 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; + }; + } } }); -// node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); +// 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); } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; + } +}); + +// 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); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } + } +}); + +// 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); } - return attrStr; + return context2; } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; + var TracingContextImpl = class _TracingContextImpl { + _contextMap; + constructor(initialContext) { + this._contextMap = initialContext instanceof _TracingContextImpl ? new Map(initialContext._contextMap) : /* @__PURE__ */ new Map(); } - return false; + 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 replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); + 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 textValue; + return state_js_1.state.instrumenterImplementation; } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; + 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 }; - this.tagEndChar = ">"; - this.newLine = ""; } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; + 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(); } - return this.j2x(jObj, 0, []).val; } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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(request, next) { + if (!tracingClient) { + return next(request); } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; } } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); + }; + } + 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; } } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.tracingOptions }, { + spanKind: "client", + spanAttributes + }); + if (!span.isRecording()) { + span.end(); + return void 0; } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; + const headers = tracingClient.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); + for (const [key, value] of Object.entries(headers)) { + request.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; } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); + } + 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)}`); } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; + } +}); + +// 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 }; } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder - }; + 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); + } + } + }; + } } }); -// 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) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + } + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false - }; - } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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 }); - } - 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(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); - } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; - } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - 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; + async sendRequest(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); + } } - } - return parsedXml; + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; - } }); + exports2.createHttpHeaders = createHttpHeaders; + var ts_http_runtime_1 = require_commonjs(); + function createHttpHeaders(rawHeaders) { + return (0, ts_http_runtime_1.createHttpHeaders)(rawHeaders); + } } }); -// 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) { +// 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.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; - } - }; - exports2.AbortError = AbortError; + exports2.createPipelineRequest = createPipelineRequest; + var ts_http_runtime_1 = require_commonjs(); + function createPipelineRequest(options) { + return (0, ts_http_runtime_1.createPipelineRequest)(options); + } } }); -// node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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; } - 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); + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } - /** - * 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."); + 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(); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + }; + 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; } - /** - * 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; + return async (scopes, tokenOptions) => { + const hasClaimChallenge = Boolean(tokenOptions.claims); + const tenantIdChanged = tenantId !== tokenOptions.tenantId; + if (hasClaimChallenge) { + token = null; } - for (const parentSignal of parentSignals) { - if (parentSignal.aborted) { - this.abort(); - } else { - parentSignal.addEventListener("abort", () => { - this.abort(); - }); - } + const mustRefresh = tenantIdChanged || hasClaimChallenge || cycler.mustRefresh; + if (mustRefresh) { + return refresh(scopes, tokenOptions); } - } - /** - * 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(); + if (cycler.shouldRefresh) { + refresh(scopes, tokenOptions); } - return signal; - } - }; - exports2.AbortController = AbortController2; - exports2.AbortError = AbortError; - exports2.AbortSignal = AbortSignal2; + return token; + }; + } } }); -// node_modules/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { + 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(request, next) { try { - return JSON.parse(serializedState).state; + return [await next(request), void 0]; } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); - } - throw error4; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - 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 isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - 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.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 - })); + 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 buildResult(inputs) { - const { processResult, response, state } = inputs; - return processResult ? processResult(response, state) : response; - } - async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation + 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) }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; - } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; + 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(request, next) { + if (!request.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, + getAccessToken, + logger + }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } } - } - return { response, status }; + }; } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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; } - 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) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; + } +}); + +// 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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); } } + return next(request); } - } + }; } - 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; - } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions + }; + return (await getAccessToken(scopes, getTokenOptions))?.token ?? ""; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - } - } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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; + } +}); + +// 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; } - return void 0; - } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; + /** + * 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; } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; + /** + * 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; } - return error4; + }; + 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"; } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + } +}); + +// 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; } - return void 0; - } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case void 0: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; - } + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; } - const status = helper(); - return status === "running" && operationLocation === void 0 ? "succeeded" : status; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return 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 - }); - } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + /** + * 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"); } - case "Body": - default: { - return void 0; + 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); - } - case "Body": { - return getProvisioningState(rawResponse); + } +}); + +// 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + this._signature = signature; } - } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + /** + * 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; } - return state.config.resourceLocation; + }; + exports2.AzureSASCredential = AzureSASCredential; + function isSASCredential(credential) { + return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; } - function isOperationError(e) { - return e.name === "RestError"; + } +}); + +// 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"; } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); + function isPopToken(accessToken) { + return accessToken.tokenType === "pop"; } - var createStateProxy$1 = () => ({ - /** - * 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, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } }; } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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; + } +}); + +// 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_utils6 = __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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + } + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + 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]; + } } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (parsedHeaders) { + for (const key of Object.keys(parsedHeaders)) { + arrayResponse[key] = parsedHeaders[key]; + } } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + 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_utils6(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Serializes the Poller operation. + * @deprecated Removing the constraints validation on client side. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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); + } + } } - }; - 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); + * Serialize the given object based on its metadata defined in the mapper * - * // You can assign more local properties here. - * } - * } - * ``` + * @param mapper - The mapper which defines the metadata of the serializable object * - * 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. + * @param object - A valid Javascript object to be serialized * - * 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: + * @param objectName - Name of the serialized object * - * ```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 options - additional options to serialization * - * @param operation - Must contain the basic properties of `PollOperation`. + * @returns A valid serialized Javascript object */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve2, reject) => { - this.resolve = resolve2; - 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; + serialize(mapper, object, 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; } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - } - /** - * 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) - }); + if (mapper.isConstant) { + object = mapper.defaultValue; } - this.processUpdatedState(); + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. + * Deserialize the given object based on its metadata defined in the mapper * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * @param mapper - The mapper which defines the metadata of the serializable object * - * @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. + * @param responseBody - A valid Javascript entity to be deserialized * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @param objectName - Name of the deserialized object * - * @param options - Optional properties passed to the operation's update method. + * @param options - Controls behavior of XML parser and builder. + * + * @returns A valid deserialized Javascript object */ - 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; + 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; } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + 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 (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + if (mapper.isConstant) { + payload = mapper.defaultValue; } + return payload; } - /** - * 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; + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; } - /** - * 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); - }; + return str2.substr(0, len); + } + function bufferToBase64Url(buffer) { + if (!buffer) { + return void 0; } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + if (!(buffer instanceof Uint8Array)) { + throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); } - /** - * 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")); + const str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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 = ""; } } } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + return classes; + } + function dateToUnixTime(d) { + if (!d) { + return void 0; } - /** - * 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; + if (typeof d.valueOf() === "string") { + d = new Date(d); } - /** - * 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; + return Math.floor(d.getTime() / 1e3); + } + function unixTimeToDate(n) { + if (!n) { + return void 0; } - /** - * 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; + 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.`); + } + } } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); + 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.`); } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + 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)}.`); } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve2) => setTimeout(() => resolve2(), this.config.intervalInMs)); + 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); } - }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs2 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); - } - }); + 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); } - n.default = e; - return Object.freeze(n); + return value; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs2); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + 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}".`); + } + } } - /** - * 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); + return value; + } + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - /** - * 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); + 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}.`); } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path2 = urlParsed.pathname; - path2 = path2 || "/"; - path2 = escape(path2); - urlParsed.pathname = path2; - 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 = 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"); + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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 }; } - 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); + } else { + tempArray[i] = serializedValue; } - return { kind: "SASConnString", url: blobEndpoint, accountName, accountSas }; } + return tempArray; } - function escape(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 path2 = urlParsed.pathname; - path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; - urlParsed.pathname = path2; - 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); - } - } + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); + 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}.`); } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : 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; + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - } - 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; + 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 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}`; + 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 `${pathString}${queryString}`; + return additionalProperties; } - 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; + 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 queries; + return serializer.modelMappers[className]; } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + 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}".`); + } } - 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 !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + return modelProps; } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - const res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay(timeInMs, aborter, abortError) { - return new Promise((resolve2, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); + if (object !== void 0 && object !== null) { + const payload = {}; + const modelProps = resolveModelProperties(serializer, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); + 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) && (object[key] !== void 0 && object[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 = object[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; + } + } } - resolve2(); - }; - 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); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + } } - return padString.slice(0, targetLength) + currentString; + return payload; } + return object; } - 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]; + 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 { - accountName = ""; + const result2 = { ...serializedValue }; + result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result2; } - return accountName; - } catch (error4) { - throw new Error("Unable to extract accountName with provided information."); } + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + 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 tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + 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; + } } } - return tagPairs.join("&"); + 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 toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); } + return tempDictionary; } - return res; + return responseBody; } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + 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 res; + return responseBody; } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + 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); + } + } + } } - 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 - } + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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; } - }; - case "json": - return { - format: { - type: "json", - jsonTextConfiguration: { - recordSeparator: textConfiguration.recordSeparator - } + } + } + } + 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); } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - }; - case "parquet": - return { - format: { - type: "parquet" + 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 = {}; } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + value[propertyName] = propertyValue; + } + } } + return value; } - 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); + 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 { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); + break; } } - return orProperties; + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } + let info7 = state_js_1.state.operationRequestMap.get(request); + if (!info7) { + info7 = {}; + state_js_1.state.operationRequestMap.set(request, info7); + } + return info7; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; } - 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; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } - 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 - }; - } + return result; } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return split.join("/"); + return result; } - function assertResponse(response) { - if (`_response` in response) { - return response; + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; } - throw new TypeError(`Unexpected response object ${response}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); + const operationSpec = operationInfo?.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + const responseSpec = getOperationResponseMap(parsedResponse); + const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); + if (error3) { + throw error3; + } else if (shouldReturnResponse) { + return parsedResponse; } - /** - * 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); + 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 (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); } - let response; + } + 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 parse(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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; + 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; } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw 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; } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; + 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)); } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; + } + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } 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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + } + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path2 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path2.startsWith("/")) { + path2 = path2.substring(1); + } + if (isAbsoluteUrl(path2)) { + requestUrl = path2; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path2); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + 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); } - } else { - delayTimeInMs = Math.random() * 1e3; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } - }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + return result; + } + function isAbsoluteUrl(url) { + return url.includes("://"); + } + function appendPath(url, pathToAppend) { + if (!pathToAppend) { + return url; } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + const parsedUrl = new URL(url); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path2 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path2; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + } + } else { + newPath = newPath + pathToAppend; } - }; - 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, + 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 pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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(url, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url; + } + const parsedUrl = new URL(url); + 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_utils6(); + 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(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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 request; + } 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") { + request.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)) { + request[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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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_util8(); + 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(request, 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)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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 = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _2), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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 = delay; + 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(url) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 || "/"; + path2 = escape(path2); + urlParsed.pathname = path2; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; + urlParsed.pathname = path2; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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 delay(timeInMs, aborter, abortError) { + return new Promise((resolve2, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve2(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path2}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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((resolve2, 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(resolve2).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve2(); + } + } + }); + }); + } + /** + * 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 = delay; + 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(url) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 || "/"; + path2 = escape(path2); + urlParsed.pathname = path2; + 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 escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; + urlParsed.pathname = path2; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; + } + } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; + } + } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + 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 delay(timeInMs, aborter, abortError) { + return new Promise((resolve2, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve2(); + }; + 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(url) { + let safeURL = url; + 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(url) { + const parsedUrl = new URL(url); + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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, @@ -47951,983 +50308,3127 @@ var require_dist7 = __commonJS({ 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; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path2}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path2}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.abortSignal, RETRY_ABORT_ERROR); + } + attempt++; + } + if (response) { + return response; + } + throw error3 ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error."); } - 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; + }; + } + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; } + return value; } - return false; + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path2}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { + } +}); + +// 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 StorageSharedKeyCredentialPolicy. + * Creates an instance of StorageBrowserPolicy. * @param nextPolicy - * @param options - - * @param factory - */ - constructor(nextPolicy, options, factory) { + // 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); - this.factory = factory; } /** - * Signs request. + * Sends out request. * * @param request - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + async sendRequest(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); } + }; + 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 { /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key + * Creates a StorageBrowserPolicyFactory object. * - * @param request - - * @param headerName - + * @param nextPolicy - + * @param options - */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; + 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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" + } + } } - 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + }; + 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" + } } - 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(request) { - const path2 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path2}`; - const queries = getURLQueries(request.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); + }; + 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" } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } - return canonicalizedResourceString; } }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); + 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" + } + } + } } }; - var StorageSharedKeyCredential = class extends Credential { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + exports2.BlobServiceStatistics = { + serializedName: "BlobServiceStatistics", + xmlName: "StorageServiceStats", + type: { + name: "Composite", + className: "BlobServiceStatistics", + modelProperties: { + geoReplication: { + serializedName: "GeoReplication", + xmlName: "GeoReplication", + type: { + name: "Composite", + className: "GeoReplication" + } + } + } } }; - var AnonymousCredentialPolicy = class extends 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.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" + } + } + } } }; - var AnonymousCredential = class extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + 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" + } + } + } } }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + 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" } } + } } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; - } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + 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" } - } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; - } - } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; } } - return false; } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; + }; + 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" + } } - } else { - delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } + }; + exports2.UserDelegationKey = { + serializedName: "UserDelegationKey", + type: { + name: "Composite", + className: "UserDelegationKey", + modelProperties: { + signedObjectId: { + serializedName: "SignedOid", + required: true, + xmlName: "SignedOid", + type: { + name: "String" } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + }, + 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" } - attempt++; - } - if (response) { - return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; - } - return value; } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); + }; + 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" + } } } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; } - function getCanonicalizedResourceString(request) { - const path2 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path2}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; - } - var StorageBrowserPolicy = class extends 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(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); - } - }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - } - return { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); + 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" + } + } + } + } } - }; - } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * 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 - }; } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); - } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; - } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; - } - } - return void 0; - } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + exports2.BlobTag = { + serializedName: "BlobTag", + xmlName: "Tag", + type: { + name: "Composite", + className: "BlobTag", + modelProperties: { + key: { + serializedName: "Key", + required: true, + xmlName: "Key", + type: { + name: "String" } - } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }, + value: { + serializedName: "Value", + required: true, + xmlName: "Value", + type: { + name: "String" } } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); - } - pipeline._corePipeline = corePipeline; - } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); - } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; - } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; } } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; - } - return factory.constructor.name === "StorageSharedKeyCredential"; - } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; - } - return factory.constructor.name === "AnonymousCredential"; - } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); - } - function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; - } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof 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 (request) => { - return { - request, - headers: request.headers.clone(), - status: 500 - }; + }; + 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" + } + } } - }; - const mockRequestPolicyOptions = { - log(_logLevel, _message) { - }, - shouldLog(_logLevel) { - return false; + } + }; + 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" + } + } } - }; - const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions); - const policyName = policyInstance.constructor.name; - return knownPolicies.some((knownPolicyName) => { - return policyName.startsWith(knownPolicyName); - }); - } - var BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", + } + }; + exports2.ListBlobsFlatSegmentResponse = { + serializedName: "ListBlobsFlatSegmentResponse", + xmlName: "EnumerationResults", type: { name: "Composite", - className: "BlobServiceProperties", + className: "ListBlobsFlatSegmentResponse", modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", + serviceEndpoint: { + serializedName: "ServiceEndpoint", + required: true, + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, type: { - name: "Composite", - className: "Logging" + name: "String" } }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", + containerName: { + serializedName: "ContainerName", + required: true, + xmlName: "ContainerName", + xmlIsAttribute: true, type: { - name: "Composite", - className: "Metrics" + name: "String" } }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", + 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: "Metrics" + className: "BlobFlatListSegment" } }, - cors: { - serializedName: "Cors", - xmlName: "Cors", - xmlIsWrapped: true, - xmlElementName: "CorsRule", + 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: "CorsRule" + className: "BlobItemInternal" } } } + } + } + } + }; + exports2.BlobItemInternal = { + serializedName: "BlobItemInternal", + xmlName: "Blob", + type: { + name: "Composite", + className: "BlobItemInternal", + modelProperties: { + name: { + serializedName: "Name", + xmlName: "Name", + type: { + name: "Composite", + className: "BlobName" + } }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", + deleted: { + serializedName: "Deleted", + required: true, + xmlName: "Deleted", + type: { + name: "Boolean" + } + }, + snapshot: { + serializedName: "Snapshot", + required: true, + xmlName: "Snapshot", type: { name: "String" } }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", + 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: "RetentionPolicy" + className: "BlobPropertiesInternal" } }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", + metadata: { + serializedName: "Metadata", + xmlName: "Metadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + blobTags: { + serializedName: "BlobTags", + xmlName: "Tags", type: { name: "Composite", - className: "StaticWebsite" + className: "BlobTags" + } + }, + objectReplicationMetadata: { + serializedName: "ObjectReplicationMetadata", + xmlName: "OrMetadata", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, + hasVersionsOnly: { + serializedName: "HasVersionsOnly", + xmlName: "HasVersionsOnly", + type: { + name: "Boolean" } } } } }; - var Logging = { - serializedName: "Logging", + exports2.BlobName = { + serializedName: "BlobName", type: { name: "Composite", - className: "Logging", + className: "BlobName", modelProperties: { - version: { - serializedName: "Version", - required: true, - xmlName: "Version", + 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" + } }, - deleteProperty: { - serializedName: "Delete", + lastModified: { + serializedName: "Last-Modified", required: true, - xmlName: "Delete", + xmlName: "Last-Modified", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - read: { - serializedName: "Read", + etag: { + serializedName: "Etag", required: true, - xmlName: "Read", + 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: "Boolean" + name: "DateTimeRfc1123" } }, - write: { - serializedName: "Write", - required: true, - xmlName: "Write", + tagCount: { + serializedName: "TagCount", + xmlName: "TagCount", type: { - name: "Boolean" + name: "Number" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + expiresOn: { + serializedName: "Expiry-Time", + xmlName: "Expiry-Time", type: { - name: "Composite", - className: "RetentionPolicy" + name: "DateTimeRfc1123" } - } - } - } - }; - var RetentionPolicy = { - serializedName: "RetentionPolicy", - type: { - name: "Composite", - className: "RetentionPolicy", - modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + }, + isSealed: { + serializedName: "Sealed", + xmlName: "Sealed", type: { name: "Boolean" } }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", + rehydratePriority: { + serializedName: "RehydratePriority", + xmlName: "RehydratePriority", type: { - name: "Number" + name: "Enum", + allowedValues: ["High", "Standard"] } - } - } - } - }; - var Metrics = { - serializedName: "Metrics", - type: { - name: "Composite", - className: "Metrics", - modelProperties: { - version: { - serializedName: "Version", - xmlName: "Version", + }, + lastAccessedOn: { + serializedName: "LastAccessTime", + xmlName: "LastAccessTime", type: { - name: "String" + name: "DateTimeRfc1123" } }, - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + immutabilityPolicyExpiresOn: { + serializedName: "ImmutabilityPolicyUntilDate", + xmlName: "ImmutabilityPolicyUntilDate", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", + immutabilityPolicyMode: { + serializedName: "ImmutabilityPolicyMode", + xmlName: "ImmutabilityPolicyMode", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + legalHold: { + serializedName: "LegalHold", + xmlName: "LegalHold", type: { - name: "Composite", - className: "RetentionPolicy" + name: "Boolean" } } } } }; - var CorsRule = { - serializedName: "CorsRule", + exports2.ListBlobsHierarchySegmentResponse = { + serializedName: "ListBlobsHierarchySegmentResponse", + xmlName: "EnumerationResults", type: { name: "Composite", - className: "CorsRule", + className: "ListBlobsHierarchySegmentResponse", modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", + serviceEndpoint: { + serializedName: "ServiceEndpoint", required: true, - xmlName: "AllowedOrigins", + xmlName: "ServiceEndpoint", + xmlIsAttribute: true, type: { name: "String" } }, - allowedMethods: { - serializedName: "AllowedMethods", + containerName: { + serializedName: "ContainerName", required: true, - xmlName: "AllowedMethods", + xmlName: "ContainerName", + xmlIsAttribute: true, type: { name: "String" } }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", + prefix: { + serializedName: "Prefix", + xmlName: "Prefix", type: { name: "String" } }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", + marker: { + serializedName: "Marker", + xmlName: "Marker", type: { name: "String" } }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", + maxPageSize: { + serializedName: "MaxResults", + xmlName: "MaxResults", type: { name: "Number" } - } - } - } - }; - var StaticWebsite = { - serializedName: "StaticWebsite", - type: { - name: "Composite", - className: "StaticWebsite", - modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", + delimiter: { + serializedName: "Delimiter", + xmlName: "Delimiter", type: { name: "String" } }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", + segment: { + serializedName: "Segment", + xmlName: "Blobs", type: { - name: "String" + name: "Composite", + className: "BlobHierarchyListSegment" } }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", + continuationToken: { + serializedName: "NextMarker", + xmlName: "NextMarker", type: { name: "String" } @@ -48935,129 +53436,205 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var StorageError = { - serializedName: "StorageError", + exports2.BlobHierarchyListSegment = { + serializedName: "BlobHierarchyListSegment", + xmlName: "Blobs", type: { name: "Composite", - className: "StorageError", + className: "BlobHierarchyListSegment", modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", - type: { - name: "String" - } - }, - code: { - serializedName: "Code", - xmlName: "Code", + blobPrefixes: { + serializedName: "BlobPrefixes", + xmlName: "BlobPrefixes", + xmlElementName: "BlobPrefix", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobPrefix" + } + } } }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", + blobItems: { + serializedName: "BlobItems", + required: true, + xmlName: "BlobItems", + xmlElementName: "Blob", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobItemInternal" + } + } } } } } }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", + exports2.BlobPrefix = { + serializedName: "BlobPrefix", type: { name: "Composite", - className: "BlobServiceStatistics", + className: "BlobPrefix", modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", + name: { + serializedName: "Name", + xmlName: "Name", type: { name: "Composite", - className: "GeoReplication" + className: "BlobName" } } } } }; - var GeoReplication = { - serializedName: "GeoReplication", + exports2.BlockLookupList = { + serializedName: "BlockLookupList", + xmlName: "BlockList", type: { name: "Composite", - className: "GeoReplication", + className: "BlockLookupList", modelProperties: { - status: { - serializedName: "Status", - required: true, - xmlName: "Status", + committed: { + serializedName: "Committed", + xmlName: "Committed", + xmlElementName: "Committed", type: { - name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", + uncommitted: { + serializedName: "Uncommitted", + xmlName: "Uncommitted", + xmlElementName: "Uncommitted", type: { - name: "DateTimeRfc1123" + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + latest: { + serializedName: "Latest", + xmlName: "Latest", + xmlElementName: "Latest", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; - var ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", + exports2.BlockList = { + serializedName: "BlockList", type: { name: "Composite", - className: "ListContainersSegmentResponse", + className: "BlockList", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + committedBlocks: { + serializedName: "CommittedBlocks", + xmlName: "CommittedBlocks", + xmlIsWrapped: true, + xmlElementName: "Block", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Block" + } + } } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + uncommittedBlocks: { + serializedName: "UncommittedBlocks", + xmlName: "UncommittedBlocks", + xmlIsWrapped: true, + xmlElementName: "Block", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Block" + } + } } - }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + } + } + } + }; + exports2.Block = { + serializedName: "Block", + type: { + name: "Composite", + className: "Block", + modelProperties: { + name: { + serializedName: "Name", + required: true, + xmlName: "Name", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + 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" + } + } + } }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", + clearRange: { + serializedName: "ClearRange", + xmlName: "ClearRange", + xmlElementName: "ClearRange", type: { name: "Sequence", element: { type: { name: "Composite", - className: "ContainerItem" + className: "ClearRange" } } } @@ -49072,159 +53649,205 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", + exports2.PageRange = { + serializedName: "PageRange", + xmlName: "PageRange", type: { name: "Composite", - className: "ContainerItem", + className: "PageRange", modelProperties: { - name: { - serializedName: "Name", + start: { + serializedName: "Start", required: true, - xmlName: "Name", - type: { - name: "String" - } - }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", + xmlName: "Start", type: { - name: "Boolean" + name: "Number" } }, - version: { - serializedName: "Version", - xmlName: "Version", + end: { + serializedName: "End", + required: true, + xmlName: "End", type: { - name: "String" + name: "Number" } - }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + } + } + } + }; + exports2.ClearRange = { + serializedName: "ClearRange", + xmlName: "ClearRange", + type: { + name: "Composite", + className: "ClearRange", + modelProperties: { + start: { + serializedName: "Start", + required: true, + xmlName: "Start", type: { - name: "Composite", - className: "ContainerProperties" + name: "Number" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + end: { + serializedName: "End", + required: true, + xmlName: "End", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Number" } } } } }; - var ContainerProperties = { - serializedName: "ContainerProperties", + exports2.QueryRequest = { + serializedName: "QueryRequest", + xmlName: "QueryRequest", type: { name: "Composite", - className: "ContainerProperties", + className: "QueryRequest", modelProperties: { - lastModified: { - serializedName: "Last-Modified", + queryType: { + serializedName: "QueryType", required: true, - xmlName: "Last-Modified", + xmlName: "QueryType", type: { - name: "DateTimeRfc1123" + name: "String" } }, - etag: { - serializedName: "Etag", + expression: { + serializedName: "Expression", required: true, - xmlName: "Etag", + xmlName: "Expression", type: { name: "String" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + inputSerialization: { + serializedName: "InputSerialization", + xmlName: "InputSerialization", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "Composite", + className: "QuerySerialization" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + outputSerialization: { + serializedName: "OutputSerialization", + xmlName: "OutputSerialization", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "Composite", + className: "QuerySerialization" } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + } + } + } + }; + 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: ["infinite", "fixed"] + allowedValues: ["delimited", "json", "arrow", "parquet"] } }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", + delimitedTextConfiguration: { + serializedName: "DelimitedTextConfiguration", + xmlName: "DelimitedTextConfiguration", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "Composite", + className: "DelimitedTextConfiguration" } }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", + jsonTextConfiguration: { + serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", type: { - name: "Boolean" + name: "Composite", + className: "JsonTextConfiguration" } }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", + arrowConfiguration: { + serializedName: "ArrowConfiguration", + xmlName: "ArrowConfiguration", type: { - name: "Boolean" + name: "Composite", + className: "ArrowConfiguration" } }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", + 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" } }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", + fieldQuote: { + serializedName: "FieldQuote", + xmlName: "FieldQuote", type: { - name: "Boolean" + name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + recordSeparator: { + serializedName: "RecordSeparator", + xmlName: "RecordSeparator", type: { - name: "DateTimeRfc1123" + name: "String" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + escapeChar: { + serializedName: "EscapeChar", + xmlName: "EscapeChar", type: { - name: "Number" + name: "String" } }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", + headersPresent: { + serializedName: "HeadersPresent", + xmlName: "HasHeaders", type: { name: "Boolean" } @@ -49232,89 +53855,118 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var KeyInfo = { - serializedName: "KeyInfo", + exports2.JsonTextConfiguration = { + serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", type: { name: "Composite", - className: "KeyInfo", + className: "JsonTextConfiguration", modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", + recordSeparator: { + serializedName: "RecordSeparator", + xmlName: "RecordSeparator", type: { name: "String" } - }, - expiresOn: { - serializedName: "Expiry", + } + } + } + }; + exports2.ArrowConfiguration = { + serializedName: "ArrowConfiguration", + xmlName: "ArrowConfiguration", + type: { + name: "Composite", + className: "ArrowConfiguration", + modelProperties: { + schema: { + serializedName: "Schema", required: true, - xmlName: "Expiry", + xmlName: "Schema", + xmlIsWrapped: true, + xmlElementName: "Field", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArrowField" + } + } } } } } }; - var UserDelegationKey = { - serializedName: "UserDelegationKey", + exports2.ArrowField = { + serializedName: "ArrowField", + xmlName: "Field", type: { name: "Composite", - className: "UserDelegationKey", + className: "ArrowField", modelProperties: { - signedObjectId: { - serializedName: "SignedOid", + type: { + serializedName: "Type", required: true, - xmlName: "SignedOid", + xmlName: "Type", type: { name: "String" } }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", + name: { + serializedName: "Name", + xmlName: "Name", type: { name: "String" } }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", + precision: { + serializedName: "Precision", + xmlName: "Precision", type: { - name: "String" + name: "Number" } }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", + 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" } }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49322,49 +53974,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", + exports2.ServiceSetPropertiesExceptionHeaders = { + serializedName: "Service_setPropertiesExceptionHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "ServiceSetPropertiesExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49372,85 +53990,96 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", + exports2.ServiceGetPropertiesHeaders = { + serializedName: "Service_getPropertiesHeaders", type: { name: "Composite", - className: "FilterBlobItem", + className: "ServiceGetPropertiesHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - tags: { - serializedName: "Tags", - xmlName: "Tags", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobTags" + name: "String" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; - var BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", + exports2.ServiceGetPropertiesExceptionHeaders = { + serializedName: "Service_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "BlobTags", + className: "ServiceGetPropertiesExceptionHeaders", modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } + name: "String" } } } } }; - var BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", + exports2.ServiceGetStatisticsHeaders = { + serializedName: "Service_getStatisticsHeaders", type: { name: "Composite", - className: "BlobTag", + className: "ServiceGetStatisticsHeaders", modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + 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" } @@ -49458,55 +54087,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", + exports2.ServiceGetStatisticsExceptionHeaders = { + serializedName: "Service_getStatisticsExceptionHeaders", type: { name: "Composite", - className: "SignedIdentifier", + className: "ServiceGetStatisticsExceptionHeaders", modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } } } } }; - var AccessPolicy = { - serializedName: "AccessPolicy", + exports2.ServiceListContainersSegmentHeaders = { + serializedName: "Service_listContainersSegmentHeaders", type: { name: "Composite", - className: "AccessPolicy", + className: "ServiceListContainersSegmentHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", + 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" } @@ -49514,63 +54140,59 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", + exports2.ServiceListContainersSegmentExceptionHeaders = { + serializedName: "Service_listContainersSegmentExceptionHeaders", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "ServiceListContainersSegmentExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + 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" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49578,136 +54200,110 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", + exports2.ServiceGetUserDelegationKeyExceptionHeaders = { + serializedName: "Service_getUserDelegationKeyExceptionHeaders", type: { name: "Composite", - className: "BlobFlatListSegment", + className: "ServiceGetUserDelegationKeyExceptionHeaders", modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", + exports2.ServiceGetAccountInfoHeaders = { + serializedName: "Service_getAccountInfoHeaders", type: { name: "Composite", - className: "BlobItemInternal", + className: "ServiceGetAccountInfoHeaders", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - isCurrentVersion: { - serializedName: "IsCurrentVersion", - xmlName: "IsCurrentVersion", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobPropertiesInternal" + name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Enum", + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { - name: "Composite", - className: "BlobTags" + name: "Enum", + allowedValues: [ + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" + ] } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Boolean" } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.ServiceGetAccountInfoExceptionHeaders = { + serializedName: "Service_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "ServiceGetAccountInfoExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49715,397 +54311,393 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.ServiceSubmitBatchHeaders = { + serializedName: "Service_submitBatchHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "ServiceSubmitBatchHeaders", modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", - type: { - name: "DateTimeRfc1123" - } - }, - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + } + } + } + }; + 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" } - }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + } + } + } + }; + 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: "ByteArray" + name: "String" } }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "String" } - }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + } + } + } + }; + exports2.ServiceFilterBlobsExceptionHeaders = { + serializedName: "Service_filterBlobsExceptionHeaders", + type: { + name: "Composite", + className: "ServiceFilterBlobsExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } - }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + } + } + } + }; + exports2.ContainerCreateHeaders = { + serializedName: "Container_createHeaders", + type: { + name: "Composite", + className: "ContainerCreateHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", + } + } + } + }; + exports2.ContainerCreateExceptionHeaders = { + serializedName: "Container_createExceptionHeaders", + type: { + name: "Composite", + className: "ContainerCreateExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + } + } + } + }; + 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: "Boolean" + name: "Dictionary", + value: { type: { name: "String" } } } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "Number" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { name: "Enum", allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" + "available", + "leased", + "expired", + "breaking", + "broken" ] } }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", - type: { - name: "Boolean" - } - }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + allowedValues: ["locked", "unlocked"] } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", type: { - name: "DateTimeRfc1123" + name: "Enum", + allowedValues: ["container", "blob"] } }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", + hasImmutabilityPolicy: { + serializedName: "x-ms-has-immutability-policy", + xmlName: "x-ms-has-immutability-policy", type: { name: "Boolean" } }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", + hasLegalHold: { + serializedName: "x-ms-has-legal-hold", + xmlName: "x-ms-has-legal-hold", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "Boolean" } }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", + defaultEncryptionScope: { + serializedName: "x-ms-default-encryption-scope", + xmlName: "x-ms-default-encryption-scope", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + denyEncryptionScopeOverride: { + serializedName: "x-ms-deny-encryption-scope-override", + xmlName: "x-ms-deny-encryption-scope-override", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", + isImmutableStorageWithVersioningEnabled: { + serializedName: "x-ms-immutable-storage-with-versioning-enabled", + xmlName: "x-ms-immutable-storage-with-versioning-enabled", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "Boolean" } }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", + exports2.ContainerGetPropertiesExceptionHeaders = { + serializedName: "Container_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "ListBlobsHierarchySegmentResponse", + className: "ContainerGetPropertiesExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + } + } + } + }; + 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" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -50113,435 +54705,349 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", + exports2.ContainerDeleteExceptionHeaders = { + serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", - className: "BlobHierarchyListSegment", + className: "ContainerDeleteExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobPrefix = { - serializedName: "BlobPrefix", + exports2.ContainerSetMetadataHeaders = { + serializedName: "Container_setMetadataHeaders", type: { name: "Composite", - className: "BlobPrefix", + className: "ContainerSetMetadataHeaders", modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Composite", - className: "BlobName" + name: "String" } - } - } - } - }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTimeRfc1123" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } - } - } - } - }; - var BlockList = { - serializedName: "BlockList", - type: { - name: "Composite", - className: "BlockList", - modelProperties: { - committedBlocks: { - serializedName: "CommittedBlocks", - xmlName: "CommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } }, - uncommittedBlocks: { - serializedName: "UncommittedBlocks", - xmlName: "UncommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; - var Block = { - serializedName: "Block", + exports2.ContainerSetMetadataExceptionHeaders = { + serializedName: "Container_setMetadataExceptionHeaders", type: { name: "Composite", - className: "Block", + className: "ContainerSetMetadataExceptionHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", - type: { - name: "Number" - } } } } }; - var PageList = { - serializedName: "PageList", + exports2.ContainerGetAccessPolicyHeaders = { + serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", - className: "PageList", + className: "ContainerGetAccessPolicyHeaders", modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + blobPublicAccess: { + serializedName: "x-ms-blob-public-access", + xmlName: "x-ms-blob-public-access", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "Enum", + allowedValues: ["container", "blob"] } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + 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" } - } - } - } - }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", - type: { - name: "Composite", - className: "PageRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", + exports2.ContainerGetAccessPolicyExceptionHeaders = { + serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", - className: "ClearRange", + className: "ContainerGetAccessPolicyExceptionHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", + exports2.ContainerSetAccessPolicyHeaders = { + serializedName: "Container_setAccessPolicyHeaders", type: { name: "Composite", - className: "QueryRequest", + className: "ContainerSetAccessPolicyHeaders", modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + 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" } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.ContainerSetAccessPolicyExceptionHeaders = { + serializedName: "Container_setAccessPolicyExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "ContainerSetAccessPolicyExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.ContainerRestoreHeaders = { + serializedName: "Container_restoreHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "ContainerRestoreHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "String" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "String" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "String" } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "DateTimeRfc1123" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Dictionary", - value: { type: { name: "any" } } + name: "String" } } } } }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + exports2.ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", - className: "DelimitedTextConfiguration", + className: "ContainerRestoreExceptionHeaders", modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + } + } + } + }; + 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" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } - } - } - } - }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration", - modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -50549,76 +55055,73 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + exports2.ContainerRenameExceptionHeaders = { + serializedName: "Container_renameExceptionHeaders", type: { name: "Composite", - className: "ArrowConfiguration", + className: "ContainerRenameExceptionHeaders", modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + name: "String" } } } } }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", + exports2.ContainerSubmitBatchHeaders = { + serializedName: "Container_submitBatchHeaders", type: { name: "Composite", - className: "ArrowField", + className: "ContainerSubmitBatchHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - name: { - serializedName: "Name", - xmlName: "Name", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } - }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + } + } + } + }; + exports2.ContainerSubmitBatchExceptionHeaders = { + serializedName: "Container_submitBatchExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSubmitBatchExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", + exports2.ContainerFilterBlobsHeaders = { + serializedName: "Container_filterBlobsHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesHeaders", + className: "ContainerFilterBlobsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50641,21 +55144,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", + exports2.ContainerFilterBlobsExceptionHeaders = { + serializedName: "Container_filterBlobsExceptionHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", + className: "ContainerFilterBlobsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50667,12 +55170,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", + exports2.ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesHeaders", + 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", @@ -50694,21 +55218,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", + exports2.ContainerAcquireLeaseExceptionHeaders = { + serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", + className: "ContainerAcquireLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50720,12 +55244,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", + exports2.ContainerReleaseLeaseHeaders = { + serializedName: "Container_releaseLeaseHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsHeaders", + 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", @@ -50753,22 +55291,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", + exports2.ContainerReleaseLeaseExceptionHeaders = { + serializedName: "Container_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", + className: "ContainerReleaseLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50780,12 +55311,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", + exports2.ContainerRenewLeaseHeaders = { + serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentHeaders", + 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", @@ -50807,21 +55359,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", + exports2.ContainerRenewLeaseExceptionHeaders = { + serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", + className: "ContainerRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50833,12 +55385,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", + exports2.ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", + 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", @@ -50866,22 +55439,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", + exports2.ContainerBreakLeaseExceptionHeaders = { + serializedName: "Container_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", + className: "ContainerBreakLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50893,12 +55459,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", + exports2.ContainerChangeLeaseHeaders = { + serializedName: "Container_changeLeaseHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoHeaders", + 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", @@ -50926,57 +55513,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" - } } } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.ContainerChangeLeaseExceptionHeaders = { + serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "ContainerChangeLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50988,11 +55533,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "ContainerListBlobFlatSegmentHeaders", modelProperties: { contentType: { serializedName: "content-type", @@ -51001,6 +55546,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51015,11 +55567,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, errorCode: { @@ -51032,11 +55584,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51048,12 +55600,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", + exports2.ContainerListBlobHierarchySegmentHeaders = { + serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + 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", @@ -51092,11 +55651,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { + serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", + className: "ContainerListBlobHierarchySegmentExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51108,26 +55667,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", + exports2.ContainerGetAccountInfoHeaders = { + serializedName: "Container_getAccountInfoHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "ContainerGetAccountInfoHeaders", 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", @@ -51156,21 +55701,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { - name: "String" + 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" } } } } }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", + exports2.ContainerGetAccountInfoExceptionHeaders = { + serializedName: "Container_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateExceptionHeaders", + className: "ContainerGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51182,12 +55755,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", + exports2.BlobDownloadHeaders = { + serializedName: "Blob_downloadHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + 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-", @@ -51197,18 +55784,141 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; value: { type: { name: "String" } } } }, - etag: { - serializedName: "etag", - xmlName: "etag", + 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" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "DateTimeRfc1123" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, leaseDuration: { @@ -51262,188 +55972,110 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "String" } }, - hasImmutabilityPolicy: { - serializedName: "x-ms-has-immutability-policy", - xmlName: "x-ms-has-immutability-policy", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { name: "Boolean" } }, - hasLegalHold: { - serializedName: "x-ms-has-legal-hold", - xmlName: "x-ms-has-legal-hold", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { - name: "Boolean" + name: "String" } }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - denyEncryptionScopeOverride: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "Boolean" + name: "Number" } }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "x-ms-immutable-storage-with-versioning-enabled", - xmlName: "x-ms-immutable-storage-with-versioning-enabled", + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { name: "Boolean" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", - type: { - name: "Composite", - className: "ContainerDeleteHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "String" + name: "ByteArray" } }, - date: { - serializedName: "date", - xmlName: "date", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", - type: { - name: "Composite", - className: "ContainerDeleteExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", - type: { - name: "Composite", - className: "ContainerSetMetadataHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "String" + name: "Boolean" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", 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", + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "String" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - date: { - serializedName: "date", - xmlName: "date", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, errorCode: { @@ -51452,15 +56084,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" + } } } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "BlobDownloadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51472,27 +56111,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.BlobGetPropertiesHeaders = { + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "BlobGetPropertiesHeaders", 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", @@ -51500,306 +56124,196 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { - name: "DateTimeRfc1123" + name: "Dictionary", + value: { type: { name: "String" } } } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", - type: { - name: "Composite", - className: "ContainerSetAccessPolicyHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { - name: "String" + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", 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" - } - } - } - } - }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } - } - } - } - }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", - type: { - name: "Composite", - className: "ContainerRestoreHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "String" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + isIncrementalCopy: { + serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { - name: "String" + name: "Boolean" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + destinationSnapshot: { + serializedName: "x-ms-copy-destination-snapshot", + xmlName: "x-ms-copy-destination-snapshot", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "DateTimeRfc1123" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "String" + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } - } - } - } - }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", - type: { - name: "Composite", - className: "ContainerRestoreExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "String" + name: "Enum", + allowedValues: ["locked", "unlocked"] } - } - } - } - }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", - type: { - name: "Composite", - className: "ContainerRenameHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", - type: { - name: "Composite", - className: "ContainerRenameExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } - } - } - } - }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + }, + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -51827,89 +56341,157 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } - } - } - } - }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", - type: { - name: "Composite", - className: "ContainerAcquireLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + accessTier: { + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + 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" } }, - date: { - serializedName: "date", - xmlName: "date", + 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" + } } } } }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", + exports2.BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", + className: "BlobGetPropertiesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51921,26 +56503,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", + exports2.BlobDeleteHeaders = { + serializedName: "Blob_deleteHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "BlobDeleteHeaders", 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", @@ -51968,15 +56536,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "BlobDeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51988,33 +56563,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "BlobUndeleteHeaders", 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", @@ -52042,15 +56596,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "BlobUndeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52062,11 +56623,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlobSetExpiryHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52082,13 +56643,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52120,11 +56674,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52136,11 +56690,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlobSetHttpHeadersHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52156,11 +56710,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } }, clientRequestId: { @@ -52190,15 +56744,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52210,19 +56771,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", + exports2.BlobSetImmutabilityPolicyHeaders = { + serializedName: "Blob_setImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", + className: "BlobSetImmutabilityPolicyHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52251,21 +56805,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" + } + }, + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlobSetImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52277,19 +56839,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlobDeleteImmutabilityPolicyHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlobDeleteImmutabilityPolicyHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52317,22 +56872,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52344,11 +56892,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlobSetLegalHoldHeaders = { + serializedName: "Blob_setLegalHoldHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + className: "BlobSetLegalHoldHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52378,37 +56926,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { name: "Boolean" } @@ -52416,11 +56936,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52432,72 +56952,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlobSetMetadataHeaders", 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", @@ -52505,127 +56965,120 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", 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", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + } + } + } + }; + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + } + } + } + }; + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, clientRequestId: { @@ -52649,134 +57102,162 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } - }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", + } + } + } + }; + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", + } + } + } + }; + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", + type: { + name: "Composite", + className: "BlobReleaseLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } - }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + } + } + } + }; + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobReleaseLeaseExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + } + } + } + }; + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", + type: { + name: "Composite", + className: "BlobRenewLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Boolean" + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } } } } }; - var BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadExceptionHeaders", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52788,12 +57269,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesHeaders = { - serializedName: "Blob_getPropertiesHeaders", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "BlobGetPropertiesHeaders", + className: "BlobChangeLeaseHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, lastModified: { serializedName: "last-modified", xmlName: "last-modified", @@ -52801,194 +57289,247 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - createdOn: { - serializedName: "x-ms-creation-time", - xmlName: "x-ms-creation-time", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - objectReplicationPolicyId: { - serializedName: "x-ms-or-policy-id", - xmlName: "x-ms-or-policy-id", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - objectReplicationRules: { - serializedName: "x-ms-or", - headerCollectionPrefix: "x-ms-or-", - xmlName: "x-ms-or", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + 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" } }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { - name: "String" + name: "Number" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "DateTimeRfc1123" } - }, - isIncrementalCopy: { - serializedName: "x-ms-incremental-copy", - xmlName: "x-ms-incremental-copy", + } + } + } + }; + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobBreakLeaseExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - destinationSnapshot: { - serializedName: "x-ms-copy-destination-snapshot", - xmlName: "x-ms-copy-destination-snapshot", + } + } + } + }; + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", + type: { + name: "Composite", + className: "BlobCreateSnapshotHeaders", + modelProperties: { + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", type: { name: "String" } }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - etag: { - serializedName: "etag", - xmlName: "etag", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + } + } + } + }; + 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" } - }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + } + } + } + }; + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", + type: { + name: "Composite", + className: "BlobStartCopyFromURLHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Number" + name: "DateTimeRfc1123" } }, clientRequestId: { @@ -53012,6 +57553,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -53019,139 +57567,150 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", 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", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + } + } + } + }; + 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" } }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { name: "String" } }, - accessTierInferred: { - serializedName: "x-ms-access-tier-inferred", - xmlName: "x-ms-access-tier-inferred", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { - name: "Boolean" + name: "Number" } - }, - archiveStatus: { - serializedName: "x-ms-archive-status", - xmlName: "x-ms-archive-status", + } + } + } + }; + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", + type: { + name: "Composite", + className: "BlobCopyFromURLHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - expiresOn: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + copyStatus: { + defaultValue: "success", + isConstant: true, + serializedName: "x-ms-copy-status", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "ByteArray" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Boolean" + name: "String" } }, errorCode: { @@ -53164,11 +57723,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53176,15 +57735,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "BlobDeleteHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53224,11 +57797,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53240,11 +57813,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + className: "BlobSetTierHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53267,13 +57840,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -53284,11 +57850,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53300,26 +57866,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "BlobGetAccountInfoHeaders", 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", @@ -53347,15 +57899,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "BlobSetExpiryExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53367,12 +57954,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersHeaders", + 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", @@ -53380,11 +58004,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + 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: { @@ -53394,66 +58046,87 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "Number" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { - name: "String" + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + copyCompletionTime: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } - } - } - } - }; - var BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } - } - } - } - }; - var BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", - type: { - name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", - modelProperties: { + }, + 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", @@ -53475,6 +58148,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -53482,29 +58162,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - immutabilityPolicyExpiry: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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" } } } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", + className: "BlobQueryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53516,11 +58230,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", + exports2.BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", + className: "BlobGetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53549,15 +58263,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53569,11 +58290,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldHeaders", + className: "BlobSetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53603,21 +58324,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53629,11 +58350,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlobSetMetadataHeaders", + className: "PageBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53649,6 +58370,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53715,11 +58443,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobSetMetadataExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53731,11 +58459,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseHeaders", + className: "PageBlobUploadPagesHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53751,11 +58479,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + 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: { @@ -53785,15 +58527,43 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53805,11 +58575,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseHeaders", + className: "PageBlobClearPagesHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53825,6 +58595,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53852,15 +58643,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53872,11 +58670,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "BlobRenewLeaseHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53892,18 +58690,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" + } + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" } }, requestId: { @@ -53926,15 +58731,43 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53942,16 +58775,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "BlobChangeLeaseHeaders", + className: "PageBlobGetPageRangesHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -53959,11 +58813,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -53980,13 +58834,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54000,15 +58847,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54020,19 +58874,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "BlobBreakLeaseHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, lastModified: { serializedName: "last-modified", xmlName: "last-modified", @@ -54040,9 +58887,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } @@ -54074,15 +58928,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54094,19 +58955,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotHeaders", + className: "PageBlobResizeHeaders", modelProperties: { - snapshot: { - serializedName: "x-ms-snapshot", - xmlName: "x-ms-snapshot", - type: { - name: "String" - } - }, etag: { serializedName: "etag", xmlName: "etag", @@ -54121,6 +58975,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54142,13 +59003,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54156,13 +59010,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54173,11 +59020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54189,11 +59036,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLHeaders", + className: "PageBlobUpdateSequenceNumberHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54209,6 +59056,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54230,13 +59084,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54244,21 +59091,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54269,11 +59101,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54285,11 +59117,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "BlobCopyFromURLHeaders", + className: "PageBlobCopyIncrementalHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54326,13 +59158,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54348,32 +59173,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }, copyStatus: { - defaultValue: "success", - isConstant: true, serializedName: "x-ms-copy-status", + xmlName: "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" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, errorCode: { @@ -54386,11 +59190,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54402,12 +59206,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAbortCopyFromURLHeaders = { - serializedName: "Blob_abortCopyFromURLHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "BlobAbortCopyFromURLHeaders", + 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", @@ -54429,6 +59254,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -54436,6 +59268,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54446,11 +59299,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAbortCopyFromURLExceptionHeaders = { - serializedName: "Blob_abortCopyFromURLExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobAbortCopyFromURLExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54462,65 +59315,40 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierHeaders = { - serializedName: "Blob_setTierHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "BlobSetTierHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var BlobSetTierExceptionHeaders = { - serializedName: "Blob_setTierExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetTierExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var BlobGetAccountInfoHeaders = { - serializedName: "Blob_getAccountInfoHeaders", - type: { - name: "Composite", - className: "BlobGetAccountInfoHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -54549,49 +59377,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "String" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + name: "Number" } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + 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" + } } } } }; - var BlobGetAccountInfoExceptionHeaders = { - serializedName: "Blob_getAccountInfoExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "BlobGetAccountInfoExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54603,12 +59438,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQueryHeaders = { - serializedName: "Blob_queryHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "BlobQueryHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" + } + }, lastModified: { serializedName: "last-modified", xmlName: "last-modified", @@ -54616,164 +59458,215 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "ByteArray" } }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Number" + name: "ByteArray" } }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - etag: { - serializedName: "etag", - xmlName: "etag", + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "ByteArray" + name: "Number" } }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + 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" } }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { name: "Number" } - }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", + } + } + } + }; + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", + type: { + name: "Composite", + className: "AppendBlobSealHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "String" } }, - copyCompletionTime: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "Boolean" } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + } + } + } + }; + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", + type: { + name: "Composite", + className: "AppendBlobSealExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" + } + } + } + } + }; + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", + type: { + name: "Composite", + className: "BlockBlobUploadHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, clientRequestId: { @@ -54797,9 +59690,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } @@ -54811,16 +59704,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -54839,35 +59725,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" - } } } } }; - var BlobQueryExceptionHeaders = { - serializedName: "Blob_queryExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "BlobQueryExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54879,12 +59751,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetTagsHeaders = { - serializedName: "Blob_getTagsHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "BlobGetTagsHeaders", + 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", @@ -54906,6 +59799,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -54913,6 +59813,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54923,11 +59844,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetTagsExceptionHeaders = { - serializedName: "Blob_getTagsExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobGetTagsExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54935,16 +59856,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobSetTagsHeaders = { - serializedName: "Blob_setTagsHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "BlobSetTagsHeaders", + 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", @@ -54973,6 +59915,34 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54983,11 +59953,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "BlobSetTagsExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54999,26 +59969,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateHeaders = { - serializedName: "PageBlob_createHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "PageBlobCreateHeaders", + className: "BlockBlobStageBlockFromURLHeaders", 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", @@ -55026,6 +59982,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -55047,13 +60010,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -55092,11 +60048,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateExceptionHeaders = { - serializedName: "PageBlob_createExceptionHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "PageBlobCreateExceptionHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -55104,15 +60060,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var PageBlobUploadPagesHeaders = { - serializedName: "PageBlob_uploadPagesHeaders", + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesHeaders", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { etag: { serializedName: "etag", @@ -55142,13 +60112,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -55170,6 +60133,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -55208,11 +60178,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesExceptionHeaders = { - serializedName: "PageBlob_uploadPagesExceptionHeaders", + exports2.BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesExceptionHeaders", + className: "BlockBlobCommitBlockListExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -55224,43 +60194,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobClearPagesHeaders = { - serializedName: "PageBlob_clearPagesHeaders", + exports2.BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", type: { name: "Composite", - className: "PageBlobClearPagesHeaders", + className: "BlockBlobGetBlockListHeaders", 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", + }, + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "ByteArray" + name: "String" } }, - xMsContentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "ByteArray" + name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } @@ -55303,1813 +60266,1238 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var 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.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" } } }; - var 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.action3 = { + parameterPath: "action", + mapper: { + defaultValue: "break", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.breakPeriod = { + parameterPath: ["options", "breakPeriod"], + mapper: { + serializedName: "x-ms-lease-break-period", + xmlName: "x-ms-lease-break-period", + type: { + name: "Number" } } }; - var 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.action4 = { + parameterPath: "action", + mapper: { + defaultValue: "change", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.proposedLeaseId1 = { + parameterPath: "proposedLeaseId", + mapper: { + serializedName: "x-ms-proposed-lease-id", + required: true, + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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", + exports2.include1 = { + parameterPath: ["options", "include"], + mapper: { + serializedName: "include", + xmlName: "include", + xmlElementName: "ListBlobsIncludeItem", + type: { + name: "Sequence", + element: { type: { - name: "String" + 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" + } } }; - var 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.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var 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.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.encryptionAlgorithm = { + parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], + mapper: { + serializedName: "x-ms-encryption-algorithm", + xmlName: "x-ms-encryption-algorithm", + type: { + name: "String" } } }; - var 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.ifMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], + mapper: { + serializedName: "If-Match", + xmlName: "If-Match", + type: { + name: "String" } } }; - var 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.ifNoneMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], + mapper: { + serializedName: "If-None-Match", + xmlName: "If-None-Match", + type: { + name: "String" } } }; - var 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.ifTags = { + parameterPath: ["options", "modifiedAccessConditions", "ifTags"], + mapper: { + serializedName: "x-ms-if-tags", + xmlName: "x-ms-if-tags", + type: { + name: "String" } } }; - var 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.deleteSnapshots = { + parameterPath: ["options", "deleteSnapshots"], + mapper: { + serializedName: "x-ms-delete-snapshots", + xmlName: "x-ms-delete-snapshots", + type: { + name: "Enum", + allowedValues: ["include", "only"] } } }; - var 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.blobDeleteType = { + parameterPath: ["options", "blobDeleteType"], + mapper: { + serializedName: "deletetype", + xmlName: "deletetype", + type: { + name: "String" } } }; - var 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.comp11 = { + parameterPath: "comp", + mapper: { + defaultValue: "expiry", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.comp12 = { + parameterPath: "comp", + mapper: { + defaultValue: "immutabilityPolicies", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.immutabilityPolicyExpiry = { + parameterPath: ["options", "immutabilityPolicyExpiry"], + mapper: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", + type: { + name: "DateTimeRfc1123" } } }; - var 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.immutabilityPolicyMode = { + parameterPath: ["options", "immutabilityPolicyMode"], + mapper: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } }; - var 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.comp13 = { + parameterPath: "comp", + mapper: { + defaultValue: "legalhold", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.legalHold = { + parameterPath: "legalHold", + mapper: { + serializedName: "x-ms-legal-hold", + required: true, + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.sealBlob = { + parameterPath: ["options", "sealBlob"], + mapper: { + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", + type: { + name: "Boolean" } } }; - var 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.legalHold1 = { + parameterPath: ["options", "legalHold"], + mapper: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.xMsRequiresSync = { + parameterPath: "xMsRequiresSync", + mapper: { + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", + type: { + name: "String" } } }; - var 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.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], + mapper: { + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", + type: { + name: "ByteArray" } } }; - var 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.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], + exports2.comp15 = { + parameterPath: "comp", mapper: { - defaultValue: "application/xml", + defaultValue: "copy", isConstant: true, - serializedName: "Content-Type", + serializedName: "comp", type: { name: "String" } } }; - var blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties - }; - var accept = { - parameterPath: "accept", + exports2.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", mapper: { - defaultValue: "application/xml", + defaultValue: "abort", isConstant: true, - serializedName: "Accept", + serializedName: "x-ms-copy-action", type: { name: "String" } } }; - var url = { - parameterPath: "url", + exports2.copyId = { + parameterPath: "copyId", mapper: { - serializedName: "url", + serializedName: "copyid", required: true, - xmlName: "url", + xmlName: "copyid", type: { name: "String" } - }, - skipEncoding: true + } }; - var restype = { - parameterPath: "restype", + exports2.comp16 = { + parameterPath: "comp", mapper: { - defaultValue: "service", + defaultValue: "tier", isConstant: true, - serializedName: "restype", + 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" } } }; - var comp = { + exports2.comp18 = { parameterPath: "comp", mapper: { - defaultValue: "properties", + defaultValue: "tags", isConstant: true, serializedName: "comp", type: { @@ -57117,132 +61505,218 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], + exports2.tags = { + parameterPath: ["options", "tags"], + mapper: mappers_js_1.BlobTags + }; + exports2.transactionalContentMD5 = { + parameterPath: ["options", "transactionalContentMD5"], mapper: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "timeout", - xmlName: "timeout", + serializedName: "Content-MD5", + xmlName: "Content-MD5", type: { - name: "Number" + name: "ByteArray" } } }; - var version = { - parameterPath: "version", + 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: "2024-11-04", + defaultValue: "PageBlob", isConstant: true, - serializedName: "x-ms-version", + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var requestId = { - parameterPath: ["options", "requestId"], + exports2.blobContentLength = { + parameterPath: "blobContentLength", mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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" } } }; - var accept1 = { + 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" + 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" } } }; - var comp1 = { - parameterPath: "comp", + exports2.ifSequenceNumberEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberEqualTo" + ], mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-if-sequence-number-eq", + xmlName: "x-ms-if-sequence-number-eq", type: { - name: "String" + name: "Number" } } }; - var comp2 = { - parameterPath: "comp", + exports2.pageWrite1 = { + parameterPath: "pageWrite", mapper: { - defaultValue: "list", + defaultValue: "clear", isConstant: true, - serializedName: "comp", + serializedName: "x-ms-page-write", type: { name: "String" } } }; - var prefix = { - parameterPath: ["options", "prefix"], + exports2.sourceUrl = { + parameterPath: "sourceUrl", mapper: { - serializedName: "prefix", - xmlName: "prefix", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { name: "String" } } }; - var marker = { - parameterPath: ["options", "marker"], + exports2.sourceRange = { + parameterPath: "sourceRange", mapper: { - serializedName: "marker", - xmlName: "marker", + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", type: { name: "String" } } }; - var maxPageSize = { - parameterPath: ["options", "maxPageSize"], + exports2.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], mapper: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "maxresults", - xmlName: "maxresults", + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", type: { - name: "Number" + name: "ByteArray" } } }; - var include = { - parameterPath: ["options", "include"], + exports2.range1 = { + parameterPath: "range", mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + name: "String" } - }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + } }; - var comp3 = { + exports2.comp20 = { parameterPath: "comp", mapper: { - defaultValue: "userdelegationkey", + defaultValue: "pagelist", isConstant: true, serializedName: "comp", type: { @@ -57250,65 +61724,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var restype1 = { - parameterPath: "restype", + exports2.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", type: { name: "String" } } }; - var body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } - } - }; - var comp4 = { - parameterPath: "comp", + exports2.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", type: { name: "String" } } }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } - } - }; - var multipartContentType = { - parameterPath: "multipartContentType", + exports2.sequenceNumberAction = { + parameterPath: "sequenceNumberAction", mapper: { - serializedName: "Content-Type", + serializedName: "x-ms-sequence-number-action", required: true, - xmlName: "Content-Type", + xmlName: "x-ms-sequence-number-action", type: { - name: "String" + name: "Enum", + allowedValues: ["max", "update", "increment"] } } }; - var comp5 = { + exports2.comp21 = { parameterPath: "comp", mapper: { - defaultValue: "blobs", + defaultValue: "incrementalcopy", isConstant: true, serializedName: "comp", type: { @@ -57316,112 +61767,98 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var where = { - parameterPath: ["options", "where"], + exports2.blobType1 = { + parameterPath: "blobType", mapper: { - serializedName: "where", - xmlName: "where", + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var restype2 = { - parameterPath: "restype", + exports2.comp22 = { + parameterPath: "comp", mapper: { - defaultValue: "container", + defaultValue: "appendblock", isConstant: true, - serializedName: "restype", + serializedName: "comp", type: { name: "String" } } }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - }; - var access = { - parameterPath: ["options", "access"], + exports2.maxSize = { + parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", + serializedName: "x-ms-blob-condition-maxsize", + xmlName: "x-ms-blob-condition-maxsize", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "Number" } } }; - var defaultEncryptionScope = { + exports2.appendPosition = { parameterPath: [ "options", - "containerEncryptionScope", - "defaultEncryptionScope" + "appendPositionAccessConditions", + "appendPosition" ], mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", type: { - name: "String" + name: "Number" } } }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], + exports2.sourceRange1 = { + parameterPath: ["options", "sourceRange"], mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", type: { - name: "Boolean" + name: "String" } } }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], + exports2.comp23 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + defaultValue: "seal", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], + exports2.blobType2 = { + parameterPath: "blobType", mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], + exports2.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", type: { - name: "DateTimeRfc1123" + name: "Boolean" } } }; - var comp6 = { + exports2.comp24 = { parameterPath: "comp", mapper: { - defaultValue: "metadata", + defaultValue: "block", isConstant: true, serializedName: "comp", type: { @@ -57429,39 +61866,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp7 = { - parameterPath: "comp", + exports2.blockId = { + parameterPath: "blockId", mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", + serializedName: "blockid", + required: true, + xmlName: "blockid", type: { name: "String" } } }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } - } + exports2.blocks = { + parameterPath: "blocks", + mapper: mappers_js_1.BlockLookupList }; - var comp8 = { + exports2.comp25 = { parameterPath: "comp", mapper: { - defaultValue: "undelete", + defaultValue: "blocklist", isConstant: true, serializedName: "comp", type: { @@ -57469,5492 +61892,6155 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], + exports2.listType = { + parameterPath: "listType", mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", + defaultValue: "committed", + serializedName: "blocklisttype", + required: true, + xmlName: "blocklisttype", type: { - name: "String" + 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); } - }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } + /** + * Restores a previously-deleted container. + * @param options The options parameters. + */ + restore(options) { + return this.client.sendOperationRequest({ options }, restoreOperationSpec); } - }; - var comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" - } + /** + * 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); } - }; - var comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * [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); } - }; - var duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" - } + /** + * [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); } - }; - var proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * [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); } - }; - var leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * [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); } - }; - var action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 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" - ] - } - } + var setMetadataOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerSetMetadataHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerSetMetadataExceptionHeaders } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" + 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 ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" + 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 ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" + 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 deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] + 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 blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" + 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 }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * 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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * 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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" - } + /** + * 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); } - }; - var comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } + /** + * 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); } - }; - var immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } + /** + * [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); } - }; - var comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } + /** + * [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); } - }; - var comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var 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" - ] - } + /** + * 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); } - }; - var rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } + /** + * 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); } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } + /** + * 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); } - }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } + /** + * 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); } - }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * 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); } - }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" - } + /** + * 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); } }; - var sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" + 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 legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" + 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 sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" + 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 copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" + 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 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"] + 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 comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" + 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 copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" + 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 comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var acquireLeaseOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlobAcquireLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobAcquireLeaseExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags + 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 transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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 transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" + 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 blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + 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 blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + 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 contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + 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 body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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 accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + var setTagsOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 204: { + headersMapper: Mappers.BlobSetTagsHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetTagsExceptionHeaders } - } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" + }, + requestBody: Parameters.tags, + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.versionId, + Parameters.comp18 ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" - } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" + urlParameters: [Parameters.url], + headerParameters: [ + Parameters.contentType, + Parameters.accept, + Parameters.version, + Parameters.requestId, + Parameters.leaseId, + Parameters.ifTags, + Parameters.transactionalContentMD5, + Parameters.transactionalContentCrc64 ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" - } - } + isXML: true, + contentType: "application/xml; charset=utf-8", + mediaType: "xml", + serializer: xmlSerializer }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" - } + } +}); + +// 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; } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" - } + /** + * 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); } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" - } + /** + * 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); } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" - } + /** + * 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); } - }; - var 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"] - } + /** + * 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); } }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + var uploadPagesFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.PageBlobUploadPagesFromURLHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUploadPagesFromURLExceptionHeaders } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" + }, + 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 ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + 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 comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + 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 comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" - } + } +}); + +// 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); } }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList + 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 comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + 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 }; - var ServiceImpl = class { + } +}); + +// 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 Service class. + * Initialize a new instance of the class BlockBlob 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(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, 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$2); - } - /** - * 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. + * 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. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); + upload(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, uploadOperationSpec); } /** - * The List Containers Segment operation returns a list of the containers under the specified account + * 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. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); + putBlobFromUrl(contentLength, copySource, options) { + return this.client.sendOperationRequest({ contentLength, copySource, options }, putBlobFromUrlOperationSpec); } /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * @param keyInfo Key information + * 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. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); + stageBlock(blockId, contentLength, body, options) { + return this.client.sendOperationRequest({ blockId, contentLength, body, options }, stageBlockOperationSpec); } /** - * Returns the sku name and account kind + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); + stageBlockFromURL(blockId, contentLength, sourceUrl, options) { + return this.client.sendOperationRequest({ blockId, contentLength, sourceUrl, options }, stageBlockFromURLOperationSpec); } /** - * 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 + * 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. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); + commitBlockList(blocks, options) { + return this.client.sendOperationRequest({ blocks, options }, commitBlockListOperationSpec); } /** - * 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. + * 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. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); + getBlockList(listType, options) { + return this.client.sendOperationRequest({ listType, options }, getBlockListOperationSpec); } }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( + exports2.BlockBlobImpl = BlockBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var setPropertiesOperationSpec = { - path: "/", + var uploadOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders + 201: { + headersMapper: Mappers.BlockBlobUploadHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobUploadExceptionHeaders } }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], + requestBody: Parameters.body1, + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId + 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: "xml", - serializer: xmlSerializer$5 + mediaType: "binary", + serializer: xmlSerializer }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", + var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders + 201: { + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", + var stageBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockExceptionHeaders } }, + requestBody: Parameters.body1, queryParameters: [ - restype, - timeoutInSeconds, - comp1 + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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, - serializer: xmlSerializer$5 + contentType: "application/xml; charset=utf-8", + mediaType: "binary", + serializer: xmlSerializer }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", + var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", + var commitBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders + 201: { + headersMapper: Mappers.BlockBlobCommitBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobCommitBlockListExceptionHeaders } }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url], + requestBody: Parameters.blocks, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp25], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId + 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$5 + serializer: xmlSerializer }; - var getAccountInfoOperationSpec$2 = { - path: "/", + var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - headersMapper: ServiceGetAccountInfoHeaders + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } }, queryParameters: [ - comp, - timeoutInSeconds, - restype1 + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.comp25, + Parameters.listType ], - urlParameters: [url], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + } +}); + +// 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(url, options) { + if (url === void 0) { + throw new Error("'url' cannot be null"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 + if (!options) { + options = {}; + } + const defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; + super(optionsWithDefaults); + this.url = url; + 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; }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + 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 = ""; } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + return super.sendOperationRequest(operationArguments, operationSpecToSend); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * Encoded URL string value. */ - constructor(client) { - this.client = client; + 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(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + 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 new container under the specified account. If the container with the same name already - * exists, the operation fails - * @param options The options parameters. + * 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 - */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); + 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; } /** - * 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. + * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it + * and boolean values for them. + * + * @param permissionLike - */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); + 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 { /** - * 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. + * 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 - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); + 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; } /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it + * and boolean values for them. + * + * @param permissionLike - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); + 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; } /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * Specifies Read access granted. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + read = false; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Specifies Add access granted. */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + add = false; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Specifies Create access granted. */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); - } + create = false; /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Specifies Write access granted. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); - } + write = false; /** - * 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. + * Specifies Delete access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } + deleteVersion = false; /** - * [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. + * Specifies List access granted. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); - } + list = false; /** - * [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. + * Specfies Tag access granted. */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); - } + tag = false; /** - * [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. + * Specifies Move access granted. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); - } + move = false; /** - * [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. + * Specifies Execute access granted. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); - } + execute = false; /** - * [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. + * Specifies SetImmutabilityPolicy access granted. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); - } + setImmutabilityPolicy = false; /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. + * Specifies that Permanent Delete is permitted. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); - } + permanentDelete = false; /** - * [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. + * Specifies that Filter Blobs by Tags is permitted. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); - } + filterByTags = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * 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 + * */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); - } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + toString() { + const permissions = []; + if (this.read) { + permissions.push("r"); } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + if (this.move) { + permissions.push("m"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + if (this.execute) { + permissions.push("e"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + if (this.permanentDelete) { + permissions.push("y"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + if (this.filterByTags) { + permissions.push("f"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 + return permissions.join(""); + } }; - var BlobImpl = class { + 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 { /** - * Initialize a new instance of the class Blob class. - * @param client Reference to the service client + * Azure Storage account name; readonly. */ - constructor(client) { - this.client = client; - } + accountName; /** - * 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. + * Azure Storage user delegation key; readonly. */ - download(options) { - return this.client.sendOperationRequest({ options }, downloadOperationSpec); - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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 { /** - * Sets the time a blob will expire and be deleted. - * @param expiryOptions Required. Indicates mode of the expiry time - * @param options The options parameters. + * The storage API version. */ - setExpiry(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); - } + version; /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); - } + protocol; /** - * The Set Immutability Policy operation sets the immutability policy on the blob - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - setImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, setImmutabilityPolicyOperationSpec); - } + startsOn; /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob - * @param options The options parameters. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - deleteImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, deleteImmutabilityPolicyOperationSpec); - } + expiresOn; /** - * 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. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - setLegalHold(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); - } + permissions; /** - * 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. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec); - } + services; /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec); - } + resourceTypes; /** - * [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. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); - } + identifier; /** - * [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. + * Optional. Encryption scope to use when sending requests authorized with this SAS URI. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); - } + encryptionScope; /** - * [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. + * 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 */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); - } + resource; /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. + * The signature for the SAS token. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec); - } + signature; /** - * The Create Snapshot operation creates a read-only snapshot of a blob - * @param options The options parameters. + * Value for cache-control header in Blob/File Service SAS. */ - createSnapshot(options) { - return this.client.sendOperationRequest({ options }, createSnapshotOperationSpec); - } + cacheControl; /** - * 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. + * Value for content-disposition header in Blob/File Service SAS. */ - startCopyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); - } + contentDisposition; /** - * 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. + * Value for content-encoding header in Blob/File Service SAS. */ - copyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); - } + contentEncoding; /** - * 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. + * Value for content-length header in Blob/File Service SAS. */ - abortCopyFromURL(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); - } + contentLanguage; /** - * 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. + * Value for content-type header in Blob/File Service SAS. */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); - } + contentType; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Inner value of getter ipRange. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); - } + ipRangeInner; /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * The Azure Active Directory object ID in GUID format. + * Property of user delegation key. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); - } + signedOid; /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * The Azure Active Directory tenant ID in GUID format. + * Property of user delegation key. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); - } + signedTenantId; /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. + * The date-time the key is active. + * Property of user delegation key. */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); - } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders + 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 + }; } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders + 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; + } } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders + } + /** + * 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; + } } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders + 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; } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 + } }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders + 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); + } } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders + } + 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); + } } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders + } + 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."); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders + } + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + } + 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(); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + } + 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(); } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var PageBlobImpl = class { - /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client - */ - constructor(client) { - this.client = client; } + 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, + timestamp2, + 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; /** - * 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. + * Gets the lease Id. + * + * @readonly */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + get leaseId() { + return this._leaseId; } /** - * 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. + * Gets the url. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get url() { + return this._url; } /** - * 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. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + 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; } /** - * 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. + * 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. */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + 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 + })); + }); } /** - * 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. + * 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. */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + 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; + }); } /** - * 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. + * 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. */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + 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 + })); + }); } /** - * 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. + * 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. */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + 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 + }); + }); } /** - * 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. + * 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. */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + 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; /** - * 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. + * 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 - */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + 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(); } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders + _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; } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders + if (!this.push(data)) { + this.source.pause(); } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders + }; + 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; } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders + 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}`)); } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 + }; + _destroy(error3, callback) { + this.removeSourceEventHandlers(); + this.source.destroy(); + callback(error3 === null ? void 0 : error3); + } }; - var AppendBlobImpl = class { + 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; + } /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * The number of bytes present in the + * response body. + * + * @readonly */ - constructor(client) { - this.client = client; + get contentLength() { + return this.originalResponse.contentLength; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * 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 */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * 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. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } /** - * 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. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get contentType() { + return this.originalResponse.contentType; } /** - * 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. + * 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 */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - constructor(client) { - this.client = client; + get copyId() { + return this.originalResponse.copyId; } /** - * 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. + * 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 */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copyProgress() { + return this.originalResponse.copyProgress; } /** - * 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. + * 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 */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get copySource() { + return this.originalResponse.copySource; } /** - * 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. + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get leaseState() { + return this.originalResponse.leaseState; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get leaseStatus() { + return this.originalResponse.leaseStatus; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * 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; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + */ + get etag() { + return this.originalResponse.etag; } /** - * 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. + * The number of tags associated with the blob * - * @param permissions - + * @readonly */ - 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; + 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; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * - * @param permissionLike - + * @readonly */ - 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; + get requestId() { + return this.originalResponse.requestId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); + get clientRequestId() { + return this.originalResponse.clientRequestId; } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + /** + * Indicates the version of the Blob service used + * to execute the request. + * + * @readonly + */ + get version() { + return this.originalResponse.version; } /** - * 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. + * Indicates the versionId of the downloaded blob version. * - * @param permissions - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates whether version of this blob is a current version. * - * @param permissionLike - + * @readonly */ - 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; + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * 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. * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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 */ - 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(""); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * + * @readonly */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * If this blob has been sealed. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get isSealed() { + return this.originalResponse.isSealed; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * Indicates if a legal hold is present on the blob. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + 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; /** - * A private helper method used to filter and append query key/value pairs into an array. + * Creates an instance of BlobDownloadResponse. * - * @param queries - - * @param key - - * @param value - + * @param originalResponse - + * @param getter - + * @param offset - + * @param count - + * @param options - */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } + constructor(originalResponse, getter, offset, count, options = {}) { + this.originalResponse = originalResponse; + this.blobDownloadStream = new RetriableReadableStream_js_1.RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); } }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); + 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(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); + if (bytes.length !== length) { + throw new Error("Hit stream end."); } + return bytes; } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); + /** + * Reads a single byte from the stream. + * + * @param stream - + * @param options - + */ + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 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(stream, options = {}) { + let zigZagEncoded = 0; + let significanceInBit = 0; + let byte, haveMoreByte, significanceInFloat; + do { + byte = await _AvroParser.readByte(stream, 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(stream, 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); } - if (version2 >= "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."); - } + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - 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."); + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; + static async readNull() { + return null; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); + if (b === 1) { + return true; + } else if (b === 0) { + return false; } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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."); + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat32(0, true); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat64(0, true); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); + if (size < 0) { + throw new Error("Bytes size was negative."); } + return stream.read(size, { abortSignal: options.abortSignal }); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); + return { key, value }; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readMap(stream, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } + return dict; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static async readArray(stream, readItemMethod, options = {}) { + const items = []; + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { + if (count < 0) { + await _AvroParser.readLong(stream, options); + count = -count; + } + while (count--) { + const item = await readItemMethod(stream, options); + items.push(item); + } } + return items; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + return _AvroType.fromObjectSchema(schema2); } } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "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'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + switch (this._primitive) { + case AvroPrimitive.NULL: + return AvroParser.readNull(); + case AvroPrimitive.BOOLEAN: + return AvroParser.readBoolean(stream, options); + case AvroPrimitive.INT: + return AvroParser.readInt(stream, options); + case AvroPrimitive.LONG: + return AvroParser.readLong(stream, options); + case AvroPrimitive.FLOAT: + return AvroParser.readFloat(stream, options); + case AvroPrimitive.DOUBLE: + return AvroParser.readDouble(stream, options); + case AvroPrimitive.BYTES: + return AvroParser.readBytes(stream, options); + case AvroPrimitive.STRING: + return AvroParser.readString(stream, options); + default: + throw new Error("Unknown Avro Primitive"); + } } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); + return this._symbols[value]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "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."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + const readItemMethod = (s, opts) => { + return this._itemType.read(s, opts); + }; + return AvroParser.readMap(stream, readItemMethod, options); } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, 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(stream, options); + } + } + return record; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + }; + } +}); + +// 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; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + return true; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + _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; } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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."); } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + this._metadata = await AvroParser_js_1.AvroParser.readMap(this._headerStream, AvroParser_js_1.AvroParser.readString, { + abortSignal: options.abortSignal }); - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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"); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal }); - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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; + } } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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((resolve2, 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(); + resolve2(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); + } + }); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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. @@ -63070,7 +68156,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -63177,14 +68263,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -63227,23 +68305,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -63272,7 +68333,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.originalResponse.clientRequestId; } /** - * Indicates the version of the Blob service used + * Indicates the version of the File service used * to execute the request. * * @readonly @@ -63281,86 +68342,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. + * 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 immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } /** - * Indicates if a legal hold is present on the blob. - * - * @readonly + * 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 legalHold() { - return this.originalResponse.legalHold; + get contentCrc64() { + return this.originalResponse.contentCrc64; } /** * The response body as a browser Blob. @@ -63368,19 +68365,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * @readonly */ - get contentAsBlob() { - return this.originalResponse.blobBody; + get blobBody() { + return void 0; } /** * The response body as a node.js Readable stream. * Always undefined in the browser. * - * It will automatically retry when internal read stream unexpected ends. + * It will parse avor data returned by blob query. * * @readonly */ get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** * The HTTP response. @@ -63388,1032 +68385,1289 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get _response() { return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** - * Creates an instance of BlobDownloadResponse. + * Creates an instance of BlobQueryResponse. * * @param originalResponse - - * @param getter - - * @param offset - - * @param count - * @param options - */ - constructor(originalResponse, getter, offset, count, options = {}) { + constructor(originalResponse, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + this.blobDownloadStream = new BlobQuickQueryStream_js_1.BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - 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); + 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; } - static async readInt(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); + return tier; + } + function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } - static async readNull() { - return null; + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25; } - 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."); + } + 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}`); } - 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."); + } + exports2.deserializeState = deserializeState; + function setStateError(inputs) { + const { state, stateProxy, isOperationError } = inputs; + return (error3) => { + if (isOperationError(error3)) { + stateProxy.setError(state, error3); + stateProxy.setFailed(state); } - 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); + throw error3; + }; + } + function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; } - static async readMapPair(stream2, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream2, options); - const value = await readItemMethod(stream2, options); - return { key, value }; + 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); } - static async readMap(stream2, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; + return { + code, + message + }; + } + function processOperationStatus(result) { + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; + switch (status) { + case "succeeded": { + stateProxy.setSucceeded(state); + break; } - 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); + 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; } - return items; - } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); - } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); - } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { - } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + case "canceled": { + stateProxy.setCanceled(state); + break; } } - }; - var AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; + 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 + })); } - // 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"); + } + function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; + } + async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 + }; } } - }; - var AvroEnumType = class extends AvroType { - 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 { - constructor(types) { - super(); - this._types = types; - } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); - } - }; - var AvroMapType = class extends AvroType { - 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 { - 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 { 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); } - return record; - } - }; - 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; + updateState === null || updateState === void 0 ? void 0 : updateState(state, response); } - return true; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; - } - get objectIndex() { - return this._objectIndex; - } - 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.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); + case "DELETE": { + return void 0; } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - }); - await 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--; + default: { + return getDefault(); + } + } + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; } } } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + } + 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; } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } - } - yield yield tslib.__await(result); - } - }); + } + 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.`); } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); + 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; } - return data; } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - get position() { - return this._position; + } + 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; } - async read(size, options = {}) { + 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 _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - throw ABORT_ERROR; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); + } + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); } - if (size === 0) { - return new Uint8Array(); + case "ResourceLocation": { + return getLocationHeader(rawResponse); } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); + case "Body": + default: { + return void 0; } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve2, 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(); - resolve2(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.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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}`); } - }; - var BlobQuickQueryStream = class extends stream.Readable { + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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 = () => ({ /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * 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. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new 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 schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 }); + 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, 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, + 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 }); } } - 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 }); + } 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`); } - 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 - }); + } + })().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; } - break; - default: - throw Error(`Unknown schema ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); - } - }; - 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; + } + 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; } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * 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; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * The number of bytes present in the - * response body. - * - * @readonly + * Serializes the Poller operation. */ - get contentLength() { - return this.originalResponse.contentLength; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * 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; + }; + 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); } - /** - * 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; + }; + 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 { /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @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. + * 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. * - * @readonly - */ - get copyCompletedOn() { - return void 0; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @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. + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @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. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @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' + * // You can assign more local properties here. + * } + * } + * ``` * - * @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. + * 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. * - * @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'. + * 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: * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get leaseState() { - return this.originalResponse.leaseState; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve2, reject) => { + this.resolve = resolve2; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The error code. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get errorCode() { - return this.originalResponse.errorCode; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * 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 + * Invokes the underlying operation's cancel method. */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * 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. + * 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. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get lastModified() { - return this.originalResponse.lastModified; + 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; } - /** - * A name-value pair - * to associate with a file storage object. - * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; + 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()); + } } /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get requestId() { - return this.originalResponse.requestId; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get clientRequestId() { - return this.originalResponse.clientRequestId; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * Indicates the version of the File service used - * to execute the request. - * - * @readonly + * Returns true if the poller has finished polling. */ - get version() { - return this.originalResponse.version; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * 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 + * Stops the poller from continuing to poll. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * 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) + * Returns true if the poller is stopped. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + isStopped() { + return this.stopped; } /** - * The response body as a browser Blob. - * Always undefined in node.js. + * Attempts to cancel the underlying operation. * - * @readonly + * 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. */ - get blobBody() { - return void 0; + 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; } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * Returns the state of the operation. * - * It will parse avor data returned by blob query. + * 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. * - * @readonly + * 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. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve2) => setTimeout(() => resolve2(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -64421,20 +69675,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -64442,10 +69697,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -64485,12 +69740,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + 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.`); @@ -64500,27 +69764,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -64535,8 +69833,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -64551,9 +69849,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve2, reject) => { this.emitter.on("finish", resolve2); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -64590,333 +69888,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve2, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve2).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve2(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream2, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve2, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream2.on("readable", () => { + const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); resolve2(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -64924,28 +69925,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve2(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream2, buffer2, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve2, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -64956,18 +69957,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream.on("end", () => { resolve2(pos); }); - stream2.on("error", reject); + stream.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve2, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve2, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -64978,9 +69991,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_utils7(); + 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. */ @@ -64996,49 +70048,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -65047,8 +70099,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -65057,8 +70109,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -65088,7 +70140,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -65097,76 +70149,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -65174,8 +70256,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -65183,9 +70264,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -65194,7 +70275,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -65211,9 +70295,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -65224,7 +70308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -65234,7 +70318,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -65245,17 +70329,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -65263,19 +70355,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -65285,19 +70379,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65307,13 +70409,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -65324,7 +70426,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -65336,14 +70438,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -65354,22 +70458,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65385,15 +70491,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -65403,15 +70511,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -65422,24 +70537,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -65460,57 +70577,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * Example using copy cancellation: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -65518,15 +70636,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -65538,14 +70656,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -65555,36 +70673,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -65595,31 +70716,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -65627,12 +70749,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -65643,26 +70765,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -65676,8 +70801,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await streamToBuffer(stream2, buffer2, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -65685,7 +70810,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -65705,10 +70830,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -65723,7 +70851,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -65739,7 +70867,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -65751,21 +70879,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -65773,12 +70903,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -65790,18 +70920,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve2) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve2(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve2((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -65810,17 +70946,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve2) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve2((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. @@ -65828,8 +71014,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -65840,8 +71026,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -65854,8 +71040,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -65865,60 +71051,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -65929,40 +71120,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -65970,20 +71176,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -65996,20 +71213,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -66018,29 +71237,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -66055,7 +71289,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -66069,74 +71303,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -66148,8 +71397,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -66158,15 +71407,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -66182,26 +71448,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -66219,7 +71487,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -66230,32 +71498,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66280,22 +71564,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -66303,10 +71602,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -66324,7 +71623,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -66341,18 +71640,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -66363,30 +71663,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66394,20 +71696,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -66436,18 +71740,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -66474,7 +71778,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -66495,23 +71799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -66521,32 +71824,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -66572,15 +71875,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -66599,27 +71905,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream2, + const scheduler = new storage_common_1.BufferScheduler( + stream, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -66637,50 +71943,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -66691,13 +72005,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -66705,23 +72019,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -66730,21 +72046,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -66752,7 +72080,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -66760,19 +72088,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -66785,7 +72115,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -66796,32 +72126,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -66830,13 +72163,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -66846,7 +72181,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -66855,16 +72190,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -66872,22 +72209,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -66907,17 +72246,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -66926,94 +72263,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```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); * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * // 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()`: * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67039,13 +72361,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67055,17 +72380,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -67074,7 +72401,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67082,20 +72409,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67116,17 +72445,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -67136,94 +72463,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -67232,7 +72553,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -67250,13 +72573,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -67264,24 +72590,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -67289,12 +72617,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -67302,22 +72632,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67327,38 +72659,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_utils7(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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."); @@ -67369,15 +72735,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -67389,18 +72755,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -67420,7 +72786,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -67435,7 +72801,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -67450,6 +72816,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -67489,6 +72865,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve2(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -67505,11 +72883,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -67533,13 +72936,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -67551,13 +72954,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; + let url; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -67566,28 +72969,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; + let url; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -67595,24 +72998,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + await new Clients_js_1.BlobClient(url, 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -67625,9 +73036,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -67636,19 +73047,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -67657,23 +73068,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path2 = getURLPath(subRequest.url); + const path2 = (0, utils_common_js_1.getURLPath)(subRequest.url); if (!path2 || path2 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } @@ -67684,7 +73095,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -67701,7 +73112,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -67712,7 +73123,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -67723,18 +73134,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url2, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path2 = getURLPath(url2); + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path2 = (0, utils_common_js_1.getURLPath)(url); if (path2 && path2 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { @@ -67746,10 +73175,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -67760,7 +73189,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -67778,11 +73207,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -67790,17 +73233,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -67809,10 +73267,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -67829,7 +73289,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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. */ @@ -67838,48 +73326,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -67887,34 +73375,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -67931,7 +73437,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -67953,7 +73459,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67961,7 +73467,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67971,15 +73477,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * 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 BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -67987,12 +73505,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -68005,14 +73523,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -68020,8 +73542,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -68032,19 +73554,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68056,24 +73585,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -68086,7 +73615,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -68094,8 +73623,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -68144,29 +73673,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -68181,7 +73710,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -68195,7 +73724,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -68205,10 +73734,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -68220,14 +73749,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -68240,18 +73769,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -68260,23 +73809,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -68292,44 +73864,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -68337,64 +73891,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -68402,41 +73955,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -68455,7 +74011,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68472,17 +74031,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -68490,35 +74047,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -68526,118 +74070,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -68655,7 +74219,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -68676,23 +74243,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -68712,18 +74283,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -68734,27 +74303,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -68764,53 +74317,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: * - * ```js - * let i = 1; + * // 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 @@ -68818,11 +74372,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -68834,7 +74387,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -68853,7 +74408,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -68862,14 +74420,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -68881,7 +74439,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -68891,7 +74449,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -68901,18 +74459,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve2) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve2(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve2((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -68921,45 +74482,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve2) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve2((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -69063,6 +74657,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -69070,7 +74716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69117,12 +74763,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -69148,10 +74799,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -69168,13 +74831,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -69203,6 +74870,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -69224,44 +74907,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -69272,22 +74973,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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. @@ -69302,35 +75031,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url2, credentialOrPipeline, options) { + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url2, pipeline); + super(url, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -69341,22 +75070,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -69373,7 +75111,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -69387,47 +75125,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -69436,15 +75156,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -69454,14 +75174,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -69472,14 +75192,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -69487,7 +75207,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -69499,9 +75219,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -69522,23 +75248,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -69558,18 +75288,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -69580,27 +75308,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -69608,57 +75320,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js + * // Use for await to iterate the blobs * let i = 1; * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // 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 @@ -69670,7 +75378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -69682,7 +75390,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -69701,7 +75411,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69717,45 +75430,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -69763,45 +75458,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js + * // Use for await to iterate the containers * let i = 1; * for await (const container of blobServiceClient.listContainers()) { * console.log(`Container ${i++}: ${container.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -69823,7 +75514,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -69835,17 +75526,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -69864,7 +75558,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -69874,16 +75571,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -69897,19 +75594,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -69917,7 +75622,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69925,21 +75630,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -69947,7 +75653,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -69955,66 +75661,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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; + } }); } }); @@ -70099,7 +75863,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70112,21 +75876,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -70154,9 +75928,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core14 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core14 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { constructor(contentLength) { @@ -70239,15 +76014,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -70258,15 +76035,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -70274,7 +76050,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70287,21 +76063,31 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -70329,9 +76115,14 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -70339,14 +76130,12 @@ var require_requestUtils = __commonJS({ } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -70358,14 +76147,13 @@ var require_requestUtils = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(name_1, method_1, getStatusCode_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { let errorMessage = ""; let attempt = 1; while (attempt <= maxAttempts) { @@ -70374,12 +76162,12 @@ var require_requestUtils = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -70402,9 +76190,8 @@ var require_requestUtils = __commonJS({ throw Error(`${name} failed: ${errorMessage}`); }); } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + function retryTypedResponse(name_1, method_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return yield retry3( name, method, @@ -70413,13 +76200,13 @@ var require_requestUtils = __commonJS({ delay, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { + (error3) => { + if (error3 instanceof http_client_1.HttpClientError) { return { - statusCode: error4.statusCode, + statusCode: error3.statusCode, result: null, headers: {}, - error: error4 + error: error3 }; } else { return void 0; @@ -70428,13 +76215,155 @@ var require_requestUtils = __commonJS({ ); }); } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + function retryHttpClientResponse(name_1, method_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return yield retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay); }); } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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; } }); @@ -70442,7 +76371,7 @@ var require_requestUtils = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70455,21 +76384,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -70497,20 +76436,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs2 = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs2 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream.pipeline); yield pipeline(response.message, output); }); @@ -70612,10 +76554,10 @@ var require_downloadUtils = __commonJS({ }; exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const writeStream = fs2.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { + 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, () => { @@ -70635,17 +76577,16 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const archiveDescriptor = yield fs2.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", () => __awaiter4(this, void 0, void 0, function* () { + 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"]; @@ -70662,7 +76603,7 @@ var require_downloadUtils = __commonJS({ const count = Math.min(blockSize, length - offset); downloads.push({ offset, - promiseGetter: () => __awaiter4(this, void 0, void 0, function* () { + promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); }) }); @@ -70675,7 +76616,7 @@ var require_downloadUtils = __commonJS({ const progressFn = progress.onProgress(); const activeDownloads = []; let nextDownload; - const waitAndWrite = () => __awaiter4(this, void 0, void 0, function* () { + 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--; @@ -70699,9 +76640,8 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const retries = 5; let failures = 0; while (true) { @@ -70722,8 +76662,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { + 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}` }); @@ -70739,8 +76679,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { retryOptions: { // Override the timeout used when downloading each 4 MB chunk @@ -70784,8 +76724,7 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; const timeoutPromise = new Promise((resolve2) => { timeoutHandle = setTimeout(() => resolve2("timeout"), timeoutMs); @@ -70802,7 +76741,7 @@ var require_downloadUtils = __commonJS({ var require_options = __commonJS({ "node_modules/@actions/cache/lib/options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -70815,23 +76754,34 @@ var require_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core14 = __importStar4(require_core()); + exports2.getUploadOptions = getUploadOptions; + exports2.getDownloadOptions = getDownloadOptions; + var core14 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -70856,7 +76806,6 @@ var require_options = __commonJS({ core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } - exports2.getUploadOptions = getUploadOptions; function getDownloadOptions(copy) { const result = { useAzureSdk: false, @@ -70898,7 +76847,6 @@ var require_options = __commonJS({ core14.debug(`Lookup only: ${result.lookupOnly}`); return result; } - exports2.getDownloadOptions = getDownloadOptions; } }); @@ -70907,7 +76855,9 @@ var require_config = __commonJS({ "node_modules/@actions/cache/lib/internal/config.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; + exports2.isGhes = isGhes; + exports2.getCacheServiceVersion = getCacheServiceVersion; + exports2.getCacheServiceURL = getCacheServiceURL; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); @@ -70916,13 +76866,11 @@ var require_config = __commonJS({ const isLocalHost = hostname.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } - exports2.isGhes = isGhes; function getCacheServiceVersion() { if (isGhes()) return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } - exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { const version = getCacheServiceVersion(); switch (version) { @@ -70934,7 +76882,6 @@ var require_config = __commonJS({ throw new Error(`Unsupported cache service version: ${version}`); } } - exports2.getCacheServiceURL = getCacheServiceURL; } }); @@ -70943,7 +76890,7 @@ var require_package2 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", - version: "4.1.0", + version: "5.0.1", preview: true, description: "Actions cache lib", keywords: [ @@ -70980,22 +76927,26 @@ var require_package2 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", + "@azure/core-rest-pipeline": "^1.22.0", + "@azure/storage-blob": "^12.29.1", semver: "^6.3.1" }, devDependencies: { - "@types/node": "^22.13.9", + "@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" } }; } @@ -71006,12 +76957,11 @@ 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 = void 0; + exports2.getUserAgentString = getUserAgentString; var packageJson = require_package2(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } - exports2.getUserAgentString = getUserAgentString; } }); @@ -71019,7 +76969,7 @@ var require_user_agent = __commonJS({ var require_cacheHttpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -71032,21 +76982,31 @@ var require_cacheHttpClient = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -71074,13 +77034,16 @@ var require_cacheHttpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var auth_1 = require_auth2(); - var fs2 = __importStar4(require("fs")); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache4; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs2 = __importStar2(require("fs")); var url_1 = require("url"); - var utils = __importStar4(require_cacheUtils()); + var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); var downloadUtils_1 = require_downloadUtils(); var options_1 = require_options(); @@ -71113,11 +77076,11 @@ var require_cacheHttpClient = __commonJS({ return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); } function getCacheEntry(keys, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { @@ -71140,11 +77103,10 @@ var require_cacheHttpClient = __commonJS({ return cacheResult; }); } - exports2.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { @@ -71161,7 +77123,7 @@ Other caches with similar key:`); }); } function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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")) { @@ -71177,9 +77139,8 @@ Other caches with similar key:`); } }); } - exports2.downloadCache = downloadCache; function reserveCache(key, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -71187,24 +77148,23 @@ Other caches with similar key:`); version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); })); return response; }); } - exports2.reserveCache = reserveCache; function getContentRange(start, end) { return `bytes ${start}-${end}/*`; } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { core14.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})`, () => __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -71213,7 +77173,7 @@ Other caches with similar key:`); }); } function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); const fd = fs2.openSync(archivePath, "r"); @@ -71224,7 +77184,7 @@ Other caches with similar key:`); core14.debug("Awaiting all uploads"); let offset = 0; try { - yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -71235,8 +77195,8 @@ Other caches with similar key:`); start, end, autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); + }).on("error", (error3) => { + throw new Error(`Cache upload failed because file read failed with ${error3.message}`); }), start, end); } }))); @@ -71247,15 +77207,15 @@ Other caches with similar key:`); }); } function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); } function saveCache4(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { if (!signedUploadURL) { @@ -71277,7 +77237,6 @@ Other caches with similar key:`); } }); } - exports2.saveCache = saveCache4; } }); @@ -71449,7 +77408,7 @@ var require_binary_format_contract = __commonJS({ exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; var UnknownFieldHandler; (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = Symbol.for("protobuf-ts/unknown"); + 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 }); @@ -72374,7 +78333,7 @@ var require_message_type_contract = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); } }); @@ -72872,26 +78831,26 @@ var require_reflection_json_reader = __commonJS({ const fieldObj = target[localName]; for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { this.assert(jsonObjValue !== null, field.name + " map value", null); - let val2; + let val; switch (field.V.kind) { case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); + val = field.V.T().internalJsonRead(jsonObjValue, options); break; case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); break; } - this.assert(val2 !== void 0, field.name + " map value", jsonObjValue); + 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] = val2; + fieldObj[key] = val; } } else if (field.repeat) { if (jsonValue === null) @@ -72900,22 +78859,22 @@ var require_reflection_json_reader = __commonJS({ const fieldArr = target[localName]; for (const jsonItem of jsonValue) { this.assert(jsonItem !== null, field.name, null); - let val2; + let val; switch (field.kind) { case "message": - val2 = field.T().internalJsonRead(jsonItem, options); + val = field.T().internalJsonRead(jsonItem, options); break; case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); + val = this.scalar(jsonItem, field.T, field.L, field.name); break; } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); + this.assert(val !== void 0, field.name, jsonValue); + fieldArr.push(val); } } else { switch (field.kind) { @@ -72929,10 +78888,10 @@ var require_reflection_json_reader = __commonJS({ case "enum": if (jsonValue === null) continue; - let val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; - target[localName] = val2; + target[localName] = val; break; case "scalar": if (jsonValue === null) @@ -73082,8 +79041,8 @@ var require_reflection_json_reader = __commonJS({ break; return base64_1.base64decode(json2); } - } catch (error4) { - e = error4.message; + } catch (error3) { + e = error3.message; } this.assert(false, fieldName + (e ? " - " + e : ""), json2); } @@ -73137,26 +79096,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== void 0); + jsonObj[entryKey.toString()] = val; } break; } @@ -73168,26 +79127,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { - const val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== void 0); + jsonArr.push(val); } break; } @@ -73437,7 +79396,7 @@ var require_reflection_binary_reader = __commonJS({ let length = reader.uint32(); let end = reader.pos + length; let key = void 0; - let val2 = void 0; + let val = void 0; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -73450,13 +79409,13 @@ var require_reflection_binary_reader = __commonJS({ case 2: switch (field.V.kind) { case "scalar": - val2 = this.scalar(reader, field.V.T, field.V.L); + val = this.scalar(reader, field.V.T, field.V.L); break; case "enum": - val2 = reader.int32(); + val = reader.int32(); break; case "message": - val2 = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); break; } break; @@ -73468,19 +79427,19 @@ var require_reflection_binary_reader = __commonJS({ let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; } - if (val2 === void 0) + if (val === void 0) switch (field.V.kind) { case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); break; case "enum": - val2 = 0; + val = 0; break; case "message": - val2 = field.V.T().create(); + val = field.V.T().create(); break; } - return [key, val2]; + return [key, val]; } scalar(reader, type2, longType) { switch (type2) { @@ -73585,8 +79544,8 @@ var require_reflection_binary_writer = __commonJS({ break; case "map": assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); break; } } @@ -74156,18 +80115,18 @@ var require_enum_object = __commonJS({ } exports2.listEnumValues = listEnumValues; function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + return listEnumValues(enumObject).map((val) => val.name); } exports2.listEnumNames = listEnumNames; function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } exports2.listEnumNumbers = listEnumNumbers; } }); // node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ +var require_commonjs16 = __commonJS({ "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -74358,7 +80317,7 @@ var require_reflection_info2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function normalizeMethodInfo(method, service) { var _a, _b, _c; let m = method; @@ -74467,7 +80426,7 @@ var require_rpc_options = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function mergeRpcOptions(defaults, options) { if (!options) return defaults; @@ -74475,7 +80434,7 @@ var require_rpc_options = __commonJS({ copy(defaults, o); copy(options, o); for (let key of Object.keys(options)) { - let val2 = options[key]; + let val = options[key]; switch (key) { case "jsonOptions": o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); @@ -74489,7 +80448,7 @@ var require_rpc_options = __commonJS({ copy(options.meta, o.meta); break; case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); break; } } @@ -74581,9 +80540,9 @@ var require_deferred = __commonJS({ /** * Resolve the promise. Ignore if not pending. */ - resolvePending(val2) { + resolvePending(val) { if (this._state === DeferredState.PENDING) - this.resolve(val2); + this.resolve(val); } /** * Reject the promise. Ignore if not pending. @@ -74604,7 +80563,7 @@ var require_rpc_output_stream = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RpcOutputStreamController = void 0; var deferred_1 = require_deferred(); - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); var RpcOutputStreamController = class { constructor() { this._lis = { @@ -74654,12 +80613,12 @@ var require_rpc_output_stream = __commonJS({ * at a time. * Can be used to wrap a stream by using the other stream's `onNext`. */ - notifyNext(message, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); + 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 (error4) - this.notifyError(error4); + if (error3) + this.notifyError(error3); if (complete) this.notifyComplete(); } @@ -74679,12 +80638,12 @@ var require_rpc_output_stream = __commonJS({ * * Triggers onNext and onError callbacks. */ - notifyError(error4) { + notifyError(error3) { runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); + 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(); } /** @@ -74753,7 +80712,7 @@ var require_rpc_output_stream = __commonJS({ var require_unary_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/unary-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -74800,7 +80759,7 @@ var require_unary_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -74822,7 +80781,7 @@ var require_unary_call = __commonJS({ var require_server_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -74871,7 +80830,7 @@ var require_server_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -74892,7 +80851,7 @@ var require_server_streaming_call = __commonJS({ var require_client_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/client-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -74940,7 +80899,7 @@ var require_client_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -74961,7 +80920,7 @@ var require_client_streaming_call = __commonJS({ var require_duplex_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/duplex-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -75009,7 +80968,7 @@ var require_duplex_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -75029,7 +80988,7 @@ var require_duplex_streaming_call = __commonJS({ var require_test_transport = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/test-transport.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -75059,7 +81018,7 @@ var require_test_transport = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.TestTransport = void 0; var rpc_error_1 = require_rpc_error(); - var runtime_1 = require_commonjs11(); + 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(); @@ -75133,7 +81092,7 @@ var require_test_transport = __commonJS({ * not reject. If it does, code is broken. */ streamResponses(method, stream, abort) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const messages = []; if (this.data.response === void 0) { messages.push(method.O.create()); @@ -75148,8 +81107,8 @@ var require_test_transport = __commonJS({ } try { yield delay(this.responseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); + } catch (error3) { + stream.notifyError(error3); return; } if (this.data.response instanceof rpc_error_1.RpcError) { @@ -75160,8 +81119,8 @@ var require_test_transport = __commonJS({ stream.notifyMessage(msg); try { yield delay(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); + } catch (error3) { + stream.notifyError(error3); return; } } @@ -75303,7 +81262,7 @@ var require_rpc_interceptor = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.stackDuplexStreamingInterceptors = exports2.stackClientStreamingInterceptors = exports2.stackServerStreamingInterceptors = exports2.stackUnaryInterceptors = exports2.stackIntercept = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function stackIntercept(kind, transport, method, options, input) { var _a, _b, _c, _d; if (kind == "unary") { @@ -75427,7 +81386,7 @@ var require_server_call_context = __commonJS({ }); // node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs12 = __commonJS({ +var require_commonjs17 = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -75513,11 +81472,11 @@ var require_cachescope = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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", [ @@ -75589,11 +81548,11 @@ var require_cachemetadata = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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() { @@ -75655,17 +81614,17 @@ var require_cachemetadata = __commonJS({ }); // node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __commonJS({ +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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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() { @@ -76140,7 +82099,7 @@ var require_cache_twirp_client = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); + var cache_1 = require_cache3(); var CacheServiceClientJSON = class { constructor(rpc) { this.rpc = rpc; @@ -76208,11 +82167,12 @@ var require_cache_twirp_client = __commonJS({ }); // node_modules/@actions/cache/lib/internal/shared/util.js -var require_util10 = __commonJS({ +var require_util9 = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; var core_1 = require_core(); function maskSigUrl(url) { if (!url) @@ -76224,11 +82184,10 @@ var require_util10 = __commonJS({ (0, core_1.setSecret)(signature); (0, core_1.setSecret)(encodeURIComponent(signature)); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${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"); @@ -76241,7 +82200,6 @@ var require_util10 = __commonJS({ maskSigUrl(body.signed_download_url); } } - exports2.maskSecretUrls = maskSecretUrls; } }); @@ -76249,7 +82207,7 @@ var require_util10 = __commonJS({ var require_cacheTwirpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -76277,16 +82235,16 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; + 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_auth2(); - var http_client_1 = require_lib4(); + 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 util_1 = require_util9(); var CacheServiceClient = class { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -76310,24 +82268,24 @@ var require_cacheTwirpClient = __commonJS({ // This function satisfies the Rpc interface. It is compatible with the JSON // JSON generated client. request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; (0, core_1.debug)(`[Request] ${method} ${url}`); const headers = { "Content-Type": contentType }; try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { return this.httpClient.post(url, JSON.stringify(data), headers); })); return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); } }); } retryableRequest(operation) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let attempt = 0; let errorMessage = ""; let rawBody = ""; @@ -76353,18 +82311,18 @@ var require_cacheTwirpClient = __commonJS({ } errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { + } catch (error3) { + if (error3 instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); } - if (error4 instanceof errors_1.UsageError) { - throw error4; + if (error3 instanceof errors_1.UsageError) { + throw error3; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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 = error4.message; + errorMessage = error3.message; } if (!isRetryable) { throw new Error(`Received non-retryable error: ${errorMessage}`); @@ -76398,7 +82356,7 @@ var require_cacheTwirpClient = __commonJS({ return retryableStatusCodes.includes(statusCode); } sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } @@ -76418,7 +82376,6 @@ var require_cacheTwirpClient = __commonJS({ 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); } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; } }); @@ -76426,7 +82383,7 @@ var require_cacheTwirpClient = __commonJS({ var require_tar = __commonJS({ "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -76439,21 +82396,31 @@ var require_tar = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -76481,16 +82448,18 @@ var require_tar = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; + exports2.listTar = listTar; + exports2.extractTar = extractTar2; + exports2.createTar = createTar; var exec_1 = require_exec(); - var io6 = __importStar4(require_io3()); + var io6 = __importStar2(require_io()); var fs_1 = require("fs"); - var path2 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); + var path2 = __importStar2(require("path")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var IS_WINDOWS = process.platform === "win32"; function getTarPath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { switch (process.platform) { case "win32": { const gnuTar = yield utils.getGnuTarPathOnWindows(); @@ -76522,8 +82491,8 @@ var require_tar = __commonJS({ }; }); } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getTarArgs(tarPath_1, compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (tarPath, compressionMethod, type2, archivePath = "") { const args = [`"${tarPath.path}"`]; const cacheFileName = utils.getCacheFileName(compressionMethod); const tarFile = "cache.tar"; @@ -76553,8 +82522,8 @@ var require_tar = __commonJS({ return args; }); } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { let args; const tarPath = yield getTarPath(); const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); @@ -76576,7 +82545,7 @@ var require_tar = __commonJS({ return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); } function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + 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: @@ -76600,7 +82569,7 @@ var require_tar = __commonJS({ }); } function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -76625,51 +82594,48 @@ var require_tar = __commonJS({ }); } function execCommands(commands, cwd) { - return __awaiter4(this, void 0, void 0, function* () { + 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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + } 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commands = yield getCommands(compressionMethod, "list", archivePath); yield execCommands(commands); }); } - exports2.listTar = listTar; function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const workingDirectory = getWorkingDirectory(); yield io6.mkdirP(workingDirectory); const commands = yield getCommands(compressionMethod, "extract", archivePath); yield execCommands(commands); }); } - exports2.extractTar = extractTar2; function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { (0, fs_1.writeFileSync)(path2.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); } - exports2.createTar = createTar; } }); // node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ +var require_cache4 = __commonJS({ "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -76682,21 +82648,31 @@ var require_cache3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -76724,15 +82700,18 @@ var require_cache3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core14 = __importStar4(require_core()); - var path2 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; + var core14 = __importStar2(require_core()); + var path2 = __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_lib4(); + var http_client_1 = require_lib(); var ValidationError = class _ValidationError extends Error { constructor(message) { super(message); @@ -76781,9 +82760,8 @@ var require_cache3 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache4(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCache4(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)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -76796,9 +82774,8 @@ var require_cache3 = __commonJS({ } }); } - exports2.restoreCache = restoreCache4; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; core14.debug("Resolved Keys:"); @@ -76834,29 +82811,29 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core14.info("Cache restored successfully"); return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); + core14.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error4.message}`); + core14.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; @@ -76904,15 +82881,15 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core14.info("Cache restored successfully"); return response.matchedKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); + core14.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error4.message}`); + core14.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -76920,15 +82897,15 @@ var require_cache3 = __commonJS({ if (archivePath) { yield utils.unlinkFile(archivePath); } - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function saveCache4(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function saveCache4(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -76942,10 +82919,9 @@ var require_cache3 = __commonJS({ } }); } - exports2.saveCache = saveCache4; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { + function saveCacheV1(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + var _a, _b, _c, _d, _e; const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); @@ -76983,10 +82959,10 @@ var require_cache3 = __commonJS({ } core14.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else if (typedError.name === ReserveCacheError2.name) { core14.info(`Failed to save: ${typedError.message}`); } else { @@ -76999,15 +82975,15 @@ var require_cache3 = __commonJS({ } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } return cacheId; }); } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: true }); const compressionMethod = yield utils.getCompressionMethod(); const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); @@ -77045,8 +83021,8 @@ var require_cache3 = __commonJS({ throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core14.debug(`Failed to reserve cache: ${error4}`); + } catch (error3) { + core14.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } core14.debug(`Attempting to upload cache located at: ${archivePath}`); @@ -77065,10 +83041,10 @@ var require_cache3 = __commonJS({ throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`); } cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else if (typedError.name === ReserveCacheError2.name) { core14.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { @@ -77083,8 +83059,8 @@ var require_cache3 = __commonJS({ } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -77097,7 +83073,7 @@ var require_cache3 = __commonJS({ var require_config2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/config.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -77109,7 +83085,7 @@ var require_config2 = __commonJS({ exports2.getConcurrency = getConcurrency; exports2.getUploadChunkTimeout = getUploadChunkTimeout; exports2.getMaxArtifactListCount = getMaxArtifactListCount; - var os_1 = __importDefault4(require("os")); + var os_1 = __importDefault2(require("os")); var core_1 = require_core(); function getUploadChunkSize() { return 8 * 1024 * 1024; @@ -77193,13 +83169,13 @@ var require_timestamp = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Timestamp = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - var runtime_6 = require_commonjs11(); - var runtime_7 = require_commonjs11(); + 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", [ @@ -77342,13 +83318,13 @@ var require_wrappers = __commonJS({ "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_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - var runtime_6 = require_commonjs11(); - var runtime_7 = require_commonjs11(); + 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", [ @@ -77608,434 +83584,35 @@ var require_wrappers = __commonJS({ 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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(json2, options, target) { - if (!target) - target = this.create(); - target.value = this.refJsonReader.scalar(json2, 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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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", + { + no: 1, + name: "value", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 5, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, signedUploadUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: 0 }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -78043,13 +83620,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* int32 value */ 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); + message.value = reader.int32(); break; default: let u = options.readUnknownField; @@ -78057,54 +83630,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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.value !== 0) + writer.tag(1, runtime_3.WireType.Varint).int32(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.MigrateArtifactResponse = new MigrateArtifactResponse$Type(); - var FinalizeMigratedArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.Int32Value = new Int32Value$Type(); + var UInt32Value$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [ + super("google.protobuf.UInt32Value", [ { 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", + name: "value", kind: "scalar", - T: 3 - /*ScalarType.INT64*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 13, void 0, "value"); + return target; + } create(value) { - const message = { workflowRunBackendId: "", name: "", size: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: 0 }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -78112,17 +83684,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* uint32 value */ 1: - message.workflowRunBackendId = reader.string(); - break; - case /* string name */ - 2: - message.name = reader.string(); - break; - case /* int64 size */ - 3: - message.size = reader.int64().toString(); + message.value = reader.uint32(); break; default: let u = options.readUnknownField; @@ -78130,49 +83694,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== 0) + writer.tag(1, runtime_3.WireType.Varint).uint32(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type(); - var FinalizeMigratedArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.UInt32Value = new UInt32Value$Type(); + var BoolValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [ + super("google.protobuf.BoolValue", [ { no: 1, - name: "ok", + name: "value", kind: "scalar", T: 8 /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "artifact_id", - kind: "scalar", - T: 3 - /*ScalarType.INT64*/ } ]); } + /** + * Encode `BoolValue` to JSON bool. + */ + internalJsonWrite(message, options) { + return message.value; + } + /** + * Decode `BoolValue` from JSON bool. + */ + internalJsonRead(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 8, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, artifactId: "0" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: false }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -78180,13 +83748,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* bool value */ 1: - message.ok = reader.bool(); - break; - case /* int64 artifact_id */ - 2: - message.artifactId = reader.int64().toString(); + message.value = reader.bool(); break; default: let u = options.readUnknownField; @@ -78194,62 +83758,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== false) + writer.tag(1, runtime_3.WireType.Varint).bool(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type(); - var CreateArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.BoolValue = new BoolValue$Type(); + var StringValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.CreateArtifactRequest", [ + super("google.protobuf.StringValue", [ { 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", + name: "value", 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*/ } ]); } + /** + * Encode `StringValue` to JSON string. + */ + internalJsonWrite(message, options) { + return message.value; + } + /** + * Decode `StringValue` from JSON string. + */ + internalJsonRead(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 9, void 0, "value"); + return target; + } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", version: 0 }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: "" }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -78257,25 +83812,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* string value */ 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(); + message.value = reader.string(); break; default: let u = options.readUnknownField; @@ -78283,53 +83822,53 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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); + if (message.value !== "") + writer.tag(1, runtime_3.WireType.LengthDelimited).string(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.CreateArtifactRequest = new CreateArtifactRequest$Type(); - var CreateArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.StringValue = new StringValue$Type(); + var BytesValue$Type = class extends runtime_7.MessageType { constructor() { - super("github.actions.results.api.v1.CreateArtifactResponse", [ + super("google.protobuf.BytesValue", [ { no: 1, - name: "ok", - kind: "scalar", - T: 8 - /*ScalarType.BOOL*/ - }, - { - no: 2, - name: "signed_upload_url", + name: "value", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + 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(json2, options, target) { + if (!target) + target = this.create(); + target.value = this.refJsonReader.scalar(json2, 12, void 0, "value"); + return target; + } create(value) { - const message = { ok: false, signedUploadUrl: "" }; - globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this }); + const message = { value: new Uint8Array(0) }; + globalThis.Object.defineProperty(message, runtime_6.MESSAGE_TYPE, { enumerable: false, value: this }); if (value !== void 0) - (0, runtime_3.reflectionMergePartial)(this, message, value); + (0, runtime_5.reflectionMergePartial)(this, message, value); return message; } internalBinaryRead(reader, length, options, target) { @@ -78337,13 +83876,9 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* bool ok */ + case /* bytes value */ 1: - message.ok = reader.bool(); - break; - case /* string signed_upload_url */ - 2: - message.signedUploadUrl = reader.string(); + message.value = reader.bytes(); break; default: let u = options.readUnknownField; @@ -78351,26 +83886,42 @@ var require_artifact = __commonJS({ 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); + (u === true ? runtime_4.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.value.length) + writer.tag(1, runtime_3.WireType.LengthDelimited).bytes(message.value); let u = options.writeUnknownFields; if (u !== false) - (u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + (u == true ? runtime_4.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); return writer; } }; - exports2.CreateArtifactResponse = new CreateArtifactResponse$Type(); - var FinalizeArtifactRequest$Type = class extends runtime_5.MessageType { + 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.FinalizeArtifactRequest", [ + super("github.actions.results.api.v1.MigrateArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -78380,30 +83931,16 @@ var require_artifact = __commonJS({ }, { 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 } + { no: 3, name: "expires_at", kind: "message", T: () => timestamp_1.Timestamp } ]); } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "", name: "", size: "0" }; + 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); @@ -78418,21 +83955,13 @@ var require_artifact = __commonJS({ 1: message.workflowRunBackendId = reader.string(); break; - case /* string workflow_job_run_backend_id */ - 2: - message.workflowJobRunBackendId = reader.string(); - break; case /* string name */ - 3: + 2: 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); + 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; @@ -78448,24 +83977,20 @@ var require_artifact = __commonJS({ 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(); + 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.FinalizeArtifactRequest = new FinalizeArtifactRequest$Type(); - var FinalizeArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.MigrateArtifactRequest = new MigrateArtifactRequest$Type(); + var MigrateArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.FinalizeArtifactResponse", [ + super("github.actions.results.api.v1.MigrateArtifactResponse", [ { no: 1, name: "ok", @@ -78475,15 +84000,15 @@ var require_artifact = __commonJS({ }, { no: 2, - name: "artifact_id", + name: "signed_upload_url", kind: "scalar", - T: 3 - /*ScalarType.INT64*/ + T: 9 + /*ScalarType.STRING*/ } ]); } create(value) { - const message = { ok: false, artifactId: "0" }; + 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); @@ -78498,9 +84023,9 @@ var require_artifact = __commonJS({ 1: message.ok = reader.bool(); break; - case /* int64 artifact_id */ + case /* string signed_upload_url */ 2: - message.artifactId = reader.int64().toString(); + message.signedUploadUrl = reader.string(); break; default: let u = options.readUnknownField; @@ -78516,18 +84041,18 @@ var require_artifact = __commonJS({ 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); + 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.FinalizeArtifactResponse = new FinalizeArtifactResponse$Type(); - var ListArtifactsRequest$Type = class extends runtime_5.MessageType { + exports2.MigrateArtifactResponse = new MigrateArtifactResponse$Type(); + var FinalizeMigratedArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.ListArtifactsRequest", [ + super("github.actions.results.api.v1.FinalizeMigratedArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -78537,17 +84062,22 @@ var require_artifact = __commonJS({ }, { no: 2, - name: "workflow_job_run_backend_id", + name: "name", 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 } + { + no: 3, + name: "size", + kind: "scalar", + T: 3 + /*ScalarType.INT64*/ + } ]); } create(value) { - const message = { workflowRunBackendId: "", workflowJobRunBackendId: "" }; + 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); @@ -78562,17 +84092,13 @@ var require_artifact = __commonJS({ 1: message.workflowRunBackendId = reader.string(); break; - case /* string workflow_job_run_backend_id */ + case /* string name */ 2: - message.workflowJobRunBackendId = reader.string(); + message.name = reader.string(); break; - case /* google.protobuf.StringValue name_filter */ + case /* int64 size */ 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); + message.size = reader.int64().toString(); break; default: let u = options.readUnknownField; @@ -78588,106 +84114,38 @@ var require_artifact = __commonJS({ 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(); + 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.ListArtifactsResponse = new ListArtifactsResponse$Type(); - var ListArtifactsResponse_MonolithArtifact$Type = class extends runtime_5.MessageType { + exports2.FinalizeMigratedArtifactRequest = new FinalizeMigratedArtifactRequest$Type(); + var FinalizeMigratedArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.ListArtifactsResponse.MonolithArtifact", [ + super("github.actions.results.api.v1.FinalizeMigratedArtifactResponse", [ { 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", + name: "ok", kind: "scalar", - T: 9 - /*ScalarType.STRING*/ + T: 8 + /*ScalarType.BOOL*/ }, { - no: 5, - name: "size", + no: 2, + name: "artifact_id", 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" }; + 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); @@ -78698,33 +84156,13 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string workflow_run_backend_id */ + case /* bool ok */ 1: - message.workflowRunBackendId = reader.string(); + message.ok = reader.bool(); break; - case /* string workflow_job_run_backend_id */ + case /* int64 artifact_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); + message.artifactId = reader.int64().toString(); break; default: let u = options.readUnknownField; @@ -78738,30 +84176,20 @@ var require_artifact = __commonJS({ 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(); + 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.ListArtifactsResponse_MonolithArtifact = new ListArtifactsResponse_MonolithArtifact$Type(); - var GetSignedArtifactURLRequest$Type = class extends runtime_5.MessageType { + exports2.FinalizeMigratedArtifactResponse = new FinalizeMigratedArtifactResponse$Type(); + var CreateArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.GetSignedArtifactURLRequest", [ + super("github.actions.results.api.v1.CreateArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -78782,11 +84210,19 @@ var require_artifact = __commonJS({ 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: "" }; + 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); @@ -78809,6 +84245,14 @@ var require_artifact = __commonJS({ 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") @@ -78827,19 +84271,30 @@ var require_artifact = __commonJS({ 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.GetSignedArtifactURLRequest = new GetSignedArtifactURLRequest$Type(); - var GetSignedArtifactURLResponse$Type = class extends runtime_5.MessageType { + exports2.CreateArtifactRequest = new CreateArtifactRequest$Type(); + var CreateArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.GetSignedArtifactURLResponse", [ + super("github.actions.results.api.v1.CreateArtifactResponse", [ { no: 1, - name: "signed_url", + name: "ok", + kind: "scalar", + T: 8 + /*ScalarType.BOOL*/ + }, + { + no: 2, + name: "signed_upload_url", kind: "scalar", T: 9 /*ScalarType.STRING*/ @@ -78847,7 +84302,7 @@ var require_artifact = __commonJS({ ]); } create(value) { - const message = { signedUrl: "" }; + 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); @@ -78858,9 +84313,13 @@ var require_artifact = __commonJS({ while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { - case /* string signed_url */ + case /* bool ok */ 1: - message.signedUrl = reader.string(); + message.ok = reader.bool(); + break; + case /* string signed_upload_url */ + 2: + message.signedUploadUrl = reader.string(); break; default: let u = options.readUnknownField; @@ -78874,18 +84333,20 @@ var require_artifact = __commonJS({ return message; } internalBinaryWrite(message, writer, options) { - if (message.signedUrl !== "") - writer.tag(1, runtime_1.WireType.LengthDelimited).string(message.signedUrl); + 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.GetSignedArtifactURLResponse = new GetSignedArtifactURLResponse$Type(); - var DeleteArtifactRequest$Type = class extends runtime_5.MessageType { + exports2.CreateArtifactResponse = new CreateArtifactResponse$Type(); + var FinalizeArtifactRequest$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.DeleteArtifactRequest", [ + super("github.actions.results.api.v1.FinalizeArtifactRequest", [ { no: 1, name: "workflow_run_backend_id", @@ -78906,11 +84367,19 @@ var require_artifact = __commonJS({ 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: "" }; + 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); @@ -78933,6 +84402,14 @@ var require_artifact = __commonJS({ 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") @@ -78951,16 +84428,20 @@ var require_artifact = __commonJS({ 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.DeleteArtifactRequest = new DeleteArtifactRequest$Type(); - var DeleteArtifactResponse$Type = class extends runtime_5.MessageType { + exports2.FinalizeArtifactRequest = new FinalizeArtifactRequest$Type(); + var FinalizeArtifactResponse$Type = class extends runtime_5.MessageType { constructor() { - super("github.actions.results.api.v1.DeleteArtifactResponse", [ + super("github.actions.results.api.v1.FinalizeArtifactResponse", [ { no: 1, name: "ok", @@ -78969,1133 +84450,823 @@ var require_artifact = __commonJS({ /*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(request) { - const data = artifact_1.CreateArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.FinalizeArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.ListArtifactsRequest.toJson(request, { - 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(request) { - const data = artifact_1.GetSignedArtifactURLRequest.toJson(request, { - 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(request) { - const data = artifact_1.DeleteArtifactRequest.toJson(request, { - 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(request) { - const data = artifact_1.CreateArtifactRequest.toBinary(request); - 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(request) { - const data = artifact_1.FinalizeArtifactRequest.toBinary(request); - 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(request) { - const data = artifact_1.ListArtifactsRequest.toBinary(request); - 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(request) { - const data = artifact_1.GetSignedArtifactURLRequest.toBinary(request); - 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(request) { - const data = artifact_1.DeleteArtifactRequest.toBinary(request); - 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 __createBinding4 = 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 __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - __exportStar4(require_timestamp(), exports2); - __exportStar4(require_wrappers(), exports2); - __exportStar4(require_artifact(), exports2); - __exportStar4(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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getExpiration = getExpiration; - var generated_1 = require_generated(); - var core14 = __importStar4(require_core()); - function getExpiration(retentionDays) { - if (!retentionDays) { - return void 0; - } - const maxRetentionDays = getRetentionDays(); - if (maxRetentionDays && maxRetentionDays < retentionDays) { - core14.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); - } - 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.validateArtifactName = validateArtifactName; - exports2.validateFilePath = validateFilePath; - 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!`); - } - function validateFilePath(path2) { - if (!path2) { - throw new Error(`Provided file path input during validation is empty`); - } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path2.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path2}. 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. - `); - } - } - } - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/artifact/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 (_a) { - 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; + no: 2, + name: "artifact_id", + kind: "scalar", + T: 3 + /*ScalarType.INT64*/ + } + ]); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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; } - 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; + 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; } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + 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; } - get username() { - return this._decodedUsername; + }; + 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 } + ]); } - get password() { - return this._decodedPassword; + 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; } - }; - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + 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; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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 } + ]); } - return new (P || (P = Promise))(function(resolve2, 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); + 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); } } - function step(result) { - result.done ? resolve2(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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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); + 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.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + 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 } + ]); } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); + 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; } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); + 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.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + 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*/ } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + ]); + } + 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; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + 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; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + 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*/ + } + ]); } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + 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; } - /** - * 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 __awaiter4(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); - }); + 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; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + }; + 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*/ + } + ]); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + 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); } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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; + return message; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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; } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info7.httpModule.request(info7.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(); + }; + 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*/ } - handleResult(new Error(`Request timeout: ${info7.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); + 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; } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); + 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 info7; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + return message; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + 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; } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + }; + 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); } - _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")}` + CreateArtifact(request) { + const data = artifact_1.CreateArtifactRequest.toJson(request, { + 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 })); - this._proxyAgentDispatcher = proxyAgent; - if (usingSsl && this._ignoreSslError) { - proxyAgent.options = Object.assign(proxyAgent.options.requestTls || {}, { - rejectUnauthorized: false - }); - } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); + FinalizeArtifact(request) { + const data = artifact_1.FinalizeArtifactRequest.toJson(request, { + 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 + })); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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 { - resolve2(response); - } - })); + ListArtifacts(request) { + const data = artifact_1.ListArtifactsRequest.toJson(request, { + 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(request) { + const data = artifact_1.GetSignedArtifactURLRequest.toJson(request, { + 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(request) { + const data = artifact_1.DeleteArtifactRequest.toJson(request, { + 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.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + 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(request) { + const data = artifact_1.CreateArtifactRequest.toBinary(request); + 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(request) { + const data = artifact_1.FinalizeArtifactRequest.toBinary(request); + 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(request) { + const data = artifact_1.ListArtifactsRequest.toBinary(request); + 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(request) { + const data = artifact_1.GetSignedArtifactURLRequest.toBinary(request); + 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(request) { + const data = artifact_1.DeleteArtifactRequest.toBinary(request); + 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/node_modules/@actions/http-client/lib/auth.js -var require_auth3 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// node_modules/@actions/artifact/lib/generated/index.js +var require_generated = __commonJS({ + "node_modules/@actions/artifact/lib/generated/index.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }); - exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; + __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]; + } }; } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + 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]); } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + __setModuleDefault2(result, mod); + return result; + }; + })(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getExpiration = getExpiration; + var generated_1 = require_generated(); + var core14 = __importStar2(require_core()); + function getExpiration(retentionDays) { + if (!retentionDays) { + return void 0; } - // 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}`; + const maxRetentionDays = getRetentionDays(); + if (maxRetentionDays && maxRetentionDays < retentionDays) { + core14.warning(`Retention days cannot be greater than the maximum allowed retention set within the repository. Using ${maxRetentionDays} instead.`); + retentionDays = maxRetentionDays; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + const expirationDate = /* @__PURE__ */ new Date(); + expirationDate.setDate(expirationDate.getDate() + retentionDays); + return generated_1.Timestamp.fromDate(expirationDate); + } + function getRetentionDays() { + const retentionDays = process.env["GITHUB_RETENTION_DAYS"]; + if (!retentionDays) { + return void 0; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + const days = parseInt(retentionDays); + if (isNaN(days)) { + return void 0; } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + 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.validateArtifactName = validateArtifactName; + exports2.validateFilePath = validateFilePath; + 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`); } - // 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"); + 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.`); } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + (0, core_1.info)(`Artifact name is valid!`); + } + function validateFilePath(path2) { + if (!path2) { + throw new Error(`Provided file path input during validation is empty`); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { + if (path2.includes(invalidCharacterKey)) { + throw new Error(`The path for one of the files in artifact is not valid: ${path2}. 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.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + } } }); @@ -80104,7 +85275,7 @@ var require_package3 = __commonJS({ "node_modules/@actions/artifact/package.json"(exports2, module2) { module2.exports = { name: "@actions/artifact", - version: "4.0.0", + version: "5.0.1", preview: true, description: "Actions artifact lib", keywords: [ @@ -80144,11 +85315,10 @@ var require_package3 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.10.0", + "@actions/core": "^2.0.0", "@actions/github": "^6.0.1", - "@actions/http-client": "^2.1.0", - "@azure/core-http": "^3.0.5", - "@azure/storage-blob": "^12.15.0", + "@actions/http-client": "^3.0.0", + "@azure/storage-blob": "^12.29.1", "@octokit/core": "^5.2.1", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-retry": "^3.0.9", @@ -80322,10 +85492,10 @@ var require_jwt_decode_cjs = __commonJS({ }); // node_modules/@actions/artifact/lib/internal/shared/util.js -var require_util11 = __commonJS({ +var require_util10 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80338,40 +85508,40 @@ var require_util11 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getBackendIdsFromToken = getBackendIdsFromToken; exports2.maskSigUrl = maskSigUrl; exports2.maskSecretUrls = maskSecretUrls; - var core14 = __importStar4(require_core()); + var core14 = __importStar2(require_core()); var config_1 = require_config2(); - var jwt_decode_1 = __importDefault4(require_jwt_decode_cjs()); + 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() { @@ -80412,8 +85582,8 @@ var require_util11 = __commonJS({ (0, core_1.setSecret)(signature); (0, core_1.setSecret)(encodeURIComponent(signature)); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${error3 instanceof Error ? error3.message : String(error3)}`); } } function maskSecretUrls(body) { @@ -80435,7 +85605,7 @@ var require_util11 = __commonJS({ var require_artifact_twirp_client2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/artifact-twirp-client.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -80464,14 +85634,14 @@ var require_artifact_twirp_client2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.internalArtifactTwirpClient = internalArtifactTwirpClient; - var http_client_1 = require_lib5(); - var auth_1 = require_auth3(); + 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 util_1 = require_util10(); var ArtifactHttpClient = class { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -80495,24 +85665,24 @@ var require_artifact_twirp_client2 = __commonJS({ // This function satisfies the Rpc interface. It is compatible with the JSON // JSON generated client. request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; (0, core_1.debug)(`[Request] ${method} ${url}`); const headers = { "Content-Type": contentType }; try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { return this.httpClient.post(url, JSON.stringify(data), headers); })); return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); } }); } retryableRequest(operation) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let attempt = 0; let errorMessage = ""; let rawBody = ""; @@ -80538,18 +85708,18 @@ var require_artifact_twirp_client2 = __commonJS({ } errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { + } catch (error3) { + if (error3 instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); } - if (error4 instanceof errors_1.UsageError) { - throw error4; + if (error3 instanceof errors_1.UsageError) { + throw error3; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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 = error4.message; + errorMessage = error3.message; } if (!isRetryable) { throw new Error(`Received non-retryable error: ${errorMessage}`); @@ -80583,7 +85753,7 @@ var require_artifact_twirp_client2 = __commonJS({ return retryableStatusCodes.includes(statusCode); } sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } @@ -80610,7 +85780,7 @@ var require_artifact_twirp_client2 = __commonJS({ var require_upload_zip_specification = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/upload-zip-specification.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80623,34 +85793,34 @@ var require_upload_zip_specification = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateRootDirectory = validateRootDirectory; exports2.getUploadZipSpecification = getUploadZipSpecification; - var fs2 = __importStar4(require("fs")); + var fs2 = __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(); @@ -80704,7 +85874,7 @@ var require_upload_zip_specification = __commonJS({ var require_blob_upload = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/blob-upload.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -80717,31 +85887,31 @@ var require_blob_upload = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -80770,18 +85940,18 @@ var require_blob_upload = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadZipToBlobStorage = uploadZipToBlobStorage; - var storage_blob_1 = require_dist7(); + var storage_blob_1 = require_commonjs15(); var config_1 = require_config2(); - var core14 = __importStar4(require_core()); - var crypto = __importStar4(require("crypto")); - var stream = __importStar4(require("stream")); + var core14 = __importStar2(require_core()); + var crypto2 = __importStar2(require("crypto")); + var stream = __importStar2(require("stream")); var errors_1 = require_errors3(); function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let uploadByteCount = 0; let lastProgressTime = Date.now(); const abortController = new AbortController(); - const chunkTimer = (interval) => __awaiter4(this, void 0, void 0, function* () { + const chunkTimer = (interval) => __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { const timer = setInterval(() => { if (Date.now() - lastProgressTime > interval) { @@ -80811,7 +85981,7 @@ var require_blob_upload = __commonJS({ }; let sha256Hash = void 0; const uploadStream = new stream.PassThrough(); - const hashStream = crypto.createHash("sha256"); + const hashStream = crypto2.createHash("sha256"); zipUploadStream.pipe(uploadStream); zipUploadStream.pipe(hashStream).setEncoding("hex"); core14.info("Beginning upload of artifact content to blob storage"); @@ -80820,11 +85990,11 @@ var require_blob_upload = __commonJS({ blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options), chunkTimer((0, config_1.getUploadChunkTimeout)()) ]); - } catch (error4) { - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + } 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 error4; + throw error3; } finally { abortController.abort(); } @@ -80908,7 +86078,7 @@ var require_brace_expansion2 = __commonJS({ function lte(i, y) { return i <= y; } - function gte5(i, y) { + function gte6(i, y) { return i >= y; } function expand(str2, isTop) { @@ -80958,7 +86128,7 @@ var require_brace_expansion2 = __commonJS({ var reverse = y < x; if (reverse) { incr *= -1; - test = gte5; + test = gte6; } var pad = n.some(isPadded); N = []; @@ -81015,7 +86185,7 @@ var require_minimatch2 = __commonJS({ module2.exports = minimatch; var path2 = require_path(); minimatch.sep = path2.sep; - var GLOBSTAR = Symbol("globstar **"); + var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; var expand = require_brace_expansion2(); var plTypes = { @@ -81079,7 +86249,7 @@ var require_minimatch2 = __commonJS({ throw new TypeError("pattern is too long"); } }; - var SUBPARSE = Symbol("subparse"); + var SUBPARSE = /* @__PURE__ */ Symbol("subparse"); minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe(); minimatch.match = (list, pattern, options = {}) => { const mm = new Minimatch(pattern, options); @@ -81845,9 +87015,9 @@ var require_async = __commonJS({ invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); }); } - function invokeCallback(callback, error4, value) { + function invokeCallback(callback, error3, value) { try { - callback(error4, value); + callback(error3, value); } catch (err) { setImmediate$1((e) => { throw e; @@ -82121,7 +87291,7 @@ var require_async = __commonJS({ } var mapSeries$1 = awaitify(mapSeries, 3); var applyEachSeries = applyEach$1(mapSeries$1); - const PROMISE_SYMBOL = Symbol("promiseCallback"); + const PROMISE_SYMBOL = /* @__PURE__ */ Symbol("promiseCallback"); function promiseCallback() { let resolve2, reject2; function callback(err, ...args) { @@ -82701,8 +87871,8 @@ var require_async = __commonJS({ var mapLimit$1 = awaitify(mapLimit, 4); function concatLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val2, iterCb) => { - _iteratee(val2, (err, ...args) => { + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { if (err) return iterCb(err); return iterCb(err, args); }); @@ -82908,10 +88078,10 @@ var require_async = __commonJS({ var forever$1 = awaitify(forever, 2); function groupByLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val2, iterCb) => { - _iteratee(val2, (err, key) => { + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { if (err) return iterCb(err); - return iterCb(err, { key, val: val2 }); + return iterCb(err, { key, val }); }); }, (err, mapResults) => { var result = {}; @@ -82919,11 +88089,11 @@ var require_async = __commonJS({ for (var i = 0; i < mapResults.length; i++) { if (mapResults[i]) { var { key } = mapResults[i]; - var { val: val2 } = mapResults[i]; + var { val } = mapResults[i]; if (hasOwnProperty.call(result, key)) { - result[key].push(val2); + result[key].push(val); } else { - result[key] = [val2]; + result[key] = [val]; } } } @@ -82942,8 +88112,8 @@ var require_async = __commonJS({ callback = once(callback); var newObj = {}; var _iteratee = wrapAsync(iteratee); - return eachOfLimit$2(limit)(obj, (val2, key, next) => { - _iteratee(val2, key, (err, result) => { + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { if (err) return next(err); newObj[key] = result; next(err); @@ -83153,10 +88323,10 @@ var require_async = __commonJS({ function reflect(fn) { var _fn = wrapAsync(fn); return initialParams(function reflectOn(args, reflectCallback) { - args.push((error4, ...cbArgs) => { + args.push((error3, ...cbArgs) => { let retVal = {}; - if (error4) { - retVal.error = error4; + if (error3) { + retVal.error = error3; } if (cbArgs.length > 0) { var value = cbArgs; @@ -83312,13 +88482,13 @@ var require_async = __commonJS({ var timer; function timeoutCallback() { var name = asyncFn.name || "anonymous"; - var error4 = new Error('Callback function "' + name + '" timed out.'); - error4.code = "ETIMEDOUT"; + var error3 = new Error('Callback function "' + name + '" timed out.'); + error3.code = "ETIMEDOUT"; if (info7) { - error4.info = info7; + error3.info = info7; } timedOut = true; - callback(error4); + callback(error3); } args.push((...cbArgs) => { if (!timedOut) { @@ -83361,7 +88531,7 @@ var require_async = __commonJS({ return callback[PROMISE_SYMBOL]; } function tryEach(tasks, callback) { - var error4 = null; + var error3 = null; var result; return eachSeries$1(tasks, (task, taskCb) => { wrapAsync(task)((err, ...args) => { @@ -83371,10 +88541,10 @@ var require_async = __commonJS({ } else { result = args; } - error4 = err; + error3 = err; taskCb(err ? null : {}); }); - }, () => callback(error4, result)); + }, () => callback(error3, result)); } var tryEach$1 = awaitify(tryEach); function unmemoize(fn) { @@ -84058,8 +89228,8 @@ var require_graceful_fs = __commonJS({ var gracefulQueue; var previousSymbol; if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = Symbol.for("graceful-fs.queue"); - previousSymbol = Symbol.for("graceful-fs.previous"); + gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"); + previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous"); } else { gracefulQueue = "___graceful-fs.queue"; previousSymbol = "___graceful-fs.previous"; @@ -84263,8 +89433,8 @@ var require_graceful_fs = __commonJS({ get: function() { return ReadStream; }, - set: function(val2) { - ReadStream = val2; + set: function(val) { + ReadStream = val; }, enumerable: true, configurable: true @@ -84273,8 +89443,8 @@ var require_graceful_fs = __commonJS({ get: function() { return WriteStream; }, - set: function(val2) { - WriteStream = val2; + set: function(val) { + WriteStream = val; }, enumerable: true, configurable: true @@ -84284,8 +89454,8 @@ var require_graceful_fs = __commonJS({ get: function() { return FileReadStream; }, - set: function(val2) { - FileReadStream = val2; + set: function(val) { + FileReadStream = val; }, enumerable: true, configurable: true @@ -84295,8 +89465,8 @@ var require_graceful_fs = __commonJS({ get: function() { return FileWriteStream; }, - set: function(val2) { - FileWriteStream = val2; + set: function(val) { + FileWriteStream = val; }, enumerable: true, configurable: true @@ -84550,7 +89720,7 @@ var require_safe_buffer = __commonJS({ }); // node_modules/core-util-is/lib/util.js -var require_util12 = __commonJS({ +var require_util11 = __commonJS({ "node_modules/core-util-is/lib/util.js"(exports2) { function isArray(arg) { if (Array.isArray) { @@ -84832,7 +90002,7 @@ var require_stream_writable = __commonJS({ var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; var Duplex; Writable.WritableState = WritableState; - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var internalUtil = { deprecate: require_node2() @@ -85268,7 +90438,7 @@ var require_stream_duplex = __commonJS({ return keys2; }; module2.exports = Duplex; - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var Readable = require_stream_readable(); var Writable = require_stream_writable(); @@ -85593,7 +90763,7 @@ var require_stream_readable = __commonJS({ function _isUint8Array(obj) { return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; } - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); var debugUtil = require("util"); var debug4 = void 0; @@ -86262,7 +91432,7 @@ var require_stream_transform = __commonJS({ "use strict"; module2.exports = Transform; var Duplex = require_stream_duplex(); - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); util.inherits(Transform, Duplex); function afterTransform(er, data) { @@ -86362,7 +91532,7 @@ var require_stream_passthrough = __commonJS({ "use strict"; module2.exports = PassThrough; var Transform = require_stream_transform(); - var util = Object.create(require_util12()); + var util = Object.create(require_util11()); util.inherits = require_inherits(); util.inherits(PassThrough, Transform); function PassThrough(options) { @@ -87280,8 +92450,8 @@ var require_primordials = __commonJS({ PromiseReject(err) { return Promise.reject(err); }, - PromiseResolve(val2) { - return Promise.resolve(val2); + PromiseResolve(val) { + return Promise.resolve(val); }, ReflectApply: Reflect.apply, RegExpPrototypeTest(self2, value) { @@ -87306,8 +92476,8 @@ var require_primordials = __commonJS({ SymbolAsyncIterator: Symbol.asyncIterator, SymbolHasInstance: Symbol.hasInstance, SymbolIterator: Symbol.iterator, - SymbolDispose: Symbol.dispose || Symbol("Symbol.dispose"), - SymbolAsyncDispose: Symbol.asyncDispose || Symbol("Symbol.asyncDispose"), + SymbolDispose: Symbol.dispose || /* @__PURE__ */ Symbol("Symbol.dispose"), + SymbolAsyncDispose: Symbol.asyncDispose || /* @__PURE__ */ Symbol("Symbol.asyncDispose"), TypedArrayPrototypeSet(self2, buf, len) { return self2.set(buf, len); }, @@ -87986,7 +93156,7 @@ var require_abort_controller = __commonJS({ }); // node_modules/readable-stream/lib/ours/util.js -var require_util13 = __commonJS({ +var require_util12 = __commonJS({ "node_modules/readable-stream/lib/ours/util.js"(exports2, module2) { "use strict"; var bufferModule = require("buffer"); @@ -88169,7 +93339,7 @@ var require_util13 = __commonJS({ return ac.signal; } }; - module2.exports.promisify.custom = Symbol.for("nodejs.util.promisify.custom"); + module2.exports.promisify.custom = /* @__PURE__ */ Symbol.for("nodejs.util.promisify.custom"); } }); @@ -88177,9 +93347,9 @@ var require_util13 = __commonJS({ var require_errors4 = __commonJS({ "node_modules/readable-stream/lib/ours/errors.js"(exports2, module2) { "use strict"; - var { format, inspect, AggregateError: CustomAggregateError } = require_util13(); + var { format, inspect, AggregateError: CustomAggregateError } = require_util12(); var AggregateError = globalThis.AggregateError || CustomAggregateError; - var kIsNodeError = Symbol("kIsNodeError"); + var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); var kTypes = [ "string", "function", @@ -88200,14 +93370,14 @@ var require_errors4 = __commonJS({ throw new codes.ERR_INTERNAL_ASSERTION(message); } } - function addNumericalSeparator(val2) { + function addNumericalSeparator(val) { let res = ""; - let i = val2.length; - const start = val2[0] === "-" ? 1 : 0; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; for (; i >= start + 4; i -= 3) { - res = `_${val2.slice(i - 3, i)}${res}`; + res = `_${val.slice(i - 3, i)}${res}`; } - return `${val2.slice(0, i)}${res}`; + return `${val.slice(0, i)}${res}`; } function getMessage(key, msg, args) { if (typeof msg === "function") { @@ -88513,8 +93683,8 @@ var require_validators = __commonJS({ hideStackFrames, codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL } } = require_errors4(); - var { normalizeEncoding } = require_util13(); - var { isAsyncFunction, isArrayBufferView } = require_util13().types; + var { normalizeEncoding } = require_util12(); + var { isAsyncFunction, isArrayBufferView } = require_util12().types; var signals = {}; function isInt32(value) { return value === (value | 0); @@ -88761,7 +93931,7 @@ var require_process = __commonJS({ }); // node_modules/readable-stream/lib/internal/streams/utils.js -var require_utils6 = __commonJS({ +var require_utils8 = __commonJS({ "node_modules/readable-stream/lib/internal/streams/utils.js"(exports2, module2) { "use strict"; var { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require_primordials(); @@ -88975,7 +94145,7 @@ var require_end_of_stream = __commonJS({ var process2 = require_process(); var { AbortError, codes } = require_errors4(); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes; - var { kEmptyObject, once } = require_util13(); + var { kEmptyObject, once } = require_util12(); var { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require_validators(); var { Promise: Promise2, PromisePrototypeThen, SymbolDispose } = require_primordials(); var { @@ -88993,7 +94163,7 @@ var require_end_of_stream = __commonJS({ isNodeStream, willEmitClose: _willEmitClose, kIsClosedPromise - } = require_utils6(); + } = require_utils8(); var addAbortListener; function isRequest(stream) { return stream.setHeader && typeof stream.abort === "function"; @@ -89148,7 +94318,7 @@ var require_end_of_stream = __commonJS({ if (options.signal.aborted) { process2.nextTick(abort); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(options.signal, abort); const originalCallback = callback; callback = once((...args) => { @@ -89175,7 +94345,7 @@ var require_end_of_stream = __commonJS({ if (options.signal.aborted) { process2.nextTick(abort); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(options.signal, abort); const originalCallback = callback; callback = once((...args) => { @@ -89231,7 +94401,7 @@ var require_destroy2 = __commonJS({ AbortError } = require_errors4(); var { Symbol: Symbol2 } = require_primordials(); - var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils6(); + var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils8(); var kDestroy = Symbol2("kDestroy"); var kConstruct = Symbol2("kConstruct"); function checkError(err, w, r) { @@ -89569,7 +94739,7 @@ var require_add_abort_signal = __commonJS({ "use strict"; var { SymbolDispose } = require_primordials(); var { AbortError, codes } = require_errors4(); - var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils6(); + var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils8(); var eos = require_end_of_stream(); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes; var addAbortListener; @@ -89605,7 +94775,7 @@ var require_add_abort_signal = __commonJS({ if (signal.aborted) { onAbort(); } else { - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; const disposable = addAbortListener(signal, onAbort); eos(stream, disposable[SymbolDispose]); } @@ -89620,7 +94790,7 @@ var require_buffer_list = __commonJS({ "use strict"; var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials(); var { Buffer: Buffer2 } = require("buffer"); - var { inspect } = require_util13(); + var { inspect } = require_util12(); module2.exports = class BufferList { constructor() { this.head = null; @@ -89756,7 +94926,7 @@ var require_buffer_list = __commonJS({ return ret; } // Make sure the linked list only shows the minimal necessary information. - [Symbol.for("nodejs.util.inspect.custom")](_2, options) { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_2, options) { return inspect(this, { ...options, // Only inspect one level. @@ -89854,19 +95024,19 @@ var require_from = __commonJS({ next(); } }; - readable._destroy = function(error4, cb) { + readable._destroy = function(error3, cb) { PromisePrototypeThen( - close(error4), - () => process2.nextTick(cb, error4), + close(error3), + () => process2.nextTick(cb, error3), // nextTick is here in case cb throws - (e) => process2.nextTick(cb, e || error4) + (e) => process2.nextTick(cb, e || error3) ); }; - async function close(error4) { - const hadError = error4 !== void 0 && error4 !== null; + async function close(error3) { + const hadError = error3 !== void 0 && error3 !== null; const hasThrow = typeof iterator.throw === "function"; if (hadError && hasThrow) { - const { value, done } = await iterator.throw(error4); + const { value, done } = await iterator.throw(error3); await value; if (done) { return; @@ -89931,7 +95101,7 @@ var require_readable3 = __commonJS({ var { Buffer: Buffer2 } = require("buffer"); var { addAbortSignal } = require_add_abort_signal(); var eos = require_end_of_stream(); - var debug4 = require_util13().debuglog("stream", (fn) => { + var debug4 = require_util12().debuglog("stream", (fn) => { debug4 = fn; }); var BufferList = require_buffer_list(); @@ -90074,12 +95244,12 @@ var require_readable3 = __commonJS({ this.destroy(err); }; Readable.prototype[SymbolAsyncDispose] = function() { - let error4; + let error3; if (!this.destroyed) { - error4 = this.readableEnded ? null : new AbortError(); - this.destroy(error4); + error3 = this.readableEnded ? null : new AbortError(); + this.destroy(error3); } - return new Promise2((resolve2, reject) => eos(this, (err) => err && err !== error4 ? reject(err) : resolve2(null))); + return new Promise2((resolve2, reject) => eos(this, (err) => err && err !== error3 ? reject(err) : resolve2(null))); }; Readable.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); @@ -90632,14 +95802,14 @@ var require_readable3 = __commonJS({ } } stream.on("readable", next); - let error4; + let error3; const cleanup = eos( stream, { writable: false }, (err) => { - error4 = err ? aggregateTwoErrors(error4, err) : null; + error3 = err ? aggregateTwoErrors(error3, err) : null; callback(); callback = nop; } @@ -90649,19 +95819,19 @@ var require_readable3 = __commonJS({ const chunk = stream.destroyed ? null : stream.read(); if (chunk !== null) { yield chunk; - } else if (error4) { - throw error4; - } else if (error4 === null) { + } else if (error3) { + throw error3; + } else if (error3 === null) { return; } else { await new Promise2(next); } } } catch (err) { - error4 = aggregateTwoErrors(error4, err); - throw error4; + error3 = aggregateTwoErrors(error3, err); + throw error3; } finally { - if ((error4 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error4 === void 0 || stream._readableState.autoDestroy)) { + if ((error3 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error3 === void 0 || stream._readableState.autoDestroy)) { destroyImpl.destroyer(stream, null); } else { stream.off("readable", next); @@ -90676,9 +95846,9 @@ var require_readable3 = __commonJS({ const r = this._readableState; return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted; }, - set(val2) { + set(val) { if (this._readableState) { - this._readableState.readable = !!val2; + this._readableState.readable = !!val; } } }, @@ -91390,9 +96560,9 @@ var require_writable = __commonJS({ const w = this._writableState; return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; }, - set(val2) { + set(val) { if (this._writableState) { - this._writableState.writable = !!val2; + this._writableState.writable = !!val; } } }, @@ -91506,7 +96676,7 @@ var require_duplexify = __commonJS({ isDuplexNodeStream, isReadableStream, isWritableStream - } = require_utils6(); + } = require_utils8(); var eos = require_end_of_stream(); var { AbortError, @@ -91516,7 +96686,7 @@ var require_duplexify = __commonJS({ var Duplex = require_duplex(); var Readable = require_readable3(); var Writable = require_writable(); - var { createDeferredPromise } = require_util13(); + var { createDeferredPromise } = require_util12(); var from = require_from(); var Blob2 = globalThis.Blob || bufferModule.Blob; var isBlob = typeof Blob2 !== "undefined" ? function isBlob2(b) { @@ -91589,9 +96759,9 @@ var require_duplexify = __commonJS({ const promise = FunctionPrototypeCall( then2, value, - (val2) => { - if (val2 != null) { - throw new ERR_INVALID_RETURN_VALUE("nully", "body", val2); + (val) => { + if (val != null) { + throw new ERR_INVALID_RETURN_VALUE("nully", "body", val); } }, (err) => { @@ -91645,9 +96815,9 @@ var require_duplexify = __commonJS({ FunctionPrototypeCall( then, body, - (val2) => { - if (val2 != null) { - d.push(val2); + (val) => { + if (val != null) { + d.push(val); } d.push(null); }, @@ -92030,13 +97200,13 @@ var require_transform = __commonJS({ const rState = this._readableState; const wState = this._writableState; const length = rState.length; - this._transform(chunk, encoding, (err, val2) => { + this._transform(chunk, encoding, (err, val) => { if (err) { callback(err); return; } - if (val2 != null) { - this.push(val2); + if (val != null) { + this.push(val); } if (wState.ended || // Backwards compat. length === rState.length || // Backwards compat. @@ -92077,12 +97247,12 @@ var require_passthrough2 = __commonJS({ }); // node_modules/readable-stream/lib/internal/streams/pipeline.js -var require_pipeline3 = __commonJS({ +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 { once } = require_util12(); var destroyImpl = require_destroy2(); var Duplex = require_duplex(); var { @@ -92106,7 +97276,7 @@ var require_pipeline3 = __commonJS({ isWebStream, isReadableStream, isReadableFinished - } = require_utils6(); + } = require_utils8(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough; var Readable; @@ -92139,26 +97309,26 @@ var require_pipeline3 = __commonJS({ validateFunction(streams[streams.length - 1], "streams[stream.length - 1]"); return streams.pop(); } - function makeAsyncIterable(val2) { - if (isIterable(val2)) { - return val2; - } else if (isReadableNodeStream(val2)) { - return fromReadable(val2); + function makeAsyncIterable(val) { + if (isIterable(val)) { + return val; + } else if (isReadableNodeStream(val)) { + return fromReadable(val); } - throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val2); + throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val); } - async function* fromReadable(val2) { + async function* fromReadable(val) { if (!Readable) { Readable = require_readable3(); } - yield* Readable.prototype[SymbolAsyncIterator].call(val2); + yield* Readable.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { - let error4; + let error3; let onresolve = null; const resume = (err) => { if (err) { - error4 = err; + error3 = err; } if (onresolve) { const callback = onresolve; @@ -92167,12 +97337,12 @@ var require_pipeline3 = __commonJS({ } }; const wait = () => new Promise2((resolve2, reject) => { - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { onresolve = () => { - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve2(); } @@ -92202,7 +97372,7 @@ var require_pipeline3 = __commonJS({ } finish(); } catch (err) { - finish(error4 !== err ? aggregateTwoErrors(error4, err) : err); + finish(error3 !== err ? aggregateTwoErrors(error3, err) : err); } finally { cleanup(); writable.off("drain", resume); @@ -92251,12 +97421,12 @@ var require_pipeline3 = __commonJS({ function abort() { finishImpl(new AbortError()); } - addAbortListener = addAbortListener || require_util13().addAbortListener; + addAbortListener = addAbortListener || require_util12().addAbortListener; let disposable; if (outerSignal) { disposable = addAbortListener(outerSignal, abort); } - let error4; + let error3; let value; const destroys = []; let finishCount = 0; @@ -92265,23 +97435,23 @@ var require_pipeline3 = __commonJS({ } function finishImpl(err, final) { var _disposable; - if (err && (!error4 || error4.code === "ERR_STREAM_PREMATURE_CLOSE")) { - error4 = err; + if (err && (!error3 || error3.code === "ERR_STREAM_PREMATURE_CLOSE")) { + error3 = err; } - if (!error4 && !final) { + if (!error3 && !final) { return; } while (destroys.length) { - destroys.shift()(error4); + destroys.shift()(error3); } ; (_disposable = disposable) === null || _disposable === void 0 ? void 0 : _disposable[SymbolDispose](); ac.abort(); if (final) { - if (!error4) { + if (!error3) { lastStreamCleanup.forEach((fn) => fn()); } - process2.nextTick(callback, error4, value); + process2.nextTick(callback, error3, value); } } let ret; @@ -92352,10 +97522,10 @@ var require_pipeline3 = __commonJS({ finishCount++; then.call( ret, - (val2) => { - value = val2; - if (val2 != null) { - pt.write(val2); + (val) => { + value = val; + if (val != null) { + pt.write(val); } if (end) { pt.end(); @@ -92508,7 +97678,7 @@ var require_pipeline3 = __commonJS({ var require_compose = __commonJS({ "node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) { "use strict"; - var { pipeline } = require_pipeline3(); + var { pipeline } = require_pipeline4(); var Duplex = require_duplex(); var { destroyer } = require_destroy2(); var { @@ -92519,7 +97689,7 @@ var require_compose = __commonJS({ isTransformStream, isWritableStream, isReadableStream - } = require_utils6(); + } = require_utils8(); var { AbortError, codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS } @@ -92712,8 +97882,8 @@ var require_operators = __commonJS({ var { finished } = require_end_of_stream(); var staticCompose = require_compose(); var { addAbortSignalNoValidate } = require_add_abort_signal(); - var { isWritable, isNodeStream } = require_utils6(); - var { deprecate } = require_util13(); + var { isWritable, isNodeStream } = require_utils8(); + var { deprecate } = require_util12(); var { ArrayPrototypePush, Boolean: Boolean2, @@ -92766,7 +97936,7 @@ var require_operators = __commonJS({ validateInteger(highWaterMark, "options.highWaterMark", 0); highWaterMark += concurrency; return async function* map3() { - const signal = require_util13().AbortSignalAny( + const signal = require_util12().AbortSignalAny( [options === null || options === void 0 ? void 0 : options.signal].filter(Boolean2) ); const stream = this; @@ -92794,7 +97964,7 @@ var require_operators = __commonJS({ } async function pump() { try { - for await (let val2 of stream) { + for await (let val of stream) { if (done) { return; } @@ -92802,17 +97972,17 @@ var require_operators = __commonJS({ throw new AbortError(); } try { - val2 = fn(val2, signalOpt); - if (val2 === kEmpty) { + val = fn(val, signalOpt); + if (val === kEmpty) { continue; } - val2 = PromiseResolve(val2); + val = PromiseResolve(val); } catch (err) { - val2 = PromiseReject(err); + val = PromiseReject(err); } cnt += 1; - PromisePrototypeThen(val2, afterItemProcessed, onCatch); - queue.push(val2); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue.push(val); if (next) { next(); next = null; @@ -92825,9 +97995,9 @@ var require_operators = __commonJS({ } queue.push(kEof); } catch (err) { - const val2 = PromiseReject(err); - PromisePrototypeThen(val2, afterItemProcessed, onCatch); - queue.push(val2); + const val = PromiseReject(err); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue.push(val); } finally { done = true; if (next) { @@ -92840,15 +98010,15 @@ var require_operators = __commonJS({ try { while (true) { while (queue.length > 0) { - const val2 = await queue[0]; - if (val2 === kEof) { + const val = await queue[0]; + if (val === kEof) { return; } if (signal.aborted) { throw new AbortError(); } - if (val2 !== kEmpty) { - yield val2; + if (val !== kEmpty) { + yield val; } queue.shift(); maybeResume(); @@ -92875,14 +98045,14 @@ var require_operators = __commonJS({ } return async function* asIndexedPairs2() { let index = 0; - for await (const val2 of this) { + 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 [index++, val2]; + yield [index++, val]; } }.call(this); } @@ -93002,22 +98172,22 @@ var require_operators = __commonJS({ validateAbortSignal(options.signal, "options.signal"); } const result = []; - for await (const val2 of this) { + 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, val2); + ArrayPrototypePush(result, val); } return result; } function flatMap(fn, options) { const values = map2.call(this, fn, options); return async function* flatMap2() { - for await (const val2 of values) { - yield* val2; + for await (const val of values) { + yield* val; } }.call(this); } @@ -93044,13 +98214,13 @@ var require_operators = __commonJS({ if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) { throw new AbortError(); } - for await (const val2 of this) { + 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 (number-- <= 0) { - yield val2; + yield val; } } }.call(this); @@ -93068,13 +98238,13 @@ var require_operators = __commonJS({ if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted) { throw new AbortError(); } - for await (const val2 of this) { + 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 (number-- > 0) { - yield val2; + yield val; } if (number <= 0) { return; @@ -93107,8 +98277,8 @@ 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_utils6(); - var { pipelineImpl: pl } = require_pipeline3(); + var { isIterable, isNodeStream, isWebStream } = require_utils8(); + var { pipelineImpl: pl } = require_pipeline4(); var { finished } = require_end_of_stream(); require_stream2(); function pipeline(...streams) { @@ -93151,18 +98321,18 @@ var require_stream2 = __commonJS({ var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(); var { promisify: { custom: customPromisify } - } = require_util13(); + } = require_util12(); var { streamReturningOperators, promiseReturningOperators } = require_operators(); var { codes: { ERR_ILLEGAL_CONSTRUCTOR } } = require_errors4(); var compose = require_compose(); var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state3(); - var { pipeline } = require_pipeline3(); + var { pipeline } = require_pipeline4(); var { destroyer } = require_destroy2(); var eos = require_end_of_stream(); var promises = require_promises(); - var utils = require_utils6(); + var utils = require_utils8(); var Stream = module2.exports = require_legacy().Stream; Stream.isDestroyed = utils.isDestroyed; Stream.isDisturbed = utils.isDisturbed; @@ -94131,52 +99301,128 @@ var require_isPlainObject = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/brace-expansion/index.js -var require_brace_expansion3 = __commonJS({ - "node_modules/archiver-utils/node_modules/brace-expansion/index.js"(exports2, module2) { - var balanced = require_balanced_match(); - module2.exports = expandTop; +// node_modules/@isaacs/balanced-match/dist/commonjs/index.js +var require_commonjs18 = __commonJS({ + "node_modules/@isaacs/balanced-match/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.range = exports2.balanced = void 0; + var balanced = (a, b, str2) => { + const ma = a instanceof RegExp ? maybeMatch(a, str2) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str2) : b; + const r = ma !== null && mb != null && (0, exports2.range)(ma, mb, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + ma.length, r[1]), + post: str2.slice(r[1] + mb.length) + }; + }; + exports2.balanced = balanced; + var maybeMatch = (reg, str2) => { + const m = str2.match(reg); + return m ? m[0] : null; + }; + var range = (a, b, str2) => { + let begs, beg, left, right = void 0, result; + let ai = str2.indexOf(a); + let bi = str2.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str2.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 = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== void 0) { + result = [left, right]; + } + } + return result; + }; + exports2.range = range; + } +}); + +// node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +var require_commonjs19 = __commonJS({ + "node_modules/@isaacs/brace-expansion/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.expand = expand; + var balanced_match_1 = require_commonjs18(); 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; function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + return !isNaN(str2) ? parseInt(str2, 10) : str2.charCodeAt(0); } function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + return str2.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod); } function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + return str2.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, "."); } function parseCommaParts(str2) { - if (!str2) + if (!str2) { return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) + } + const parts = []; + const m = (0, balanced_match_1.balanced)("{", "}", str2); + if (!m) { return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); + } + const { pre, body, post } = m; + const p = pre.split(","); p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); + 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 expandTop(str2) { - if (!str2) + function expand(str2) { + if (!str2) { return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); } - return expand(escapeBraces(str2), true).map(unescapeBraces); + if (str2.slice(0, 2) === "{}") { + str2 = "\\{\\}" + str2.slice(2); + } + return expand_(escapeBraces(str2), true).map(unescapeBraces); } function embrace(str2) { return "{" + str2 + "}"; @@ -94187,76 +99433,77 @@ var require_brace_expansion3 = __commonJS({ function lte(i, y) { return i <= y; } - function gte5(i, y) { + function gte6(i, y) { return i >= y; } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m) return [str2]; - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; + function expand_(str2, isTop) { + const expansions = []; + const m = (0, balanced_match_1.balanced)("{", "}", str2); + if (!m) + return [str2]; + const pre = m.pre; + const post = m.post.length ? expand_(m.post, false) : [""]; if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + "{" + m.body + "}" + post[k]; + for (let k = 0; k < post.length; k++) { + const expansion = pre + "{" + m.body + "}" + post[k]; expansions.push(expansion); } } else { - 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; + 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(/,(?!,).*\}/)) { str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); + return expand_(str2); } return [str2]; } - var n; + let n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); + if (n.length === 1 && n[0] !== void 0) { + n = expand_(n[0], false).map(embrace); if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); + return post.map((p) => m.pre + n[0] + p); } } } - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; + let N; + if (isSequence && n[0] !== void 0 && n[1] !== void 0) { + 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.abs(numeric(n[2])) : 1; + let test = lte; + const reverse = y < x; if (reverse) { incr *= -1; - test = gte5; + test = gte6; } - var pad = n.some(isPadded); + const pad = n.some(isPadded); N = []; - for (var i = x; test(i, y); i += incr) { - var c; + for (let i = x; test(i, y); i += incr) { + let c; if (isAlphaSequence) { c = String.fromCharCode(i); - if (c === "\\") + if (c === "\\") { c = ""; + } } else { c = String(i); if (pad) { - var need = width - c.length; + const need = width - c.length; if (need > 0) { - var z = new Array(need + 1).join("0"); - if (i < 0) + const z = new Array(need + 1).join("0"); + if (i < 0) { c = "-" + z + c.slice(1); - else + } else { c = z + c; + } } } } @@ -94264,15 +99511,16 @@ var require_brace_expansion3 = __commonJS({ } } else { N = []; - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], false)); } } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { expansions.push(expansion); + } } } } @@ -94281,9 +99529,9 @@ var require_brace_expansion3 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js var require_assert_valid_pattern = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.assertValidPattern = void 0; @@ -94300,9 +99548,9 @@ var require_assert_valid_pattern = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/brace-expressions.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js var require_brace_expressions = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseClass = void 0; @@ -94417,22 +99665,25 @@ var require_brace_expressions = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/unescape.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js var require_unescape = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/unescape.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = void 0; - var unescape = (s, { windowsPathsNoEscape = false } = {}) => { - return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"); + var unescape = (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"); }; exports2.unescape = unescape; } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/ast.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js var require_ast = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; @@ -94788,7 +100039,7 @@ var require_ast = __commonJS({ if (this.#root === this) this.#fillNegs(); if (!this.type) { - const noEmpty = this.isStart() && this.isEnd(); + 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" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; @@ -94898,10 +100149,7 @@ var require_ast = __commonJS({ } } if (c === "*") { - if (noEmpty && glob2 === "*") - re += starNoEmpty; - else - re += star; + re += noEmpty && glob2 === "*" ? starNoEmpty : star; hasMagic = true; continue; } @@ -94919,29 +100167,29 @@ var require_ast = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/escape.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js var require_escape = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/escape.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.escape = void 0; - var escape = (s, { windowsPathsNoEscape = false } = {}) => { + var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { + if (magicalBraces) { + return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&"); + } return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); }; exports2.escape = escape; } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/index.js -var require_commonjs13 = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/index.js"(exports2) { +// node_modules/glob/node_modules/minimatch/dist/commonjs/index.js +var require_commonjs20 = __commonJS({ + "node_modules/glob/node_modules/minimatch/dist/commonjs/index.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = exports2.escape = exports2.AST = exports2.Minimatch = exports2.match = exports2.makeRe = exports2.braceExpand = exports2.defaults = exports2.filter = exports2.GLOBSTAR = exports2.sep = exports2.minimatch = void 0; - var brace_expansion_1 = __importDefault4(require_brace_expansion3()); + var brace_expansion_1 = require_commonjs19(); var assert_valid_pattern_js_1 = require_assert_valid_pattern(); var ast_js_1 = require_ast(); var escape_js_1 = require_escape(); @@ -95011,7 +100259,7 @@ var require_commonjs13 = __commonJS({ }; exports2.sep = defaultPlatform === "win32" ? path2.win32.sep : path2.posix.sep; exports2.minimatch.sep = exports2.sep; - exports2.GLOBSTAR = Symbol("globstar **"); + exports2.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); exports2.minimatch.GLOBSTAR = exports2.GLOBSTAR; var qmark = "[^/]"; var star = qmark + "*?"; @@ -95064,7 +100312,7 @@ var require_commonjs13 = __commonJS({ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } - return (0, brace_expansion_1.default)(pattern); + return (0, brace_expansion_1.expand)(pattern); }; exports2.braceExpand = braceExpand; exports2.minimatch.braceExpand = exports2.braceExpand; @@ -95588,16 +100836,27 @@ var require_commonjs13 = __commonJS({ pp[i] = twoStar; } } else if (next === void 0) { - pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?"; + pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?"; } else if (next !== exports2.GLOBSTAR) { pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next; pp[i + 1] = exports2.GLOBSTAR; } }); - return pp.filter((p) => p !== exports2.GLOBSTAR).join("/"); + const filtered = pp.filter((p) => p !== exports2.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] = set2.length > 1 ? ["(?:", ")"] : ["", ""]; re = "^" + open + re + close + "$"; + if (this.partial) { + re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$"; + } if (this.negate) re = "^(?!" + re + ").+$"; try { @@ -95684,9 +100943,9 @@ var require_commonjs13 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/lru-cache/dist/commonjs/index.js -var require_commonjs14 = __commonJS({ - "node_modules/archiver-utils/node_modules/lru-cache/dist/commonjs/index.js"(exports2) { +// node_modules/lru-cache/dist/commonjs/index.js +var require_commonjs21 = __commonJS({ + "node_modules/lru-cache/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.LRUCache = void 0; @@ -95733,7 +100992,6 @@ var require_commonjs14 = __commonJS({ }; } var shouldWarn = (code) => !warned.has(code); - var TYPE = Symbol("type"); var isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; var ZeroArray = class extends Array { @@ -95775,6 +101033,7 @@ var require_commonjs14 = __commonJS({ #max; #maxSize; #dispose; + #onInsert; #disposeAfter; #fetchMethod; #memoMethod; @@ -95856,6 +101115,7 @@ var require_commonjs14 = __commonJS({ #hasDispose; #hasFetchMethod; #hasDisposeAfter; + #hasOnInsert; /** * Do not call this method unless you need to inspect the * inner workings of the cache. If anything returned by this @@ -95932,6 +101192,12 @@ var require_commonjs14 = __commonJS({ get dispose() { return this.#dispose; } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } /** * {@link LRUCache.OptionsBase.disposeAfter} (read-only) */ @@ -95939,7 +101205,7 @@ var require_commonjs14 = __commonJS({ return this.#disposeAfter; } constructor(options) { - const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; if (max !== 0 && !isPosInt(max)) { throw new TypeError("max option must be a nonnegative integer"); } @@ -95981,6 +101247,9 @@ var require_commonjs14 = __commonJS({ if (typeof dispose === "function") { this.#dispose = dispose; } + if (typeof onInsert === "function") { + this.#onInsert = onInsert; + } if (typeof disposeAfter === "function") { this.#disposeAfter = disposeAfter; this.#disposed = []; @@ -95989,6 +101258,7 @@ var require_commonjs14 = __commonJS({ this.#disposed = void 0; } this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; this.#hasDisposeAfter = !!this.#disposeAfter; this.noDisposeOnSet = !!noDisposeOnSet; this.noUpdateTTL = !!noUpdateTTL; @@ -96391,7 +101661,7 @@ var require_commonjs14 = __commonJS({ } /** * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to {@link LRLUCache#load}. + * passed to {@link LRUCache#load}. * * The `start` fields are calculated relative to a portable `Date.now()` * timestamp, even if `performance.now()` is available. @@ -96502,6 +101772,9 @@ var require_commonjs14 = __commonJS({ if (status) status.set = "add"; noUpdateTTL = false; + if (this.#hasOnInsert) { + this.#onInsert?.(v, k, "add"); + } } else { this.#moveToTail(index); const oldVal = this.#valList[index]; @@ -96537,6 +101810,9 @@ var require_commonjs14 = __commonJS({ } else if (status) { status.set = "update"; } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, v === oldVal ? "update" : "replace"); + } } if (ttl !== 0 && !this.#ttls) { this.#initializeTTLTracking(); @@ -96564,14 +101840,14 @@ var require_commonjs14 = __commonJS({ pop() { try { while (this.#size) { - const val2 = this.#valList[this.#head]; + const val = this.#valList[this.#head]; this.#evict(true); - if (this.#isBackgroundFetch(val2)) { - if (val2.__staleWhileFetching) { - return val2.__staleWhileFetching; + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; } - } else if (val2 !== void 0) { - return val2; + } else if (val !== void 0) { + return val; } } } finally { @@ -97062,10 +102338,10 @@ var require_commonjs14 = __commonJS({ }); // node_modules/minipass/dist/commonjs/index.js -var require_commonjs15 = __commonJS({ +var require_commonjs22 = __commonJS({ "node_modules/minipass/dist/commonjs/index.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -97075,7 +102351,7 @@ var require_commonjs15 = __commonJS({ stderr: null }; var node_events_1 = require("node:events"); - var node_stream_1 = __importDefault4(require("node:stream")); + var node_stream_1 = __importDefault2(require("node:stream")); var node_string_decoder_1 = require("node:string_decoder"); var isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass || s instanceof node_stream_1.default || (0, exports2.isReadable)(s) || (0, exports2.isWritable)(s)); exports2.isStream = isStream; @@ -97084,37 +102360,37 @@ var require_commonjs15 = __commonJS({ exports2.isReadable = isReadable; var isWritable = (s) => !!s && typeof s === "object" && s instanceof node_events_1.EventEmitter && typeof s.write === "function" && typeof s.end === "function"; exports2.isWritable = isWritable; - var EOF = Symbol("EOF"); - var MAYBE_EMIT_END = Symbol("maybeEmitEnd"); - var EMITTED_END = Symbol("emittedEnd"); - var EMITTING_END = Symbol("emittingEnd"); - var EMITTED_ERROR = Symbol("emittedError"); - var CLOSED = Symbol("closed"); - var READ = Symbol("read"); - var FLUSH = Symbol("flush"); - var FLUSHCHUNK = Symbol("flushChunk"); - var ENCODING = Symbol("encoding"); - var DECODER = Symbol("decoder"); - var FLOWING = Symbol("flowing"); - var PAUSED = Symbol("paused"); - var RESUME = Symbol("resume"); - var BUFFER = Symbol("buffer"); - var PIPES = Symbol("pipes"); - var BUFFERLENGTH = Symbol("bufferLength"); - var BUFFERPUSH = Symbol("bufferPush"); - var BUFFERSHIFT = Symbol("bufferShift"); - var OBJECTMODE = Symbol("objectMode"); - var DESTROYED = Symbol("destroyed"); - var ERROR = Symbol("error"); - var EMITDATA = Symbol("emitData"); - var EMITEND = Symbol("emitEnd"); - var EMITEND2 = Symbol("emitEnd2"); - var ASYNC = Symbol("async"); - var ABORT = Symbol("abort"); - var ABORTED = Symbol("aborted"); - var SIGNAL = Symbol("signal"); - var DATALISTENERS = Symbol("dataListeners"); - var DISCARDED = Symbol("discarded"); + var EOF = /* @__PURE__ */ Symbol("EOF"); + var MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd"); + var EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd"); + var EMITTING_END = /* @__PURE__ */ Symbol("emittingEnd"); + var EMITTED_ERROR = /* @__PURE__ */ Symbol("emittedError"); + var CLOSED = /* @__PURE__ */ Symbol("closed"); + var READ = /* @__PURE__ */ Symbol("read"); + var FLUSH = /* @__PURE__ */ Symbol("flush"); + var FLUSHCHUNK = /* @__PURE__ */ Symbol("flushChunk"); + var ENCODING = /* @__PURE__ */ Symbol("encoding"); + var DECODER = /* @__PURE__ */ Symbol("decoder"); + var FLOWING = /* @__PURE__ */ Symbol("flowing"); + var PAUSED = /* @__PURE__ */ Symbol("paused"); + var RESUME = /* @__PURE__ */ Symbol("resume"); + var BUFFER = /* @__PURE__ */ Symbol("buffer"); + var PIPES = /* @__PURE__ */ Symbol("pipes"); + var BUFFERLENGTH = /* @__PURE__ */ Symbol("bufferLength"); + var BUFFERPUSH = /* @__PURE__ */ Symbol("bufferPush"); + var BUFFERSHIFT = /* @__PURE__ */ Symbol("bufferShift"); + var OBJECTMODE = /* @__PURE__ */ Symbol("objectMode"); + var DESTROYED = /* @__PURE__ */ Symbol("destroyed"); + var ERROR = /* @__PURE__ */ Symbol("error"); + var EMITDATA = /* @__PURE__ */ Symbol("emitData"); + var EMITEND = /* @__PURE__ */ Symbol("emitEnd"); + var EMITEND2 = /* @__PURE__ */ Symbol("emitEnd2"); + var ASYNC = /* @__PURE__ */ Symbol("async"); + var ABORT = /* @__PURE__ */ Symbol("abort"); + var ABORTED = /* @__PURE__ */ Symbol("aborted"); + var SIGNAL = /* @__PURE__ */ Symbol("signal"); + var DATALISTENERS = /* @__PURE__ */ Symbol("dataListeners"); + var DISCARDED = /* @__PURE__ */ Symbol("discarded"); var defer = (fn) => Promise.resolve().then(fn); var nodefer = (fn) => fn(); var isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; @@ -97953,11 +103229,11 @@ var require_commonjs15 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js -var require_commonjs16 = __commonJS({ - "node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js"(exports2) { +// node_modules/path-scurry/dist/commonjs/index.js +var require_commonjs23 = __commonJS({ + "node_modules/path-scurry/dist/commonjs/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -97970,30 +103246,30 @@ var require_commonjs16 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.PathScurry = exports2.Path = exports2.PathScurryDarwin = exports2.PathScurryPosix = exports2.PathScurryWin32 = exports2.PathScurryBase = exports2.PathPosix = exports2.PathWin32 = exports2.PathBase = exports2.ChildrenCache = exports2.ResolveCache = void 0; - var lru_cache_1 = require_commonjs14(); + var lru_cache_1 = require_commonjs21(); var node_path_1 = require("node:path"); var node_url_1 = require("node:url"); var fs_1 = require("fs"); - var actualFS = __importStar4(require("node:fs")); + var actualFS = __importStar2(require("node:fs")); var realpathSync = fs_1.realpathSync.native; var promises_1 = require("node:fs/promises"); - var minipass_1 = require_commonjs15(); + var minipass_1 = require_commonjs22(); var defaultFS = { lstatSync: fs_1.lstatSync, readdir: fs_1.readdir, @@ -98071,7 +103347,7 @@ var require_commonjs16 = __commonJS({ } }; exports2.ChildrenCache = ChildrenCache; - var setAsCwd = Symbol("PathScurry setAsCwd"); + var setAsCwd = /* @__PURE__ */ Symbol("PathScurry setAsCwd"); var PathBase = class { /** * the basename of this path @@ -98208,6 +103484,8 @@ var require_commonjs16 = __commonJS({ /** * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, * this property refers to the *parent* path, not the path object itself. + * + * @deprecated */ get path() { return this.parentPath; @@ -99727,13 +105005,13 @@ var require_commonjs16 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/pattern.js +// node_modules/glob/dist/commonjs/pattern.js var require_pattern = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/pattern.js"(exports2) { + "node_modules/glob/dist/commonjs/pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var isPatternList = (pl) => pl.length >= 1; var isGlobList = (gl) => gl.length >= 1; var Pattern = class _Pattern { @@ -99901,13 +105179,13 @@ var require_pattern = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/ignore.js +// node_modules/glob/dist/commonjs/ignore.js var require_ignore = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/ignore.js"(exports2) { + "node_modules/glob/dist/commonjs/ignore.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Ignore = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var pattern_js_1 = require_pattern(); var defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux"; var Ignore = class { @@ -99998,13 +105276,13 @@ var require_ignore = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/processor.js +// node_modules/glob/dist/commonjs/processor.js var require_processor = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/processor.js"(exports2) { + "node_modules/glob/dist/commonjs/processor.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Processor = exports2.SubWalks = exports2.MatchRecord = exports2.HasWalkedCache = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var HasWalkedCache = class _HasWalkedCache { store; constructor(store = /* @__PURE__ */ new Map()) { @@ -100231,13 +105509,13 @@ var require_processor = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/walker.js +// node_modules/glob/dist/commonjs/walker.js var require_walker = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/walker.js"(exports2) { + "node_modules/glob/dist/commonjs/walker.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.GlobStream = exports2.GlobWalker = exports2.GlobUtil = void 0; - var minipass_1 = require_commonjs15(); + var minipass_1 = require_commonjs22(); var ignore_js_1 = require_ignore(); var processor_js_1 = require_processor(); var makeIgnore = (ignore, opts) => typeof ignore === "string" ? new ignore_js_1.Ignore([ignore], opts) : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore; @@ -100571,15 +105849,15 @@ var require_walker = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/glob.js +// node_modules/glob/dist/commonjs/glob.js var require_glob2 = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/glob.js"(exports2) { + "node_modules/glob/dist/commonjs/glob.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Glob = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var node_url_1 = require("node:url"); - var path_scurry_1 = require_commonjs16(); + var path_scurry_1 = require_commonjs23(); var pattern_js_1 = require_pattern(); var walker_js_1 = require_walker(); var defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux"; @@ -100784,13 +106062,13 @@ var require_glob2 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/has-magic.js +// node_modules/glob/dist/commonjs/has-magic.js var require_has_magic = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/has-magic.js"(exports2) { + "node_modules/glob/dist/commonjs/has-magic.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hasMagic = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var hasMagic = (pattern, options = {}) => { if (!Array.isArray(pattern)) { pattern = [pattern]; @@ -100805,9 +106083,9 @@ var require_has_magic = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/index.js -var require_commonjs17 = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/index.js"(exports2) { +// node_modules/glob/dist/commonjs/index.js +var require_commonjs24 = __commonJS({ + "node_modules/glob/dist/commonjs/index.js"(exports2) { "use strict"; 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; @@ -100816,10 +106094,10 @@ var require_commonjs17 = __commonJS({ exports2.globSync = globSync; exports2.globIterateSync = globIterateSync; exports2.globIterate = globIterate; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var glob_js_1 = require_glob2(); var has_magic_js_1 = require_has_magic(); - var minimatch_2 = require_commonjs13(); + var minimatch_2 = require_commonjs20(); Object.defineProperty(exports2, "escape", { enumerable: true, get: function() { return minimatch_2.escape; } }); @@ -100896,7 +106174,7 @@ var require_file3 = __commonJS({ var difference = require_difference(); var union = require_union(); var isPlainObject = require_isPlainObject(); - var glob2 = require_commonjs17(); + var glob2 = require_commonjs24(); var file = module2.exports = {}; var pathSeparatorRe = /[\/\\]/g; var processPatterns = function(patterns, fn) { @@ -101160,7 +106438,7 @@ var require_archiver_utils = __commonJS({ }); // node_modules/archiver/lib/error.js -var require_error2 = __commonJS({ +var require_error3 = __commonJS({ "node_modules/archiver/lib/error.js"(exports2, module2) { var util = require("util"); var ERROR_CODES = { @@ -101193,7 +106471,7 @@ var require_error2 = __commonJS({ }); // node_modules/archiver/lib/core.js -var require_core2 = __commonJS({ +var require_core3 = __commonJS({ "node_modules/archiver/lib/core.js"(exports2, module2) { var fs2 = require("fs"); var glob2 = require_readdir_glob(); @@ -101201,7 +106479,7 @@ var require_core2 = __commonJS({ var path2 = require("path"); var util = require_archiver_utils(); var inherits = require("util").inherits; - var ArchiverError = require_error2(); + var ArchiverError = require_error3(); var Transform = require_ours().Transform; var win32 = process.platform === "win32"; var Archiver = function(format, options) { @@ -101744,7 +107022,7 @@ var require_archive_entry = __commonJS({ }); // node_modules/compress-commons/lib/archivers/zip/util.js -var require_util14 = __commonJS({ +var require_util13 = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/util.js"(exports2, module2) { var util = module2.exports = {}; util.dateToDos = function(d, forceLocalTime) { @@ -101755,7 +107033,7 @@ var require_util14 = __commonJS({ } else if (year >= 2044) { return 2141175677; } - var val2 = { + var val = { year, month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), date: forceLocalTime ? d.getDate() : d.getUTCDate(), @@ -101763,7 +107041,7 @@ var require_util14 = __commonJS({ minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() }; - return val2.year - 1980 << 25 | val2.month + 1 << 21 | val2.date << 16 | val2.hours << 11 | val2.minutes << 5 | val2.seconds / 2; + return val.year - 1980 << 25 | val.month + 1 << 21 | val.date << 16 | val.hours << 11 | val.minutes << 5 | val.seconds / 2; }; util.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); @@ -101802,7 +107080,7 @@ var require_util14 = __commonJS({ // node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js var require_general_purpose_bit = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js"(exports2, module2) { - var zipUtil = require_util14(); + var zipUtil = require_util13(); var DATA_DESCRIPTOR_FLAG = 1 << 3; var ENCRYPTION_FLAG = 1 << 0; var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2; @@ -101929,7 +107207,7 @@ var require_unix_stat = __commonJS({ }); // node_modules/compress-commons/lib/archivers/zip/constants.js -var require_constants9 = __commonJS({ +var require_constants13 = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/constants.js"(exports2, module2) { module2.exports = { WORD: 4, @@ -102013,8 +107291,8 @@ var require_zip_archive_entry = __commonJS({ var ArchiveEntry = require_archive_entry(); var GeneralPurposeBit = require_general_purpose_bit(); var UnixStat = require_unix_stat(); - var constants = require_constants9(); - var zipUtil = require_util14(); + var constants = require_constants13(); + var zipUtil = require_util13(); var ZipArchiveEntry = module2.exports = function(name) { if (!(this instanceof ZipArchiveEntry)) { return new ZipArchiveEntry(name); @@ -102194,7 +107472,7 @@ var require_is_stream2 = __commonJS({ }); // node_modules/compress-commons/lib/util/index.js -var require_util15 = __commonJS({ +var require_util14 = __commonJS({ "node_modules/compress-commons/lib/util/index.js"(exports2, module2) { var Stream = require("stream").Stream; var PassThrough = require_ours().PassThrough; @@ -102222,7 +107500,7 @@ var require_archive_output_stream = __commonJS({ var isStream = require_is_stream2(); var Transform = require_ours().Transform; var ArchiveEntry = require_archive_entry(); - var util = require_util15(); + var util = require_util14(); var ArchiveOutputStream = module2.exports = function(options) { if (!(this instanceof ArchiveOutputStream)) { return new ArchiveOutputStream(options); @@ -102485,7 +107763,7 @@ var require_deflate_crc32_stream = __commonJS({ }); // node_modules/crc32-stream/lib/index.js -var require_lib6 = __commonJS({ +var require_lib5 = __commonJS({ "node_modules/crc32-stream/lib/index.js"(exports2, module2) { "use strict"; module2.exports = { @@ -102500,14 +107778,14 @@ var require_zip_archive_output_stream = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js"(exports2, module2) { var inherits = require("util").inherits; var crc32 = require_crc32(); - var { CRC32Stream } = require_lib6(); - var { DeflateCRC32Stream } = require_lib6(); + var { CRC32Stream } = require_lib5(); + var { DeflateCRC32Stream } = require_lib5(); var ArchiveOutputStream = require_archive_output_stream(); var ZipArchiveEntry = require_zip_archive_entry(); var GeneralPurposeBit = require_general_purpose_bit(); - var constants = require_constants9(); - var util = require_util15(); - var zipUtil = require_util14(); + var constants = require_constants13(); + var util = require_util14(); + var zipUtil = require_util13(); var ZipArchiveOutputStream = module2.exports = function(options) { if (!(this instanceof ZipArchiveOutputStream)) { return new ZipArchiveOutputStream(options); @@ -102623,18 +107901,18 @@ var require_zip_archive_output_stream = __commonJS({ ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { var deflate = ae.getMethod() === constants.METHOD_DEFLATED; var process2 = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream(); - var error4 = null; + 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(error4, ae); + callback(error3, ae); } process2.once("end", handleStuff.bind(this)); process2.once("error", function(err) { - error4 = err; + error3 = err; }); process2.pipe(this, { end: false }); return process2; @@ -103005,29 +108283,29 @@ var require_fast_fifo = __commonJS({ this.head.clear(); this.length = 0; } - push(val2) { + push(val) { this.length++; - if (!this.head.push(val2)) { + if (!this.head.push(val)) { const prev = this.head; this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length); - this.head.push(val2); + this.head.push(val); } } shift() { if (this.length !== 0) this.length--; - const val2 = this.tail.shift(); - if (val2 === void 0 && this.tail.next) { + 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 val2; + return val; } peek() { - const val2 = this.tail.peek(); - if (val2 === void 0 && this.tail.next) return this.tail.next.peek(); - return val2; + const val = this.tail.peek(); + if (val === void 0 && this.tail.next) return this.tail.next.peek(); + return val; } isEmpty() { return this.length === 0; @@ -103453,7 +108731,7 @@ var require_streamx = __commonJS({ 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 || Symbol("asyncIterator"); + var asyncIterator = Symbol.asyncIterator || /* @__PURE__ */ Symbol("asyncIterator"); var WritableState = class { constructor(stream, { highWaterMark = 16384, map: map2 = null, mapWritable, byteLength, byteLengthWritable } = {}) { this.stream = stream; @@ -104000,11 +109278,11 @@ var require_streamx = __commonJS({ } [asyncIterator]() { const stream = this; - let error4 = null; + let error3 = null; let promiseResolve = null; let promiseReject = null; this.on("error", (err) => { - error4 = err; + error3 = err; }); this.on("readable", onreadable); this.on("close", onclose); @@ -104036,7 +109314,7 @@ var require_streamx = __commonJS({ } function ondata(data) { if (promiseReject === null) return; - if (error4) promiseReject(error4); + if (error3) promiseReject(error3); else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED); else promiseResolve({ value: data, done: data === null }); promiseReject = promiseResolve = null; @@ -104210,7 +109488,7 @@ var require_streamx = __commonJS({ if (all.length < 2) throw new Error("Pipeline requires at least 2 streams"); let src = all[0]; let dest = null; - let error4 = null; + let error3 = null; for (let i = 1; i < all.length; i++) { dest = all[i]; if (isStreamx(src)) { @@ -104225,14 +109503,14 @@ var require_streamx = __commonJS({ let fin = false; const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy); dest.on("error", (err) => { - if (error4 === null) error4 = err; + if (error3 === null) error3 = err; }); dest.on("finish", () => { fin = true; - if (!autoDestroy) done(error4); + if (!autoDestroy) done(error3); }); if (autoDestroy) { - dest.on("close", () => done(error4 || (fin ? null : PREMATURE_CLOSE))); + dest.on("close", () => done(error3 || (fin ? null : PREMATURE_CLOSE))); } } return dest; @@ -104245,8 +109523,8 @@ var require_streamx = __commonJS({ } } function onerror(err) { - if (!err || error4) return; - error4 = err; + if (!err || error3) return; + error3 = err; for (const s of all) { s.destroy(err); } @@ -104505,10 +109783,10 @@ var require_headers2 = __commonJS({ for (let j = 156; j < 512; j++) sum += block[j]; return sum; } - function encodeOct(val2, n) { - val2 = val2.toString(8); - if (val2.length > n) return SEVENS.slice(0, n) + " "; - return ZEROS.slice(0, n - val2.length) + val2 + " "; + 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; @@ -104543,21 +109821,21 @@ var require_headers2 = __commonJS({ } return positive ? sum : -1 * sum; } - function decodeOct(val2, offset, length) { - val2 = val2.subarray(offset, offset + length); + function decodeOct(val, offset, length) { + val = val.subarray(offset, offset + length); offset = 0; - if (val2[offset] & 128) { - return parse256(val2); + if (val[offset] & 128) { + return parse256(val); } else { - while (offset < val2.length && val2[offset] === 32) offset++; - const end = clamp(indexOf(val2, 32, offset, val2.length), val2.length, val2.length); - while (offset < end && val2[offset] === 0) offset++; + 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(val2.subarray(offset, end)), 8); + return parseInt(b4a.toString(val.subarray(offset, end)), 8); } } - function decodeStr(val2, offset, length, encoding) { - return b4a.toString(val2.subarray(offset, indexOf(val2, 0, offset, offset + length)), encoding); + function decodeStr(val, offset, length, encoding) { + return b4a.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding); } function addLength(str2) { const len = b4a.byteLength(str2); @@ -104812,7 +110090,7 @@ var require_extract = __commonJS({ cb(null); } [Symbol.asyncIterator]() { - let error4 = null; + let error3 = null; let promiseResolve = null; let promiseReject = null; let entryStream = null; @@ -104820,7 +110098,7 @@ var require_extract = __commonJS({ const extract2 = this; this.on("entry", onentry); this.on("error", (err) => { - error4 = err; + error3 = err; }); this.on("close", onclose); return { @@ -104844,8 +110122,8 @@ var require_extract = __commonJS({ cb(err); } function onnext(resolve2, reject) { - if (error4) { - return reject(error4); + if (error3) { + return reject(error3); } if (entryStream) { resolve2({ value: entryStream, done: false }); @@ -104871,9 +110149,9 @@ var require_extract = __commonJS({ } } function onclose() { - consumeCallback(error4); + consumeCallback(error3); if (!promiseResolve) return; - if (error4) promiseReject(error4); + if (error3) promiseReject(error3); else promiseResolve({ value: void 0, done: true }); promiseResolve = promiseReject = null; } @@ -104903,7 +110181,7 @@ var require_extract = __commonJS({ }); // node_modules/tar-stream/constants.js -var require_constants10 = __commonJS({ +var require_constants14 = __commonJS({ "node_modules/tar-stream/constants.js"(exports2, module2) { var constants = { // just for envs without fs @@ -104927,7 +110205,7 @@ var require_pack = __commonJS({ "node_modules/tar-stream/pack.js"(exports2, module2) { var { Readable, Writable, getStreamError } = require_streamx(); var b4a = require_b4a(); - var constants = require_constants10(); + var constants = require_constants14(); var headers = require_headers2(); var DMODE = 493; var FMODE = 420; @@ -105243,7 +110521,7 @@ var require_tar2 = __commonJS({ }); // node_modules/buffer-crc32/dist/index.cjs -var require_dist8 = __commonJS({ +var require_dist5 = __commonJS({ "node_modules/buffer-crc32/dist/index.cjs"(exports2, module2) { "use strict"; function getDefaultExportFromCjs(x) { @@ -105555,7 +110833,7 @@ var require_json = __commonJS({ "node_modules/archiver/lib/plugins/json.js"(exports2, module2) { var inherits = require("util").inherits; var Transform = require_ours().Transform; - var crc32 = require_dist8(); + var crc32 = require_dist5(); var util = require_archiver_utils(); var Json = function(options) { if (!(this instanceof Json)) { @@ -105607,7 +110885,7 @@ var require_json = __commonJS({ // node_modules/archiver/index.js var require_archiver = __commonJS({ "node_modules/archiver/index.js"(exports2, module2) { - var Archiver = require_core2(); + var Archiver = require_core3(); var formats = {}; var vending = function(format, options) { return vending.create(format, options); @@ -105651,7 +110929,7 @@ var require_archiver = __commonJS({ var require_zip2 = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/zip.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -105664,31 +110942,31 @@ var require_zip2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -105718,10 +110996,10 @@ var require_zip2 = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.ZipUploadStream = exports2.DEFAULT_COMPRESSION_LEVEL = void 0; exports2.createZipUploadStream = createZipUploadStream; - var stream = __importStar4(require("stream")); + var stream = __importStar2(require("stream")); var promises_1 = require("fs/promises"); - var archiver2 = __importStar4(require_archiver()); - var core14 = __importStar4(require_core()); + var archiver2 = __importStar2(require_archiver()); + var core14 = __importStar2(require_core()); var config_1 = require_config2(); exports2.DEFAULT_COMPRESSION_LEVEL = 6; var ZipUploadStream = class extends stream.Transform { @@ -105737,7 +111015,7 @@ var require_zip2 = __commonJS({ }; exports2.ZipUploadStream = ZipUploadStream; function createZipUploadStream(uploadSpecification_1) { - return __awaiter4(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { + return __awaiter2(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { core14.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); const zip = archiver2.create("zip", { highWaterMark: (0, config_1.getUploadChunkSize)(), @@ -105769,18 +111047,18 @@ var require_zip2 = __commonJS({ return zipUploadStream; }); } - var zipErrorCallback = (error4) => { + var zipErrorCallback = (error3) => { core14.error("An error has occurred while creating the zip file for upload"); - core14.info(error4); + core14.info(error3); throw new Error("An error has occurred during zip creation for the artifact"); }; - var zipWarningCallback = (error4) => { - if (error4.code === "ENOENT") { + var zipWarningCallback = (error3) => { + if (error3.code === "ENOENT") { core14.warning("ENOENT warning during artifact zip creation. No such file or directory"); - core14.info(error4); + core14.info(error3); } else { - core14.warning(`A non-blocking warning has occurred during artifact zip creation: ${error4.code}`); - core14.info(error4); + core14.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); + core14.info(error3); } }; var zipFinishCallback = () => { @@ -105796,7 +111074,7 @@ var require_zip2 = __commonJS({ var require_upload_artifact = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/upload-artifact.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -105809,31 +111087,31 @@ var require_upload_artifact = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -105862,18 +111140,18 @@ var require_upload_artifact = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadArtifact = uploadArtifact; - var core14 = __importStar4(require_core()); + var core14 = __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 util_1 = require_util10(); 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -106232,1617 +111510,2411 @@ var require_chainsaw = __commonJS({ }); return ch; }; - saw.pop = function() { - return saw.actions.shift(); + 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 index = i >= 0 ? i : this.length - i; + var reps = [].slice.call(arguments, 2); + if (howMany === void 0) { + howMany = this.length - index; + } else if (howMany > this.length - index) { + howMany = this.length - index; + } + 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 < index; ii++) { + startBytes += buffers[ii].length; + } + if (index - startBytes > 0) { + var start = index - 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 set2(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, match = 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[match]) { + if (match == 0) { + mstart = { + i, + j, + pos + }; + } + match++; + if (match == needle.length) { + return mstart.pos; + } + } else if (match != 0) { + i = mstart.i; + j = mstart.j; + pos = mstart.pos; + match = 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 EventEmitter = 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 find2(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 stream = Chainsaw.light(builder); + stream.writable = true; + var buffers = Buffers(); + stream.write = function(buf) { + buffers.push(buf); + dispatch(); + }; + var vars = Vars(); + var done = false, caughtEnd = false; + stream.end = function() { + caughtEnd = true; + }; + stream.pipe = Stream.prototype.pipe; + Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function(name) { + stream[name] = EventEmitter.prototype[name]; + }); + return stream; + }; + exports2.parse = function parse(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; }; - 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); + 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; }; - saw.nest = function(cb) { - var args = [].slice.call(arguments, 1); - var autonext = true; - if (typeof cb === "boolean") { - var autonext = cb; - cb = args.shift(); + self2.loop = function(cb) { + var end = false; + var ender = function() { + end = true; + }; + while (end === false) { + cb.call(self2, ender, vars.store); } - 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(); + return self2; + }; + self2.buffer = function(name, size) { + if (typeof size === "string") { + size = vars.get(size); } - cb.apply(s.chain(), args); - if (autonext !== false) s.on("end", saw.next); + var buf = buffer.slice(offset, Math.min(buffer.length, offset + size)); + offset += size; + vars.set(name, buf); + return self2; }; - saw.record = function() { - upgradeChainsaw(saw); + self2.skip = function(bytes) { + if (typeof bytes === "string") { + bytes = vars.get(bytes); + } + offset += bytes; + return self2; }; - ["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++]; + 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; }; - saw.trap = function(name, cb) { - var ps = Array.isArray(name) ? name : [name]; - saw.actions.push({ - path: ps, - step: saw.step, - cb, - trap: true - }); + self2.peek = function(cb) { + var was = offset; + cb.call(self2, vars.store); + offset = was; + return self2; }; - 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(); + self2.flush = function() { + vars.store = {}; + return self2; }; - saw.jump = function(step) { - saw.step = step; - saw.next(); + 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/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); +// node_modules/unzip-stream/lib/matcher-stream.js +var require_matcher_stream = __commonJS({ + "node_modules/unzip-stream/lib/matcher-stream.js"(exports2, module2) { + var Transform = require("stream").Transform; + var util = require("util"); + function MatcherStream(patternDesc, matchFn) { + if (!(this instanceof MatcherStream)) { + return new MatcherStream(); + } + Transform.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; } - 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"); + util.inherits(MatcherStream, Transform); + 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; } - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.push(buf); - this.length += buf.length; + 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; } - return this.length; + 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; }; - 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"); + 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; } } - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.unshift(buf); - this.length += buf.length; + if (this.data.length > 0) { + this.push(this.data); + this.data = null; } - return this.length; + cb(); }; - Buffers.prototype.copy = function(dst, dStart, start, end) { - return this.slice(start, end).copy(dst, dStart, 0, end - start); + 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 stream = require("stream"); + var inherits = require("util").inherits; + function Entry() { + if (!(this instanceof Entry)) { + return new Entry(); + } + stream.PassThrough.call(this); + this.path = null; + this.type = null; + this.isDirectory = false; + } + inherits(Entry, stream.PassThrough); + Entry.prototype.autodrain = function() { + return this.pipe(new stream.Transform({ transform: function(d, e, cb) { + cb(); + } })); }; - Buffers.prototype.splice = function(i, howMany) { - var buffers = this.buffers; - var index = i >= 0 ? i : this.length - i; - var reps = [].slice.call(arguments, 2); - if (howMany === void 0) { - howMany = this.length - index; - } else if (howMany > this.length - index) { - howMany = this.length - index; + 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 binary2 = require_binary(); + var stream = require("stream"); + var util = require("util"); + var zlib = 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); } - for (var i = 0; i < reps.length; i++) { - this.length += reps[i].length; + stream.Transform.call(this); + this.options = options || {}; + this.data = new Buffer(""); + this.state = states.STREAM_START; + this.skippedBytes = 0; + this.parsedEntity = null; + this.outStreamInfo = {}; + } + util.inherits(UnzipStream, stream.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 removed = new Buffers(); - var bytes = 0; - var startBytes = 0; - for (var ii = 0; ii < buffers.length && startBytes + buffers[ii].length < index; ii++) { - startBytes += buffers[ii].length; + var chunkLength = chunk.length; + if (chunkLength < requiredLength) { + return 0; } - if (index - startBytes > 0) { - var start = index - 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]; + 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 path2 = 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) { + path2 = extra.parsed.path; } - var buf1 = new Buffer(orig.length - start - howMany); - for (var i = start + howMany; i < orig.length; i++) { - buf1[i - howMany - start] = orig[i]; + 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 (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; + if (this.options.debug) { + const debugObj = Object.assign({}, this.parsedEntity, { + path: path2, + 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)); } - } 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 set2(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, match = 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; + 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); } - } - var char = this.buffers[i][j]; - if (char == needle[match]) { - if (match == 0) { - mstart = { - i, - j, - pos - }; + 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); } - match++; - if (match == needle.length) { - return mstart.pos; + 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()); } - } else if (match != 0) { - i = mstart.i; - j = mstart.j; - pos = mstart.pos; - match = 0; - } - j++; - pos++; + 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; } }; - 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; - } + 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 vars = { - get: function(name) { - return getset(name); - }, - set: function(name, value) { - return getset(name, value); - }, - store: store || {} + var isVersionSupported = vars.versionsNeededToExtract <= 45; + this.outStreamInfo = { + stream: null, + limit: fileSizeKnown ? vars.compressedSize : -1, + written: 0 }; - return vars; - }; - } -}); - -// node_modules/binary/index.js -var require_binary = __commonJS({ - "node_modules/binary/index.js"(exports2, module2) { - var Chainsaw = require_chainsaw(); - var EventEmitter = 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); + 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 stream.PassThrough(); } - var s = exports2.stream(); - if (bufOrEm && bufOrEm.pipe) { - bufOrEm.pipe(s); - } else if (bufOrEm) { - bufOrEm.on(eventName || "data", function(buf) { - s.write(buf); + 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)); }); - bufOrEm.on("end", function() { - s.end(); + this.outStreamInfo.stream.pipe(new Entry().autodrain()); + return; + } + var isCompressed = vars.compressionMethod > 0; + if (isCompressed) { + var inflater = zlib.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(); } - 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(); + UnzipStream.prototype._readFile = function(data) { + var vars = binary2.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 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; + var index = 0; + while (index < data.length) { + var vars = binary2.parse(data).skip(index).word16lu("extraId").word16lu("extraSize").vars; + index += 4; + var fieldType = void 0; + switch (vars.extraId) { + case 1: + fieldType = "Zip64 extended information extra field"; + var z64vars = binary2.parse(data.slice(index, index + vars.extraSize)).word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offsetToLocalHeader").word32lu("diskStartNumber").vars; + if (z64vars.uncompressedSize !== null) { + extra.uncompressedSize = z64vars.uncompressedSize; } - if (pending.skip) { - pending.cb(); - } else { - pending.cb(buf); + if (z64vars.compressedSize !== null) { + extra.compressedSize = z64vars.compressedSize; } - } - } - } - 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 find2(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); + extra.zip64Mode = true; + break; + case 10: + fieldType = "NTFS extra field"; + break; + case 21589: + fieldType = "extended timestamp"; + var timestampFields = data.readUInt8(index); + var offset = 1; + if (vars.extraSize >= offset + 4 && timestampFields & 1) { + extra.mtime = new Date(data.readUInt32LE(index + offset) * 1e3); + offset += 4; + } + if (vars.extraSize >= offset + 4 && timestampFields & 2) { + extra.atime = new Date(data.readUInt32LE(index + offset) * 1e3); + offset += 4; + } + if (vars.extraSize >= offset + 4 && timestampFields & 4) { + extra.ctime = new Date(data.readUInt32LE(index + offset) * 1e3); + } + break; + case 28789: + fieldType = "Info-ZIP Unicode Path Extra Field"; + var fieldVer = data.readUInt8(index); + if (fieldVer === 1) { + var offset = 1; + var nameCrc32 = data.readUInt32LE(index + offset); + offset += 4; + var pathBuffer = data.slice(index + 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(index + offset) * 1e3); + offset += 4; + var mtime = new Date(data.readUInt32LE(index + offset) * 1e3); + offset += 4; + extra.atime = atime; + extra.mtime = mtime; + if (vars.extraSize >= 12) { + var uid = data.readUInt16LE(index + offset); + offset += 2; + var gid = data.readUInt16LE(index + 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(index + offset); + offset += 2; + var gid = data.readUInt16LE(index + offset); + offset += 2; + extra.uid = uid; + extra.gid = gid; + } + break; + case 30837: + fieldType = "Info-ZIP New Unix"; + var offset = 0; + var extraVer = data.readUInt8(index); + offset += 1; + if (extraVer === 1) { + var uidSize = data.readUInt8(index + offset); + offset += 1; + if (uidSize <= 6) { + extra.uid = data.readUIntLE(index + offset, uidSize); + } + offset += uidSize; + var gidSize = data.readUInt8(index + offset); + offset += 1; + if (gidSize <= 6) { + extra.gid = data.readUIntLE(index + offset, gidSize); } - 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; - }); + break; + case 30062: + fieldType = "ASi Unix"; + var offset = 0; + if (vars.extraSize >= 14) { + var crc = data.readUInt32LE(index + offset); + offset += 4; + var mode = data.readUInt16LE(index + offset); + offset += 2; + var sizdev = data.readUInt32LE(index + offset); + offset += 4; + var uid = data.readUInt16LE(index + offset); + offset += 2; + var gid = data.readUInt16LE(index + offset); + offset += 2; + extra.mode = mode; + extra.uid = uid; + extra.gid = gid; + if (vars.extraSize > 14) { + var start = index + offset; + var end = index + 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(index, index + vars.extraSize).inspect() }); - }; - return self2; + } + index += vars.extraSize; } - ; - var stream = Chainsaw.light(builder); - stream.writable = true; - var buffers = Buffers(); - stream.write = function(buf) { - buffers.push(buf); - dispatch(); - }; - var vars = Vars(); - var done = false, caughtEnd = false; - stream.end = function() { - caughtEnd = true; - }; - stream.pipe = Stream.prototype.pipe; - Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function(name) { - stream[name] = EventEmitter.prototype[name]; - }); - return stream; + return result; }; - exports2.parse = function parse(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)); + UnzipStream.prototype._readDataDescriptor = function(data, zip64Mode) { + if (zip64Mode) { + var vars = binary2.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars; + return vars; + } + var vars = binary2.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars; + return vars; + }; + UnzipStream.prototype._readCentralDirectoryEntry = function(data) { + var vars = binary2.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 = binary2.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 = binary2.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 { - vars.set(name, null); + packet = this.data; + this.data = new Buffer(""); } - 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"); + 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(); + }); } - 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; + 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; } - 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; + cb(); }; - return self2; + self2._parseOrOutput(encoding, done); }; - 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 val2 = decodeBEu(bytes); - if ((bytes[0] & 128) == 128) { - val2 -= Math.pow(256, bytes.length); + 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; } - return val2; - } - function decodeLEs(bytes) { - var val2 = decodeLEu(bytes); - if ((bytes[bytes.length - 1] & 128) == 128) { - val2 -= Math.pow(256, bytes.length); + if (self2.state === states.FILE_DATA) { + return cb(new Error("Stream finished in an invalid state, uncompression failed")); } - return val2; - } - 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; - } + setImmediate(cb); + }; + module2.exports = UnzipStream; } }); -// node_modules/unzip-stream/lib/matcher-stream.js -var require_matcher_stream = __commonJS({ - "node_modules/unzip-stream/lib/matcher-stream.js"(exports2, module2) { +// node_modules/unzip-stream/lib/parser-stream.js +var require_parser_stream = __commonJS({ + "node_modules/unzip-stream/lib/parser-stream.js"(exports2, module2) { var Transform = require("stream").Transform; var util = require("util"); - function MatcherStream(patternDesc, matchFn) { - if (!(this instanceof MatcherStream)) { - return new MatcherStream(); + var UnzipStream = require_unzip_stream(); + function ParserStream(opts) { + if (!(this instanceof ParserStream)) { + return new ParserStream(opts); } - Transform.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; + var transformOpts = opts || {}; + Transform.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); + }); } - util.inherits(MatcherStream, Transform); - MatcherStream.prototype.checkDataChunk = function(ignoreMatchZero) { - var enoughData = this.data.length >= this.requiredLength; - if (!enoughData) { - return; + util.inherits(ParserStream, Transform); + 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 Transform.prototype.on.call(this, "data", fn); } - 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; + return Transform.prototype.on.call(this, eventName, fn); + }; + ParserStream.prototype.drainAll = function() { + this.unzipStream.drainAll(); + return this.pipe(new Transform({ 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 path2 = require("path"); + var fs2 = 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 }; } - 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; + var mode = opts.mode; + var xfs = opts.fs || fs2; + if (mode === void 0) { + mode = _0777; } - if (matchIndex > 0) { - var packet = this.data.slice(0, matchIndex); - this.data = this.data.slice(matchIndex); - this.push(packet); - this.bytesSoFar += matchIndex; + if (!made) made = null; + var cb = f || /* istanbul ignore next */ + function() { + }; + p = path2.resolve(p); + xfs.mkdir(p, mode, function(er) { + if (!er) { + made = made || p; + return cb(null, made); + } + switch (er.code) { + case "ENOENT": + if (path2.dirname(p) === p) return cb(er); + mkdirP(path2.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, stat) { + if (er2 || !stat.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 finished = this.matchFn ? this.matchFn(this.data, this.bytesSoFar) : true; - if (finished) { - this.data = new Buffer(""); - return; + var mode = opts.mode; + var xfs = opts.fs || fs2; + if (mode === void 0) { + mode = _0777; } - 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; + if (!made) made = null; + p = path2.resolve(p); + try { + xfs.mkdirSync(p, mode); + made = made || p; + } catch (err0) { + switch (err0.code) { + case "ENOENT": + made = sync(path2.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 stat; + try { + stat = xfs.statSync(p); + } catch (err1) { + throw err0; + } + if (!stat.isDirectory()) throw err0; + break; + } } - cb(); + return made; + }; + } +}); + +// node_modules/unzip-stream/lib/extract.js +var require_extract2 = __commonJS({ + "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { + var fs2 = require("fs"); + var path2 = require("path"); + var util = require("util"); + var mkdirp = require_mkdirp(); + var Transform = require("stream").Transform; + var UnzipStream = require_unzip_stream(); + function Extract(opts) { + if (!(this instanceof Extract)) + return new Extract(opts); + Transform.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); + }); + } + util.inherits(Extract, Transform); + Extract.prototype._transform = function(chunk, encoding, cb) { + this.unzipStream.write(chunk, encoding, cb); }; - MatcherStream.prototype._flush = function(cb) { - if (this.data.length > 0) { - var firstIteration = true; - while (this.checkDataChunk(!firstIteration)) { - firstIteration = false; + 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 = path2.join(this.opts.path, entry.path); + var directory = entry.isDirectory ? destPath : path2.dirname(destPath); + this.unfinishedEntries++; + var writeFileFn = function() { + var pipedStream = fs2.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(); } - if (this.data.length > 0) { - this.push(this.data); - this.data = null; + 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; } - cb(); }; - module2.exports = MatcherStream; + module2.exports = Extract; } }); -// node_modules/unzip-stream/lib/entry.js -var require_entry = __commonJS({ - "node_modules/unzip-stream/lib/entry.js"(exports2, module2) { +// node_modules/unzip-stream/unzip.js +var require_unzip = __commonJS({ + "node_modules/unzip-stream/unzip.js"(exports2) { "use strict"; - var stream = require("stream"); - var inherits = require("util").inherits; - function Entry() { - if (!(this instanceof Entry)) { - return new Entry(); - } - stream.PassThrough.call(this); - this.path = null; - this.type = null; - this.isDirectory = false; - } - inherits(Entry, stream.PassThrough); - Entry.prototype.autodrain = function() { - return this.pipe(new stream.Transform({ transform: function(d, e, cb) { - cb(); - } })); - }; - module2.exports = Entry; + exports2.Parse = require_parser_stream(); + exports2.Extract = require_extract2(); } }); -// node_modules/unzip-stream/lib/unzip-stream.js -var require_unzip_stream = __commonJS({ - "node_modules/unzip-stream/lib/unzip-stream.js"(exports2, module2) { +// 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 binary2 = require_binary(); - var stream = require("stream"); - var util = require("util"); - var zlib = 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); - } - stream.Transform.call(this); - this.options = options || {}; - this.data = new Buffer(""); - this.state = states.STREAM_START; - this.skippedBytes = 0; - this.parsedEntity = null; - this.outStreamInfo = {}; - } - util.inherits(UnzipStream, stream.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 __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]; + } }; } - var chunkLength = chunk.length; - if (chunkLength < requiredLength) { - return 0; + 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(resolve2) { + resolve2(value); + }); } - 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 path2 = 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) { - path2 = 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: path2, - 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); + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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()); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; - } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - 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]); + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.streamExtractExternal = streamExtractExternal; + exports2.downloadArtifactPublic = downloadArtifactPublic; + exports2.downloadArtifactInternal = downloadArtifactInternal; + var promises_1 = __importDefault2(require("fs/promises")); + var crypto2 = __importStar2(require("crypto")); + var stream = __importStar2(require("stream")); + var github2 = __importStar2(require_github()); + var core14 = __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_util10(); + var errors_1 = require_errors3(); + var scrubQueryParameters = (url) => { + const parsed = new URL(url); + parsed.search = ""; + return parsed.toString(); + }; + function exists(path2) { + return __awaiter2(this, void 0, void 0, function* () { + try { + yield promises_1.default.access(path2); + return true; + } catch (error3) { + if (error3.code === "ENOENT") { + return false; } else { - self2.data = matchedChunk.slice(sliceOffset); + throw error3; } - return true; - }); - this.outStreamInfo.stream = matcherStream; - } else { - this.outStreamInfo.stream = new stream.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)); + } + }); + } + function streamExtract(url, directory) { + return __awaiter2(this, void 0, void 0, function* () { + let retryCount = 0; + while (retryCount < 5) { + try { + return yield streamExtractExternal(url, directory); + } catch (error3) { + retryCount++; + core14.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); + yield new Promise((resolve2) => setTimeout(resolve2, 5e3)); + } + } + throw new Error(`Artifact download failed after ${retryCount} retries.`); + }); + } + function streamExtractExternal(url_1, directory_1) { + return __awaiter2(this, arguments, void 0, function* (url, directory, opts = { timeout: 30 * 1e3 }) { + const client = new httpClient.HttpClient((0, user_agent_1.getUserAgentString)()); + const response = yield client.get(url); + 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((resolve2, 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 = crypto2.createHash("sha256").setEncoding("hex"); + const passThrough = new stream.PassThrough(); + response.message.pipe(passThrough); + passThrough.pipe(hashStream); + const extractStream = passThrough; + extractStream.on("data", () => { + timer.refresh(); + }).on("error", (error3) => { + core14.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(); + core14.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); + } + resolve2({ sha256Digest: `sha256:${sha256Digest}` }); + }).on("error", (error3) => { + reject(error3); + }); }); - this.outStreamInfo.stream.pipe(new Entry().autodrain()); - return; - } - var isCompressed = vars.compressionMethod > 0; - if (isCompressed) { - var inflater = zlib.createInflateRaw(); - inflater.on("error", function(err) { - self2.state = states.ERROR; - self2.emit("error", err); + }); + } + 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 = github2.getOctokit(token); + let digestMismatch = false; + core14.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" + } }); - 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 = binary2.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 index = 0; - while (index < data.length) { - var vars = binary2.parse(data).skip(index).word16lu("extraId").word16lu("extraSize").vars; - index += 4; - var fieldType = void 0; - switch (vars.extraId) { - case 1: - fieldType = "Zip64 extended information extra field"; - var z64vars = binary2.parse(data.slice(index, index + 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(index); - var offset = 1; - if (vars.extraSize >= offset + 4 && timestampFields & 1) { - extra.mtime = new Date(data.readUInt32LE(index + offset) * 1e3); - offset += 4; - } - if (vars.extraSize >= offset + 4 && timestampFields & 2) { - extra.atime = new Date(data.readUInt32LE(index + offset) * 1e3); - offset += 4; - } - if (vars.extraSize >= offset + 4 && timestampFields & 4) { - extra.ctime = new Date(data.readUInt32LE(index + offset) * 1e3); - } - break; - case 28789: - fieldType = "Info-ZIP Unicode Path Extra Field"; - var fieldVer = data.readUInt8(index); - if (fieldVer === 1) { - var offset = 1; - var nameCrc32 = data.readUInt32LE(index + offset); - offset += 4; - var pathBuffer = data.slice(index + 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(index + offset) * 1e3); - offset += 4; - var mtime = new Date(data.readUInt32LE(index + offset) * 1e3); - offset += 4; - extra.atime = atime; - extra.mtime = mtime; - if (vars.extraSize >= 12) { - var uid = data.readUInt16LE(index + offset); - offset += 2; - var gid = data.readUInt16LE(index + 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(index + offset); - offset += 2; - var gid = data.readUInt16LE(index + offset); - offset += 2; - extra.uid = uid; - extra.gid = gid; - } - break; - case 30837: - fieldType = "Info-ZIP New Unix"; - var offset = 0; - var extraVer = data.readUInt8(index); - offset += 1; - if (extraVer === 1) { - var uidSize = data.readUInt8(index + offset); - offset += 1; - if (uidSize <= 6) { - extra.uid = data.readUIntLE(index + offset, uidSize); - } - offset += uidSize; - var gidSize = data.readUInt8(index + offset); - offset += 1; - if (gidSize <= 6) { - extra.gid = data.readUIntLE(index + offset, gidSize); - } + 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`); + } + core14.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); + try { + core14.info(`Starting download of artifact to: ${downloadPath}`); + const extractResponse = yield streamExtract(location, downloadPath); + core14.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; + core14.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core14.debug(`Expected digest: ${options.expectedHash}`); } - break; - case 30062: - fieldType = "ASi Unix"; - var offset = 0; - if (vars.extraSize >= 14) { - var crc = data.readUInt32LE(index + offset); - offset += 4; - var mode = data.readUInt16LE(index + offset); - offset += 2; - var sizdev = data.readUInt32LE(index + offset); - offset += 4; - var uid = data.readUInt16LE(index + offset); - offset += 2; - var gid = data.readUInt16LE(index + offset); - offset += 2; - extra.mode = mode; - extra.uid = uid; - extra.gid = gid; - if (vars.extraSize > 14) { - var start = index + offset; - var end = index + vars.extraSize - 14; - var symlinkName = this._decodeString(data.slice(start, end)); - extra.symlink = symlinkName; - } + } + } catch (error3) { + throw new Error(`Unable to download and extract artifact: ${error3.message}`); + } + return { downloadPath, digestMismatch }; + }); + } + 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) { + core14.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); + core14.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); + try { + core14.info(`Starting download of artifact to: ${downloadPath}`); + const extractResponse = yield streamExtract(signedUrl, downloadPath); + core14.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; + core14.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core14.debug(`Expected digest: ${options.expectedHash}`); } - break; + } + } catch (error3) { + throw new Error(`Unable to download and extract artifact: ${error3.message}`); } - if (this.options.debug) { - result.debug.push({ - extraId: "0x" + vars.extraId.toString(16), - description: fieldType, - data: data.slice(index, index + vars.extraSize).inspect() - }); + return { downloadPath, digestMismatch }; + }); + } + function resolveOrCreateDirectory() { + return __awaiter2(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { + if (!(yield exists(downloadPath))) { + core14.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); + yield promises_1.default.mkdir(downloadPath, { recursive: true }); + } else { + core14.debug(`Artifact destination folder already exists: ${downloadPath}`); } - index += vars.extraSize; + 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]; + } }; } - return result; - }; - UnzipStream.prototype._readDataDescriptor = function(data, zip64Mode) { - if (zip64Mode) { - var vars = binary2.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars; - return vars; + 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.getRetryOptions = getRetryOptions; + var core14 = __importStar2(require_core()); + var defaultMaxRetryNumber = 5; + var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; + function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { + var _a; + if (retries <= 0) { + return [{ enabled: false }, defaultOptions.request]; } - var vars = binary2.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars; - return vars; - }; - UnzipStream.prototype._readCentralDirectoryEntry = function(data) { - var vars = binary2.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 = binary2.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 = binary2.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"); + const retryOptions = { + enabled: true + }; + if (exemptStatusCodes.length > 0) { + retryOptions.doNotRetry = exemptStatusCodes; } - if (this.options.decodeString) { - return this.options.decodeString(buffer); + const requestOptions = Object.assign(Object.assign({}, defaultOptions.request), { retries }); + core14.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : "octokit default: [400, 401, 403, 404, 422]"})`); + return [retryOptions, requestOptions]; + } + } +}); + +// node_modules/@octokit/plugin-request-log/dist-node/index.js +var require_dist_node16 = __commonJS({ + "node_modules/@octokit/plugin-request-log/dist-node/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var VERSION = "1.0.4"; + function requestLog(octokit) { + octokit.hook.wrap("request", (request, options) => { + octokit.log.debug("request", options); + const start = Date.now(); + const requestOptions = octokit.request.endpoint.parse(options); + const path2 = requestOptions.url.replace(options.baseUrl, ""); + return request(options).then((response) => { + octokit.log.info(`${requestOptions.method} ${path2} - ${response.status} in ${Date.now() - start}ms`); + return response; + }).catch((error3) => { + octokit.log.info(`${requestOptions.method} ${path2} - ${error3.status} in ${Date.now() - start}ms`); + throw error3; + }); + }); + } + requestLog.VERSION = VERSION; + exports2.requestLog = requestLog; + } +}); + +// node_modules/@actions/artifact/node_modules/@octokit/plugin-retry/dist-node/index.js +var require_dist_node17 = __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 Bottleneck = _interopDefault(require_light()); + async function errorRequest(octokit, state, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - let result = ""; - for (var i = 0; i < buffer.length; i++) { - result += cp437[buffer[i]]; + 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); } - 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; + throw error3; + } + async function wrapRequest(state, request, options) { + const limiter = new Bottleneck(); + limiter.on("failed", function(error3, info7) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; + options.request.retryCount = info7.retryCount + 1; + if (maxRetries > info7.retryCount) { + return after * state.retryAfterBaseValue; + } + }); + return limiter.schedule(request, options); + } + var VERSION = "3.0.9"; + function retry3(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", errorRequest.bind(null, octokit, state)); + octokit.hook.wrap("request", wrapRequest.bind(null, state)); } - 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(""); + return { + retry: { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { + retries, + retryAfter + }); + return error3; } - 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); + } + }; + } + retry3.VERSION = VERSION; + exports2.VERSION = VERSION; + exports2.retry = retry3; + } +}); + +// 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 || /* @__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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getArtifactPublic = getArtifactPublic; + exports2.getArtifactInternal = getArtifactInternal; + var github_1 = require_github(); + var plugin_retry_1 = require_dist_node17(); + var core14 = __importStar2(require_core()); + var utils_1 = require_utils4(); + var retry_options_1 = require_retry_options(); + var plugin_request_log_1 = require_dist_node16(); + var util_1 = require_util10(); + 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 _a; + 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 github2 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); + const getArtifactResp = yield github2.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} (${(_a = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp.headers) === null || _a === void 0 ? void 0 : _a["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]; + core14.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 } - } 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(); - }); + }; + }); + } + function getArtifactInternal(artifactName) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + 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`); } - 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; + let artifact2 = res.artifacts[0]; + if (res.artifacts.length > 1) { + artifact2 = res.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0]; + core14.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); } - 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; + 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: (_a = artifact2.digest) === null || _a === void 0 ? void 0 : _a.value + } + }; + }); + } } }); -// node_modules/unzip-stream/lib/parser-stream.js -var require_parser_stream = __commonJS({ - "node_modules/unzip-stream/lib/parser-stream.js"(exports2, module2) { - var Transform = require("stream").Transform; - var util = require("util"); - var UnzipStream = require_unzip_stream(); - function ParserStream(opts) { - if (!(this instanceof ParserStream)) { - return new ParserStream(opts); +// 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(resolve2) { + resolve2(value); + }); } - var transformOpts = opts || {}; - Transform.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(error4) { - self2.emit("error", error4); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - util.inherits(ParserStream, Transform); - 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"); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.deleteArtifactPublic = deleteArtifactPublic; + exports2.deleteArtifactInternal = deleteArtifactInternal; + var core_1 = require_core(); + var github_1 = require_github(); + var user_agent_1 = require_user_agent2(); + var retry_options_1 = require_retry_options(); + var utils_1 = require_utils4(); + var plugin_request_log_1 = require_dist_node16(); + var plugin_retry_1 = require_dist_node17(); + var artifact_twirp_client_1 = require_artifact_twirp_client2(); + var util_1 = require_util10(); + 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 _a; + 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 github2 = (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 github2.rest.actions.deleteArtifact({ + owner: repositoryOwner, + repo: repositoryName, + artifact_id: getArtifactResp.artifact.id }); - cb(); + if (deleteArtifactResp.status !== 204) { + throw new errors_1.InvalidResponseError(`Invalid response from GitHub API: ${deleteArtifactResp.status} (${(_a = deleteArtifactResp === null || deleteArtifactResp === void 0 ? void 0 : deleteArtifactResp.headers) === null || _a === void 0 ? void 0 : _a["x-github-request-id"]})`); + } + return { + id: getArtifactResp.artifact.id + }; }); - }; - ParserStream.prototype.on = function(eventName, fn) { - if (eventName === "entry") { - return Transform.prototype.on.call(this, "data", fn); - } - return Transform.prototype.on.call(this, eventName, fn); - }; - ParserStream.prototype.drainAll = function() { - this.unzipStream.drainAll(); - return this.pipe(new Transform({ 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 path2 = require("path"); - var fs2 = 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 || fs2; - if (mode === void 0) { - mode = _0777; - } - if (!made) made = null; - var cb = f || /* istanbul ignore next */ - function() { - }; - p = path2.resolve(p); - xfs.mkdir(p, mode, function(er) { - if (!er) { - made = made || p; - return cb(null, made); + } + 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}`); } - switch (er.code) { - case "ENOENT": - if (path2.dirname(p) === p) return cb(er); - mkdirP(path2.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, stat) { - if (er2 || !stat.isDirectory()) cb(er, made); - else cb(null, made); - }); - break; + 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) + }; }); } - mkdirP.sync = function sync(p, opts, made) { - if (!opts || typeof opts !== "object") { - opts = { mode: opts }; - } - var mode = opts.mode; - var xfs = opts.fs || fs2; - if (mode === void 0) { - mode = _0777; - } - if (!made) made = null; - p = path2.resolve(p); - try { - xfs.mkdirSync(p, mode); - made = made || p; - } catch (err0) { - switch (err0.code) { - case "ENOENT": - made = sync(path2.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 stat; - try { - stat = xfs.statSync(p); - } catch (err1) { - throw err0; - } - if (!stat.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 fs2 = require("fs"); - var path2 = require("path"); - var util = require("util"); - var mkdirp = require_mkdirp(); - var Transform = require("stream").Transform; - var UnzipStream = require_unzip_stream(); - function Extract(opts) { - if (!(this instanceof Extract)) - return new Extract(opts); - Transform.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(error4) { - self2.emit("error", error4); - }); - } - util.inherits(Extract, Transform); - 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"); +// 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(resolve2) { + resolve2(value); }); - cb(); - }; - this.unzipStream.end(function() { - if (self2.unfinishedEntries > 0) { - self2.afterFlushWait = true; - return self2.on("await-finished", allDone); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - allDone(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Extract.prototype._processEntry = function(entry) { - var self2 = this; - var destPath = path2.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path2.dirname(destPath); - this.unfinishedEntries++; - var writeFileFn = function() { - var pipedStream = fs2.createWriteStream(destPath); - pipedStream.on("close", function() { - self2.unfinishedEntries--; - self2._notifyAwaiter(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.listArtifactsPublic = listArtifactsPublic; + exports2.listArtifactsInternal = listArtifactsInternal; + var core_1 = require_core(); + var github_1 = require_github(); + var user_agent_1 = require_user_agent2(); + var retry_options_1 = require_retry_options(); + var utils_1 = require_utils4(); + var plugin_request_log_1 = require_dist_node16(); + var plugin_retry_1 = require_dist_node17(); + var artifact_twirp_client_1 = require_artifact_twirp_client2(); + var util_1 = require_util10(); + 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 github2 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); + let currentPageNumber = 1; + const { data: listArtifactResponse } = yield github2.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { + owner: repositoryOwner, + repo: repositoryName, + run_id: workflowRunId, + per_page: paginationCount, + page: currentPageNumber }); - pipedStream.on("error", function(error4) { - self2.emit("error", error4); + 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 github2.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 + }; + }); + } + 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 _a; + return { + name: artifact2.name, + id: Number(artifact2.databaseId), + size: Number(artifact2.size), + createdAt: artifact2.createdAt ? generated_1.Timestamp.toDate(artifact2.createdAt) : void 0, + digest: (_a = artifact2.digest) === null || _a === void 0 ? void 0 : _a.value + }; }); - 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; + if (latest) { + artifacts = filterLatest(artifacts); + } + (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); + return { + artifacts + }; + }); + } + 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); } - 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(); + return latestArtifacts; + } } }); -// 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) { +// node_modules/@actions/artifact/lib/internal/client.js +var require_client2 = __commonJS({ + "node_modules/@actions/artifact/lib/internal/client.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -107869,202 +113941,209 @@ var require_download_artifact = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + 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.streamExtractExternal = streamExtractExternal; - exports2.downloadArtifactPublic = downloadArtifactPublic; - exports2.downloadArtifactInternal = downloadArtifactInternal; - var promises_1 = __importDefault4(require("fs/promises")); - var crypto = __importStar4(require("crypto")); - var stream = __importStar4(require("stream")); - var github2 = __importStar4(require_github()); - var core14 = __importStar4(require_core()); - var httpClient = __importStar4(require_lib5()); - var unzip_stream_1 = __importDefault4(require_unzip()); - var user_agent_1 = require_user_agent2(); + exports2.DefaultArtifactClient = void 0; + var core_1 = require_core(); 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 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 scrubQueryParameters = (url) => { - const parsed = new URL(url); - parsed.search = ""; - return parsed.toString(); - }; - function exists(path2) { - return __awaiter4(this, void 0, void 0, function* () { - try { - yield promises_1.default.access(path2); - return true; - } catch (error4) { - if (error4.code === "ENOENT") { - return false; - } else { - throw error4; - } - } - }); - } - function streamExtract(url, directory) { - return __awaiter4(this, void 0, void 0, function* () { - let retryCount = 0; - while (retryCount < 5) { + var DefaultArtifactClient2 = class { + uploadArtifact(name, files, rootDirectory, options) { + return __awaiter2(this, void 0, void 0, function* () { try { - return yield streamExtractExternal(url, directory); - } catch (error4) { - retryCount++; - core14.debug(`Failed to download artifact after ${retryCount} retries due to ${error4.message}. Retrying in 5 seconds...`); - yield new Promise((resolve2) => setTimeout(resolve2, 5e3)); + 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; } - } - throw new Error(`Artifact download failed after ${retryCount} retries.`); - }); - } - function streamExtractExternal(url_1, directory_1) { - return __awaiter4(this, arguments, void 0, function* (url, directory, opts = { timeout: 30 * 1e3 }) { - const client = new httpClient.HttpClient((0, user_agent_1.getUserAgentString)()); - const response = yield client.get(url); - 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((resolve2, 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 = crypto.createHash("sha256").setEncoding("hex"); - const passThrough = new stream.PassThrough(); - response.message.pipe(passThrough); - passThrough.pipe(hashStream); - const extractStream = passThrough; - extractStream.on("data", () => { - timer.refresh(); - }).on("error", (error4) => { - core14.debug(`response.message: Artifact download failed: ${error4.message}`); - clearTimeout(timer); - reject(error4); - }).pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", () => { - clearTimeout(timer); - if (hashStream) { - hashStream.end(); - sha256Digest = hashStream.read(); - core14.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); + }); + } + downloadArtifact(artifactId, options) { + return __awaiter2(this, void 0, void 0, function* () { + try { + if ((0, config_1.isGhes)()) { + throw new errors_1.GHESNotSupportedError(); } - resolve2({ sha256Digest: `sha256:${sha256Digest}` }); - }).on("error", (error4) => { - reject(error4); - }); + 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; + } }); - }); - } - function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, options) { - return __awaiter4(this, void 0, void 0, function* () { - const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); - const api = github2.getOctokit(token); - let digestMismatch = false; - core14.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" + } + 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; } }); - 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`); - } - core14.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); - try { - core14.info(`Starting download of artifact to: ${downloadPath}`); - const extractResponse = yield streamExtract(location, downloadPath); - core14.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; - core14.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core14.debug(`Expected digest: ${options.expectedHash}`); + } + 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; } - } catch (error4) { - throw new Error(`Unable to download and extract artifact: ${error4.message}`); - } - return { downloadPath, digestMismatch }; - }); - } - function downloadArtifactInternal(artifactId, options) { - return __awaiter4(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) { - core14.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); - core14.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); - try { - core14.info(`Starting download of artifact to: ${downloadPath}`); - const extractResponse = yield streamExtract(signedUrl, downloadPath); - core14.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; - core14.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core14.debug(`Expected digest: ${options.expectedHash}`); + }); + } + 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; } - } catch (error4) { - throw new Error(`Unable to download and extract artifact: ${error4.message}`); - } - return { downloadPath, digestMismatch }; - }); + }); + } + }; + 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_utils9 = __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); } - function resolveOrCreateDirectory() { - return __awaiter4(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { - if (!(yield exists(downloadPath))) { - core14.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); - yield promises_1.default.mkdir(downloadPath, { recursive: true }); - } else { - core14.debug(`Artifact destination folder already exists: ${downloadPath}`); - } - return downloadPath; - }); + 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/lib/internal/find/retry-options.js -var require_retry_options = __commonJS({ - "node_modules/@actions/artifact/lib/internal/find/retry-options.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -108077,146 +114156,227 @@ var require_retry_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); + 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 = getRetryOptions; - var core14 = __importStar4(require_core()); - var defaultMaxRetryNumber = 5; - var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; - function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { - var _a; - if (retries <= 0) { - return [{ enabled: false }, defaultOptions.request]; + exports2.issue = exports2.issueCommand = void 0; + var os = __importStar2(require("os")); + var utils_1 = require_utils9(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.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; } - const retryOptions = { - enabled: true - }; - if (exemptStatusCodes.length > 0) { - retryOptions.doNotRetry = exemptStatusCodes; + 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; } - const requestOptions = Object.assign(Object.assign({}, defaultOptions.request), { retries }); - core14.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : "octokit default: [400, 401, 403, 404, 422]"})`); - return [retryOptions, requestOptions]; + }; + 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/@octokit/plugin-request-log/dist-node/index.js -var require_dist_node16 = __commonJS({ - "node_modules/@octokit/plugin-request-log/dist-node/index.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __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 }); - var VERSION = "1.0.4"; - function requestLog(octokit) { - octokit.hook.wrap("request", (request, options) => { - octokit.log.debug("request", options); - const start = Date.now(); - const requestOptions = octokit.request.endpoint.parse(options); - const path2 = requestOptions.url.replace(options.baseUrl, ""); - return request(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path2} - ${response.status} in ${Date.now() - start}ms`); - return response; - }).catch((error4) => { - octokit.log.info(`${requestOptions.method} ${path2} - ${error4.status} in ${Date.now() - start}ms`); - throw error4; - }); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs2 = __importStar2(require("fs")); + var os = __importStar2(require("os")); + var utils_1 = require_utils9(); + 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 (!fs2.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + encoding: "utf8" }); } - requestLog.VERSION = VERSION; - exports2.requestLog = requestLog; + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.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}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/artifact/node_modules/@octokit/plugin-retry/dist-node/index.js -var require_dist_node17 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@octokit/plugin-retry/dist-node/index.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - function _interopDefault(ex) { - return ex && typeof ex === "object" && "default" in ex ? ex["default"] : ex; + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; + } } - var Bottleneck = _interopDefault(require_light()); - async function errorRequest(octokit, state, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.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(error4, retries, retryAfter); + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - throw error4; - } - async function wrapRequest(state, request, options) { - const limiter = new Bottleneck(); - limiter.on("failed", function(error4, info7) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; - options.request.retryCount = info7.retryCount + 1; - if (maxRetries > info7.retryCount) { - return after * state.retryAfterBaseValue; - } - }); - return limiter.schedule(request, options); - } - var VERSION = "3.0.9"; - function retry3(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", errorRequest.bind(null, octokit, state)); - octokit.hook.wrap("request", wrapRequest.bind(null, state)); + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - return { - retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { - retries, - retryAfter - }); - return error4; - } + 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; } - retry3.VERSION = VERSION; - exports2.VERSION = VERSION; - exports2.retry = retry3; + 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(url, base) { + super(url, 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/lib/internal/find/get-artifact.js -var require_get_artifact = __commonJS({ - "node_modules/@actions/artifact/lib/internal/find/get-artifact.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js +var require_lib6 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -108229,153 +114389,613 @@ var require_get_artifact = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); + 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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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((resolve2) => __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", () => { + resolve2(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve2(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(userAgent, 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 = userAgent; + 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, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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 info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, 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(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve2(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; + } + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.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: ${info7.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 info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + return info7; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getArtifactPublic = getArtifactPublic; - exports2.getArtifactInternal = getArtifactInternal; - var github_1 = require_github(); - var plugin_retry_1 = require_dist_node17(); - var core14 = __importStar4(require_core()); - var utils_1 = require_utils4(); - var retry_options_1 = require_retry_options(); - var plugin_request_log_1 = require_dist_node16(); - 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 __awaiter4(this, void 0, void 0, function* () { - var _a; - 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 github2 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); - const getArtifactResp = yield github2.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} (${(_a = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp.headers) === null || _a === void 0 ? void 0 : _a["x-github-request-id"]})`); + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - 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`); + if (!useProxy) { + agent = this._agent; } - let artifact2 = getArtifactResp.data.artifacts[0]; - if (getArtifactResp.data.artifacts.length > 1) { - artifact2 = getArtifactResp.data.artifacts.sort((a, b) => b.id - a.id)[0]; - core14.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.id})`); + if (agent) { + return agent; } - 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 + 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; } - }; - }); - } - function getArtifactInternal(artifactName) { - return __awaiter4(this, void 0, void 0, function* () { - var _a; - 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`); + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } - let artifact2 = res.artifacts[0]; - if (res.artifacts.length > 1) { - artifact2 = res.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0]; - core14.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); + this._agent = agent; } - 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: (_a = artifact2.digest) === null || _a === void 0 ? void 0 : _a.value - } - }; - }); - } + 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((resolve2) => setTimeout(() => resolve2(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve2(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 { + resolve2(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -108403,84 +115023,83 @@ var require_delete_artifact = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.deleteArtifactPublic = deleteArtifactPublic; - exports2.deleteArtifactInternal = deleteArtifactInternal; - var core_1 = require_core(); - var github_1 = require_github(); - var user_agent_1 = require_user_agent2(); - var retry_options_1 = require_retry_options(); - var utils_1 = require_utils4(); - var plugin_request_log_1 = require_dist_node16(); - var plugin_retry_1 = require_dist_node17(); - 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 __awaiter4(this, void 0, void 0, function* () { - var _a; - 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 github2 = (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 github2.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} (${(_a = deleteArtifactResp === null || deleteArtifactResp === void 0 ? void 0 : deleteArtifactResp.headers) === null || _a === void 0 ? void 0 : _a["x-github-request-id"]})`); + 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"); } - return { - id: getArtifactResp.artifact.id - }; - }); - } - function deleteArtifactInternal(artifactName) { - return __awaiter4(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}`); + 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"); } - 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})`); + 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"); } - 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) - }; - }); - } + 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/lib/internal/find/list-artifacts.js -var require_list_artifacts = __commonJS({ - "node_modules/@actions/artifact/lib/internal/find/list-artifacts.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -108508,135 +115127,77 @@ var require_list_artifacts = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.listArtifactsPublic = listArtifactsPublic; - exports2.listArtifactsInternal = listArtifactsInternal; - var core_1 = require_core(); - var github_1 = require_github(); - var user_agent_1 = require_user_agent2(); - var retry_options_1 = require_retry_options(); - var utils_1 = require_utils4(); - var plugin_request_log_1 = require_dist_node16(); - var plugin_retry_1 = require_dist_node17(); - 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 __awaiter4(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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib6(); + var auth_1 = require_auth3(); + var core_1 = require_core4(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - const github2 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); - let currentPageNumber = 1; - const { data: listArtifactResponse } = yield github2.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; + 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"); } - 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 - }); + 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"); } - currentPageNumber++; - for (currentPageNumber; currentPageNumber <= numberOfPages; currentPageNumber++) { - (0, core_1.debug)(`Fetching page ${currentPageNumber} of artifact list`); - const { data: listArtifactResponse2 } = yield github2.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { - owner: repositoryOwner, - repo: repositoryName, - run_id: workflowRunId, - per_page: paginationCount, - page: currentPageNumber + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + 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}`); }); - 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 - }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.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}`); } - } - if (latest) { - artifacts = filterLatest(artifacts); - } - (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); - return { - artifacts - }; - }); - } - function listArtifactsInternal() { - return __awaiter4(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 _a; - return { - name: artifact2.name, - id: Number(artifact2.databaseId), - size: Number(artifact2.size), - createdAt: artifact2.createdAt ? generated_1.Timestamp.toDate(artifact2.createdAt) : void 0, - digest: (_a = artifact2.digest) === null || _a === void 0 ? void 0 : _a.value - }; }); - if (latest) { - artifacts = filterLatest(artifacts); - } - (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); - return { - artifacts - }; - }); - } - 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; - } + }; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/artifact/lib/internal/client.js -var require_client2 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/client.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -108663,147 +115224,274 @@ var require_client2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __rest4 = 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 __awaiter4(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 (error4) { - (0, core_1.warning)(`Artifact upload failed with error: ${error4}. - -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 error4; - } - }); + 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 = ""; } - downloadArtifact(artifactId, options) { - return __awaiter4(this, void 0, void 0, function* () { + /** + * 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 { - 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 = __rest4(options, ["findBy"]); - return (0, download_artifact_1.downloadArtifactPublic)(artifactId, repositoryOwner, repositoryName, token, downloadOptions); - } - return (0, download_artifact_1.downloadArtifactInternal)(artifactId, options); - } catch (error4) { - (0, core_1.warning)(`Download Artifact failed with error: ${error4}. - -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 error4; + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } + this._filePath = pathFromEnv; + return this._filePath; }); } - listArtifacts(options) { - return __awaiter4(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 (error4) { - (0, core_1.warning)(`Listing Artifacts failed with error: ${error4}. - -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 error4; - } + /** + * 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(); }); } - getArtifact(artifactName, options) { - return __awaiter4(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 (error4) { - (0, core_1.warning)(`Get Artifact failed with error: ${error4}. - -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 error4; - } + /** + * 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 }); }); } - deleteArtifact(artifactName, options) { - return __awaiter4(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); + /** + * 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); } - return (0, delete_artifact_1.deleteArtifactInternal)(artifactName); - } catch (error4) { - (0, core_1.warning)(`Delete Artifact failed with error: ${error4}. - -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 error4; - } - }); + 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(); } }; - 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 }); + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/artifact/lib/artifact.js -var require_artifact2 = __commonJS({ - "node_modules/@actions/artifact/lib/artifact.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -108816,667 +115504,971 @@ var require_artifact2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); + 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 }); - var client_1 = require_client2(); - __exportStar4(require_interfaces2(), exports2); - __exportStar4(require_errors3(), exports2); - __exportStar4(require_client2(), exports2); - var client = new client_1.DefaultArtifactClient(); - exports2.default = client; + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path2 = __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, path2.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io-util.js +var require_io_util3 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkArtifactFilePath = exports2.checkArtifactName = 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 checkArtifactName(name) { - if (!name) { - throw new Error(`Artifact name: ${name}, is incorrectly provided`); + 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); } - 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.`); - } + __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(resolve2) { + resolve2(value); + }); } - (0, core_1.info)(`Artifact name is valid!`); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + 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 fs2 = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); + _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs2.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.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path2) { - if (!path2) { - throw new Error(`Artifact path: ${path2}, is incorrectly provided`); + 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'); } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path2.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path2}. 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. - `); + 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 = path2.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 = path2.dirname(filePath); + const upperName = path2.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path2.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, "/"); } - exports2.checkArtifactFilePath = checkArtifactFilePath; + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; } }); -// 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) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io.js +var require_io3 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUploadSpecification = void 0; - var fs2 = __importStar4(require("fs")); - var core_1 = require_core(); - 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 (!fs2.existsSync(rootDirectory)) { - throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); - } - if (!fs2.statSync(rootDirectory).isDirectory()) { - throw new Error(`Provided rootDirectory ${rootDirectory} is not a valid directory`); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - rootDirectory = (0, path_1.normalize)(rootDirectory); - rootDirectory = (0, path_1.resolve)(rootDirectory); - for (let file of artifactFiles) { - if (!fs2.existsSync(file)) { - throw new Error(`File ${file} does not exist`); + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (!fs2.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}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(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 path2 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); + 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 ? path2.join(dest, path2.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); } - 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`); + if (path2.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); } - } - return specifications; - } - exports2.getUploadSpecification = getUploadSpecification; - } -}); - -// node_modules/tmp/lib/tmp.js -var require_tmp = __commonJS({ - "node_modules/tmp/lib/tmp.js"(exports2, module2) { - var fs2 = require("fs"); - var os = require("os"); - var path2 = require("path"); - var crypto = require("crypto"); - var _c = { fs: fs2.constants, os: os.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 = os.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 = fs2.rmdirSync.bind(fs2); - var _gracefulCleanup = false; - function rimraf(dirPath, callback) { - return fs2.rm(dirPath, { recursive: true }, callback); - } - function FN_RIMRAF_SYNC(dirPath) { - return fs2.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); - fs2.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); + 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 = path2.join(dest, path2.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(path2.dirname(dest)); + yield ioUtil.rename(source, dest); }); } - function tmpNameSync(options) { - const args = _parseArguments(options), opts = args[0]; - const sanitizedOptions = _assertAndSanitizeOptionsSync(opts); - let tries = sanitizedOptions.tries; - do { - const name = _generateTmpName(sanitizedOptions); + 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 { - fs2.statSync(name); - } catch (e) { - return name; + yield ioUtil.rm(inputPath, { + force: true, + maxRetries: 3, + recursive: true, + retryDelay: 300 + }); + } catch (err) { + throw new Error(`File was unable to be removed ${err}`); } - } 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); - fs2.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { - if (err2) return cb(err2); - if (opts.discardDescriptor) { - return fs2.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)); - } - }); + 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 }); }); } - function fileSync(options) { - const args = _parseArguments(options), opts = args[0]; - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - const name = tmpNameSync(opts); - let fd = fs2.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); - if (opts.discardDescriptor) { - fs2.closeSync(fd); - fd = void 0; - } - return { - name, - fd, - removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true) - }; + exports2.mkdirP = mkdirP; + function which6(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + if (check) { + const result = yield which6(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 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); - fs2.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { - if (err2) return cb(err2); - cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); - }); + exports2.which = which6; + 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(path2.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(path2.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path2.delimiter)) { + if (p) { + directories.push(p); + } + } + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; }); } - function dirSync(options) { - const args = _parseArguments(options), opts = args[0]; - const name = tmpNameSync(opts); - fs2.mkdirSync(name, opts.mode || DIR_MODE); - return { - name, - removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) - }; + 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 _removeFileAsync(fdPath, next) { - const _handler = function(err) { - if (err && !_isENOENT(err)) { - return next(err); + 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 copyFile(srcFile, destFile, force); + } } - next(); - }; - if (0 <= fdPath[0]) - fs2.close(fdPath[0], function() { - fs2.unlink(fdPath[1], _handler); - }); - else fs2.unlink(fdPath[1], _handler); + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - function _removeFileSync(fdPath) { - let rethrownException = null; - try { - if (0 <= fdPath[0]) fs2.closeSync(fdPath[0]); - } catch (e) { - if (!_isEBADF(e) && !_isENOENT(e)) throw e; - } finally { - try { - fs2.unlinkSync(fdPath[1]); - } catch (e) { - if (!_isENOENT(e)) rethrownException = e; + function copyFile(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_toolrunner3 = __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); } - if (rethrownException !== null) { - throw rethrownException; + __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(resolve2) { + resolve2(value); + }); } - } - 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 : fs2.rmdir.bind(fs2); - 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 index = _removeObjects.indexOf(toRemove); - if (index >= 0) _removeObjects.splice(index, 1); - called = true; - if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { - return removeFunction(fileOrDirName); - } else { - return removeFunction(fileOrDirName, next || function() { - }); + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - }; - } - function _garbageCollector() { - if (!_gracefulCleanup) return; - while (_removeObjects.length) { - try { - _removeObjects[0](); - } catch (e) { + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(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 os = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path2 = __importStar2(require("path")); + var io6 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - } - function _randomChars(howMany) { - let value = [], rnd = null; - try { - rnd = crypto.randomBytes(howMany); - } catch (e) { - rnd = crypto.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]; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - return [actualOptions, callback]; - } - function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path2.isAbsolute(name) ? name : path2.join(tmpDir, name); - fs2.stat(pathToResolve, function(err) { - if (err) { - fs2.realpath(path2.dirname(pathToResolve), function(err2, parentDir) { - if (err2) return cb(err2); - cb(null, path2.join(parentDir, path2.basename(pathToResolve))); - }); + _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 { - fs2.realpath(path2, cb); + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - }); - } - function _resolvePathSync(name, tmpDir) { - const pathToResolve = path2.isAbsolute(name) ? name : path2.join(tmpDir, name); - try { - fs2.statSync(pathToResolve); - return fs2.realpathSync(pathToResolve); - } catch (_err) { - const parentDir = fs2.realpathSync(path2.dirname(pathToResolve)); - return path2.join(parentDir, path2.basename(pathToResolve)); + return cmd; } - } - function _generateTmpName(opts) { - const tmpDir = opts.tmpdir; - if (!_isUndefined(opts.name)) { - return path2.join(tmpDir, opts.dir, opts.name); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (!_isUndefined(opts.template)) { - return path2.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - const name = [ - opts.prefix ? opts.prefix : "tmp", - "-", - process.pid, - "-", - _randomChars(12), - opts.postfix ? "-" + opts.postfix : "" - ].join(""); - return path2.join(tmpDir, opts.dir, name); - } - function _assertOptionsBase(options) { - if (!_isUndefined(options.name)) { - const name = options.name; - if (path2.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename = path2.basename(name); - if (basename === ".." || basename === "." || basename !== name) - throw new Error(`name option must not contain a path, found "${name}".`); + _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; } - if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) { - throw new Error(`Invalid template, found "${options.template}".`); + _endsWith(str2, end) { + return str2.endsWith(end); } - if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) { - throw new Error(`Invalid tries, found "${options.tries}".`); + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - 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) ? "" : options.prefix; - options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; - } - function _getRelativePath(option, name, tmpDir, cb) { - if (_isUndefined(name)) return cb(null); - _resolvePath(name, tmpDir, function(err, resolvedPath) { - if (err) return cb(err); - const relativePath = path2.relative(tmpDir, resolvedPath); - if (!resolvedPath.startsWith(tmpDir)) { - return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - cb(null, relativePath); - }); - } - function _getRelativePathSync(option, name, tmpDir) { - if (_isUndefined(name)) return; - const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath = path2.relative(tmpDir, resolvedPath); - if (!resolvedPath.startsWith(tmpDir)) { - throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); + 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(""); } - return relativePath; - } - 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); + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - _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(error4) { - return _isExpectedError(error4, -EBADF, "EBADF"); - } - function _isENOENT(error4) { - return _isExpectedError(error4, -ENOENT, "ENOENT"); - } - function _isExpectedError(error4, errno, code) { - return IS_WIN32 ? error4.code === code : error4.code === code && error4.errno === errno; - } - function setGracefulCleanup() { - _gracefulCleanup = true; - } - function _getTmpDir(options, cb) { - return fs2.realpath(options && options.tmpdir || os.tmpdir(), cb); - } - function _getTmpDirSync(options) { - return fs2.realpathSync(options && options.tmpdir || os.tmpdir()); - } - process.addListener(EXIT, _garbageCollector); - Object.defineProperty(module2.exports, "tmpdir", { - enumerable: true, - configurable: false, - get: function() { - return _getTmpDirSync(); + 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(""); } - }); - 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, path2, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path2, fd, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.file = async (options) => fileWithOptions(options); - module2.exports.withFile = async function withFile(fn, options) { - const { path: path2, fd, cleanup } = await module2.exports.file(options); - try { - return await fn({ path: path2, fd }); - } finally { - await cleanup(); + _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; } - }; - module2.exports.dirSync = tmp.dirSync; - var dirWithOptions = promisify( - (options, cb) => tmp.dir( - options, - (err, path2, cleanup) => err ? cb(err) : cb(void 0, { path: path2, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.dir = async (options) => dirWithOptions(options); - module2.exports.withDir = async function withDir(fn, options) { - const { path: path2, cleanup } = await module2.exports.dir(options); - try { - return await fn({ path: path2 }); - } finally { - await cleanup(); + _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 = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve2, 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) + os.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 { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - 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/node_modules/@actions/http-client/lib/proxy.js -var require_proxy5 = __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; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; + } + arg += c; + escaped = false; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); + } + continue; } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + if (c === "\\" && escaped) { + append(c); + continue; } - } 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; + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; + } + append(c); } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + if (arg.length > 0) { + args.push(arg.trim()); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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; + } } - 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; + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + _debug(message) { + this.emit("debug", message); } - get username() { - return this._decodedUsername; + _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); } - get password() { - return this._decodedPassword; + 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/http-client/lib/index.js -var require_lib7 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -109504,667 +116496,937 @@ var require_lib7 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + 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.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + exports2.exec = exec3; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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; - }); + }; + 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_platform3 = __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]; + } }; } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; + 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); } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); + __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(resolve2) { + resolve2(value); }); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - const req = info7.httpModule.request(info7.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(void 0, res); + function step(result) { + result.done ? resolve2(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_exec3()); + 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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 }); - let socket; - req.on("socket", (sock) => { - socket = sock; + }); + } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/artifact-legacy/node_modules/@actions/core/lib/core.js +var require_core4 = __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(resolve2) { + resolve2(value); }); - req.setTimeout(this._socketTimeout || 3 * 6e4, () => { - if (socket) { - socket.end(); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - handleResult(new Error(`Request timeout: ${info7.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(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils9(); + var os = __importStar2(require("os")); + var path2 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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)); } - /** - * 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); + (0, command_1.issueCommand)("set-env", { name }, convertedVal); + } + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - 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); + process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } - } - return info7; + if (options && options.trimWhitespace === false) { + return val; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + 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; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + process.stdout.write(os.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed; + function isDebug3() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug3; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } - return agent; + return result; + }); + } + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - _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 - }); + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.saveState = saveState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); + } +}); + +// 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_core4(); + 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.`); } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); + (0, core_1.info)(`Artifact name is valid!`); + } + exports2.checkArtifactName = checkArtifactName; + function checkArtifactFilePath(path2) { + if (!path2) { + throw new Error(`Artifact path: ${path2}, is incorrectly provided`); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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 { - resolve2(response); - } - })); - }); + for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { + if (path2.includes(invalidCharacterKey)) { + throw new Error(`Artifact path is not valid: ${path2}. 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.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } + exports2.checkArtifactFilePath = checkArtifactFilePath; } }); -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js -var require_auth4 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 fs2 = __importStar2(require("fs")); + var core_1 = require_core4(); + 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 (!fs2.existsSync(rootDirectory)) { + throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); + } + if (!fs2.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 (!fs2.existsSync(file)) { + throw new Error(`File ${file} does not exist`); + } + if (!fs2.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`); } - function rejected(value) { + } + return specifications; + } + exports2.getUploadSpecification = getUploadSpecification; + } +}); + +// node_modules/tmp/lib/tmp.js +var require_tmp = __commonJS({ + "node_modules/tmp/lib/tmp.js"(exports2, module2) { + var fs2 = require("fs"); + var os = require("os"); + var path2 = require("path"); + var crypto2 = require("crypto"); + var _c = { fs: fs2.constants, os: os.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 = os.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 = fs2.rmdirSync.bind(fs2); + var _gracefulCleanup = false; + function rimraf(dirPath, callback) { + return fs2.rm(dirPath, { recursive: true }, callback); + } + function FN_RIMRAF_SYNC(dirPath) { + return fs2.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 { - step(generator["throw"](value)); - } catch (e) { - reject(e); + const name = _generateTmpName(sanitizedOptions); + fs2.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 { + fs2.statSync(name); + } catch (e) { + return name; } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + } 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); + fs2.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { + if (err2) return cb(err2); + if (opts.discardDescriptor) { + return fs2.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)); + } + }); }); - }; - 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; + } + function fileSync(options) { + const args = _parseArguments(options), opts = args[0]; + const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; + const name = tmpNameSync(opts); + let fd = fs2.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + if (opts.discardDescriptor) { + fs2.closeSync(fd); + fd = void 0; } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + 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); + fs2.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); + fs2.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); } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); + next(); + }; + if (0 <= fdPath[0]) + fs2.close(fdPath[0], function() { + fs2.unlink(fdPath[1], _handler); }); + else fs2.unlink(fdPath[1], _handler); + } + function _removeFileSync(fdPath) { + let rethrownException = null; + try { + if (0 <= fdPath[0]) fs2.closeSync(fdPath[0]); + } catch (e) { + if (!_isEBADF(e) && !_isENOENT(e)) throw e; + } finally { + try { + fs2.unlinkSync(fdPath[1]); + } catch (e) { + if (!_isENOENT(e)) rethrownException = e; + } } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + if (rethrownException !== null) { + throw rethrownException; } - // 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"); + } + 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 : fs2.rmdir.bind(fs2); + 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 index = _removeObjects.indexOf(toRemove); + if (index >= 0) _removeObjects.splice(index, 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) { } - options.headers["Authorization"] = `Bearer ${this.token}`; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + } + function _randomChars(howMany) { + let value = [], rnd = null; + try { + rnd = crypto2.randomBytes(howMany); + } catch (e) { + rnd = crypto2.pseudoRandomBytes(howMany); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + for (let i = 0; i < howMany; i++) { + value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + return value.join(""); + } + function _isUndefined(obj) { + return typeof obj === "undefined"; + } + function _parseArguments(options, callback) { + if (typeof options === "function") { + return [{}, options]; } - // 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"); + 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 = path2.isAbsolute(name) ? name : path2.join(tmpDir, name); + fs2.stat(pathToResolve, function(err) { + if (err) { + fs2.realpath(path2.dirname(pathToResolve), function(err2, parentDir) { + if (err2) return cb(err2); + cb(null, path2.join(parentDir, path2.basename(pathToResolve))); + }); + } else { + fs2.realpath(path2, cb); } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; + }); + } + function _resolvePathSync(name, tmpDir) { + const pathToResolve = path2.isAbsolute(name) ? name : path2.join(tmpDir, name); + try { + fs2.statSync(pathToResolve); + return fs2.realpathSync(pathToResolve); + } catch (_err) { + const parentDir = fs2.realpathSync(path2.dirname(pathToResolve)); + return path2.join(parentDir, path2.basename(pathToResolve)); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + } + function _generateTmpName(opts) { + const tmpDir = opts.tmpdir; + if (!_isUndefined(opts.name)) { + return path2.join(tmpDir, opts.dir, opts.name); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); + if (!_isUndefined(opts.template)) { + return path2.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 path2.join(tmpDir, opts.dir, name); + } + function _assertOptionsBase(options) { + if (!_isUndefined(options.name)) { + const name = options.name; + if (path2.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); + const basename = path2.basename(name); + if (basename === ".." || basename === "." || basename !== name) + throw new Error(`name option must not contain a path, found "${name}".`); + } + if (!_isUndefined(options.template) && !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) ? "" : options.prefix; + options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; + } + function _getRelativePath(option, name, tmpDir, cb) { + if (_isUndefined(name)) return cb(null); + _resolvePath(name, tmpDir, function(err, resolvedPath) { + if (err) return cb(err); + const relativePath = path2.relative(tmpDir, resolvedPath); + if (!resolvedPath.startsWith(tmpDir)) { + return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); + } + cb(null, relativePath); + }); + } + function _getRelativePathSync(option, name, tmpDir) { + if (_isUndefined(name)) return; + const resolvedPath = _resolvePathSync(name, tmpDir); + const relativePath = path2.relative(tmpDir, resolvedPath); + if (!resolvedPath.startsWith(tmpDir)) { + throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); + } + return relativePath; + } + 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 fs2.realpath(options && options.tmpdir || os.tmpdir(), cb); + } + function _getTmpDirSync(options) { + return fs2.realpathSync(options && options.tmpdir || os.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, path2, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path2, fd, cleanup: promisify(cleanup) }) + ) + ); + module2.exports.file = async (options) => fileWithOptions(options); + module2.exports.withFile = async function withFile(fn, options) { + const { path: path2, fd, cleanup } = await module2.exports.file(options); + try { + return await fn({ path: path2, fd }); + } finally { + await cleanup(); } }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + module2.exports.dirSync = tmp.dirSync; + var dirWithOptions = promisify( + (options, cb) => tmp.dir( + options, + (err, path2, cleanup) => err ? cb(err) : cb(void 0, { path: path2, cleanup: promisify(cleanup) }) + ) + ); + module2.exports.dir = async (options) => dirWithOptions(options); + module2.exports.withDir = async function withDir(fn, options) { + const { path: path2, cleanup } = await module2.exports.dir(options); + try { + return await fn({ path: path2 }); + } finally { + await cleanup(); + } + }; + module2.exports.tmpNameSync = tmp.tmpNameSync; + module2.exports.tmpName = promisify(tmp.tmpName); + module2.exports.tmpdir = tmp.tmpdir; + module2.exports.setGracefulCleanup = tmp.setGracefulCleanup; } }); @@ -110540,10 +117802,10 @@ var require_crc64 = __commonJS({ }); // node_modules/@actions/artifact-legacy/lib/internal/utils.js -var require_utils7 = __commonJS({ +var require_utils10 = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -110570,18 +117832,18 @@ var require_utils7 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + 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 = __importDefault4(require("crypto")); + var crypto_1 = __importDefault2(require("crypto")); var fs_1 = require("fs"); - var core_1 = require_core(); - var http_client_1 = require_lib7(); - var auth_1 = require_auth4(); + var core_1 = require_core4(); + var http_client_1 = require_lib6(); + var auth_1 = require_auth3(); var config_variables_1 = require_config_variables(); - var crc64_1 = __importDefault4(require_crc64()); + var crc64_1 = __importDefault2(require_crc64()); function getExponentialRetryTimeInMilliseconds(retryCount) { if (retryCount < 0) { throw new Error("RetryCount should not be negative"); @@ -110727,7 +117989,7 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.displayHttpDiagnostics = displayHttpDiagnostics; function createDirectoriesForArtifact(directories) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { for (const directory of directories) { yield fs_1.promises.mkdir(directory, { recursive: true @@ -110737,7 +117999,7 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.createDirectoriesForArtifact = createDirectoriesForArtifact; function createEmptyFilesForArtifact(emptyFilesToCreate) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { for (const filePath of emptyFilesToCreate) { yield (yield fs_1.promises.open(filePath, "w")).close(); } @@ -110745,7 +118007,7 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.createEmptyFilesForArtifact = createEmptyFilesForArtifact; function getFileSize(filePath) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -110753,7 +118015,7 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.getFileSize = getFileSize; function rmFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { yield fs_1.promises.unlink(filePath); }); } @@ -110774,13 +118036,13 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.getProperRetention = getProperRetention; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } exports2.sleep = sleep; function digestForStream(stream) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { const crc64 = new crc64_1.default(); const md5 = crypto_1.default.createHash("md5"); @@ -110804,7 +118066,7 @@ var require_status_reporter = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.StatusReporter = void 0; - var core_1 = require_core(); + var core_1 = require_core4(); var StatusReporter = class { constructor(displayFrequencyInMilliseconds) { this.totalNumberOfFilesToProcess = 0; @@ -110850,7 +118112,7 @@ var require_http_manager = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.HttpManager = void 0; - var utils_1 = require_utils7(); + var utils_1 = require_utils10(); var HttpManager = class { constructor(clientCount, userAgent) { if (clientCount < 1) { @@ -110882,7 +118144,7 @@ var require_http_manager = __commonJS({ var require_upload_gzip = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/upload-gzip.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -110895,21 +118157,21 @@ var require_upload_gzip = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -110936,7 +118198,7 @@ var require_upload_gzip = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = exports2 && exports2.__asyncValues || function(o) { + 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() { @@ -110957,8 +118219,8 @@ var require_upload_gzip = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; - var fs2 = __importStar4(require("fs")); - var zlib = __importStar4(require("zlib")); + var fs2 = __importStar2(require("fs")); + var zlib = __importStar2(require("zlib")); var util_1 = require("util"); var stat = (0, util_1.promisify)(fs2.stat); var gzipExemptFileExtensions = [ @@ -110986,7 +118248,7 @@ var require_upload_gzip = __commonJS({ // 7ZIP ]; function createGZipFileOnDisk(originalFilePath, tempFilePath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { for (const gzipExemptExtension of gzipExemptFileExtensions) { if (originalFilePath.endsWith(gzipExemptExtension)) { return Number.MAX_SAFE_INTEGER; @@ -110997,28 +118259,28 @@ var require_upload_gzip = __commonJS({ const gzip = zlib.createGzip(); const outputStream = fs2.createWriteStream(tempFilePath); inputStream.pipe(gzip).pipe(outputStream); - outputStream.on("finish", () => __awaiter4(this, void 0, void 0, function* () { + outputStream.on("finish", () => __awaiter2(this, void 0, void 0, function* () { const size = (yield stat(tempFilePath)).size; resolve2(size); })); - outputStream.on("error", (error4) => { - console.log(error4); - reject(error4); + outputStream.on("error", (error3) => { + console.log(error3); + reject(error3); }); }); }); } exports2.createGZipFileOnDisk = createGZipFileOnDisk; function createGZipFileInBuffer(originalFilePath) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { var _a, e_1, _b, _c; const inputStream = fs2.createReadStream(originalFilePath); const gzip = zlib.createGzip(); inputStream.pipe(gzip); const chunks = []; try { - for (var _d = true, gzip_1 = __asyncValues4(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), _a = gzip_1_1.done, !_a; ) { + for (var _d = true, gzip_1 = __asyncValues2(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), _a = gzip_1_1.done, !_a; ) { _c = gzip_1_1.value; _d = false; try { @@ -111049,7 +118311,7 @@ var require_upload_gzip = __commonJS({ var require_requestUtils2 = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111062,21 +118324,21 @@ var require_requestUtils2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -111105,11 +118367,11 @@ var require_requestUtils2 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.retryHttpClientRequest = exports2.retry = void 0; - var utils_1 = require_utils7(); - var core14 = __importStar4(require_core()); + var utils_1 = require_utils10(); + var core14 = __importStar2(require_core4()); var config_variables_1 = require_config_variables(); function retry3(name, operation, customErrorMessages, maxAttempts) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let response = void 0; let statusCode = void 0; let isRetryable = false; @@ -111128,9 +118390,9 @@ var require_requestUtils2 = __commonJS({ } isRetryable = (0, utils_1.isRetryableStatusCode)(statusCode); errorMessage = `Artifact service responded with ${statusCode}`; - } catch (error4) { + } catch (error3) { isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (!isRetryable) { core14.info(`${name} - Error is not retryable`); @@ -111154,7 +118416,7 @@ var require_requestUtils2 = __commonJS({ } exports2.retry = retry3; function retryHttpClientRequest(name, method, customErrorMessages = /* @__PURE__ */ new Map(), maxAttempts = (0, config_variables_1.getRetryLimit)()) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield retry3(name, method, customErrorMessages, maxAttempts); }); } @@ -111166,7 +118428,7 @@ var require_requestUtils2 = __commonJS({ var require_upload_http_client = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/upload-http-client.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111179,21 +118441,21 @@ var require_upload_http_client = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -111222,17 +118484,17 @@ var require_upload_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadHttpClient = void 0; - var fs2 = __importStar4(require("fs")); - var core14 = __importStar4(require_core()); - var tmp = __importStar4(require_tmp_promise()); - var stream = __importStar4(require("stream")); - var utils_1 = require_utils7(); + var fs2 = __importStar2(require("fs")); + var core14 = __importStar2(require_core4()); + var tmp = __importStar2(require_tmp_promise()); + var stream = __importStar2(require("stream")); + var utils_1 = require_utils10(); 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_lib7(); + var http_client_1 = require_lib6(); var http_manager_1 = require_http_manager(); var upload_gzip_1 = require_upload_gzip(); var requestUtils_1 = require_requestUtils2(); @@ -111248,7 +118510,7 @@ var require_upload_http_client = __commonJS({ * @returns The response from the Artifact Service if the file container was successfully created */ createArtifactInFileContainer(artifactName, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const parameters = { Type: "actions_storage", Name: artifactName @@ -111271,7 +118533,7 @@ var require_upload_http_client = __commonJS({ `The artifact name ${artifactName} is not valid. Request URL ${artifactUrl}` ] ]); - const response = yield (0, requestUtils_1.retryHttpClientRequest)("Create Artifact Container", () => __awaiter4(this, void 0, void 0, function* () { + 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(); @@ -111285,7 +118547,7 @@ var require_upload_http_client = __commonJS({ * @returns The size of all the files uploaded in bytes */ uploadArtifactToFileContainer(uploadUrl, filesToUpload, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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)(); core14.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); @@ -111315,7 +118577,7 @@ var require_upload_http_client = __commonJS({ let abortPendingFileUploads = false; this.statusReporter.setTotalNumberOfFilesToProcess(filesToUpload.length); this.statusReporter.start(); - yield Promise.all(parallelUploads.map((index) => __awaiter4(this, void 0, void 0, function* () { + yield Promise.all(parallelUploads.map((index) => __awaiter2(this, void 0, void 0, function* () { while (currentFile < filesToUpload.length) { const currentFileParameters = parameters[currentFile]; currentFile += 1; @@ -111358,7 +118620,7 @@ var require_upload_http_client = __commonJS({ * @returns The size of the file that was uploaded in bytes along with any failed uploads */ uploadFileAsync(httpClientIndex, parameters) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileStat = yield stat(parameters.file); const totalFileSize = fileStat.size; const isFIFO = fileStat.isFIFO(); @@ -111459,10 +118721,10 @@ var require_upload_http_client = __commonJS({ * @returns if the chunk was successfully uploaded */ uploadChunk(httpClientIndex, resourceUrl, openStream, start, end, uploadFileSize, isGzip, totalFileSize) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = () => __awaiter4(this, void 0, void 0, function* () { + const uploadChunkRequest = () => __awaiter2(this, void 0, void 0, function* () { const client = this.uploadHttpManager.getClient(httpClientIndex); return yield client.sendStream("PUT", resourceUrl, openStream(), headers); }); @@ -111479,7 +118741,7 @@ var require_upload_http_client = __commonJS({ } return false; }; - const backOff = (retryAfterValue) => __awaiter4(this, void 0, void 0, function* () { + const backOff = (retryAfterValue) => __awaiter2(this, void 0, void 0, function* () { this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); if (retryAfterValue) { core14.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); @@ -111496,9 +118758,9 @@ var require_upload_http_client = __commonJS({ let response; try { response = yield uploadChunkRequest(); - } catch (error4) { + } catch (error3) { core14.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); - console.log(error4); + console.log(error3); if (incrementAndCheckRetryLimit()) { return false; } @@ -111528,7 +118790,7 @@ var require_upload_http_client = __commonJS({ * Updating the size indicates that we are done uploading all the contents of the artifact */ patchArtifactSize(size, artifactName) { - return __awaiter4(this, void 0, void 0, function* () { + 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 }; @@ -111542,7 +118804,7 @@ var require_upload_http_client = __commonJS({ `An Artifact with the name ${artifactName} was not found` ] ]); - const response = yield (0, requestUtils_1.retryHttpClientRequest)("Finalize artifact upload", () => __awaiter4(this, void 0, void 0, function* () { + 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(); @@ -111558,7 +118820,7 @@ var require_upload_http_client = __commonJS({ var require_download_http_client = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/download-http-client.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111571,21 +118833,21 @@ var require_download_http_client = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -111614,10 +118876,10 @@ var require_download_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.DownloadHttpClient = void 0; - var fs2 = __importStar4(require("fs")); - var core14 = __importStar4(require_core()); - var zlib = __importStar4(require("zlib")); - var utils_1 = require_utils7(); + var fs2 = __importStar2(require("fs")); + var core14 = __importStar2(require_core4()); + var zlib = __importStar2(require("zlib")); + var utils_1 = require_utils10(); var url_1 = require("url"); var status_reporter_1 = require_status_reporter(); var perf_hooks_1 = require("perf_hooks"); @@ -111633,11 +118895,11 @@ var require_download_http_client = __commonJS({ * Gets a list of all artifacts that are in a specific container */ listArtifacts() { - return __awaiter4(this, void 0, void 0, function* () { + 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", () => __awaiter4(this, void 0, void 0, function* () { + 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(); @@ -111650,12 +118912,12 @@ var require_download_http_client = __commonJS({ * @param containerUrl the artifact container URL for the run */ getContainerItems(artifactName, containerUrl) { - return __awaiter4(this, void 0, void 0, function* () { + 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", () => __awaiter4(this, void 0, void 0, function* () { + 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(); @@ -111667,7 +118929,7 @@ var require_download_http_client = __commonJS({ * @param downloadItems information about what items to download and where to save them */ downloadSingleArtifact(downloadItems) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const DOWNLOAD_CONCURRENCY = (0, config_variables_1.getDownloadFileConcurrency)(); core14.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; @@ -111676,7 +118938,7 @@ var require_download_http_client = __commonJS({ core14.info(`Total number of files that will be downloaded: ${downloadItems.length}`); this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); this.statusReporter.start(); - yield Promise.all(parallelDownloads.map((index) => __awaiter4(this, void 0, void 0, function* () { + yield Promise.all(parallelDownloads.map((index) => __awaiter2(this, void 0, void 0, function* () { while (currentFile < downloadItems.length) { const currentFileToDownload = downloadItems[currentFile]; currentFile += 1; @@ -111687,8 +118949,8 @@ var require_download_http_client = __commonJS({ } this.statusReporter.incrementProcessedCount(); } - }))).catch((error4) => { - throw new Error(`Unable to download the artifact: ${error4}`); + }))).catch((error3) => { + throw new Error(`Unable to download the artifact: ${error3}`); }).finally(() => { this.statusReporter.stop(); this.downloadHttpManager.disposeAndReplaceAllClients(); @@ -111702,19 +118964,19 @@ var require_download_http_client = __commonJS({ * @param downloadPath destination location for the file being downloaded */ downloadIndividualFile(httpClientIndex, artifactLocation, downloadPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let retryCount = 0; const retryLimit = (0, config_variables_1.getRetryLimit)(); let destinationStream = fs2.createWriteStream(downloadPath); const headers = (0, utils_1.getDownloadHeaders)("application/json", true, true); - const makeDownloadRequest = () => __awaiter4(this, void 0, void 0, function* () { + 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) => __awaiter4(this, void 0, void 0, function* () { + 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}`)); @@ -111738,7 +119000,7 @@ var require_download_http_client = __commonJS({ } return parseInt(expected) === received; }; - const resetDestinationStream = (fileDownloadPath) => __awaiter4(this, void 0, void 0, function* () { + const resetDestinationStream = (fileDownloadPath) => __awaiter2(this, void 0, void 0, function* () { destinationStream.close(); yield new Promise((resolve2) => { destinationStream.on("close", resolve2); @@ -111753,9 +119015,9 @@ var require_download_http_client = __commonJS({ let response; try { response = yield makeDownloadRequest(); - } catch (error4) { + } catch (error3) { core14.info("An error occurred while attempting to download a file"); - console.log(error4); + console.log(error3); yield backOff(); continue; } @@ -111769,7 +119031,7 @@ var require_download_http_client = __commonJS({ } else { forceRetry = true; } - } catch (error4) { + } catch (error3) { forceRetry = true; } } @@ -111791,35 +119053,35 @@ var require_download_http_client = __commonJS({ * @param isGzip a boolean denoting if the content is compressed using gzip and if we need to decode it */ pipeResponseToFile(response, destinationStream, isGzip) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { yield new Promise((resolve2, reject) => { if (isGzip) { const gunzip = zlib.createGunzip(); - response.message.on("error", (error4) => { + response.message.on("error", (error3) => { core14.info(`An error occurred while attempting to read the response stream`); gunzip.close(); destinationStream.close(); - reject(error4); - }).pipe(gunzip).on("error", (error4) => { + reject(error3); + }).pipe(gunzip).on("error", (error3) => { core14.info(`An error occurred while attempting to decompress the response stream`); destinationStream.close(); - reject(error4); + reject(error3); }).pipe(destinationStream).on("close", () => { resolve2(); - }).on("error", (error4) => { + }).on("error", (error3) => { core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error4); + reject(error3); }); } else { - response.message.on("error", (error4) => { + response.message.on("error", (error3) => { core14.info(`An error occurred while attempting to read the response stream`); destinationStream.close(); - reject(error4); + reject(error3); }).pipe(destinationStream).on("close", () => { resolve2(); - }).on("error", (error4) => { + }).on("error", (error3) => { core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error4); + reject(error3); }); } }); @@ -111835,7 +119097,7 @@ var require_download_http_client = __commonJS({ var require_download_specification = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/download-specification.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111848,23 +119110,23 @@ var require_download_specification = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getDownloadSpecification = void 0; - var path2 = __importStar4(require("path")); + var path2 = __importStar2(require("path")); function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { const directories = /* @__PURE__ */ new Set(); const specifications = { @@ -111889,427 +119151,46 @@ var require_download_specification = __commonJS({ } } } - } - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 core14 = __importStar4(require_core()); - var upload_specification_1 = require_upload_specification(); - var upload_http_client_1 = require_upload_http_client(); - var utils_1 = require_utils7(); - 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 __awaiter4(this, void 0, void 0, function* () { - core14.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) { - core14.warning(`No files found that can be uploaded`); - } else { - const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); - if (!response.fileContainerResourceUrl) { - core14.debug(response.toString()); - throw new Error("No URL provided by the Artifact Service to upload an artifact to"); - } - core14.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); - core14.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); - const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); - core14.info(`File upload process has finished. Finalizing the artifact upload`); - yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); - if (uploadResult.failedItems.length > 0) { - core14.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); - } else { - core14.info(`Artifact has been finalized. All files have been successfully uploaded!`); - } - core14.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, path2, options) { - return __awaiter4(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 (!path2) { - path2 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path2 = (0, path_1.normalize)(path2); - path2 = (0, path_1.resolve)(path2); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path2, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); - if (downloadSpecification.filesToDownload.length === 0) { - core14.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); - } else { - yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); - core14.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(path2) { - return __awaiter4(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) { - core14.info("Unable to find any artifacts for the associated workflow"); - return response; - } - if (!path2) { - path2 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path2 = (0, path_1.normalize)(path2); - path2 = (0, path_1.resolve)(path2); - let downloadedArtifacts = 0; - while (downloadedArtifacts < artifacts.count) { - const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; - downloadedArtifacts += 1; - core14.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, path2, true); - if (downloadSpecification.filesToDownload.length === 0) { - core14.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/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a; - 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 fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs2.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path2.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 = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path2.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + specifications.directoryStructure = Array.from(directories); + return specifications; } - exports2.getCmdPath = getCmdPath; + exports2.getDownloadSpecification = getDownloadSpecification; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -112337,204 +119218,196 @@ var require_io4 = __commonJS({ }); }; 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 path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); - function cp(source, dest, options = {}) { - return __awaiter4(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 ? path2.join(dest, path2.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.`); + exports2.DefaultArtifactClient = void 0; + var core14 = __importStar2(require_core4()); + var upload_specification_1 = require_upload_specification(); + var upload_http_client_1 = require_upload_http_client(); + var utils_1 = require_utils10(); + 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* () { + core14.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) { + core14.warning(`No files found that can be uploaded`); } else { - yield cpDirRecursive(source, newDest, 0, force); - } - } else { - if (path2.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.basename(source)); - destExists = yield ioUtil.exists(dest); - } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); + const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); + if (!response.fileContainerResourceUrl) { + core14.debug(response.toString()); + throw new Error("No URL provided by the Artifact Service to upload an artifact to"); + } + core14.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); + core14.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); + const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); + core14.info(`File upload process has finished. Finalizing the artifact upload`); + yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); + if (uploadResult.failedItems.length > 0) { + core14.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); } else { - throw new Error("Destination already exists"); + core14.info(`Artifact has been finalized. All files have been successfully uploaded!`); } + core14.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; } - } - yield mkdirP(path2.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - exports2.mv = mv; - function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - if (/[*"<>|]/.test(inputPath)) { - throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + return uploadResponse; + }); + } + downloadArtifact(name, path2, 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`); } - } - try { - yield ioUtil.rm(inputPath, { - force: true, - maxRetries: 3, - recursive: true, - retryDelay: 300 + const artifactToDownload = artifacts.value.find((artifact2) => { + return artifact2.name === name; }); - } catch (err) { - throw new Error(`File was unable to be removed ${err}`); - } - }); - } - exports2.rmRF = rmRF; - function mkdirP(fsPath) { - return __awaiter4(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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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 = which6; - function findInPath(tool) { - return __awaiter4(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(path2.delimiter)) { - if (extension) { - extensions.push(extension); - } + if (!artifactToDownload) { + throw new Error(`Unable to find an artifact with the name: ${name}`); } - } - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; + const items = yield downloadHttpClient.getContainerItems(artifactToDownload.name, artifactToDownload.fileContainerResourceUrl); + if (!path2) { + path2 = (0, config_variables_1.getWorkSpaceDirectory)(); } - return []; - } - if (tool.includes(path2.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { - if (p) { - directories.push(p); - } + path2 = (0, path_1.normalize)(path2); + path2 = (0, path_1.resolve)(path2); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path2, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); + if (downloadSpecification.filesToDownload.length === 0) { + core14.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); + } else { + yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); + core14.info("Directory structure has been set up for the artifact"); + yield (0, utils_1.createEmptyFilesForArtifact)(downloadSpecification.emptyFilesToCreate); + yield downloadHttpClient.downloadSingleArtifact(downloadSpecification.filesToDownload); } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); + return { + artifactName: name, + downloadPath: downloadSpecification.rootDownloadLocation + }; + }); + } + downloadAllArtifacts(path2) { + 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) { + core14.info("Unable to find any artifacts for the associated workflow"); + return response; } - } - 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 __awaiter4(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 copyFile(srcFile, destFile, force); + if (!path2) { + path2 = (0, config_variables_1.getWorkSpaceDirectory)(); } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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); + path2 = (0, path_1.normalize)(path2); + path2 = (0, path_1.resolve)(path2); + let downloadedArtifacts = 0; + while (downloadedArtifacts < artifacts.count) { + const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; + downloadedArtifacts += 1; + core14.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, path2, true); + if (downloadSpecification.filesToDownload.length === 0) { + core14.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 + }); } - 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); - } - }); + 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/@actions/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils11 = __commonJS({ + "node_modules/@actions/tool-cache/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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -112547,130 +119420,142 @@ var require_manifest = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os = require("os"); - var cp = require("child_process"); - var fs2 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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; + exports2.issue = exports2.issueCommand = void 0; + var os = __importStar2(require("os")); + var utils_1 = require_utils11(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os.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 { - chk = semver8.satisfies(osVersion, item.platform_version); + cmdStr += ","; } + cmdStr += `${key}=${escapeProperty(val)}`; } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os.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; } } } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - return version; + }; + function escapeData(s) { + return (0, utils_1.toCommandValue)(s).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A"); } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs2.existsSync(lsbReleaseFile)) { - contents = fs2.readFileSync(lsbReleaseFile).toString(); - } else if (fs2.existsSync(osReleaseFile)) { - contents = fs2.readFileSync(osReleaseFile).toString(); + 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/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command4 = __commonJS({ + "node_modules/@actions/tool-cache/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 crypto2 = __importStar2(require("crypto")); + var fs2 = __importStar2(require("fs")); + var os = __importStar2(require("os")); + var utils_1 = require_utils11(); + 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 (!fs2.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + encoding: "utf8" + }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - return contents; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; } - exports2._readLinuxVersionFile = _readLinuxVersionFile; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); // node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy6 = __commonJS({ +var require_proxy5 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -112752,10 +119637,10 @@ var require_proxy6 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib8 = __commonJS({ +var require_lib7 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -112768,21 +119653,21 @@ var require_lib8 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -112811,10 +119696,10 @@ var require_lib8 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy6()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy5()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -112889,8 +119774,8 @@ var require_lib8 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -112902,8 +119787,8 @@ var require_lib8 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -112960,42 +119845,42 @@ var require_lib8 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -113004,14 +119889,14 @@ var require_lib8 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -113020,7 +119905,7 @@ var require_lib8 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -113029,7 +119914,7 @@ var require_lib8 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -113043,7 +119928,7 @@ var require_lib8 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -113117,7 +120002,7 @@ var require_lib8 = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { function callbackForResult(err, res) { if (err) { @@ -113283,98 +120168,594 @@ var require_lib8 = __commonJS({ } 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; + _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((resolve2) => setTimeout(() => resolve2(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve2(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 { + resolve2(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth4 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils4 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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_lib7(); + var auth_1 = require_auth4(); + var core_1 = require_core5(); + 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 _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.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/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary4 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 (_a) { + 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(); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); + /** + * 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(); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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 { - resolve2(response); - } - })); - }); + /** + * 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(); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -113387,21 +120768,66 @@ var require_retry_helper = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 path2 = __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, path2.sep); + } + exports2.toPlatformPath = toPlatformPath; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js +var require_io_util4 = __commonJS({ + "node_modules/@actions/tool-cache/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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -113428,86 +120854,153 @@ var require_retry_helper = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; + var _a; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core14 = __importStar4(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"); + 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 fs2 = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); + _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs2.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'); } - execute(action, isRetryable) { - return __awaiter4(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; + 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 = path2.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 = path2.dirname(filePath); + const upperName = path2.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path2.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; } - core14.info(err.message); } - const seconds = this.getSleepAmount(); - core14.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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => setTimeout(resolve2, seconds * 1e3)); - }); + } + return ""; + }); + } + exports2.tryGetExecutablePath = tryGetExecutablePath; + function normalizeSeparators(p) { + p = p || ""; + if (exports2.IS_WINDOWS) { + p = p.replace(/\//g, "\\"); + return p.replace(/\\\\+/g, "\\"); } - }; - exports2.RetryHelper = RetryHelper; + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js +var require_io4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -113535,649 +121028,227 @@ var require_tool_cache = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core14 = __importStar4(require_core()); - var io6 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs2 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os = __importStar4(require("os")); - var path2 = __importStar4(require("path")); - var httpm = __importStar4(require_lib8()); - var semver8 = __importStar4(require_semver2()); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); + exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; var assert_1 = require("assert"); - var exec_1 = require_exec(); - var retry_helper_1 = require_retry_helper(); - var HTTPError = class extends Error { - constructor(httpStatusCode) { - super(`Unexpected HTTP response: ${httpStatusCode}`); - this.httpStatusCode = httpStatusCode; - Object.setPrototypeOf(this, new.target.prototype); - } - }; - exports2.HTTPError = HTTPError; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path2.join(_getTempDirectory(), crypto.randomUUID()); - yield io6.mkdirP(path2.dirname(dest)); - core14.debug(`Downloading ${url}`); - core14.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs2.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core14.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError(response.message.statusCode); - core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs2.createWriteStream(dest)); - core14.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core14.debug("download failed"); - try { - yield io6.rmRF(dest); - } catch (err) { - core14.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core14.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path2.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 io6.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core14.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() - } - }); - core14.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core14.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core14.isDebug()) { - args.push("-v"); + var path2 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util4()); + 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 xarPath = yield io6.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path2.join(dest, path2.basename(source)) : dest; + if (!(yield ioUtil.exists(source))) { + throw new Error(`no such file or directory: ${source}`); } - dest = yield _createExtractFolder(dest); - if (IS_WINDOWS) { - yield extractZipWin(file, dest); + 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 { - yield extractZipNix(file, dest); + if (path2.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); } - return dest; }); } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io6.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 - ]; - core14.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 io6.which("powershell", true); - core14.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); + 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 = path2.join(dest, path2.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(path2.dirname(dest)); + yield ioUtil.rename(source, dest); }); } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io6.which("unzip", true); - const args = [file]; - if (!core14.isDebug()) { - args.unshift("-q"); + 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}`); } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); }); } - function cacheDir(sourceDir, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch}`); - core14.debug(`source dir: ${sourceDir}`); - if (!fs2.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch); - for (const itemName of fs2.readdirSync(sourceDir)) { - const s = path2.join(sourceDir, itemName); - yield io6.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch); - return destPath; + 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.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch}`); - core14.debug(`source file: ${sourceFile}`); - if (!fs2.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); + exports2.mkdirP = mkdirP; + function which6(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - const destFolder = yield _createToolPath(tool, version, arch); - const destPath = path2.join(destFolder, targetFile); - core14.debug(`destination file ${destPath}`); - yield io6.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch); - return destFolder; + if (check) { + const result = yield which6(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.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch = arch || os.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path2.join(_getCacheDirectory(), toolName, versionSpec, arch); - core14.debug(`checking cache: ${cachePath}`); - if (fs2.existsSync(cachePath) && fs2.existsSync(`${cachePath}.complete`)) { - core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); - toolPath = cachePath; - } else { - core14.debug("not found"); + exports2.which = which6; + function findInPath(tool) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch) { - const versions = []; - arch = arch || os.arch(); - const toolPath = path2.join(_getCacheDirectory(), toolName); - if (fs2.existsSync(toolPath)) { - const children = fs2.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path2.join(toolPath, child, arch || ""); - if (fs2.existsSync(fullPath) && fs2.existsSync(`${fullPath}.complete`)) { - versions.push(child); + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { + for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { + if (extension) { + extensions.push(extension); } } } - } - return versions; - } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core14.debug("set auth"); - headers.authorization = auth; + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; } - const response = yield http.getJson(treeUrl, headers); - if (!response.result) { - return releases; + if (tool.includes(path2.sep)) { + return []; } - let manifestUrl = ""; - for (const item of response.result.tree) { - if (item.path === "versions-manifest.json") { - manifestUrl = item.url; - break; + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path2.delimiter)) { + if (p) { + directories.push(p); + } } } - 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 (_a) { - core14.debug("Invalid json"); + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); } } - return releases; + return matches; }); } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); + 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 }; } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path2.join(_getTempDirectory(), crypto.randomUUID()); + 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 copyFile(srcFile, destFile, force); + } } - yield io6.mkdirP(dest); - return dest; - }); - } - function _createToolPath(tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path2.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - core14.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io6.rmRF(folderPath); - yield io6.rmRF(markerPath); - yield io6.mkdirP(folderPath); - return folderPath; + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); }); } - function _completeToolPath(tool, version, arch) { - const folderPath = path2.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - const markerPath = `${folderPath}.complete`; - fs2.writeFileSync(markerPath, ""); - core14.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core14.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core14.debug(`explicit? ${valid3}`); - return valid3; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core14.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; + function copyFile(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); } - return -1; }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core14.debug(`matched: ${version}`); - } else { - core14.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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/@actions/http-client/lib/proxy.js -var require_proxy7 = __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 (_a) { - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib9 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = 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) { + var __createBinding2 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -114205,1140 +121276,547 @@ var require_lib9 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy7()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path2 = __importStar2(require("path")); + var io6 = __importStar2(require_io4()); + var ioUtil = __importStar2(require_io_util4()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, data); - redirectsRemaining--; + _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}`; } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - } 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(); + } + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + return cmd; } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os.EOL.length); + n = s.indexOf(os.EOL); } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + } + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; } } - const req = info7.httpModule.request(info7.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(); + 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]; } - handleResult(new Error(`Request timeout: ${info7.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(); } + return this.args; } - /** - * 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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); + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - return info7; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + if (!arg) { + return '""'; } - return lowercaseKeys(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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; - if (headerValue) { - clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } } - const additionalValue = additionalHeaders[header]; - if (additionalValue !== void 0) { - return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; - } - if (clientHeader !== void 0) { - return clientHeader; - } - return _default2; - } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; - } - } + if (!needsQuotes) { + return arg; } - const additionalValue = additionalHeaders[Headers.ContentType]; - if (additionalValue !== void 0) { - if (typeof additionalValue === "number") { - return String(additionalValue); - } else if (Array.isArray(additionalValue)) { - return additionalValue.join(", "); + 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 { - return additionalValue; + quoteHit = false; } } - if (clientHeader !== void 0) { - return clientHeader; - } - return _default2; + reverse += '"'; + return reverse.split("").reverse().join(""); } - _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; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - if (agent) { - return agent; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; } - 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; + 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 { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + quoteHit = false; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); } - return agent; + reverse += '"'; + return reverse.split("").reverse().join(""); } - _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; + _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; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); + _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; } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(response); + /** + * 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 = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve2, 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}`); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.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); } - } - return value; + 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 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); + 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); } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { + 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); + } + }); + }); } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; + 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 { - msg = `Failed request: (${statusCode})`; + resolve2(exitCode); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve2(response); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } })); }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ - "node_modules/follow-redirects/debug.js"(exports2, module2) { - var debug4; - module2.exports = function() { - if (!debug4) { - try { - debug4 = require_src()("follow-redirects"); - } catch (error4) { - } - if (typeof debug4 !== "function") { - debug4 = function() { - }; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = false; } - debug4.apply(null, arguments); - }; - } -}); - -// node_modules/follow-redirects/index.js -var require_follow_redirects = __commonJS({ - "node_modules/follow-redirects/index.js"(exports2, module2) { - var url = require("url"); - var URL2 = url.URL; - var http = require("http"); - var https2 = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug4 = require_debug2(); - (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 (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; - } - 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 || noop; - 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 })); + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); + } + continue; } - }; - 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(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); - return this; - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString(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(); + if (c === "\\" && escaped) { + append(c); + continue; } - 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; + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; + } + append(c); } - }; - 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); + if (arg.length > 0) { + args.push(arg.trim()); } - function startTimer(socket) { - if (self2._timeout) { - clearTimeout(self2._timeout); + 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"); } - self2._timeout = setTimeout(function() { - self2.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); - } - function clearTimer() { - if (self2._timeout) { - clearTimeout(self2._timeout); - self2._timeout = null; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - self2.removeListener("abort", clearTimer); - self2.removeListener("error", clearTimer); - self2.removeListener("response", clearTimer); - self2.removeListener("close", clearTimer); - if (callback) { - self2.removeListener("timeout", callback); + } + CheckComplete() { + if (this.done) { + return; } - if (!self2.socket) { - self2._currentRequest.removeListener("socket", startTimer); + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (callback) { - this.on("timeout", callback); - } - if (this.socket) { - startTimer(this.socket); - } else { - this._currentRequest.once("socket", startTimer); + _debug(message) { + this.emit("debug", message); } - 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]; + _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`); + } } - }); - }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - if (options.host) { - if (!options.hostname) { - options.hostname = options.host; + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; } - delete options.host; + this.done = true; + this.emit("done", error3, this.processExitCode); } - 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); + 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(); } }; - 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 request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); - } - this._currentUrl = /^\//.test(this._options.path) ? url.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(error4) { - if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self2._ended) { - request.end(); - } - } - })(); + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec4 = __commonJS({ + "node_modules/@actions/tool-cache/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; }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); } - 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 = parseUrl(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl = resolveUrl(location, currentUrl); - debug4("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(/^(?:(?:proxy-)?authorization|cookie)$/i, 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 request(input, options, callback) { - if (isURL(input)) { - input = spreadUrlObject(input); - } else if (isString(input)) { - input = spreadUrlObject(parseUrl(input)); - } else { - callback = options; - options = validateUrl(input); - input = { protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug4("options", options); - return new RedirectableRequest(options, callback); } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - return exports3; - } - function noop() { - } - function parseUrl(input) { - var parsed; - if (useNativeURL) { - parsed = new URL2(input); - } else { - parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } - } - return parsed; - } - function resolveUrl(relative, base) { - return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative)); - } - 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 + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner4()); + 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(); }); - return CustomError; - } - function destroyRequest(request, error4) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); - } - request.on("error", noop); - request.destroy(error4); - } - function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); } - function isString(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; + exports2.exec = exec3; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 + }; + }); } - module2.exports = wrap({ http, https: https2 }); - module2.exports.wrap = wrap; + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115351,64 +121829,113 @@ var require_internal_glob_options_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(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; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); - } - if (typeof copy.matchDirectories === "boolean") { - result.matchDirectories = copy.matchDirectories; - core14.debug(`matchDirectories '${result.matchDirectories}'`); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (typeof copy.excludeHiddenFiles === "boolean") { - result.excludeHiddenFiles = copy.excludeHiddenFiles; - core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; + 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_exec4()); + 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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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.getOptions = getOptions; + exports2.getDetails = getDetails; } }); -// node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core5 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115421,145 +121948,223 @@ var require_internal_path_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path2 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname2(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - let result = path2.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; - } - exports2.dirname = dirname2; - 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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - 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)}`; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } 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)}`; } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(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_command4(); + var file_command_1 = require_file_command4(); + var utils_1 = require_utils11(); + var os = __importStar2(require("os")); + var path2 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils4(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + (0, command_1.issueCommand)("set-env", { name }, convertedVal); + } + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); } else { - root += path2.sep; + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return root + itemPath; + process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - 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); + exports2.addPath = addPath; + 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}`); } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - 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); + if (options && options.trimWhitespace === false) { + return val; } - return itemPath.startsWith("/"); + return val.trim(); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + 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 p.replace(/\/\/+/g, "/"); + return inputs.map((input) => input.trim()); } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; - } - p = normalizeSeparators(p); - if (!p.endsWith(path2.sep)) { - return p; - } - if (p === path2.sep) { - return p; + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + process.stdout.write(os.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed; + function isDebug3() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug3; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return p.substr(0, p.length - 1); + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind2 = __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 = {})); + exports2.saveState = saveState2; + 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_summary4(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary4(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils4(); + 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_platform4()); } }); -// node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115572,81 +122177,133 @@ var require_internal_pattern_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(require_internal_path_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - 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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - const result = []; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - if (searchPathMap[key] === "included") { - continue; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core5(); + var os = require("os"); + var cp = require("child_process"); + var fs2 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } + } + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); } - exports2.getSearchPaths = getSearchPaths; - function match(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); + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os.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 result; + return version; } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs2.existsSync(lsbReleaseFile)) { + contents = fs2.readFileSync(lsbReleaseFile).toString(); + } else if (fs2.existsSync(osReleaseFile)) { + contents = fs2.readFileSync(osReleaseFile).toString(); + } + return contents; } - exports2.partialMatch = partialMatch; + exports2._readLinuxVersionFile = _readLinuxVersionFile; } }); -// node_modules/@actions/glob/lib/internal-path.js -var require_internal_path2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115659,95 +122316,100 @@ var require_internal_path2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(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(path2.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path2.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } 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(path2.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } + function step(result) { + result.done ? resolve2(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 core14 = __importStar2(require_core5()); + 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"); + } } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path2.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path2.sep; + 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; + } + core14.info(err.message); + } + const seconds = this.getSleepAmount(); + core14.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; } - result += this.segments[i]; - } - return result; + 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((resolve2) => setTimeout(resolve2, seconds * 1e3)); + }); } }; - exports2.Path = Path; + exports2.RetryHelper = RetryHelper; } }); -// node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115760,674 +122422,1081 @@ var require_internal_pattern2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os = __importStar4(require("os")); - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(require("assert")); - var minimatch_1 = require_minimatch(); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_path_1 = require_internal_path2(); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core14 = __importStar2(require_core5()); + var io6 = __importStar2(require_io4()); + var crypto2 = __importStar2(require("crypto")); + var fs2 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os = __importStar2(require("os")); + var path2 = __importStar2(require("path")); + var httpm = __importStar2(require_lib7()); + var semver9 = __importStar2(require_semver2()); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec4(); + var retry_helper_1 = require_retry_helper(); + var HTTPError = class extends Error { + constructor(httpStatusCode) { + super(`Unexpected HTTP response: ${httpStatusCode}`); + this.httpStatusCode = httpStatusCode; + Object.setPrototypeOf(this, new.target.prototype); + } + }; + exports2.HTTPError = HTTPError; var IS_WINDOWS = process.platform === "win32"; - var Pattern = class _Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path2.join(_getTempDirectory(), crypto2.randomUUID()); + yield io6.mkdirP(path2.dirname(dest)); + core14.debug(`Downloading ${url}`); + core14.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(url, dest || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; + }); + }); + } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs2.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false + }); + if (auth) { + core14.debug("set auth"); + if (headers === void 0) { + headers = {}; + } + headers.authorization = auth; + } + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError(response.message.statusCode); + core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs2.createWriteStream(dest)); + core14.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core14.debug("download failed"); + try { + yield io6.rmRF(dest); + } catch (err) { + core14.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 = core14.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } } 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}`; + const escapedScript = path2.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 io6.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - while (pattern.startsWith("!")) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); } - pattern = _Pattern.fixupPattern(pattern, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path2.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(path2.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path2.sep}`; + dest = yield _createExtractFolder(dest); + core14.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() } + }); + core14.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; } else { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + args = [flags]; } - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + if (core14.isDebug() && !flags.includes("v")) { + args.push("-v"); } - 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); + let destArg = dest; + let fileArg = file; + if (IS_WINDOWS && isGnuTar) { + args.push("--force-local"); + destArg = dest.replace(/\\/g, "/"); + fileArg = file.replace(/\\/g, "/"); } - return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); + 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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 (core14.isDebug()) { + args.push("-v"); + } + const xarPath = yield io6.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io6.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 + ]; + core14.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 io6.which("powershell", true); + core14.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 io6.which("unzip", true); + const args = [file]; + if (!core14.isDebug()) { + args.unshift("-q"); + } + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch}`); + core14.debug(`source dir: ${sourceDir}`); + if (!fs2.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); + } + const destPath = yield _createToolPath(tool, version, arch); + for (const itemName of fs2.readdirSync(sourceDir)) { + const s = path2.join(sourceDir, itemName); + yield io6.cp(s, destPath, { recursive: true }); + } + _completeToolPath(tool, version, arch); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch}`); + core14.debug(`source file: ${sourceFile}`); + if (!fs2.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); + } + const destFolder = yield _createToolPath(tool, version, arch); + const destPath = path2.join(destFolder, targetFile); + core14.debug(`destination file ${destPath}`); + yield io6.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - /** - * Escapes glob patterns within a path - */ - static globEscape(s) { - return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - (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(`.${path2.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path2.sep}`)) { - homedir = homedir || os.homedir(); - (0, assert_1.default)(homedir, "Unable to determine HOME directory"); - (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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); + arch = arch || os.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path2.join(_getCacheDirectory(), toolName, versionSpec, arch); + core14.debug(`checking cache: ${cachePath}`); + if (fs2.existsSync(cachePath) && fs2.existsSync(`${cachePath}.complete`)) { + core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); + core14.debug("not found"); } - 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch) { + const versions = []; + arch = arch || os.arch(); + const toolPath = path2.join(_getCacheDirectory(), toolName); + if (fs2.existsSync(toolPath)) { + const children = fs2.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path2.join(toolPath, child, arch || ""); + if (fs2.existsSync(fullPath) && fs2.existsSync(`${fullPath}.complete`)) { + versions.push(child); } } - literal += c; } - return literal; } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core14.debug("set auth"); + headers.authorization = auth; + } + 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 (_a) { + core14.debug("Invalid json"); + } + } + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path2.join(_getTempDirectory(), crypto2.randomUUID()); + } + yield io6.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path2.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + core14.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io6.rmRF(folderPath); + yield io6.rmRF(markerPath); + yield io6.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch) { + const folderPath = path2.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + const markerPath = `${folderPath}.complete`; + fs2.writeFileSync(markerPath, ""); + core14.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core14.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core14.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core14.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; + } + return -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; + } + } + if (version) { + core14.debug(`matched: ${version}`); + } else { + core14.debug("match not found"); } - }; - exports2.Pattern = Pattern; + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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/@actions/glob/lib/internal-search-state.js -var require_internal_search_state2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-search-state.js"(exports2) { +// node_modules/fast-deep-equal/index.js +var require_fast_deep_equal = __commonJS({ + "node_modules/fast-deep-equal/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.SearchState = void 0; - var SearchState = class { - constructor(path2, level) { - this.path = path2; - this.level = level; + 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; }; - exports2.SearchState = SearchState; } }); -// node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-globber.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; +// node_modules/follow-redirects/debug.js +var require_debug3 = __commonJS({ + "node_modules/follow-redirects/debug.js"(exports2, module2) { + var debug4; + module2.exports = function() { + if (!debug4) { + try { + debug4 = require_src()("follow-redirects"); + } catch (error3) { + } + if (typeof debug4 !== "function") { + debug4 = function() { + }; + } } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + debug4.apply(null, arguments); + }; + } +}); + +// node_modules/follow-redirects/index.js +var require_follow_redirects = __commonJS({ + "node_modules/follow-redirects/index.js"(exports2, module2) { + var url = require("url"); + var URL2 = url.URL; + var http = require("http"); + var https2 = require("https"); + var Writable = require("stream").Writable; + var assert = require("assert"); + var debug4 = 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 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 __importStar4 = 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)) __createBinding4(result, mod, k); + 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 || noop; + 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); } - __setModuleDefault4(result, mod); - return result; + var self2 = this; + this._onNativeResponse = function(response) { + try { + self2._processResponse(response); + } catch (cause) { + self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); + } + }; + this._performRequest(); + } + RedirectableRequest.prototype = Object.create(Writable.prototype); + RedirectableRequest.prototype.abort = function() { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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(); } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!isString(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(); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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(); + } }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; + RedirectableRequest.prototype.end = function(data, encoding, callback) { + if (isFunction(data)) { + callback = data; + data = encoding = null; + } else if (isFunction(encoding)) { + callback = encoding; + encoding = null; } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); + 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; } }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); + RedirectableRequest.prototype.setHeader = function(name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + 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 resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + function startTimer(socket) { + if (self2._timeout) { + clearTimeout(self2._timeout); } + self2._timeout = setTimeout(function() { + self2.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); + 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); + } } - function reject(value) { - resume("throw", value); + if (callback) { + this.on("timeout", callback); } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + 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; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core14 = __importStar4(require_core()); - var fs2 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper2()); - var path2 = __importStar4(require("path")); - var patternHelper = __importStar4(require_internal_pattern_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_pattern_1 = require_internal_pattern2(); - var internal_search_state_1 = require_internal_search_state2(); - 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() { - var _a, e_1, _b, _c; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _d = true, _e = __asyncValues4(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); - } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs2.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (options.excludeHiddenFiles && path2.basename(item.path).match(/^\./)) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs2.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path2.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + [ + "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 = {}; } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter4(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; - }); + if (options.host) { + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs2.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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.`); + 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 request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } + this._currentUrl = /^\//.test(this._options.path) ? url.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 (request === self2._currentRequest) { + if (error3) { + self2.emit("error", error3); + } else if (i < buffers.length) { + var buffer = buffers[i++]; + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); } - throw err; - } - } else { - stats = yield fs2.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs2.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + } else if (self2._ended) { + request.end(); } - 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 __createBinding4 = 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]; - } }; + RedirectableRequest.prototype._processResponse = function(response) { + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode + }); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + destroyRequest(this._currentRequest); + response.destroy(); + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; + 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); } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); + 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 = parseUrl(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); + var redirectUrl = resolveUrl(location, currentUrl); + debug4("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(/^(?:(?:proxy-)?authorization|cookie)$/i, 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(); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = void 0; - var crypto = __importStar4(require("crypto")); - var core14 = __importStar4(require_core()); - var fs2 = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var path2 = __importStar4(require("path")); - function hashFiles2(globber, currentWorkspace, verbose = false) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const writeDelegate = verbose ? core14.info : core14.debug; - let hasMatch = false; - const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const result = crypto.createHash("sha256"); - let count = 0; - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path2.sep}`)) { - writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); - continue; - } - if (fs2.statSync(file).isDirectory()) { - writeDelegate(`Skip directory '${file}'.`); - continue; - } - const hash = crypto.createHash("sha256"); - const pipeline = util.promisify(stream.pipeline); - yield pipeline(fs2.createReadStream(file), hash); - result.write(hash.digest()); - count++; - if (!hasMatch) { - hasMatch = true; - } + 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 request(input, options, callback) { + if (isURL(input)) { + input = spreadUrlObject(input); + } else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } else { + callback = options; + options = validateUrl(input); + input = { protocol }; } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; + if (isFunction(options)) { + callback = options; + options = null; + } + options = Object.assign({ + maxRedirects: exports3.maxRedirects, + maxBodyLength: exports3.maxBodyLength + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; } + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug4("options", options); + return new RedirectableRequest(options, callback); } - result.end(); - if (hasMatch) { - writeDelegate(`Found ${count} files to hash.`); - return result.digest("hex"); - } else { - writeDelegate(`No matches found for glob`); - return ""; + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; } + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true } + }); }); + return exports3; } - exports2.hashFiles = hashFiles2; - } -}); - -// node_modules/@actions/glob/lib/glob.js -var require_glob3 = __commonJS({ - "node_modules/@actions/glob/lib/glob.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + function noop() { + } + function parseUrl(input) { + var parsed; + if (useNativeURL) { + parsed = new URL2(input); + } else { + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + return parsed; + } + function resolveUrl(relative, base) { + return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative)); + } + 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]; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + } + 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); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + 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 } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = exports2.create = void 0; - var internal_globber_1 = require_internal_globber2(); - var internal_hash_files_1 = require_internal_hash_files(); - function create3(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); }); + return CustomError; } - exports2.create = create3; - function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - }); + function destroyRequest(request, error3) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error3); } - exports2.hashFiles = hashFiles2; + function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); + } + function isString(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; + } + module2.exports = wrap({ http, https: https2 }); + module2.exports.wrap = wrap; } }); @@ -116438,12 +123507,11 @@ var core13 = __toESM(require_core()); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -116460,14 +123528,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs2.lstat(itemPath, { bigint: true }) : await fs2.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs2.lstat(itemPath, { bigint: true }) : await fs2.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 fs2.readdir(itemPath) : await fs2.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs2.readdir(itemPath) : await fs2.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -116478,13 +123546,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -117364,6 +124432,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -117483,7 +124563,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -117523,16 +124603,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -119087,7 +126158,7 @@ var safeDump = renamed("safeDump", "dump"); var semver = __toESM(require_semver2()); // src/api-compatibility.json -var maximumVersion = "3.19"; +var maximumVersion = "3.20"; var minimumVersion = "3.14"; // src/util.ts @@ -119124,7 +126195,7 @@ function parseGitHubUrl(inputUrl) { var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; var hasBeenWarnedAboutVersion = false; function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== 1 /* GHES */) { + if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { return; } const disallowedAPIVersionReason = apiVersionInRange( @@ -119166,8 +126237,8 @@ var ConfigurationError = class extends Error { super(message); } }; -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } // src/actions-util.ts @@ -119230,17 +126301,17 @@ function getApiClient() { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -119277,38 +126348,39 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); +// src/logging.ts +var core7 = __toESM(require_core()); +function getActionsLogger() { + return { + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup + }; +} + // src/feature-flags.ts -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); // src/overlay-database-utils.ts -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts -var core7 = __toESM(require_core()); -var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); - -// src/logging.ts var core8 = __toESM(require_core()); -function getActionsLogger() { - return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup - }; -} +var toolrunner2 = __toESM(require_toolrunner()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); // src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); // src/feature-flags.ts var featureConfig = { @@ -119317,11 +126389,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -119333,6 +126400,16 @@ var featureConfig = { 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", @@ -119361,12 +126438,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -119467,6 +126538,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -119478,21 +126554,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -119502,9 +126579,12 @@ var featureConfig = { }; // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -119561,7 +126641,7 @@ var core12 = __toESM(require_core()); var import_archiver = __toESM(require_archiver()); // src/analyze.ts -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); // src/autobuild.ts var core11 = __toESM(require_core()); @@ -119709,29 +126789,32 @@ var cliErrorsConfig = { // src/setup-codeql.ts var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // src/tar.ts var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); // src/tools-download.ts var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib9()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // src/dependency-caching.ts -var actionsCache3 = __toESM(require_cache3()); -var glob = __toESM(require_glob3()); +var actionsCache3 = __toESM(require_cache4()); +var glob = __toESM(require_glob()); + +// src/artifact-scanner.ts +var exec = __toESM(require_exec()); // src/debug-artifacts.ts async function getArtifactUploaderClient(logger, ghVariant) { - if (ghVariant === 1 /* GHES */) { + 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." ); @@ -119784,9 +126867,9 @@ async function runWrapper() { } ); } - } catch (error4) { + } catch (error3) { logger.warning( - `start-proxy post-action step failed: ${getErrorMessage(error4)}` + `start-proxy post-action step failed: ${getErrorMessage(error3)}` ); } } @@ -119875,5 +126958,5 @@ tmp/lib/tmp.js: *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) */ diff --git a/lib/start-proxy-action.js b/lib/start-proxy-action.js index a22f9949eb..50555d40ea 100644 --- a/lib/start-proxy-action.js +++ b/lib/start-proxy-action.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os2 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os2 = __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() + os2.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs = __importStar4(require("fs")); - var os2 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug5("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay: delay2, persist } = mockDispatch2; + 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 (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve2({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path2 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path2 = __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, path2.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); + _a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path2.dirname(filePath); const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path2.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which4; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path2 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which4(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which4; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os2 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path2 = __importStar4(require("path")); - var io4 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path2 = __importStar2(require("path")); + var io4 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner3 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io4.which(this.toolPath, true); - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve2(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,30 +19504,44 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -19416,11 +19569,12 @@ var require_exec = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getExecOutput = exports2.exec = void 0; + exports2.exec = exec; + exports2.getExecOutput = getExecOutput; var string_decoder_1 = require("string_decoder"); - var tr = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(this, void 0, void 0, function* () { + var tr = __importStar2(require_toolrunner()); + function exec(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.`); @@ -19431,10 +19585,9 @@ var require_exec = __commonJS({ return runner.exec(); }); } - exports2.exec = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(this, void 0, void 0, function* () { + function getExecOutput(commandLine, args, options) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, _b; let stdout = ""; let stderr = ""; const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); @@ -19454,7 +19607,7 @@ var require_exec = __commonJS({ } }; const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); - const exitCode = yield exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); stdout += stdoutDecoder.end(); stderr += stderrDecoder.end(); return { @@ -19464,7 +19617,6 @@ var require_exec = __commonJS({ }; }); } - exports2.getExecOutput = getExecOutput2; } }); @@ -19472,7 +19624,7 @@ var require_exec = __commonJS({ var require_platform = __commonJS({ "node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,21 +19637,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -19526,18 +19688,19 @@ var require_platform = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + exports2.isLinux = exports2.isMacOS = exports2.isWindows = exports2.arch = exports2.platform = void 0; + exports2.getDetails = getDetails; + var os_1 = __importDefault2(require("os")); + var exec = __importStar2(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { silent: true }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { silent: true }); return { @@ -19545,9 +19708,9 @@ var require_platform = __commonJS({ version: version.trim() }; }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { silent: true }); const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : ""; @@ -19557,8 +19720,8 @@ var require_platform = __commonJS({ version }; }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + var getLinuxInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout } = yield exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { silent: true }); const [name, version] = stdout.trim().split("\n"); @@ -19573,7 +19736,7 @@ var require_platform = __commonJS({ exports2.isMacOS = exports2.platform === "darwin"; exports2.isLinux = exports2.platform === "linux"; function getDetails() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -19583,7 +19746,6 @@ var require_platform = __commonJS({ }); }); } - exports2.getDetails = getDetails; } }); @@ -19591,7 +19753,7 @@ var require_platform = __commonJS({ var require_core = __commonJS({ "node_modules/@actions/core/lib/core.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19604,246 +19766,31 @@ var require_core = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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_command(); - var file_command_1 = require_file_command(); - var utils_1 = require_utils(); - var os2 = __importStar4(require("os")); - var path2 = __importStar4(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 exportVariable4(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); - 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, val2)); - } - (0, command_1.issueCommand)("set-env", { name }, convertedVal); - } - exports2.exportVariable = exportVariable4; - function setSecret2(secret) { - (0, command_1.issueCommand)("add-mask", {}, secret); - } - exports2.setSecret = setSecret2; - function addPath(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}${path2.delimiter}${process.env["PATH"]}`; - } - exports2.addPath = addPath; - function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { - throw new Error(`Input required and not supplied: ${name}`); - } - if (options && options.trimWhitespace === false) { - return val2; - } - return val2.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 val2 = getInput2(name, options); - if (trueValue.includes(val2)) - return true; - if (falseValue.includes(val2)) - 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 setOutput2(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(os2.EOL); - (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); - } - exports2.setOutput = setOutput2; - function setCommandEcho(enabled) { - (0, command_1.issue)("echo", enabled ? "on" : "off"); - } - exports2.setCommandEcho = setCommandEcho; - function setFailed2(message) { - process.exitCode = ExitCode.Failure; - error4(message); - } - exports2.setFailed = setFailed2; - function isDebug2() { - return process.env["RUNNER_DEBUG"] === "1"; - } - exports2.isDebug = isDebug2; - function debug5(message) { - (0, command_1.issueCommand)("debug", {}, message); - } - exports2.debug = debug5; - function error4(message, properties = {}) { - (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.error = error4; - function warning6(message, properties = {}) { - (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.warning = warning6; - function notice(message, properties = {}) { - (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); - } - exports2.notice = notice; - function info6(message) { - process.stdout.write(message + os2.EOL); - } - exports2.info = info6; - function startGroup3(name) { - (0, command_1.issue)("group", name); - } - exports2.startGroup = startGroup3; - function endGroup3() { - (0, command_1.issue)("endgroup"); - } - exports2.endGroup = endGroup3; - function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { - startGroup3(name); - let result; - try { - result = yield fn(); - } finally { - endGroup3(); + 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; - }); - } - 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 getState2(name) { - return process.env[`STATE_${name}`] || ""; - } - exports2.getState = getState2; - function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { - return yield oidc_utils_1.OidcClient.getIDToken(aud); - }); - } - exports2.getIDToken = getIDToken; - 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 = __importStar4(require_platform()); - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + }; + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -19870,153 +19817,474 @@ var require_io_util2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var _a; 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 fs = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + exports2.platform = exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = exports2.markdownSummary = exports2.summary = exports2.ExitCode = void 0; + exports2.exportVariable = exportVariable4; + exports2.setSecret = setSecret2; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput2; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug5; + exports2.error = error3; + exports2.warning = warning7; + exports2.notice = notice; + exports2.info = info6; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState3; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; + var command_1 = require_command(); + var file_command_1 = require_file_command(); + var utils_1 = require_utils(); + var os2 = __importStar2(require("os")); + var path2 = __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 exportVariable4(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 addPath(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}${path2.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 setOutput2(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(os2.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 setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + function debug5(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 warning7(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 info6(message) { + process.stdout.write(message + os2.EOL); + } + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; try { - yield exports2.stat(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; - } - throw err; + result = yield fn(); + } finally { + endGroup3(); } - return true; + return result; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); - return stats.isDirectory(); + 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 getState2(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); }); } - exports2.isDirectory = isDirectory; - function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); + 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/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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; } - if (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - return p.startsWith("/"); + return { + title: annotationProperties.title, + file: annotationProperties.file, + line: annotationProperties.startLine, + endLine: annotationProperties.endLine, + col: annotationProperties.startColumn, + endColumn: annotationProperties.endColumn + }; } - exports2.isRooted = isRooted; - function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(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 = path2.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } - } + exports2.toCommandProperties = toCommandProperties; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/tool-cache/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 os2 = __importStar2(require("os")); + var utils_1 = require_utils3(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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"; } - 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 = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path2.join(directory, actualName); - break; - } + 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 += ","; } - } 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; + cmdStr += `${key}=${escapeProperty(val)}`; } } } } - return ""; + 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/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/tool-cache/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 crypto2 = __importStar2(require("crypto")); + var fs = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils3(); + 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 (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; - function normalizeSeparators(p) { - p = p || ""; - if (exports2.IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - return p.replace(/\\\\+/g, "\\"); + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - return p.replace(/\/\/+/g, "/"); + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); + } + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - function isUnixExecutable(stats) { - return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && stats.uid === process.getuid(); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy2 = __commonJS({ + "node_modules/@actions/tool-cache/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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; + } } - function getCmdPath() { - var _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + 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.getCmdPath = getCmdPath; + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -20044,7650 +20312,7483 @@ var require_io2 = __commonJS({ }); }; 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 path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source, dest, options = {}) { - return __awaiter4(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 ? path2.join(dest, path2.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 (path2.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.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(path2.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - exports2.mv = mv; - function rmRF(inputPath) { - return __awaiter4(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.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; + var http = __importStar2(require("http")); + var https = __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.rmRF = rmRF; - function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); + 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((resolve2) => __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", () => { + resolve2(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + })); + }); + } + }; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - exports2.mkdirP = mkdirP; - function which4(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which4(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.`); - } + exports2.isHttps = isHttps; + var HttpClient = class { + constructor(userAgent, 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 = userAgent; + 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; } - return result; - } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; } - return ""; - }); - } - exports2.which = which4; - function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); + } + 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, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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(); } - const extensions = []; - if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { - for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { - if (extension) { - extensions.push(extension); + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve2(res); + } } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); } - return []; - } - if (tool.includes(path2.sep)) { - return []; } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { - if (p) { - directories.push(p); - } + const req = info6.httpModule.request(info6.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: ${info6.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); } - 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 __awaiter4(this, void 0, void 0, function* () { - if (currentDepth >= 255) + } + /** + * 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; - 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 copyFile(srcFile, destFile, force); - } } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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); - } + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - 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/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 debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + return info6; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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 https.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((resolve2) => setTimeout(() => resolve2(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve2(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 { + resolve2(response); + } + })); + }); + } }; - module2.exports = debug5; + exports2.HttpClient = HttpClient; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/semver/internal/re.js -var require_re = __commonJS({ - "node_modules/semver/internal/re.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var { - MAX_SAFE_COMPONENT_LENGTH, - MAX_SAFE_BUILD_LENGTH, - MAX_LENGTH - } = require_constants6(); - var debug5 = 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}}`); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - return value; - }; - var createToken = (name, value, isGlobal) => { - const safe = makeSafeRegex(value); - const index = R++; - debug5(name, index, value); - t[name] = index; - src[index] = value; - safeSrc[index] = safe; - re[index] = new RegExp(value, isGlobal ? "g" : void 0); - safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - 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; + 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; } - if (typeof options !== "object") { - return looseOption; + 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"); + }); } - 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 numeric = /^[0-9]+$/; - var compareIdentifiers = (a, b) => { - if (typeof a === "number" && typeof b === "number") { - return a === b ? 0 : a < b ? -1 : 1; + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - const anum = numeric.test(a); - const bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; + // 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"); + }); } - 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 + 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/semver/classes/semver.js -var require_semver = __commonJS({ - "node_modules/semver/classes/semver.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var debug5 = 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 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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } 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` - ); - } - debug5("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"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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; - }); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OidcClient = void 0; + var http_client_1 = require_lib2(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + 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"); } - this.build = m[5] ? m[5].split(".") : []; - this.format(); + return token; } - format() { - this.version = `${this.major}.${this.minor}.${this.patch}`; - if (this.prerelease.length) { - this.version += `-${this.prerelease.join(".")}`; + 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 this.version; + return runtimeUrl; } - toString() { - return this.version; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); + } + return id_token; + }); } - compare(other) { - debug5("SemVer.compare", this.version, this.options, other); - if (!(other instanceof _SemVer)) { - if (typeof other === "string" && other === this.version) { - return 0; + 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}`); } - 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; + }; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve2) { + resolve2(value); + }); } - 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]; - debug5("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); + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } 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]; - debug5("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); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - } while (++i); + } + function step(result) { + result.done ? resolve2(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 = ""; } - // 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"); + /** + * 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; } - if (identifier) { - const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); - if (!match || match[1] !== identifier) { - throw new Error(`invalid identifier: ${identifier}`); - } + 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.`); } - } - 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 (compareIdentifiers(this.prerelease[0], identifier) === 0) { - if (isNaN(this.prerelease[1])) { - this.prerelease = prerelease; - } - } else { - this.prerelease = prerelease; - } - } - break; + try { + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } - default: - throw new Error(`invalid increment argument: ${release2}`); - } - this.raw = this.format(); - if (this.build.length) { - this.raw += `+${this.build.join(".")}`; + 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(); + } }; - module2.exports = SemVer; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/semver/functions/parse.js -var require_parse2 = __commonJS({ - "node_modules/semver/functions/parse.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var SemVer = require_semver(); - var parse = (version, options, throwErrors = false) => { - if (version instanceof SemVer) { - return version; + 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]; + } }; } - try { - return new SemVer(version, options); - } catch (er) { - if (!throwErrors) { - return null; - } - throw er; + 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; }; - module2.exports = parse; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path2 = __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, path2.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/semver/functions/valid.js -var require_valid = __commonJS({ - "node_modules/semver/functions/valid.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var parse = require_parse2(); - var valid2 = (version, options) => { - const v = parse(version, options); - return v ? v.version : null; - }; - module2.exports = valid2; - } -}); - -// node_modules/semver/functions/clean.js -var require_clean = __commonJS({ - "node_modules/semver/functions/clean.js"(exports2, module2) { - "use strict"; - var parse = require_parse2(); - var clean = (version, options) => { - const s = parse(version.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; - }; - module2.exports = clean; - } -}); - -// 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; + 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; }; - module2.exports = inc; - } -}); - -// node_modules/semver/functions/diff.js -var require_diff = __commonJS({ - "node_modules/semver/functions/diff.js"(exports2, module2) { - "use strict"; - var parse = require_parse2(); - var diff = (version1, version2) => { - const v1 = parse(version1, null, true); - const v2 = parse(version2, null, true); - const comparison = v1.compare(v2); - if (comparison === 0) { - return null; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - 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"; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (lowVersion.compareMain(highVersion) === 0) { - if (lowVersion.minor && !lowVersion.patch) { - return "minor"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return "patch"; } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + 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 fs = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); + _a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs.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'); } - 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"; + if (exports2.IS_WINDOWS) { + return p.startsWith("\\") || /^[A-Z]:/i.test(p); } - 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 parse = require_parse2(); - var prerelease = (version, options) => { - const parsed = parse(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 compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); - module2.exports = compare; - } -}); - -// node_modules/semver/functions/rcompare.js -var require_rcompare = __commonJS({ - "node_modules/semver/functions/rcompare.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var rcompare = (a, b, loose) => compare(b, a, loose); - module2.exports = rcompare; - } -}); - -// node_modules/semver/functions/compare-loose.js -var require_compare_loose = __commonJS({ - "node_modules/semver/functions/compare-loose.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var compareLoose = (a, b) => compare(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 compare = require_compare(); - var gt = (a, b, loose) => compare(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 compare = require_compare(); - var lt = (a, b, loose) => compare(a, b, loose) < 0; - module2.exports = lt; - } -}); - -// node_modules/semver/functions/eq.js -var require_eq = __commonJS({ - "node_modules/semver/functions/eq.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var eq = (a, b, loose) => compare(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 compare = require_compare(); - var neq = (a, b, loose) => compare(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 compare = require_compare(); - var gte3 = (a, b, loose) => compare(a, b, loose) >= 0; - module2.exports = gte3; - } -}); - -// node_modules/semver/functions/lte.js -var require_lte = __commonJS({ - "node_modules/semver/functions/lte.js"(exports2, module2) { - "use strict"; - var compare = require_compare(); - var lte = (a, b, loose) => compare(a, b, loose) <= 0; - module2.exports = lte; - } -}); - -// 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 gte3 = require_gte(); - var lt = require_lt(); - var lte = require_lte(); - var cmp = (a, op, b, loose) => { - switch (op) { - case "===": - if (typeof a === "object") { - a = a.version; + 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 (typeof b === "object") { - b = b.version; + } + if (stats && stats.isFile()) { + if (exports2.IS_WINDOWS) { + const upperExt = path2.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { + return filePath; + } + } else { + if (isUnixExecutable(stats)) { + return filePath; + } } - return a === b; - case "!==": - if (typeof a === "object") { - a = a.version; + } + 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 (typeof b === "object") { - b = b.version; + if (stats && stats.isFile()) { + if (exports2.IS_WINDOWS) { + try { + const directory = path2.dirname(filePath); + const upperName = path2.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path2.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 a !== b; - case "": - case "=": - case "==": - return eq(a, b, loose); - case "!=": - return neq(a, b, loose); - case ">": - return gt(a, b, loose); - case ">=": - return gte3(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError(`Invalid operator: ${op}`); + } + return ""; + }); + } + exports2.tryGetExecutablePath = tryGetExecutablePath; + function normalizeSeparators(p) { + p = p || ""; + if (exports2.IS_WINDOWS) { + p = p.replace(/\//g, "\\"); + return p.replace(/\\\\+/g, "\\"); } - }; - module2.exports = cmp; + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; } }); -// node_modules/semver/functions/coerce.js -var require_coerce = __commonJS({ - "node_modules/semver/functions/coerce.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var SemVer = require_semver(); - var parse = require_parse2(); - var { safeRe: re, t } = require_re(); - var coerce2 = (version, options) => { - if (version instanceof SemVer) { - return version; - } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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(resolve2) { + resolve2(value); + }); } - options = options || {}; - let match = null; - if (!options.rtl) { - match = 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)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; } - coerceRtlRegex.lastIndex = -1; - } - if (match === null) { - return null; - } - const major = match[2]; - const minor = match[3] || "0"; - const patch = match[4] || "0"; - const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ""; - const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; - return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - module2.exports = coerce2; - } -}); - -// 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; + 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 path2 = __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 ? path2.join(dest, path2.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 { - this.map.delete(key); - this.map.set(key, value); - return value; + if (path2.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); } - } - 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); + }); + } + 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 = path2.join(dest, path2.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"); + } } - 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(range, options) { - options = parseOptions(options); - if (range instanceof _Range) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new _Range(range.raw, options); + yield mkdirP(path2.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'); } } - if (range instanceof Comparator) { - this.raw = range.value; - this.set = [[range]]; - this.formatted = void 0; - return this; + 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}`); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.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}`); + }); + } + 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 which4(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - 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; - } + if (check) { + const result = yield which4(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; } - 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(); - } - } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; } - return this.formatted; - } - format() { - return this.range; - } - toString() { - return this.range; - } - parseRange(range) { - const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); - const memoKey = memoOpts + ":" + range; - const cached = cache.get(memoKey); - if (cached) { - return cached; + return ""; + }); + } + exports2.which = which4; + function findInPath(tool) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - const loose = this.options.loose; - const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); - debug5("hyphen replace", range); - range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); - debug5("comparator trim", range); - range = range.replace(re[t.TILDETRIM], tildeTrimReplace); - debug5("tilde trim", range); - range = range.replace(re[t.CARETTRIM], caretTrimReplace); - debug5("caret trim", range); - let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); - if (loose) { - rangeList = rangeList.filter((comp) => { - debug5("loose invalid filter", comp, this.options); - return !!comp.match(re[t.COMPARATORLOOSE]); - }); + const extensions = []; + if (ioUtil.IS_WINDOWS && process.env["PATHEXT"]) { + for (const extension of process.env["PATHEXT"].split(path2.delimiter)) { + if (extension) { + extensions.push(extension); + } + } } - debug5("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]; + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; } - rangeMap.set(comp.value, comp); + return []; } - if (rangeMap.size > 1 && rangeMap.has("")) { - rangeMap.delete(""); + if (tool.includes(path2.sep)) { + return []; } - const result = [...rangeMap.values()]; - cache.set(memoKey, result); - return result; - } - intersects(range, options) { - if (!(range instanceof _Range)) { - throw new TypeError("a Range is required"); + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path2.delimiter)) { + if (p) { + directories.push(p); + } + } } - return this.set.some((thisComparators) => { - return isSatisfiable(thisComparators, options) && range.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; + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; + 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 copyFile(srcFile, destFile, force); } } - for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version, this.options)) { - return true; + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + function copyFile(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); } - return false; + }); + } + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/tool-cache/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; }; - module2.exports = Range2; - var LRU = require_lrucache(); - var cache = new LRU(); - var parseOptions = require_parse_options(); - var Comparator = require_comparator(); - var debug5 = require_debug(); - var SemVer = require_semver(); - var { - safeRe: re, - t, - comparatorTrimReplace, - tildeTrimReplace, - caretTrimReplace - } = require_re(); - var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants6(); - 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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); - testComparator = remainingComparators.pop(); } - return result; - }; - var parseComparator = (comp, options) => { - comp = comp.replace(re[t.BUILD], ""); - debug5("comp", comp, options); - comp = replaceCarets(comp, options); - debug5("caret", comp); - comp = replaceTildes(comp, options); - debug5("tildes", comp); - comp = replaceXRanges(comp, options); - debug5("xrange", comp); - comp = replaceStars(comp, options); - debug5("stars", comp); - return comp; - }; - var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; - 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]; - return comp.replace(r, (_, M, m, p, pr) => { - debug5("tilde", comp, _, M, m, p, pr); - let ret; - if (isX(M)) { - ret = ""; - } else if (isX(m)) { - ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; - } else if (isX(p)) { - ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; - } else if (pr) { - debug5("replaceTilde pr", pr); - ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; - } else { - ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - debug5("tilde return", ret); - return ret; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var replaceCarets = (comp, options) => { - return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); - }; - var replaceCaret = (comp, options) => { - debug5("caret", comp, options); - const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; - const z = options.includePrerelease ? "-0" : ""; - return comp.replace(r, (_, M, m, p, pr) => { - debug5("caret", comp, _, 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) { - debug5("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`; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path2 = __importStar2(require("path")); + var io4 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner3 = 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 { - ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`; + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; + } } } else { - debug5("no pr"); - if (M === "0") { - if (m === "0") { - ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; - } else { - ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; - } - } else { - ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; } } - debug5("caret return", ret); - return ret; - }); - }; - var replaceXRanges = (comp, options) => { - debug5("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) => { - debug5("xRange", comp, ret, gtlt, M, m, p, pr); - 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"; + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); } - 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`; + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - debug5("xRange return", ret); - return ret; - }); - }; - var replaceStars = (comp, options) => { - debug5("replaceStars", comp, options); - return comp.trim().replace(re[t.STAR], ""); - }; - var replaceGTE0 = (comp, options) => { - debug5("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 = (set2, version, options) => { - for (let i = 0; i < set2.length; i++) { - if (!set2[i].test(version)) { - return false; + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } } + return this.toolPath; } - if (version.prerelease.length && !options.includePrerelease) { - for (let i = 0; i < set2.length; i++) { - debug5(set2[i].semver); - if (set2[i].semver === Comparator.ANY) { - continue; - } - if (set2[i].semver.prerelease.length > 0) { - const allowed = set2[i].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; + _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 false; + return this.args; } - return true; - }; - } -}); - -// node_modules/semver/classes/comparator.js -var require_comparator = __commonJS({ - "node_modules/semver/classes/comparator.js"(exports2, module2) { - "use strict"; - var ANY = Symbol("SemVer ANY"); - var Comparator = class _Comparator { - static get ANY() { - return ANY; + _endsWith(str2, end) { + return str2.endsWith(end); } - constructor(comp, options) { - options = parseOptions(options); - if (comp instanceof _Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } } - comp = comp.trim().split(/\s+/).join(" "); - debug5("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; + if (!needsQuotes) { + return arg; } - debug5("comp", this); + 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(""); } - 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}`); + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); + 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(""); } - toString() { - return this.value; + _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; } - test(version) { - debug5("Comparator.test", version, this.options.loose); - if (this.semver === ANY || version === ANY) { - return true; + _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}"`; } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; + 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 = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - } - return cmp(version, this.operator, this.semver, this.options); + this.toolPath = yield io4.which(this.toolPath, true); + return new Promise((resolve2, 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) + os2.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 { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } - intersects(comp, options) { - if (!(comp instanceof _Comparator)) { - throw new TypeError("a Comparator is required"); + }; + exports2.ToolRunner = ToolRunner3; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } - if (this.operator === "") { - if (this.value === "") { - return true; + 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); } - return new Range2(comp.value, options).test(this.value); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + continue; + } + if (c === "\\" && escaped) { + append(c); + continue; + } + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; } - return new Range2(this.value, options).test(comp.semver); + continue; } - options = parseOptions(options); - if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { - return false; + 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"); } - if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { - return false; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { - return true; + } + CheckComplete() { + if (this.done) { + return; } - if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { - return true; + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } - if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { - return true; + } + _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 (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { - return true; + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; } - if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { - return true; + this.done = true; + this.emit("done", error3, this.processExitCode); + } + static HandleTimeout(state) { + if (state.done) { + return; } - return false; + 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(); } }; - module2.exports = Comparator; - var parseOptions = require_parse_options(); - var { safeRe: re, t } = require_re(); - var cmp = require_cmp(); - var debug5 = 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) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var Range2 = require_range(); - var satisfies2 = (version, range, options) => { - try { - range = new Range2(range, options); - } catch (er) { - return false; - } - return range.test(version); + 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; }; - 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 = (range, options) => new Range2(range, 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, range, options) => { - let max = null; - let maxSV = null; - let rangeObj = null; - try { - rangeObj = new Range2(range, options); - } catch (er) { - return null; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - versions.forEach((v) => { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - return max; }; - module2.exports = maxSatisfying; + 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 exec(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 = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports2.getExecOutput = getExecOutput; } }); -// node_modules/semver/ranges/min-satisfying.js -var require_min_satisfying = __commonJS({ - "node_modules/semver/ranges/min-satisfying.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var SemVer = require_semver(); - var Range2 = require_range(); - var minSatisfying = (versions, range, options) => { - let min = null; - let minSV = null; - let rangeObj = null; - try { - rangeObj = new Range2(range, options); - } catch (er) { - return null; + 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]; + } }; } - versions.forEach((v) => { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); + 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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - return min; }; - module2.exports = minSatisfying; + 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 exec = __importStar2(require_exec2()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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/semver/ranges/min-version.js -var require_min_version = __commonJS({ - "node_modules/semver/ranges/min-version.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js"(exports2) { "use strict"; - var SemVer = require_semver(); - var Range2 = require_range(); - var gt = require_gt(); - var minVersion = (range, loose) => { - range = new Range2(range, loose); - let minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + 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]; + } }; } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; + 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); } - minver = null; - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.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}`); - } + __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(resolve2) { + resolve2(value); }); - if (setMin && (!minver || gt(minver, setMin))) { - minver = setMin; + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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_utils3(); + var os2 = __importStar2(require("os")); + var path2 = __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 exportVariable4(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)); } - if (minver && range.test(minver)) { - return minver; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); + } + exports2.exportVariable = exportVariable4; + function setSecret2(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret2; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return null; + process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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 setOutput2(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(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning7(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning7; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + 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 getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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/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 }; - module2.exports = minVersion; } }); -// node_modules/semver/ranges/valid.js -var require_valid2 = __commonJS({ - "node_modules/semver/ranges/valid.js"(exports2, module2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var Range2 = require_range(); - var validRange = (range, options) => { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; - } + var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; - module2.exports = validRange; + module2.exports = debug5; } }); -// node_modules/semver/ranges/outside.js -var require_outside = __commonJS({ - "node_modules/semver/ranges/outside.js"(exports2, module2) { +// node_modules/semver/internal/re.js +var require_re = __commonJS({ + "node_modules/semver/internal/re.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 lt = require_lt(); - var lte = require_lte(); - var gte3 = require_gte(); - var outside = (version, range, hilo, options) => { - version = new SemVer(version, options); - range = new Range2(range, options); - let gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte3; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - if (satisfies2(version, range, options)) { - return false; - } - for (let i = 0; i < range.set.length; ++i) { - const comparators = range.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; - } + var { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH + } = require_constants6(); + var debug5 = 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 true; + return value; }; - 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, range, options) => outside(version, range, ">", options); - module2.exports = gtr; + var createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value); + const index = R++; + debug5(name, index, value); + t[name] = index; + src[index] = value; + safeSrc[index] = safe; + re[index] = new RegExp(value, isGlobal ? "g" : void 0); + safeRe[index] = 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/ranges/ltr.js -var require_ltr = __commonJS({ - "node_modules/semver/ranges/ltr.js"(exports2, module2) { +// node_modules/semver/internal/parse-options.js +var require_parse_options = __commonJS({ + "node_modules/semver/internal/parse-options.js"(exports2, module2) { "use strict"; - var outside = require_outside(); - var ltr = (version, range, options) => outside(version, range, "<", options); - module2.exports = ltr; + 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/ranges/intersects.js -var require_intersects = __commonJS({ - "node_modules/semver/ranges/intersects.js"(exports2, module2) { +// node_modules/semver/internal/identifiers.js +var require_identifiers = __commonJS({ + "node_modules/semver/internal/identifiers.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); + var numeric = /^[0-9]+$/; + var compareIdentifiers = (a, b) => { + if (typeof a === "number" && typeof b === "number") { + return a === b ? 0 : a < b ? -1 : 1; + } + const anum = numeric.test(a); + const bnum = numeric.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 }; - module2.exports = intersects; } }); -// node_modules/semver/ranges/simplify.js -var require_simplify = __commonJS({ - "node_modules/semver/ranges/simplify.js"(exports2, module2) { +// node_modules/semver/classes/semver.js +var require_semver = __commonJS({ + "node_modules/semver/classes/semver.js"(exports2, module2) { "use strict"; - var satisfies2 = require_satisfies(); - var compare = require_compare(); - module2.exports = (versions, range, options) => { - const set2 = []; - let first = null; - let prev = null; - const v = versions.sort((a, b) => compare(a, b, options)); - for (const version of v) { - const included = satisfies2(version, range, options); - if (included) { - prev = version; - if (!first) { - first = version; + var debug5 = 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 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` + ); + } + debug5("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 { - if (prev) { - set2.push([first, prev]); - } - prev = null; - first = null; + 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(); } - if (first) { - set2.push([first, null]); - } - const ranges = []; - for (const [min, max] of set2) { - 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}`); + format() { + this.version = `${this.major}.${this.minor}.${this.patch}`; + if (this.prerelease.length) { + this.version += `-${this.prerelease.join(".")}`; } + return this.version; } - const simplified = ranges.join(" || "); - const original = typeof range.raw === "string" ? range.raw : String(range); - return simplified.length < original.length ? simplified : range; - }; - } -}); - -// 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 compare = require_compare(); - var subset = (sub, dom, options = {}) => { - if (sub === dom) { - return true; + toString() { + return this.version; } - 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; + compare(other) { + debug5("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 (sawNonNull) { - return false; + if (other.version === this.version) { + return 0; } + return this.compareMain(other) || this.comparePre(other); } - return true; - }; - var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; - var minimumVersion = [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 = minimumVersion; + compareMain(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); } - } - if (dom.length === 1 && dom[0].semver === ANY) { - if (options.includePrerelease) { - return true; - } else { - dom = minimumVersion; + if (this.major < other.major) { + return -1; } - } - const eqSet = /* @__PURE__ */ new Set(); - let gt, lt; - for (const c of sub) { - if (c.operator === ">" || c.operator === ">=") { - gt = higherGT(gt, c, options); - } else if (c.operator === "<" || c.operator === "<=") { - lt = lowerLT(lt, c, options); - } else { - eqSet.add(c.semver); + if (this.major > other.major) { + return 1; } - } - if (eqSet.size > 1) { - return null; - } - let gtltComp; - if (gt && lt) { - gtltComp = compare(gt.semver, lt.semver, options); - if (gtltComp > 0) { - return null; - } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) { - return null; + 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; } - for (const eq of eqSet) { - if (gt && !satisfies2(eq, String(gt), options)) { - return null; + comparePre(other) { + if (!(other instanceof _SemVer)) { + other = new _SemVer(other, this.options); } - if (lt && !satisfies2(eq, String(lt), options)) { - return null; + 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; } - for (const c of dom) { - if (!satisfies2(eq, String(c), options)) { - return false; + let i = 0; + do { + const a = this.prerelease[i]; + const b = other.prerelease[i]; + debug5("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); } - } - return true; + } while (++i); } - let higher, lower; - let hasDomLT, hasDomGT; - let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; - let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; - if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { - needDomLTPre = false; + 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]; + debug5("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); } - 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; - } + // 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 (c.operator === ">" || c.operator === ">=") { - higher = higherGT(gt, c, options); - if (higher === c && higher !== gt) { - return false; + if (identifier) { + const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]); + if (!match || match[1] !== identifier) { + throw new Error(`invalid identifier: ${identifier}`); } - } else if (gt.operator === ">=" && !satisfies2(gt.semver, String(c), options)) { - return false; } } - if (lt) { - 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; + 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); } - } - if (c.operator === "<" || c.operator === "<=") { - lower = lowerLT(lt, c, options); - if (lower === c && lower !== lt) { - return false; + this.inc("pre", identifier, identifierBase); + break; + case "release": + if (this.prerelease.length === 0) { + throw new Error(`version ${this.raw} is not a prerelease`); } - } else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options)) { - return false; + 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 (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease; + } + } else { + this.prerelease = prerelease; + } + } + break; } + default: + throw new Error(`invalid increment argument: ${release2}`); } - if (!c.operator && (lt || gt) && gtltComp !== 0) { - return false; + this.raw = this.format(); + if (this.build.length) { + this.raw += `+${this.build.join(".")}`; } + return this; } - if (gt && hasDomLT && !lt && gtltComp !== 0) { - return false; - } - if (lt && hasDomGT && !gt && gtltComp !== 0) { - return false; - } - if (needDomGTPre || needDomLTPre) { - return false; - } - return true; }; - var higherGT = (a, b, options) => { - if (!a) { - return b; + 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 parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version; } - const comp = compare(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; + try { + return new SemVer(version, options); + } catch (er) { + if (!throwErrors) { + return null; + } + throw er; } - const comp = compare(a.semver, b.semver, options); - return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a; }; - module2.exports = subset; + module2.exports = parse; } }); -// node_modules/semver/index.js -var require_semver2 = __commonJS({ - "node_modules/semver/index.js"(exports2, module2) { +// node_modules/semver/functions/valid.js +var require_valid = __commonJS({ + "node_modules/semver/functions/valid.js"(exports2, module2) { "use strict"; - var internalRe = require_re(); - var constants = require_constants6(); - var SemVer = require_semver(); - var identifiers = require_identifiers(); var parse = require_parse2(); - var valid2 = require_valid(); - var clean = 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 compare = require_compare(); - var rcompare = 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 lt = require_lt(); - var eq = require_eq(); - var neq = require_neq(); - var gte3 = require_gte(); - var lte = require_lte(); - var cmp = require_cmp(); - var coerce2 = require_coerce(); - 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, - valid: valid2, - clean, - inc, - diff, - major, - minor, - patch, - prerelease, - compare, - rcompare, - compareLoose, - compareBuild, - sort, - rsort, - gt, - lt, - eq, - neq, - gte: gte3, - lte, - cmp, - coerce: coerce2, - 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 + var valid2 = (version, options) => { + const v = parse(version, options); + return v ? v.version : null; }; + module2.exports = valid2; } }); -// node_modules/@actions/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { +// node_modules/semver/functions/clean.js +var require_clean = __commonJS({ + "node_modules/semver/functions/clean.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + var parse = require_parse2(); + var clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver5 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os2 = require("os"); - var cp = require("child_process"); - var fs = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os2.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver5.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 = semver5.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os2.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; - } - } - } + module2.exports = clean; + } +}); + +// 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; } - return version; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs.existsSync(lsbReleaseFile)) { - contents = fs.readFileSync(lsbReleaseFile).toString(); - } else if (fs.existsSync(osReleaseFile)) { - contents = fs.readFileSync(osReleaseFile).toString(); + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release2, identifier, identifierBase).version; + } catch (er) { + return null; } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; + }; + module2.exports = inc; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy2 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/semver/functions/diff.js +var require_diff = __commonJS({ + "node_modules/semver/functions/diff.js"(exports2, module2) { "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; + var parse = require_parse2(); + var diff = (version1, version2) => { + const v1 = parse(version1, null, true); + const v2 = parse(version2, null, true); + const comparison = v1.compare(v2); + if (comparison === 0) { + return null; } - 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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + 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"; } - } 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; + if (lowVersion.compareMain(highVersion) === 0) { + if (lowVersion.minor && !lowVersion.patch) { + return "minor"; + } + return "patch"; } } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + const prefix = highHasPre ? "pre" : ""; + if (v1.major !== v2.major) { + return prefix + "major"; } - get username() { - return this._decodedUsername; + if (v1.minor !== v2.minor) { + return prefix + "minor"; } - get password() { - return this._decodedPassword; + if (v1.patch !== v2.patch) { + return prefix + "patch"; } + return "prerelease"; }; + module2.exports = diff; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib2 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/semver/functions/major.js +var require_major = __commonJS({ + "node_modules/semver/functions/major.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = __importStar4(require("http")); - var https = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(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); - } + 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 parse = require_parse2(); + var prerelease = (version, options) => { + const parsed = parse(version, options); + return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; - } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); - } + 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 compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)); + module2.exports = compare; + } +}); + +// node_modules/semver/functions/rcompare.js +var require_rcompare = __commonJS({ + "node_modules/semver/functions/rcompare.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var rcompare = (a, b, loose) => compare(b, a, loose); + module2.exports = rcompare; + } +}); + +// node_modules/semver/functions/compare-loose.js +var require_compare_loose = __commonJS({ + "node_modules/semver/functions/compare-loose.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var compareLoose = (a, b) => compare(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); }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient = class { - constructor(userAgent, 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 = userAgent; - 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); + 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 compare = require_compare(); + var gt = (a, b, loose) => compare(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 compare = require_compare(); + var lt = (a, b, loose) => compare(a, b, loose) < 0; + module2.exports = lt; + } +}); + +// node_modules/semver/functions/eq.js +var require_eq = __commonJS({ + "node_modules/semver/functions/eq.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var eq = (a, b, loose) => compare(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 compare = require_compare(); + var neq = (a, b, loose) => compare(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 compare = require_compare(); + var gte4 = (a, b, loose) => compare(a, b, loose) >= 0; + module2.exports = gte4; + } +}); + +// node_modules/semver/functions/lte.js +var require_lte = __commonJS({ + "node_modules/semver/functions/lte.js"(exports2, module2) { + "use strict"; + var compare = require_compare(); + var lte = (a, b, loose) => compare(a, b, loose) <= 0; + module2.exports = lte; + } +}); + +// 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 gte4 = require_gte(); + var lt = require_lt(); + var lte = require_lte(); + var cmp = (a, op, b, loose) => { + switch (op) { + case "===": + if (typeof a === "object") { + a = a.version; } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; + if (typeof b === "object") { + b = b.version; } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + return a === b; + case "!==": + if (typeof a === "object") { + a = a.version; } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + if (typeof b === "object") { + b = b.version; } - } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + 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 gte4(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError(`Invalid operator: ${op}`); } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + }; + 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 parse = require_parse2(); + var { safeRe: re, t } = require_re(); + var coerce2 = (version, options) => { + if (version instanceof SemVer) { + return version; } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + if (typeof version === "number") { + version = String(version); } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + if (typeof version !== "string") { + return null; } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + options = options || {}; + let match = null; + if (!options.rtl) { + match = 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)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length; + } + coerceRtlRegex.lastIndex = -1; } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + if (match === null) { + return null; } - /** - * 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 __awaiter4(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); - }); + const major = match[2]; + const minor = match[3] || "0"; + const patch = match[4] || "0"; + const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ""; + const build = options.includePrerelease && match[6] ? `+${match[6]}` : ""; + return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options); + }; + module2.exports = coerce2; + } +}); + +// 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(); } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; + } } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + delete(key) { + return this.map.delete(key); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + 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; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + }; + 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(range, options) { + options = parseOptions(options); + if (range instanceof _Range) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new _Range(range.raw, options); } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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) { + } + if (range instanceof Comparator) { + this.raw = range.value; + this.set = [[range]]; + this.formatted = void 0; + return this; + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.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; } - 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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; + this.formatted = void 0; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); + 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(); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info6.httpModule.request(info6.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: ${info6.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 info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); } } - return info6; + return this.formatted; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + format() { + return this.range; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + toString() { + return this.range; } - _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; + parseRange(range) { + const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE); + const memoKey = memoOpts + ":" + range; + const cached = cache.get(memoKey); + if (cached) { + return cached; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const loose = this.options.loose; + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)); + debug5("hyphen replace", range); + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace); + debug5("comparator trim", range); + range = range.replace(re[t.TILDETRIM], tildeTrimReplace); + debug5("tilde trim", range); + range = range.replace(re[t.CARETTRIM], caretTrimReplace); + debug5("caret trim", range); + let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options)); + if (loose) { + rangeList = rangeList.filter((comp) => { + debug5("loose invalid filter", comp, this.options); + return !!comp.match(re[t.COMPARATORLOOSE]); + }); } - 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; + debug5("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]; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.Agent(options) : new http.Agent(options); - this._agent = agent; + rangeMap.set(comp.value, comp); } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + if (rangeMap.size > 1 && rangeMap.has("")) { + rangeMap.delete(""); } - return agent; + const result = [...rangeMap.values()]; + cache.set(memoKey, result); + return result; } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; - } - if (proxyAgent) { - return proxyAgent; + intersects(range, options) { + if (!(range instanceof _Range)) { + throw new TypeError("a Range is required"); } - 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 this.set.some((thisComparators) => { + return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => { + return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options); + }); + }); }); - } - return proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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 { - resolve2(response); - } - })); - }); - } - }; - exports2.HttpClient = HttpClient; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); }); } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + // if ANY of the sets match ALL of its comparators, then pass + test(version) { + if (!version) { + return false; } - function rejected(value) { + if (typeof version === "string") { try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + version = new SemVer(version, this.options); + } catch (er) { + return false; } } - function step(result) { - result.done ? resolve2(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 core12 = __importStar4(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 __awaiter4(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; - } - core12.info(err.message); - } - const seconds = this.getSleepAmount(); - core12.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true; } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; + } + return false; } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => setTimeout(resolve2, seconds * 1e3)); + }; + module2.exports = Range2; + var LRU = require_lrucache(); + var cache = new LRU(); + var parseOptions = require_parse_options(); + var Comparator = require_comparator(); + var debug5 = require_debug(); + var SemVer = require_semver(); + var { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace + } = require_re(); + var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants6(); + 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; }; - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; + var parseComparator = (comp, options) => { + comp = comp.replace(re[t.BUILD], ""); + debug5("comp", comp, options); + comp = replaceCarets(comp, options); + debug5("caret", comp); + comp = replaceTildes(comp, options); + debug5("tildes", comp); + comp = replaceXRanges(comp, options); + debug5("xrange", comp); + comp = replaceStars(comp, options); + debug5("stars", comp); + return comp; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + var isX = (id) => !id || id.toLowerCase() === "x" || id === "*"; + 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]; + return comp.replace(r, (_, M, m, p, pr) => { + debug5("tilde", comp, _, M, m, p, pr); + let ret; + if (isX(M)) { + ret = ""; + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0`; + } else if (isX(p)) { + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`; + } else if (pr) { + debug5("replaceTilde pr", pr); + ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`; + } else { + ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + debug5("tilde return", ret); + return ret; }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core12 = __importStar4(require_core()); - var io4 = __importStar4(require_io2()); - var crypto = __importStar4(require("crypto")); - var fs = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os2 = __importStar4(require("os")); - var path2 = __importStar4(require("path")); - var httpm = __importStar4(require_lib2()); - var semver5 = __importStar4(require_semver2()); - var stream = __importStar4(require("stream")); - var util = __importStar4(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); - } + var replaceCarets = (comp, options) => { + return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "); }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path2.join(_getTempDirectory(), crypto.randomUUID()); - yield io4.mkdirP(path2.dirname(dest)); - core12.debug(`Downloading ${url}`); - core12.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; + var replaceCaret = (comp, options) => { + debug5("caret", comp, options); + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]; + const z = options.includePrerelease ? "-0" : ""; + return comp.replace(r, (_, M, m, p, pr) => { + debug5("caret", comp, _, 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) { + debug5("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`; } - return true; - }); + } else { + debug5("no pr"); + if (M === "0") { + if (m === "0") { + ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`; + } else { + ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`; + } + } else { + ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`; + } + } + debug5("caret return", ret); + return ret; }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); + }; + var replaceXRanges = (comp, options) => { + debug5("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) => { + debug5("xRange", comp, ret, gtlt, M, m, p, pr); + const xM = isX(M); + const xm = xM || isX(m); + const xp = xm || isX(p); + const anyX = xp; + if (gtlt === "=" && anyX) { + gtlt = ""; } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core12.debug("set auth"); - if (headers === void 0) { - headers = {}; + pr = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; + } else { + ret = "*"; } - headers.authorization = auth; + } 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`; } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core12.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; + debug5("xRange return", ret); + return ret; + }); + }; + var replaceStars = (comp, options) => { + debug5("replaceStars", comp, options); + return comp.trim().replace(re[t.STAR], ""); + }; + var replaceGTE0 = (comp, options) => { + debug5("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 = (set2, version, options) => { + for (let i = 0; i < set2.length; i++) { + if (!set2[i].test(version)) { + return false; } - const pipeline = util.promisify(stream.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs.createWriteStream(dest)); - core12.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core12.debug("download failed"); - try { - yield io4.rmRF(dest); - } catch (err) { - core12.debug(`Failed to delete '${dest}'. ${err.message}`); + } + if (version.prerelease.length && !options.includePrerelease) { + for (let i = 0; i < set2.length; i++) { + debug5(set2[i].semver); + if (set2[i].semver === Comparator.ANY) { + continue; + } + if (set2[i].semver.prerelease.length > 0) { + const allowed = set2[i].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; } } } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core12.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); + 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(" "); + debug5("comparator", comp, options); + this.options = options; + this.loose = !!options.loose; + this.parse(comp); + if (this.semver === ANY) { + this.value = ""; } else { - const escapedScript = path2.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 - }; + this.value = this.operator + this.semver.version; + } + debug5("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) { + debug5("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; + } + if (typeof version === "string") { try { - const powershellPath = yield io4.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); + version = new SemVer(version, this.options); + } catch (er) { + return false; } } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); + return cmp(version, this.operator, this.semver, this.options); + } + intersects(comp, options) { + if (!(comp instanceof _Comparator)) { + throw new TypeError("a Comparator is required"); } - dest = yield _createExtractFolder(dest); - core12.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() + if (this.operator === "") { + if (this.value === "") { + return true; } - }); - core12.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; + 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); } - if (core12.isDebug() && !flags.includes("v")) { - args.push("-v"); + options = parseOptions(options); + if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) { + return false; } - let destArg = dest; - let fileArg = file; - if (IS_WINDOWS && isGnuTar) { - args.push("--force-local"); - destArg = dest.replace(/\\/g, "/"); - fileArg = file.replace(/\\/g, "/"); + if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) { + return false; } - if (isGnuTar) { - args.push("--warning=no-unknown-keyword"); - args.push("--overwrite"); + if (this.operator.startsWith(">") && comp.operator.startsWith(">")) { + return true; } - args.push("-C", destArg, "-f", fileArg); - yield (0, exec_1.exec)(`tar`, args); - return dest; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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]; + if (this.operator.startsWith("<") && comp.operator.startsWith("<")) { + return true; } - args.push("-x", "-C", dest, "-f", file); - if (core12.isDebug()) { - args.push("-v"); + if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) { + return true; } - const xarPath = yield io4.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); + if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) { + return true; } - dest = yield _createExtractFolder(dest); - if (IS_WINDOWS) { - yield extractZipWin(file, dest); - } else { - yield extractZipNix(file, dest); + if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) { + return true; } - return dest; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io4.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 - ]; - core12.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 io4.which("powershell", true); - core12.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io4.which("unzip", true); - const args = [file]; - if (!core12.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir2(sourceDir, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver5.clean(version) || version; - arch = arch || os2.arch(); - core12.debug(`Caching tool ${tool} ${version} ${arch}`); - core12.debug(`source dir: ${sourceDir}`); - if (!fs.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch); - for (const itemName of fs.readdirSync(sourceDir)) { - const s = path2.join(sourceDir, itemName); - yield io4.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch); - return destPath; - }); - } - exports2.cacheDir = cacheDir2; - function cacheFile(sourceFile, targetFile, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver5.clean(version) || version; - arch = arch || os2.arch(); - core12.debug(`Caching tool ${tool} ${version} ${arch}`); - core12.debug(`source file: ${sourceFile}`); - if (!fs.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch); - const destPath = path2.join(destFolder, targetFile); - core12.debug(`destination file ${destPath}`); - yield io4.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch); - return destFolder; - }); - } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch = arch || os2.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions(toolName, arch); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; + return false; } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver5.clean(versionSpec) || ""; - const cachePath = path2.join(_getCacheDirectory(), toolName, versionSpec, arch); - core12.debug(`checking cache: ${cachePath}`); - if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) { - core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); - toolPath = cachePath; - } else { - core12.debug("not found"); - } + }; + module2.exports = Comparator; + var parseOptions = require_parse_options(); + var { safeRe: re, t } = require_re(); + var cmp = require_cmp(); + var debug5 = 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, range, options) => { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - return toolPath; - } - exports2.find = find2; - function findAllVersions(toolName, arch) { - const versions = []; - arch = arch || os2.arch(); - const toolPath = path2.join(_getCacheDirectory(), toolName); - if (fs.existsSync(toolPath)) { - const children = fs.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path2.join(toolPath, child, arch || ""); - if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } + return range.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 = (range, options) => new Range2(range, 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, range, options) => { + let max = null; + let maxSV = null; + let rangeObj = null; + try { + rangeObj = new Range2(range, options); + } catch (er) { + return null; } - return versions; - } - exports2.findAllVersions = findAllVersions; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core12.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core12.debug("Invalid json"); + versions.forEach((v) => { + if (rangeObj.test(v)) { + if (!max || maxSV.compare(v) === -1) { + max = v; + maxSV = new SemVer(max, options); } } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path2.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io4.mkdirP(dest); - return dest; - }); - } - function _createToolPath(tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path2.join(_getCacheDirectory(), tool, semver5.clean(version) || version, arch || ""); - core12.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io4.rmRF(folderPath); - yield io4.rmRF(markerPath); - yield io4.mkdirP(folderPath); - return folderPath; - }); - } - function _completeToolPath(tool, version, arch) { - const folderPath = path2.join(_getCacheDirectory(), tool, semver5.clean(version) || version, arch || ""); - const markerPath = `${folderPath}.complete`; - fs.writeFileSync(markerPath, ""); - core12.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver5.clean(versionSpec) || ""; - core12.debug(`isExplicit: ${c}`); - const valid2 = semver5.valid(c) != null; - core12.debug(`explicit? ${valid2}`); - return valid2; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core12.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver5.gt(a, b)) { - return 1; - } - return -1; }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver5.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core12.debug(`matched: ${version}`); - } else { - core12.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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)); - } + return max; + }; + module2.exports = maxSatisfying; } }); -// 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/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, range, options) => { + let min = null; + let minSV = null; + let rangeObj = null; + try { + rangeObj = new Range2(range, 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/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.'); +// 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 = (range, loose) => { + range = new Range2(range, loose); + let minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - if (maxline !== void 0 && typeof maxline !== "number") { - throw new TypeError('"maxline" must be a number.'); + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; } - 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; + minver = null; + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.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}`); } - } - 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 (setMin && (!minver || gt(minver, setMin))) { + minver = setMin; } } - if (maxline) { - var regex = new RegExp(".{1," + maxline + "}", "g"); - output = output.match(regex).join("\r\n"); + if (minver && range.test(minver)) { + return minver; } - return output; + return null; }; - api.decode = function(input, alphabet) { - if (typeof input !== "string") { - throw new TypeError('"input" must be a string.'); + 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 = (range, options) => { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; } - if (typeof alphabet !== "string") { - throw new TypeError('"alphabet" must be a string.'); + }; + 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 lt = require_lt(); + var lte = require_lte(); + var gte4 = require_gte(); + var outside = (version, range, hilo, options) => { + version = new SemVer(version, options); + range = new Range2(range, options); + let gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte4; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); } - var table = _reverseAlphabets[alphabet]; - if (!table) { - table = _reverseAlphabets[alphabet] = []; - for (var i = 0; i < alphabet.length; ++i) { - table[alphabet.charCodeAt(i)] = i; - } + if (satisfies2(version, range, options)) { + return false; } - 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; + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.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; } - while (carry > 0) { - bytes.push(carry & 255); - carry >>= 8; + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; } } - 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()); + return true; }; - 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; - } + module2.exports = outside; } }); -// node_modules/node-forge/lib/util.js -var require_util8 = __commonJS({ - "node_modules/node-forge/lib/util.js"(exports2, module2) { - var forge = require_forge(); - var baseN = require_baseN(); - var util = module2.exports = forge.util = forge.util || {}; - (function() { - if (typeof process !== "undefined" && process.nextTick && !process.browser) { - util.nextTick = process.nextTick; - if (typeof setImmediate === "function") { - util.setImmediate = setImmediate; +// 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, range, options) => outside(version, range, ">", 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, range, options) => outside(version, range, "<", 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 compare = require_compare(); + module2.exports = (versions, range, options) => { + const set2 = []; + let first = null; + let prev = null; + const v = versions.sort((a, b) => compare(a, b, options)); + for (const version of v) { + const included = satisfies2(version, range, options); + if (included) { + prev = version; + if (!first) { + first = version; + } } else { - util.setImmediate = util.nextTick; + if (prev) { + set2.push([first, prev]); + } + prev = null; + first = null; } - return; } - if (typeof setImmediate === "function") { - util.setImmediate = function() { - return setImmediate.apply(void 0, arguments); - }; - util.nextTick = function(callback) { - return setImmediate(callback); - }; - return; + if (first) { + set2.push([first, null]); } - util.setImmediate = function(callback) { - setTimeout(callback, 0); - }; - if (typeof window !== "undefined" && typeof window.postMessage === "function") { - let handler2 = function(event) { - if (event.source === window && event.data === msg) { - event.stopPropagation(); - var copy = callbacks.slice(); - callbacks.length = 0; - copy.forEach(function(callback) { - callback(); - }); - } - }; - var handler = handler2; - var msg = "forge.setImmediate"; - var callbacks = []; - util.setImmediate = function(callback) { - callbacks.push(callback); - if (callbacks.length === 1) { - window.postMessage(msg, "*"); - } - }; - window.addEventListener("message", handler2, true); + const ranges = []; + for (const [min, max] of set2) { + 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}`); + } } - 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 = util.setImmediate; - util.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); - } - } - }; + const simplified = ranges.join(" || "); + const original = typeof range.raw === "string" ? range.raw : String(range); + return simplified.length < original.length ? simplified : range; + }; + } +}); + +// 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 compare = require_compare(); + var subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true; } - util.nextTick = util.setImmediate; - })(); - util.isNodejs = typeof process !== "undefined" && process.versions && process.versions.node; - util.globalScope = (function() { - if (util.isNodejs) { - return global; + 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 typeof self === "undefined" ? window : self; - })(); - util.isArray = Array.isArray || function(x) { - return Object.prototype.toString.call(x) === "[object Array]"; - }; - util.isArrayBuffer = function(x) { - return typeof ArrayBuffer !== "undefined" && x instanceof ArrayBuffer; - }; - util.isArrayBufferView = function(x) { - return x && util.isArrayBuffer(x.buffer) && x.byteLength !== void 0; + return true; }; - function _checkBitsParam(n) { - if (!(n === 8 || n === 16 || n === 24 || n === 32)) { - throw new Error("Only 8, 16, 24, or 32 bits supported: " + n); + var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")]; + var minimumVersion = [new Comparator(">=0.0.0")]; + var simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true; } - } - util.ByteBuffer = ByteStringBuffer; - function ByteStringBuffer(b) { - this.data = ""; - this.read = 0; - if (typeof b === "string") { - this.data = b; - } else if (util.isArrayBuffer(b) || util.isArrayBufferView(b)) { - if (typeof Buffer !== "undefined" && b instanceof Buffer) { - this.data = b.toString("binary"); + 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 { - 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]); - } + sub = minimumVersion; + } + } + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true; + } else { + dom = minimumVersion; + } + } + const eqSet = /* @__PURE__ */ new Set(); + let gt, lt; + for (const c of sub) { + if (c.operator === ">" || c.operator === ">=") { + gt = higherGT(gt, c, options); + } else if (c.operator === "<" || c.operator === "<=") { + lt = lowerLT(lt, c, options); + } else { + eqSet.add(c.semver); + } + } + if (eqSet.size > 1) { + return null; + } + let gtltComp; + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options); + if (gtltComp > 0) { + return null; + } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) { + return null; + } + } + for (const eq of eqSet) { + if (gt && !satisfies2(eq, String(gt), options)) { + return null; + } + if (lt && !satisfies2(eq, String(lt), options)) { + return null; + } + for (const c of dom) { + if (!satisfies2(eq, String(c), options)) { + return false; } } - } else if (b instanceof ByteStringBuffer || typeof b === "object" && typeof b.data === "string" && typeof b.read === "number") { - this.data = b.data; - this.read = b.read; + return true; } - this._constructedStringLength = 0; - } - util.ByteStringBuffer = ByteStringBuffer; - var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; - util.ByteStringBuffer.prototype._optimizeConstructedString = function(x) { - this._constructedStringLength += x; - if (this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { - this.data.substr(0, 1); - this._constructedStringLength = 0; + let higher, lower; + let hasDomLT, hasDomGT; + let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; + let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false; + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false; } - }; - util.ByteStringBuffer.prototype.length = function() { - return this.data.length - this.read; - }; - util.ByteStringBuffer.prototype.isEmpty = function() { - return this.length() <= 0; - }; - util.ByteStringBuffer.prototype.putByte = function(b) { - return this.putBytes(String.fromCharCode(b)); - }; - util.ByteStringBuffer.prototype.fillWithByte = function(b, n) { - b = String.fromCharCode(b); - var d = this.data; - while (n > 0) { - if (n & 1) { - d += b; + 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 === ">=" && !satisfies2(gt.semver, String(c), options)) { + return false; + } } - n >>>= 1; - if (n > 0) { - b += b; + if (lt) { + 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(lt, c, options); + if (lower === c && lower !== lt) { + return false; + } + } else if (lt.operator === "<=" && !satisfies2(lt.semver, String(c), options)) { + return false; + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false; } } - this.data = d; - this._optimizeConstructedString(n); - return this; - }; - util.ByteStringBuffer.prototype.putBytes = function(bytes) { - this.data += bytes; - this._optimizeConstructedString(bytes.length); - return this; - }; - util.ByteStringBuffer.prototype.putString = function(str2) { - return this.putBytes(util.encodeUtf8(str2)); - }; - util.ByteStringBuffer.prototype.putInt16 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255) - ); - }; - util.ByteStringBuffer.prototype.putInt24 = function(i) { - return this.putBytes( - String.fromCharCode(i >> 16 & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255) - ); - }; - util.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) - ); - }; - util.ByteStringBuffer.prototype.putInt16Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 255) + String.fromCharCode(i >> 8 & 255) - ); - }; - util.ByteStringBuffer.prototype.putInt24Le = function(i) { - return this.putBytes( - String.fromCharCode(i & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i >> 16 & 255) - ); - }; - util.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) - ); - }; - util.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); - }; - util.ByteStringBuffer.prototype.putSignedInt = function(i, n) { - if (i < 0) { - i += 2 << n - 1; + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false; } - return this.putInt(i, n); - }; - util.ByteStringBuffer.prototype.putBuffer = function(buffer) { - return this.putBytes(buffer.getBytes()); - }; - util.ByteStringBuffer.prototype.getByte = function() { - return this.data.charCodeAt(this.read++); - }; - util.ByteStringBuffer.prototype.getInt16 = function() { - var rval = this.data.charCodeAt(this.read) << 8 ^ this.data.charCodeAt(this.read + 1); - this.read += 2; - return rval; - }; - util.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; - }; - util.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; - }; - util.ByteStringBuffer.prototype.getInt16Le = function() { - var rval = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8; - this.read += 2; - return rval; - }; - util.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; - }; - util.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; - }; - util.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; - }; - util.ByteStringBuffer.prototype.getSignedInt = function(n) { - var x = this.getInt(n); - var max = 2 << n - 2; - if (x >= max) { - x -= max << 1; + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false; } - return x; - }; - util.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(); + if (needDomGTPre || needDomLTPre) { + return false; } - return rval; - }; - util.ByteStringBuffer.prototype.bytes = function(count) { - return typeof count === "undefined" ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count); - }; - util.ByteStringBuffer.prototype.at = function(i) { - return this.data.charCodeAt(this.read + i); - }; - util.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; - }; - util.ByteStringBuffer.prototype.last = function() { - return this.data.charCodeAt(this.data.length - 1); - }; - util.ByteStringBuffer.prototype.copy = function() { - var c = util.createBuffer(this.data); - c.read = this.read; - return c; + return true; }; - util.ByteStringBuffer.prototype.compact = function() { - if (this.read > 0) { - this.data = this.data.slice(this.read); - this.read = 0; + var higherGT = (a, b, options) => { + if (!a) { + return b; } - return this; + const comp = compare(a.semver, b.semver, options); + return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a; }; - util.ByteStringBuffer.prototype.clear = function() { - this.data = ""; - this.read = 0; - return this; + var lowerLT = (a, b, options) => { + if (!a) { + return b; + } + const comp = compare(a.semver, b.semver, options); + return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a; }; - util.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; + 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 parse = require_parse2(); + var valid2 = require_valid(); + var clean = 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 compare = require_compare(); + var rcompare = 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 lt = require_lt(); + var eq = require_eq(); + var neq = require_neq(); + var gte4 = require_gte(); + var lte = require_lte(); + var cmp = require_cmp(); + var coerce2 = require_coerce(); + 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, + valid: valid2, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte: gte4, + lte, + cmp, + coerce: coerce2, + 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 }; - util.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); + } +}); + +// 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]; + } }; } - return rval; + 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; }; - util.ByteStringBuffer.prototype.toString = function() { - return util.decodeUtf8(this.bytes()); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - function DataBuffer(b, options) { - options = options || {}; - this.read = options.readOffset || 0; - this.growSize = options.growSize || 1024; - var isArrayBuffer = util.isArrayBuffer(b); - var isArrayBufferView = util.isArrayBufferView(b); - if (isArrayBuffer || isArrayBufferView) { - if (isArrayBuffer) { - this.data = new DataView(b); - } else { - this.data = new DataView(b.buffer, b.byteOffset, b.byteLength); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver6 = __importStar2(require_semver2()); + var core_1 = require_core2(); + var os2 = require("os"); + var cp = require("child_process"); + var fs = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os2.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver6.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 = semver6.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } + } + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); + } + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os2.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; + } + } } - 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; + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs.existsSync(lsbReleaseFile)) { + contents = fs.readFileSync(lsbReleaseFile).toString(); + } else if (fs.existsSync(osReleaseFile)) { + contents = fs.readFileSync(osReleaseFile).toString(); } + return contents; } - util.DataBuffer = DataBuffer; - util.DataBuffer.prototype.length = function() { - return this.write - this.read; - }; - util.DataBuffer.prototype.isEmpty = function() { - return this.length() <= 0; - }; - util.DataBuffer.prototype.accommodate = function(amount, growSize) { - if (this.length() >= amount) { - return this; + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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]; + } }; } - 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; - }; - util.DataBuffer.prototype.putByte = function(b) { - this.accommodate(1); - this.data.setUint8(this.write++, b); - return this; - }; - util.DataBuffer.prototype.fillWithByte = function(b, n) { - this.accommodate(n); - for (var i = 0; i < n; ++i) { - this.data.setUint8(b); + 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); } - return this; + __setModuleDefault2(result, mod); + return result; }; - util.DataBuffer.prototype.putBytes = function(bytes, encoding) { - if (util.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 (util.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 util.DataBuffer || typeof bytes === "object" && typeof bytes.read === "number" && typeof bytes.write === "number" && util.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 util.ByteStringBuffer) { - bytes = bytes.data; - encoding = "binary"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - 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 += util.binary.hex.decode(bytes, view, this.write); - return this; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (encoding === "base64") { - this.accommodate(Math.ceil(bytes.length / 4) * 3); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.base64.decode(bytes, view, this.write); - return this; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (encoding === "utf8") { - bytes = util.encodeUtf8(bytes); - encoding = "binary"; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - if (encoding === "binary" || encoding === "raw") { - this.accommodate(bytes.length); - view = new Uint8Array(this.data.buffer, this.write); - this.write += util.binary.raw.decode(view); - return this; + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RetryHelper = void 0; + var core12 = __importStar2(require_core2()); + var RetryHelper = class { + constructor(maxAttempts, minSeconds, maxSeconds) { + if (maxAttempts < 1) { + throw new Error("max attempts should be greater than or equal to 1"); } - if (encoding === "utf16") { - this.accommodate(bytes.length * 2); - view = new Uint16Array(this.data.buffer, this.write); - this.write += util.text.utf16.encode(view); - return this; + 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"); } - throw new Error("Invalid encoding: " + encoding); } - throw Error("Invalid parameter: " + bytes); - }; - util.DataBuffer.prototype.putBuffer = function(buffer) { - this.putBytes(buffer); - buffer.clear(); - return this; - }; - util.DataBuffer.prototype.putString = function(str2) { - return this.putBytes(str2, "utf16"); + 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; + } + core12.info(err.message); + } + const seconds = this.getSleepAmount(); + core12.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((resolve2) => setTimeout(resolve2, seconds * 1e3)); + }); + } }; - util.DataBuffer.prototype.putInt16 = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i); - this.write += 2; - return this; + 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 || 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; }; - util.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - util.DataBuffer.prototype.putInt32 = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i); - this.write += 4; - return this; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core12 = __importStar2(require_core2()); + var io4 = __importStar2(require_io2()); + var crypto2 = __importStar2(require("crypto")); + var fs = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os2 = __importStar2(require("os")); + var path2 = __importStar2(require("path")); + var httpm = __importStar2(require_lib2()); + var semver6 = __importStar2(require_semver2()); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec2(); + 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); + } }; - util.DataBuffer.prototype.putInt16Le = function(i) { - this.accommodate(2); - this.data.setInt16(this.write, i, true); - this.write += 2; - return this; - }; - util.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; - }; - util.DataBuffer.prototype.putInt32Le = function(i) { - this.accommodate(4); - this.data.setInt32(this.write, i, true); - this.write += 4; - return this; - }; - util.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; - }; - util.DataBuffer.prototype.putSignedInt = function(i, n) { - _checkBitsParam(n); - this.accommodate(n / 8); - if (i < 0) { - i += 2 << n - 1; - } - return this.putInt(i, n); - }; - util.DataBuffer.prototype.getByte = function() { - return this.data.getInt8(this.read++); - }; - util.DataBuffer.prototype.getInt16 = function() { - var rval = this.data.getInt16(this.read); - this.read += 2; - return rval; - }; - util.DataBuffer.prototype.getInt24 = function() { - var rval = this.data.getInt16(this.read) << 8 ^ this.data.getInt8(this.read + 2); - this.read += 3; - return rval; - }; - util.DataBuffer.prototype.getInt32 = function() { - var rval = this.data.getInt32(this.read); - this.read += 4; - return rval; - }; - util.DataBuffer.prototype.getInt16Le = function() { - var rval = this.data.getInt16(this.read, true); - this.read += 2; - return rval; - }; - util.DataBuffer.prototype.getInt24Le = function() { - var rval = this.data.getInt8(this.read) ^ this.data.getInt16(this.read + 1, true) << 8; - this.read += 3; - return rval; - }; - util.DataBuffer.prototype.getInt32Le = function() { - var rval = this.data.getInt32(this.read, true); - this.read += 4; - return rval; - }; - util.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; - }; - util.DataBuffer.prototype.getSignedInt = function(n) { - var x = this.getInt(n); - var max = 2 << n - 2; - if (x >= max) { - x -= max << 1; - } - return x; - }; - util.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; - }; - util.DataBuffer.prototype.bytes = function(count) { - return typeof count === "undefined" ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count); - }; - util.DataBuffer.prototype.at = function(i) { - return this.data.getUint8(this.read + i); - }; - util.DataBuffer.prototype.setAt = function(i, b) { - this.data.setUint8(i, b); - return this; - }; - util.DataBuffer.prototype.last = function() { - return this.data.getUint8(this.write - 1); - }; - util.DataBuffer.prototype.copy = function() { - return new util.DataBuffer(this); - }; - util.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; - }; - util.DataBuffer.prototype.clear = function() { - this.data = new DataView(new ArrayBuffer(0)); - this.read = this.write = 0; - return this; - }; - util.DataBuffer.prototype.truncate = function(count) { - this.write = Math.max(0, this.length() - count); - this.read = Math.min(this.read, this.write); - return this; - }; - util.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"; + exports2.HTTPError = HTTPError2; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path2.join(_getTempDirectory(), crypto2.randomUUID()); + yield io4.mkdirP(path2.dirname(dest)); + core12.debug(`Downloading ${url}`); + core12.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(url, dest || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; + }); + }); + } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); } - rval += b.toString(16); - } - return rval; - }; - util.DataBuffer.prototype.toString = function(encoding) { - var view = new Uint8Array(this.data, this.read, this.length()); - encoding = encoding || "utf8"; - if (encoding === "binary" || encoding === "raw") { - return util.binary.raw.encode(view); - } - if (encoding === "hex") { - return util.binary.hex.encode(view); - } - if (encoding === "base64") { - return util.binary.base64.encode(view); - } - if (encoding === "utf8") { - return util.text.utf8.decode(view); - } - if (encoding === "utf16") { - return util.text.utf16.decode(view); - } - throw new Error("Invalid encoding: " + encoding); - }; - util.createBuffer = function(input, encoding) { - encoding = encoding || "raw"; - if (input !== void 0 && encoding === "utf8") { - input = util.encodeUtf8(input); - } - return new util.ByteBuffer(input); - }; - util.fillString = function(c, n) { - var s = ""; - while (n > 0) { - if (n & 1) { - s += c; + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false + }); + if (auth) { + core12.debug("set auth"); + if (headers === void 0) { + headers = {}; + } + headers.authorization = auth; } - n >>>= 1; - if (n > 0) { - c += c; + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core12.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; } - } - return s; - }; - util.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; + const pipeline = util.promisify(stream.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs.createWriteStream(dest)); + core12.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core12.debug("download failed"); + try { + yield io4.rmRF(dest); + } catch (err) { + core12.debug(`Failed to delete '${dest}'. ${err.message}`); + } + } } - t += String.fromCharCode(b); - ++c; - } - s3 += t; - return s3; - }; - util.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; - }; - util.bytesToHex = function(bytes) { - return util.createBuffer(bytes).toHex(); - }; - util.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"; - util.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 += "=="; + }); + } + 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 = core12.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } } else { - line += _base64.charAt((chr2 & 15) << 2 | chr3 >> 6); - line += isNaN(chr3) ? "=" : _base64.charAt(chr3 & 63); + const escapedScript = path2.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 io4.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } } - if (maxline && line.length > maxline) { - output += line.substr(0, maxline) + "\r\n"; - line = line.substr(maxline); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); } - } - output += line; - return output; - }; - util.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); + dest = yield _createExtractFolder(dest); + core12.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() } + }); + core12.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; } - } - return output; - }; - util.encodeUtf8 = function(str2) { - return unescape(encodeURIComponent(str2)); - }; - util.decodeUtf8 = function(str2) { - return decodeURIComponent(escape(str2)); - }; - util.binary = { - raw: {}, - hex: {}, - base64: {}, - base58: {}, - baseN: { - encode: baseN.encode, - decode: baseN.decode - } - }; - util.binary.raw.encode = function(bytes) { - return String.fromCharCode.apply(null, bytes); - }; - util.binary.raw.decode = function(str2, output, offset) { - var out = output; - if (!out) { - out = new Uint8Array(str2.length); - } - offset = offset || 0; - var j = offset; - for (var i = 0; i < str2.length; ++i) { - out[j++] = str2.charCodeAt(i); - } - return output ? j - offset : out; - }; - util.binary.hex.encode = util.bytesToHex; - util.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; - }; - util.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 += "=="; + if (core12.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 { - line += _base64.charAt((chr2 & 15) << 2 | chr3 >> 6); - line += isNaN(chr3) ? "=" : _base64.charAt(chr3 & 63); + args = [flags]; } - if (maxline && line.length > maxline) { - output += line.substr(0, maxline) + "\r\n"; - line = line.substr(maxline); + args.push("-x", "-C", dest, "-f", file); + if (core12.isDebug()) { + args.push("-v"); } - } - output += line; - return output; - }; - util.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; - } + const xarPath = yield io4.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io4.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 + ]; + core12.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 io4.which("powershell", true); + core12.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 io4.which("unzip", true); + const args = [file]; + if (!core12.isDebug()) { + args.unshift("-q"); + } + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir2(sourceDir, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver6.clean(version) || version; + arch = arch || os2.arch(); + core12.debug(`Caching tool ${tool} ${version} ${arch}`); + core12.debug(`source dir: ${sourceDir}`); + if (!fs.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); + } + const destPath = yield _createToolPath(tool, version, arch); + for (const itemName of fs.readdirSync(sourceDir)) { + const s = path2.join(sourceDir, itemName); + yield io4.cp(s, destPath, { recursive: true }); + } + _completeToolPath(tool, version, arch); + return destPath; + }); + } + exports2.cacheDir = cacheDir2; + function cacheFile(sourceFile, targetFile, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver6.clean(version) || version; + arch = arch || os2.arch(); + core12.debug(`Caching tool ${tool} ${version} ${arch}`); + core12.debug(`source file: ${sourceFile}`); + if (!fs.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); + } + const destFolder = yield _createToolPath(tool, version, arch); + const destPath = path2.join(destFolder, targetFile); + core12.debug(`destination file ${destPath}`); + yield io4.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - return output ? j - offset : out.subarray(0, j); - }; - util.binary.base58.encode = function(input, maxline) { - return util.binary.baseN.encode(input, _base58, maxline); - }; - util.binary.base58.decode = function(input, maxline) { - return util.binary.baseN.decode(input, _base58, maxline); - }; - util.text = { - utf8: {}, - utf16: {} - }; - util.text.utf8.encode = function(str2, output, offset) { - str2 = util.encodeUtf8(str2); - var out = output; - if (!out) { - out = new Uint8Array(str2.length); - } - offset = offset || 0; - var j = offset; - for (var i = 0; i < str2.length; ++i) { - out[j++] = str2.charCodeAt(i); + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); } - return output ? j - offset : out; - }; - util.text.utf8.decode = function(bytes) { - return util.decodeUtf8(String.fromCharCode.apply(null, bytes)); - }; - util.text.utf16.encode = function(str2, output, offset) { - var out = output; - if (!out) { - out = new Uint8Array(str2.length * 2); + arch = arch || os2.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions(toolName, arch); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; } - var view = new Uint16Array(out.buffer); - offset = offset || 0; - var j = offset; - var k = offset; - for (var i = 0; i < str2.length; ++i) { - view[k++] = str2.charCodeAt(i); - j += 2; + let toolPath = ""; + if (versionSpec) { + versionSpec = semver6.clean(versionSpec) || ""; + const cachePath = path2.join(_getCacheDirectory(), toolName, versionSpec, arch); + core12.debug(`checking cache: ${cachePath}`); + if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) { + core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; + } else { + core12.debug("not found"); + } } - return output ? j - offset : out; - }; - util.text.utf16.decode = function(bytes) { - return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); - }; - util.deflate = function(api, bytes, raw) { - bytes = util.decode64(api.deflate(util.encode64(bytes)).rval); - if (raw) { - var start = 2; - var flg = bytes.charCodeAt(1); - if (flg & 32) { - start = 6; + return toolPath; + } + exports2.find = find2; + function findAllVersions(toolName, arch) { + const versions = []; + arch = arch || os2.arch(); + const toolPath = path2.join(_getCacheDirectory(), toolName); + if (fs.existsSync(toolPath)) { + const children = fs.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path2.join(toolPath, child, arch || ""); + if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) { + versions.push(child); + } + } } - bytes = bytes.substring(start, bytes.length - 4); } - return bytes; - }; - util.inflate = function(api, bytes, raw) { - var rval = api.inflate(util.encode64(bytes)).rval; - return rval === null ? null : util.decode64(rval); - }; - var _setStorageObject = function(api, id, obj) { - if (!api) { - throw new Error("WebStorage not available."); + return versions; + } + exports2.findAllVersions = findAllVersions; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core12.debug("set auth"); + headers.authorization = auth; + } + 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 (_a) { + core12.debug("Invalid json"); + } + } + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path2.join(_getTempDirectory(), crypto2.randomUUID()); + } + yield io4.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path2.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); + core12.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io4.rmRF(folderPath); + yield io4.rmRF(markerPath); + yield io4.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch) { + const folderPath = path2.join(_getCacheDirectory(), tool, semver6.clean(version) || version, arch || ""); + const markerPath = `${folderPath}.complete`; + fs.writeFileSync(markerPath, ""); + core12.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver6.clean(versionSpec) || ""; + core12.debug(`isExplicit: ${c}`); + const valid2 = semver6.valid(c) != null; + core12.debug(`explicit? ${valid2}`); + return valid2; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core12.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver6.gt(a, b)) { + return 1; + } + return -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver6.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; + } } - var rval; - if (obj === null) { - rval = api.removeItem(id); + if (version) { + core12.debug(`matched: ${version}`); } else { - obj = util.encode64(JSON.stringify(obj)); - rval = api.setItem(id, obj); + core12.debug("match not found"); } - if (typeof rval !== "undefined" && rval.rval !== true) { - var error4 = new Error(rval.error.message); - error4.id = rval.error.id; - error4.name = rval.error.name; - throw error4; + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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/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 } }; - var _getStorageObject = function(api, id) { - if (!api) { - throw new Error("WebStorage not available."); + } +}); + +// 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.'); } - var rval = api.getItem(id); - if (api.init) { - if (rval.rval === null) { - if (rval.error) { - var error4 = new Error(rval.error.message); - error4.id = rval.error.id; - error4.name = rval.error.name; - throw error4; + 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; } - rval = null; - } else { - rval = rval.rval; + 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 (rval !== null) { - rval = JSON.parse(util.decode64(rval)); + if (maxline) { + var regex = new RegExp(".{1," + maxline + "}", "g"); + output = output.match(regex).join("\r\n"); } - return rval; + return output; }; - var _setItem = function(api, id, key, data) { - var obj = _getStorageObject(api, id); - if (obj === null) { - obj = {}; + api.decode = function(input, alphabet) { + if (typeof input !== "string") { + throw new TypeError('"input" must be a string.'); } - 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; + if (typeof alphabet !== "string") { + throw new TypeError('"alphabet" must be a string.'); } - 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; + var table = _reverseAlphabets[alphabet]; + if (!table) { + table = _reverseAlphabets[alphabet] = []; + for (var i = 0; i < alphabet.length; ++i) { + table[alphabet.charCodeAt(i)] = i; } - _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 type2; - var done = false; - var exception2 = null; - for (var idx in location) { - type2 = location[idx]; - try { - if (type2 === "flash" || type2 === "both") { - if (args[0] === null) { - throw new Error("Flash local storage not available."); - } - rval = func.apply(this, args); - done = type2 === "flash"; - } - if (type2 === "web" || type2 === "both") { - args[0] = localStorage; - rval = func.apply(this, args); - done = true; - } - } catch (ex) { - exception2 = ex; - } - if (done) { - break; - } - } - if (!done) { - throw exception2; - } - return rval; - }; - util.setItem = function(api, id, key, data, location) { - _callStorageFunction(_setItem, arguments, location); - }; - util.getItem = function(api, id, key, location) { - return _callStorageFunction(_getItem, arguments, location); - }; - util.removeItem = function(api, id, key, location) { - _callStorageFunction(_removeItem, arguments, location); - }; - util.clearItems = function(api, id, location) { - _callStorageFunction(_clearItems, arguments, location); - }; - util.isEmpty = function(obj) { - for (var prop in obj) { - if (obj.hasOwnProperty(prop)) { - return false; + 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; } - } - return true; - }; - util.format = function(format) { - var re = /%./g; - var match; - var part; - var argi = 0; - var parts = []; - var last = 0; - while (match = re.exec(format)) { - part = format.substring(last, re.lastIndex - 2); - if (part.length > 0) { - parts.push(part); + for (var j = 0, carry = value; j < bytes.length; ++j) { + carry += bytes[j] * base; + bytes[j] = carry & 255; + carry >>= 8; } - last = re.lastIndex; - var code = match[0][1]; - switch (code) { - case "s": - case "o": - if (argi < arguments.length) { - parts.push(arguments[argi++ + 1]); - } else { - parts.push(""); - } - break; - // FIXME: do proper formating for numbers, etc - //case 'f': - //case 'd': - case "%": - parts.push("%"); - break; - default: - parts.push("<%" + code + "?>"); + while (carry > 0) { + bytes.push(carry & 255); + carry >>= 8; } } - parts.push(format.substring(last)); - return parts.join(""); - }; - util.formatNumber = function(number, decimals, dec_point, thousands_sep) { - var n = number, 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) : ""); - }; - util.formatSize = function(size) { - if (size >= 1073741824) { - size = util.formatNumber(size / 1073741824, 2, ".", "") + " GiB"; - } else if (size >= 1048576) { - size = util.formatNumber(size / 1048576, 2, ".", "") + " MiB"; - } else if (size >= 1024) { - size = util.formatNumber(size / 1024, 0) + " KiB"; - } else { - size = util.formatNumber(size, 0) + " bytes"; - } - return size; - }; - util.bytesFromIP = function(ip) { - if (ip.indexOf(".") !== -1) { - return util.bytesFromIPv4(ip); - } - if (ip.indexOf(":") !== -1) { - return util.bytesFromIPv6(ip); - } - return null; - }; - util.bytesFromIPv4 = function(ip) { - ip = ip.split("."); - if (ip.length !== 4) { - return null; + for (var k = 0; input[k] === first && k < input.length - 1; ++k) { + bytes.push(0); } - var b = util.createBuffer(); - for (var i = 0; i < ip.length; ++i) { - var num = parseInt(ip[i], 10); - if (isNaN(num)) { - return null; - } - b.putByte(num); + if (typeof Buffer !== "undefined") { + return Buffer.from(bytes.reverse()); } - return b.getBytes(); + return new Uint8Array(bytes.reverse()); }; - util.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 = util.createBuffer(); - for (var i = 0; i < 8; ++i) { - if (!ip[i] || ip[i].length === 0) { - b.fillWithByte(0, zeros); - zeros = 0; - continue; + 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; } - var bytes = util.hexToBytes(ip[i]); - if (bytes.length < 2) { - b.putByte(0); + while (carry > 0) { + digits.push(carry % base); + carry = carry / base | 0; } - b.putBytes(bytes); } - return b.getBytes(); - }; - util.bytesToIP = function(bytes) { - if (bytes.length === 4) { - return util.bytesToIPv4(bytes); + var output = ""; + for (i = 0; input.at(i) === 0 && i < input.length() - 1; ++i) { + output += first; } - if (bytes.length === 16) { - return util.bytesToIPv6(bytes); + for (i = digits.length - 1; i >= 0; --i) { + output += alphabet[digits[i]]; } - return null; - }; - util.bytesToIPv4 = function(bytes) { - if (bytes.length !== 4) { - return null; + return output; + } + } +}); + +// node_modules/node-forge/lib/util.js +var require_util8 = __commonJS({ + "node_modules/node-forge/lib/util.js"(exports2, module2) { + var forge = require_forge(); + var baseN = require_baseN(); + var util = module2.exports = forge.util = forge.util || {}; + (function() { + if (typeof process !== "undefined" && process.nextTick && !process.browser) { + util.nextTick = process.nextTick; + if (typeof setImmediate === "function") { + util.setImmediate = setImmediate; + } else { + util.setImmediate = util.nextTick; + } + return; } - var ip = []; - for (var i = 0; i < bytes.length; ++i) { - ip.push(bytes.charCodeAt(i)); + if (typeof setImmediate === "function") { + util.setImmediate = function() { + return setImmediate.apply(void 0, arguments); + }; + util.nextTick = function(callback) { + return setImmediate(callback); + }; + return; } - return ip.join("."); - }; - util.bytesToIPv6 = function(bytes) { - if (bytes.length !== 16) { - return null; + util.setImmediate = function(callback) { + setTimeout(callback, 0); + }; + if (typeof window !== "undefined" && typeof window.postMessage === "function") { + let handler2 = function(event) { + if (event.source === window && event.data === msg) { + event.stopPropagation(); + var copy = callbacks.slice(); + callbacks.length = 0; + copy.forEach(function(callback) { + callback(); + }); + } + }; + var handler = handler2; + var msg = "forge.setImmediate"; + var callbacks = []; + util.setImmediate = function(callback) { + callbacks.push(callback); + if (callbacks.length === 1) { + window.postMessage(msg, "*"); + } + }; + window.addEventListener("message", handler2, true); } - var ip = []; - var zeroGroups = []; - var zeroMaxGroup = 0; - for (var i = 0; i < bytes.length; i += 2) { - var hex = util.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 }); + 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 = util.setImmediate; + util.setImmediate = function(callback) { + if (Date.now() - now > 15) { + now = Date.now(); + oldSetImmediate(callback); } else { - last.end = idx; - if (last.end - last.start > zeroGroups[zeroMaxGroup].end - zeroGroups[zeroMaxGroup].start) { - zeroMaxGroup = zeroGroups.length - 1; + callbacks.push(callback); + if (callbacks.length === 1) { + div.setAttribute("a", attr = !attr); } } - } - 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(""); - } - } + util.nextTick = util.setImmediate; + })(); + util.isNodejs = typeof process !== "undefined" && process.versions && process.versions.node; + util.globalScope = (function() { + if (util.isNodejs) { + return global; } - return ip.join(":"); + return typeof self === "undefined" ? window : self; + })(); + util.isArray = Array.isArray || function(x) { + return Object.prototype.toString.call(x) === "[object Array]"; }; - util.estimateCores = function(options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; - } - options = options || {}; - if ("cores" in util && !options.update) { - return callback(null, util.cores); - } - if (typeof navigator !== "undefined" && "hardwareConcurrency" in navigator && navigator.hardwareConcurrency > 0) { - util.cores = navigator.hardwareConcurrency; - return callback(null, util.cores); - } - if (typeof Worker === "undefined") { - util.cores = 1; - return callback(null, util.cores); - } - if (typeof Blob === "undefined") { - util.cores = 2; - return callback(null, util.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); - util.cores = Math.max(1, avg); - URL.revokeObjectURL(blobUrl); - return callback(null, util.cores); - } - map2(numWorkers, function(err, results) { - max.push(reduce(numWorkers, results)); - sample(max, samples - 1, numWorkers); - }); - } - function map2(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); - } + util.isArrayBuffer = function(x) { + return typeof ArrayBuffer !== "undefined" && x instanceof ArrayBuffer; + }; + util.isArrayBufferView = function(x) { + return x && util.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); } - 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); + } + util.ByteBuffer = ByteStringBuffer; + function ByteStringBuffer(b) { + this.data = ""; + this.read = 0; + if (typeof b === "string") { + this.data = b; + } else if (util.isArrayBuffer(b) || util.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]); } } } - 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_util8(); - 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(); - } + } else if (b instanceof ByteStringBuffer || typeof b === "object" && typeof b.data === "string" && typeof b.read === "number") { + this.data = b.data; + this.read = b.read; } - if (!api) { - throw new Error("Unsupported algorithm: " + algorithm); + this._constructedStringLength = 0; + } + util.ByteStringBuffer = ByteStringBuffer; + var _MAX_CONSTRUCTED_STRING_LENGTH = 4096; + util.ByteStringBuffer.prototype._optimizeConstructedString = function(x) { + this._constructedStringLength += x; + if (this._constructedStringLength > _MAX_CONSTRUCTED_STRING_LENGTH) { + this.data.substr(0, 1); + this._constructedStringLength = 0; } - 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 - }); + util.ByteStringBuffer.prototype.length = function() { + return this.data.length - this.read; }; - forge.cipher.registerAlgorithm = function(name, algorithm) { - name = name.toUpperCase(); - forge.cipher.algorithms[name] = algorithm; + util.ByteStringBuffer.prototype.isEmpty = function() { + return this.length() <= 0; }; - forge.cipher.getAlgorithm = function(name) { - name = name.toUpperCase(); - if (name in forge.cipher.algorithms) { - return forge.cipher.algorithms[name]; + util.ByteStringBuffer.prototype.putByte = function(b) { + return this.putBytes(String.fromCharCode(b)); + }; + util.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; + } } - return null; + this.data = d; + this._optimizeConstructedString(n); + return this; }; - 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); + util.ByteStringBuffer.prototype.putBytes = function(bytes) { + this.data += bytes; + this._optimizeConstructedString(bytes.length); + return this; }; - 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); + util.ByteStringBuffer.prototype.putString = function(str2) { + return this.putBytes(util.encodeUtf8(str2)); }; - 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(); + util.ByteStringBuffer.prototype.putInt16 = function(i) { + return this.putBytes( + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255) + ); }; - 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; + util.ByteStringBuffer.prototype.putInt24 = function(i) { + return this.putBytes( + String.fromCharCode(i >> 16 & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255) + ); }; - } -}); - -// 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_util8(); - 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); + util.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) + ); }; - modes.ecb.prototype.start = function(options) { + util.ByteStringBuffer.prototype.putInt16Le = function(i) { + return this.putBytes( + String.fromCharCode(i & 255) + String.fromCharCode(i >> 8 & 255) + ); }; - 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]); - } + util.ByteStringBuffer.prototype.putInt24Le = function(i) { + return this.putBytes( + String.fromCharCode(i & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i >> 16 & 255) + ); }; - 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]); - } + util.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) + ); }; - 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; + util.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); }; - 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; + util.ByteStringBuffer.prototype.putSignedInt = function(i, n) { + if (i < 0) { + i += 2 << n - 1; } - output.truncate(count); - return true; + return this.putInt(i, n); }; - 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); + util.ByteStringBuffer.prototype.putBuffer = function(buffer) { + return this.putBytes(buffer.getBytes()); }; - 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); - } + util.ByteStringBuffer.prototype.getByte = function() { + return this.data.charCodeAt(this.read++); }; - 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; + util.ByteStringBuffer.prototype.getInt16 = function() { + var rval = this.data.charCodeAt(this.read) << 8 ^ this.data.charCodeAt(this.read + 1); + this.read += 2; + return rval; }; - 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); + util.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; }; - 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; + util.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; }; - 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; + util.ByteStringBuffer.prototype.getInt16Le = function() { + var rval = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8; + this.read += 2; + return rval; }; - 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; + util.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; }; - 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; + util.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; }; - 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]); + util.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; + }; + util.ByteStringBuffer.prototype.getSignedInt = function(n) { + var x = this.getInt(n); + var max = 2 << n - 2; + if (x >= max) { + x -= max << 1; } - if (partialBytes > 0) { - input.read -= this.blockSize; + return x; + }; + util.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 { - 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; + rval = this.read === 0 ? this.data : this.data.slice(this.read); + this.clear(); } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; + return rval; }; - modes.cfb.prototype.decrypt = function(input, output, finish) { - var inputLength = input.length(); - if (inputLength === 0) { - return true; + util.ByteStringBuffer.prototype.bytes = function(count) { + return typeof count === "undefined" ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count); + }; + util.ByteStringBuffer.prototype.at = function(i) { + return this.data.charCodeAt(this.read + i); + }; + util.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; + }; + util.ByteStringBuffer.prototype.last = function() { + return this.data.charCodeAt(this.data.length - 1); + }; + util.ByteStringBuffer.prototype.copy = function() { + var c = util.createBuffer(this.data); + c.read = this.read; + return c; + }; + util.ByteStringBuffer.prototype.compact = function() { + if (this.read > 0) { + this.data = this.data.slice(this.read); + this.read = 0; } - 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 this; + }; + util.ByteStringBuffer.prototype.clear = function() { + this.data = ""; + this.read = 0; + return this; + }; + util.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; + }; + util.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"; } - 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]); + rval += b.toString(16); } - if (partialBytes > 0) { - input.read -= this.blockSize; - } else { - for (var i = 0; i < this._ints; ++i) { - this._inBlock[i] = this._partialBlock[i]; + return rval; + }; + util.ByteStringBuffer.prototype.toString = function() { + return util.decodeUtf8(this.bytes()); + }; + function DataBuffer(b, options) { + options = options || {}; + this.read = options.readOffset || 0; + this.growSize = options.growSize || 1024; + var isArrayBuffer = util.isArrayBuffer(b); + var isArrayBufferView = util.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; } - if (this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); + this.data = new DataView(new ArrayBuffer(0)); + this.write = 0; + if (b !== null && b !== void 0) { + this.putBytes(b); } - if (partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes - )); - this._partialBytes = partialBytes; - return true; + if ("writeOffset" in options) { + this.write = options.writeOffset; } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; + } + util.DataBuffer = DataBuffer; + util.DataBuffer.prototype.length = function() { + return this.write - this.read; }; - 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; + util.DataBuffer.prototype.isEmpty = function() { + return this.length() <= 0; }; - modes.ofb.prototype.start = function(options) { - if (!("iv" in options)) { - throw new Error("Invalid IV parameter."); + util.DataBuffer.prototype.accommodate = function(amount, growSize) { + if (this.length() >= amount) { + return this; } - this._iv = transformIV(options.iv, this.blockSize); - this._inBlock = this._iv.slice(0); - this._partialBytes = 0; + 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; }; - modes.ofb.prototype.encrypt = function(input, output, finish) { - var inputLength = input.length(); - if (input.length() === 0) { - return true; + util.DataBuffer.prototype.putByte = function(b) { + this.accommodate(1); + this.data.setUint8(this.write++, b); + return this; + }; + util.DataBuffer.prototype.fillWithByte = function(b, n) { + this.accommodate(n); + for (var i = 0; i < n; ++i) { + this.data.setUint8(b); } - 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; + return this; + }; + util.DataBuffer.prototype.putBytes = function(bytes, encoding) { + if (util.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; } - var partialBytes = (this.blockSize - inputLength) % this.blockSize; - if (partialBytes > 0) { - partialBytes = this.blockSize - partialBytes; + if (util.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; } - this._partialOutput.clear(); - for (var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); + if (bytes instanceof util.DataBuffer || typeof bytes === "object" && typeof bytes.read === "number" && typeof bytes.write === "number" && util.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 (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; + if (bytes instanceof util.ByteStringBuffer) { + bytes = bytes.data; + encoding = "binary"; } - 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; + 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 += util.binary.hex.decode(bytes, view, this.write); + return this; } - this._partialOutput.clear(); - for (var i = 0; i < this._ints; ++i) { - this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); + if (encoding === "base64") { + this.accommodate(Math.ceil(bytes.length / 4) * 3); + view = new Uint8Array(this.data.buffer, this.write); + this.write += util.binary.base64.decode(bytes, view, this.write); + return this; } - if (partialBytes > 0) { - input.read -= this.blockSize; + if (encoding === "utf8") { + bytes = util.encodeUtf8(bytes); + encoding = "binary"; } - if (this._partialBytes > 0) { - this._partialOutput.getBytes(this._partialBytes); + if (encoding === "binary" || encoding === "raw") { + this.accommodate(bytes.length); + view = new Uint8Array(this.data.buffer, this.write); + this.write += util.binary.raw.decode(view); + return this; } - if (partialBytes > 0 && !finish) { - output.putBytes(this._partialOutput.getBytes( - partialBytes - this._partialBytes - )); - this._partialBytes = partialBytes; - return true; + if (encoding === "utf16") { + this.accommodate(bytes.length * 2); + view = new Uint16Array(this.data.buffer, this.write); + this.write += util.text.utf16.encode(view); + return this; } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; + throw new Error("Invalid encoding: " + encoding); } - inc32(this._inBlock); + throw Error("Invalid parameter: " + bytes); }; - 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; + util.DataBuffer.prototype.putBuffer = function(buffer) { + this.putBytes(buffer); + buffer.clear(); + return this; }; - 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; + util.DataBuffer.prototype.putString = function(str2) { + return this.putBytes(str2, "utf16"); + }; + util.DataBuffer.prototype.putInt16 = function(i) { + this.accommodate(2); + this.data.setInt16(this.write, i); + this.write += 2; + return this; + }; + util.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; + }; + util.DataBuffer.prototype.putInt32 = function(i) { + this.accommodate(4); + this.data.setInt32(this.write, i); + this.write += 4; + return this; + }; + util.DataBuffer.prototype.putInt16Le = function(i) { + this.accommodate(2); + this.data.setInt16(this.write, i, true); + this.write += 2; + return this; + }; + util.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; + }; + util.DataBuffer.prototype.putInt32Le = function(i) { + this.accommodate(4); + this.data.setInt32(this.write, i, true); + this.write += 4; + return this; + }; + util.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; + }; + util.DataBuffer.prototype.putSignedInt = function(i, n) { + _checkBitsParam(n); + this.accommodate(n / 8); + if (i < 0) { + i += 2 << n - 1; } - 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."); - } + return this.putInt(i, n); + }; + util.DataBuffer.prototype.getByte = function() { + return this.data.getInt8(this.read++); + }; + util.DataBuffer.prototype.getInt16 = function() { + var rval = this.data.getInt16(this.read); + this.read += 2; + return rval; + }; + util.DataBuffer.prototype.getInt24 = function() { + var rval = this.data.getInt16(this.read) << 8 ^ this.data.getInt8(this.read + 2); + this.read += 3; + return rval; + }; + util.DataBuffer.prototype.getInt32 = function() { + var rval = this.data.getInt32(this.read); + this.read += 4; + return rval; + }; + util.DataBuffer.prototype.getInt16Le = function() { + var rval = this.data.getInt16(this.read, true); + this.read += 2; + return rval; + }; + util.DataBuffer.prototype.getInt24Le = function() { + var rval = this.data.getInt8(this.read) ^ this.data.getInt16(this.read + 1, true) << 8; + this.read += 3; + return rval; + }; + util.DataBuffer.prototype.getInt32Le = function() { + var rval = this.data.getInt32(this.read, true); + this.read += 4; + return rval; + }; + util.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; + }; + util.DataBuffer.prototype.getSignedInt = function(n) { + var x = this.getInt(n); + var max = 2 << n - 2; + if (x >= max) { + x -= max << 1; } - 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]; + return x; + }; + util.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 { - 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() - ]); + rval = this.read === 0 ? this.data : this.data.slice(this.read); + this.clear(); } + return rval; }; - modes.gcm.prototype.encrypt = function(input, output, finish) { - var inputLength = input.length(); - if (inputLength === 0) { - return true; + util.DataBuffer.prototype.bytes = function(count) { + return typeof count === "undefined" ? this.data.slice(this.read) : this.data.slice(this.read, this.read + count); + }; + util.DataBuffer.prototype.at = function(i) { + return this.data.getUint8(this.read + i); + }; + util.DataBuffer.prototype.setAt = function(i, b) { + this.data.setUint8(i, b); + return this; + }; + util.DataBuffer.prototype.last = function() { + return this.data.getUint8(this.write - 1); + }; + util.DataBuffer.prototype.copy = function() { + return new util.DataBuffer(this); + }; + util.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; } - 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; + return this; + }; + util.DataBuffer.prototype.clear = function() { + this.data = new DataView(new ArrayBuffer(0)); + this.read = this.write = 0; + return this; + }; + util.DataBuffer.prototype.truncate = function(count) { + this.write = Math.max(0, this.length() - count); + this.read = Math.min(this.read, this.write); + return this; + }; + util.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"; } - output.putBytes(this._partialOutput.getBytes( - inputLength - this._partialBytes - )); - this._partialBytes = 0; + rval += b.toString(16); } - this._s = this.ghash(this._hashSubkey, this._s, this._outBlock); - inc32(this._inBlock); + return rval; }; - modes.gcm.prototype.decrypt = function(input, output, finish) { - var inputLength = input.length(); - if (inputLength < this.blockSize && !(finish && inputLength > 0)) { - return true; + util.DataBuffer.prototype.toString = function(encoding) { + var view = new Uint8Array(this.data, this.read, this.length()); + encoding = encoding || "utf8"; + if (encoding === "binary" || encoding === "raw") { + return util.binary.raw.encode(view); } - 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 (encoding === "hex") { + return util.binary.hex.encode(view); } - if (inputLength < this.blockSize) { - this._cipherLength += inputLength % this.blockSize; - } else { - this._cipherLength += this.blockSize; + if (encoding === "base64") { + return util.binary.base64.encode(view); } - }; - modes.gcm.prototype.afterFinish = function(output, options) { - var rval = true; - if (options.decrypt && options.overflow) { - output.truncate(this.blockSize - options.overflow); + if (encoding === "utf8") { + return util.text.utf8.decode(view); } - 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]); + if (encoding === "utf16") { + return util.text.utf16.decode(view); } - this.tag.truncate(this.tag.length() % (this._tagLength / 8)); - if (options.decrypt && this.tag.bytes() !== this._tag) { - rval = false; + throw new Error("Invalid encoding: " + encoding); + }; + util.createBuffer = function(input, encoding) { + encoding = encoding || "raw"; + if (input !== void 0 && encoding === "utf8") { + input = util.encodeUtf8(input); } - return rval; + return new util.ByteBuffer(input); }; - 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]; + util.fillString = function(c, n) { + var s = ""; + while (n > 0) { + if (n & 1) { + s += c; + } + n >>>= 1; + if (n > 0) { + c += c; } - this.pow(v_i, v_i); } - return z_i; + return s; }; - 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; + util.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; }; - 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]; + util.hexToBytes = function(hex) { + var rval = ""; + var i = 0; + if (hex.length & true) { + i = 1; + rval += String.fromCharCode(parseInt(hex[0], 16)); } - return z; + for (; i < hex.length; i += 2) { + rval += String.fromCharCode(parseInt(hex.substr(i, 2), 16)); + } + return rval; }; - 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); + util.bytesToHex = function(bytes) { + return util.createBuffer(bytes).toHex(); }; - 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; + util.int32ToBytes = function(i) { + return String.fromCharCode(i >> 24 & 255) + String.fromCharCode(i >> 16 & 255) + String.fromCharCode(i >> 8 & 255) + String.fromCharCode(i & 255); }; - 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; + 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"; + util.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); + } } - 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] - ]; + output += line; + return output; + }; + util.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); + } } - 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 output; + }; + util.encodeUtf8 = function(str2) { + return unescape(encodeURIComponent(str2)); + }; + util.decodeUtf8 = function(str2) { + return decodeURIComponent(escape(str2)); + }; + util.binary = { + raw: {}, + hex: {}, + base64: {}, + base58: {}, + baseN: { + encode: baseN.encode, + decode: baseN.decode } - return m; }; - function transformIV(iv, blockSize) { - if (typeof iv === "string") { - iv = forge.util.createBuffer(iv); + util.binary.raw.encode = function(bytes) { + return String.fromCharCode.apply(null, bytes); + }; + util.binary.raw.decode = function(str2, output, offset) { + var out = output; + if (!out) { + out = new Uint8Array(str2.length); } - 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]); + offset = offset || 0; + var j = offset; + for (var i = 0; i < str2.length; ++i) { + out[j++] = str2.charCodeAt(i); + } + return output ? j - offset : out; + }; + util.binary.hex.encode = util.bytesToHex; + util.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; + }; + util.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); } } - if (iv.length() < blockSize) { - throw new Error( - "Invalid IV length; got " + iv.length() + " bytes and expected " + blockSize + " bytes." - ); + output += line; + return output; + }; + util.binary.base64.decode = function(input, output, offset) { + var out = output; + if (!out) { + out = new Uint8Array(Math.ceil(input.length / 4) * 3); } - if (!forge.util.isArray(iv)) { - var ints = []; - var blocks = blockSize / 4; - for (var i = 0; i < blocks; ++i) { - ints.push(iv.getInt32()); + 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; + } } - 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_util8(); - 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; + return output ? j - offset : out.subarray(0, j); }; - forge.aes.createEncryptionCipher = function(key, mode) { - return _createCipher({ - key, - output: null, - decrypt: false, - mode - }); + util.binary.base58.encode = function(input, maxline) { + return util.binary.baseN.encode(input, _base58, maxline); }; - forge.aes.startDecrypting = function(key, iv, output, mode) { - var cipher = _createCipher({ - key, - output, - decrypt: true, - mode - }); - cipher.start(iv); - return cipher; + util.binary.base58.decode = function(input, maxline) { + return util.binary.baseN.decode(input, _base58, maxline); }; - forge.aes.createDecryptionCipher = function(key, mode) { - return _createCipher({ - key, - output: null, - decrypt: true, - mode - }); + util.text = { + utf8: {}, + utf16: {} }; - forge.aes.Algorithm = function(name, mode) { - if (!init) { - initialize(); + util.text.utf8.encode = function(str2, output, offset) { + str2 = util.encodeUtf8(str2); + var out = output; + if (!out) { + out = new Uint8Array(str2.length); } - 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; + offset = offset || 0; + var j = offset; + for (var i = 0; i < str2.length; ++i) { + out[j++] = str2.charCodeAt(i); + } + return output ? j - offset : out; }; - forge.aes.Algorithm.prototype.initialize = function(options) { - if (this._init) { - return; + util.text.utf8.decode = function(bytes) { + return util.decodeUtf8(String.fromCharCode.apply(null, bytes)); + }; + util.text.utf16.encode = function(str2, output, offset) { + var out = output; + if (!out) { + out = new Uint8Array(str2.length * 2); } - 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]); + var view = new Uint16Array(out.buffer); + offset = offset || 0; + var j = offset; + var k = offset; + for (var i = 0; i < str2.length; ++i) { + view[k++] = str2.charCodeAt(i); + j += 2; + } + return output ? j - offset : out; + }; + util.text.utf16.decode = function(bytes) { + return String.fromCharCode.apply(null, new Uint16Array(bytes.buffer)); + }; + util.deflate = function(api, bytes, raw) { + bytes = util.decode64(api.deflate(util.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); } - 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()); + return bytes; + }; + util.inflate = function(api, bytes, raw) { + var rval = api.inflate(util.encode64(bytes)).rval; + return rval === null ? null : util.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 = util.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 (!forge.util.isArray(key) || !(key.length === 4 || key.length === 6 || key.length === 8)) { - throw new Error("Invalid key parameter."); + if (rval !== null) { + rval = JSON.parse(util.decode64(rval)); } - var mode = this.mode.name; - var encryptOp = ["CFB", "OFB", "CTR", "GCM"].indexOf(mode) !== -1; - this._w = _expandKey(key, options.decrypt && !encryptOp); - this._init = true; + return rval; }; - forge.aes._expandKey = function(key, decrypt) { - if (!init) { - initialize(); + var _setItem = function(api, id, key, data) { + var obj = _getStorageObject(api, id); + if (obj === null) { + obj = {}; } - return _expandKey(key, decrypt); + obj[key] = data; + _setStorageObject(api, id, obj); }; - 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 init = false; - var Nb = 4; - var sbox; - var isbox; - var rcon; - var mix; - var imix; - function initialize() { - init = 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; + var _getItem = function(api, id, key) { + var rval = _getStorageObject(api, id); + if (rval !== null) { + rval = key in rval ? rval[key] : null; } - 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; + 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 (e === 0) { - e = ei = 1; - } else { - e = e2 ^ xtime[xtime[xtime[e2 ^ e8]]]; - ei ^= xtime[xtime[ei]]; + if (empty) { + obj = null; } + _setStorageObject(api, id, obj); } - } - 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; + }; + 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"]; } - 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]]; + var type2; + var done = false; + var exception2 = null; + for (var idx in location) { + type2 = location[idx]; + try { + if (type2 === "flash" || type2 === "both") { + if (args[0] === null) { + throw new Error("Flash local storage not available."); } + rval = func.apply(this, args); + done = type2 === "flash"; + } + if (type2 === "web" || type2 === "both") { + args[0] = localStorage; + rval = func.apply(this, args); + done = true; } + } catch (ex) { + exception2 = ex; + } + if (done) { + break; } - 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); + if (!done) { + throw exception2; } - 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("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_util8(); - require_oids(); - var asn1 = module2.exports = forge.asn1 = forge.asn1 || {}; - asn1.Class = { - UNIVERSAL: 0, - APPLICATION: 64, - CONTEXT_SPECIFIC: 128, - PRIVATE: 192 + return rval; }; - 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 + util.setItem = function(api, id, key, data, location) { + _callStorageFunction(_setItem, arguments, location); }; - asn1.create = function(tagClass, type2, 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: type2, - constructed, - composed: constructed || forge.util.isArray(value), - value - }; - if (options && "bitStringContents" in options) { - obj.bitStringContents = options.bitStringContents; - obj.original = asn1.copy(obj); - } - return obj; + util.getItem = function(api, id, key, location) { + return _callStorageFunction(_getItem, arguments, location); }; - 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; + util.removeItem = function(api, id, key, location) { + _callStorageFunction(_removeItem, arguments, location); }; - asn1.equals = function(obj1, obj2, options) { - if (forge.util.isArray(obj1)) { - if (!forge.util.isArray(obj2)) { + util.clearItems = function(api, id, location) { + _callStorageFunction(_clearItems, arguments, location); + }; + util.isEmpty = function(obj) { + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) { return false; } - if (obj1.length !== obj2.length) { - return false; + } + return true; + }; + util.format = function(format) { + var re = /%./g; + var match; + var part; + var argi = 0; + var parts = []; + var last = 0; + while (match = re.exec(format)) { + part = format.substring(last, re.lastIndex - 2); + if (part.length > 0) { + parts.push(part); } - for (var i = 0; i < obj1.length; ++i) { - if (!asn1.equals(obj1[i], obj2[i])) { - return false; - } + last = re.lastIndex; + var code = match[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 + "?>"); } - return true; } - if (typeof obj1 !== typeof obj2) { - return false; + parts.push(format.substring(last)); + return parts.join(""); + }; + util.formatNumber = function(number, decimals, dec_point, thousands_sep) { + var n = number, 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) : ""); + }; + util.formatSize = function(size) { + if (size >= 1073741824) { + size = util.formatNumber(size / 1073741824, 2, ".", "") + " GiB"; + } else if (size >= 1048576) { + size = util.formatNumber(size / 1048576, 2, ".", "") + " MiB"; + } else if (size >= 1024) { + size = util.formatNumber(size / 1024, 0) + " KiB"; + } else { + size = util.formatNumber(size, 0) + " bytes"; } - if (typeof obj1 === "string") { - return obj1 === obj2; + return size; + }; + util.bytesFromIP = function(ip) { + if (ip.indexOf(".") !== -1) { + return util.bytesFromIPv4(ip); } - 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; + if (ip.indexOf(":") !== -1) { + return util.bytesFromIPv6(ip); } - return equal; + return null; }; - asn1.getBerValueLength = function(b) { - var b2 = b.getByte(); - if (b2 === 128) { - return void 0; + util.bytesFromIPv4 = function(ip) { + ip = ip.split("."); + if (ip.length !== 4) { + return null; } - var length; - var longForm = b2 & 128; - if (!longForm) { - length = b2; - } else { - length = b.getInt((b2 & 127) << 3); + var b = util.createBuffer(); + for (var i = 0; i < ip.length; ++i) { + var num = parseInt(ip[i], 10); + if (isNaN(num)) { + return null; + } + b.putByte(num); } - return length; + return b.getBytes(); }; - function _checkBufferLength(bytes, remaining, n) { - if (n > remaining) { - var error4 = new Error("Too few bytes to parse DER."); - error4.available = bytes.length(); - error4.remaining = remaining; - error4.requested = n; - throw error4; + util.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 = util.createBuffer(); + for (var i = 0; i < 8; ++i) { + if (!ip[i] || ip[i].length === 0) { + b.fillWithByte(0, zeros); + zeros = 0; + continue; + } + var bytes = util.hexToBytes(ip[i]); + if (bytes.length < 2) { + b.putByte(0); + } + b.putBytes(bytes); } - } - var _getValueLength = function(bytes, remaining) { - var b2 = bytes.getByte(); - remaining--; - if (b2 === 128) { - return void 0; + return b.getBytes(); + }; + util.bytesToIP = function(bytes) { + if (bytes.length === 4) { + return util.bytesToIPv4(bytes); } - 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 (bytes.length === 16) { + return util.bytesToIPv6(bytes); } - if (length < 0) { - throw new Error("Negative length: " + length); + return null; + }; + util.bytesToIPv4 = function(bytes) { + if (bytes.length !== 4) { + return null; } - return length; + var ip = []; + for (var i = 0; i < bytes.length; ++i) { + ip.push(bytes.charCodeAt(i)); + } + return ip.join("."); }; - asn1.fromDer = function(bytes, options) { - if (options === void 0) { - options = { - strict: true, - parseAllBytes: true, - decodeBitStrings: true - }; + util.bytesToIPv6 = function(bytes) { + if (bytes.length !== 16) { + return null; } - if (typeof options === "boolean") { - options = { - strict: options, - parseAllBytes: true, - decodeBitStrings: true - }; + var ip = []; + var zeroGroups = []; + var zeroMaxGroup = 0; + for (var i = 0; i < bytes.length; i += 2) { + var hex = util.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 (!("strict" in options)) { - options.strict = true; + 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(""); + } + } } - if (!("parseAllBytes" in options)) { - options.parseAllBytes = true; + return ip.join(":"); + }; + util.estimateCores = function(options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; } - if (!("decodeBitStrings" in options)) { - options.decodeBitStrings = true; + options = options || {}; + if ("cores" in util && !options.update) { + return callback(null, util.cores); } - if (typeof bytes === "string") { - bytes = forge.util.createBuffer(bytes); + if (typeof navigator !== "undefined" && "hardwareConcurrency" in navigator && navigator.hardwareConcurrency > 0) { + util.cores = navigator.hardwareConcurrency; + return callback(null, util.cores); } - var byteCount = bytes.length(); - var value = _fromDer(bytes, bytes.length(), 0, options); - if (options.parseAllBytes && bytes.length() !== 0) { - var error4 = new Error("Unparsed DER bytes remain after ASN.1 parsing."); - error4.byteCount = byteCount; - error4.remaining = bytes.length(); - throw error4; + if (typeof Worker === "undefined") { + util.cores = 1; + return callback(null, util.cores); } - return value; - }; - function _fromDer(bytes, remaining, depth, options) { - var start; - _checkBufferLength(bytes, remaining, 2); - var b1 = bytes.getByte(); - remaining--; - var tagClass = b1 & 192; - var type2 = b1 & 31; - start = bytes.length(); - var length = _getValueLength(bytes, remaining); - remaining -= start - bytes.length(); - if (length !== void 0 && length > remaining) { - if (options.strict) { - var error4 = new Error("Too few bytes to read ASN.1 value."); - error4.available = bytes.length(); - error4.remaining = remaining; - error4.requested = length; - throw error4; + if (typeof Blob === "undefined") { + util.cores = 2; + return callback(null, util.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); + util.cores = Math.max(1, avg); + URL.revokeObjectURL(blobUrl); + return callback(null, util.cores); } - length = remaining; + map2(numWorkers, function(err, results) { + max.push(reduce(numWorkers, results)); + sample(max, samples - 1, numWorkers); + }); } - 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; + function map2(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); } - 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(); - } + }); + workers.push(worker); } - } - if (value === void 0 && tagClass === asn1.Class.UNIVERSAL && type2 === 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 - type2 === asn1.Type.BITSTRING && length > 1) { - var savedRead = bytes.read; - var savedRemaining = remaining; - var unused = 0; - if (type2 === asn1.Type.BITSTRING) { - _checkBufferLength(bytes, remaining, 1); - unused = bytes.getByte(); - remaining--; + for (var i = 0; i < numWorkers; ++i) { + workers[i].postMessage(i); } - 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 (type2 == asn1.Type.BITSTRING) { - used++; + } + 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 tc = composed.tagClass; - if (used === length && (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { - value = [composed]; + var r2 = results[i]; + if (r1.st > r2.st && r1.st < r2.et || r2.st > r1.st && r2.st < r1.et) { + overlap.push(i); } - } catch (ex) { } } - if (value === void 0) { - bytes.read = savedRead; - remaining = savedRemaining; - } + return overlaps.reduce(function(max, overlap2) { + return Math.max(max, overlap2.length); + }, 0); } - 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 (type2 === 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; + }; + } +}); + +// 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_util8(); + 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(); } } - var asn1Options = bitStringContents === void 0 ? null : { - bitStringContents - }; - return asn1.create(tagClass, type2, 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 (!api) { + throw new Error("Unsupported algorithm: " + algorithm); } - 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); - } + 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(); } } - 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)); - } + if (!api) { + throw new Error("Unsupported algorithm: " + algorithm); } - bytes.putBuffer(value); - return bytes; + return new forge.cipher.BlockCipher({ + algorithm: api, + key, + decrypt: true + }); }; - 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); - 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]); - } + 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 bytes; + return null; }; - asn1.derToOid = function(bytes) { - var oid; - if (typeof bytes === "string") { - bytes = forge.util.createBuffer(bytes); + 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]; } - var b = bytes.getByte(); - oid = Math.floor(b / 40) + "." + b % 40; - var value = 0; - while (bytes.length() > 0) { - b = bytes.getByte(); - value = value << 7; - if (b & 128) { - value += b & 127; - } else { - oid += "." + (value + b); - value = 0; - } + 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); } - return oid; + while (!this._op.call(this.mode, this._input, this.output, this._finish) && !this._finish) { + } + this._input.compact(); }; - 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; + 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; } } - 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); - } + this._finish = true; + this.update(); + if (this._decrypt && this.mode.unpad) { + if (!this.mode.unpad(this.output, options)) { + return false; } } - return date; + if (this.mode.afterFinish) { + if (!this.mode.afterFinish(this.output, options)) { + return false; + } + } + return true; }; - 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; + } +}); + +// 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_util8(); + 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; } - if (gentime.charAt(14) === ".") { - fff = parseFloat(gentime.substr(14), 10) * 1e3; + for (var i = 0; i < this._ints; ++i) { + this._inBlock[i] = input.getInt32(); } - 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); + this.cipher.encrypt(this._inBlock, this._outBlock); + for (var i = 0; i < this._ints; ++i) { + output.putInt32(this._outBlock[i]); } - return date; }; - asn1.dateToUtcTime = function(date) { - if (typeof date === "string") { - return date; + modes.ecb.prototype.decrypt = function(input, output, finish) { + if (input.length() < this.blockSize && !(finish && input.length() > 0)) { + return true; } - 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]; + 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]); } - rval += "Z"; - return rval; }; - asn1.dateToGeneralizedTime = function(date) { - if (typeof date === "string") { - return date; + 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 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"; + 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."); } - rval += format[i]; + 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); } - rval += "Z"; - return rval; }; - asn1.integerToDer = function(x) { - var rval = forge.util.createBuffer(); - if (x >= -128 && x < 128) { - return rval.putSignedInt(x, 8); + modes.cbc.prototype.encrypt = function(input, output, finish) { + if (input.length() < this.blockSize && !(finish && input.length() > 0)) { + return true; } - if (x >= -32768 && x < 32768) { - return rval.putSignedInt(x, 16); + for (var i = 0; i < this._ints; ++i) { + this._inBlock[i] = this._prev[i] ^ input.getInt32(); } - if (x >= -8388608 && x < 8388608) { - return rval.putSignedInt(x, 24); + this.cipher.encrypt(this._inBlock, this._outBlock); + for (var i = 0; i < this._ints; ++i) { + output.putInt32(this._outBlock[i]); } - if (x >= -2147483648 && x < 2147483648) { - return rval.putSignedInt(x, 32); + 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]); } - var error4 = new Error("Integer too large; max is 32-bits."); - error4.integer = x; - throw error4; + this._prev = this._inBlock.slice(0); }; - asn1.derToInteger = function(bytes) { - if (typeof bytes === "string") { - bytes = forge.util.createBuffer(bytes); + 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 n = bytes.length() * 8; - if (n > 32) { - throw new Error("Integer too large; max is 32-bits."); + var len = output.length(); + var count = output.at(len - 1); + if (count > this.blockSize << 2) { + return false; } - return bytes.getSignedInt(n); + output.truncate(count); + return true; }; - 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) { - rval = v.value[i].optional || false; - if (obj.value[j]) { - rval = asn1.validate(obj.value[j], v.value[i], capture, errors); - if (rval) { - ++j; - } else if (v.value[i].optional) { - rval = true; - } - } - if (!rval && errors) { - errors.push( - "[" + v.name + '] Tag class "' + v.tagClass + '", type "' + v.type + '" expected value length "' + v.value.length + '", got "' + obj.value.length + '"' - ); - } - } - } - 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 + '"' - ); - } + 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."); } - return rval; + this._iv = transformIV(options.iv, this.blockSize); + this._inBlock = this._iv.slice(0); + this._partialBytes = 0; }; - var _nonLatinRegex = /[^\\u0000-\\u00ff]/; - asn1.prettyPrint = function(obj, level, indentation) { - var rval = ""; - level = level || 0; - indentation = indentation || 2; - if (level > 0) { - rval += "\n"; + modes.cfb.prototype.encrypt = function(input, output, finish) { + var inputLength = input.length(); + if (inputLength === 0) { + return true; } - var indent = ""; - for (var i = 0; i < level * indentation; ++i) { - indent += " "; + 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; } - 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; + var partialBytes = (this.blockSize - inputLength) % this.blockSize; + if (partialBytes > 0) { + partialBytes = this.blockSize - partialBytes; } - 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; - } + 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 { - rval += obj.type; + for (var i = 0; i < this._ints; ++i) { + this._inBlock[i] = this._partialBlock[i]; + } } - 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 += ","; - } - } + 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]); } - rval += indent + "Sub values: " + subvalues + sub; + 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 { - 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; + for (var i = 0; i < this._ints; ++i) { + this._inBlock[i] = this._partialBlock[i]; } } - return rval; + 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; }; - } -}); - -// 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_util8(); - 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(md, key) { - if (md !== null) { - if (typeof md === "string") { - md = md.toLowerCase(); - if (md in forge.md.algorithms) { - _md = forge.md.algorithms[md].create(); - } else { - throw new Error('Unknown hash algorithm "' + md + '"'); - } - } else { - _md = md; - } - } - 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; + 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; }; - } -}); - -// 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_util8(); - var md5 = module2.exports = forge.md5 = forge.md5 || {}; - forge.md.md5 = forge.md.algorithms.md5 = md5; - md5.create = function() { - if (!_initialized) { - _init(); + modes.ofb.prototype.start = function(options) { + if (!("iv" in options)) { + throw new Error("Invalid IV parameter."); } - var _state = null; - var _input = forge.util.createBuffer(); - var _w = new Array(16); - var md = { - 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 - }; - md.start = function() { - md.messageLength = 0; - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for (var i = 0; i < int32s; ++i) { - md.fullMessageLength.push(0); - } - _input = forge.util.createBuffer(); - _state = { - h0: 1732584193, - h1: 4023233417, - h2: 2562383102, - h3: 271733878 - }; - return md; - }; - md.start(); - md.update = function(msg, encoding) { - if (encoding === "utf8") { - msg = forge.util.encodeUtf8(msg); - } - var len = msg.length; - md.messageLength += len; - len = [len / 4294967296 >>> 0, len >>> 0]; - for (var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + (md.fullMessageLength[i] / 4294967296 >>> 0); - md.fullMessageLength[i] = md.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 md; - }; - md.digest = function() { - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; - var overflow = remaining & md.blockLength - 1; - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - var bits, carry = 0; - for (var i = md.fullMessageLength.length - 1; i >= 0; --i) { - bits = md.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 md; + this._iv = transformIV(options.iv, this.blockSize); + this._inBlock = this._iv.slice(0); + this._partialBytes = 0; }; - 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); + modes.ofb.prototype.encrypt = function(input, output, finish) { + var inputLength = input.length(); + if (input.length() === 0) { + return true; } - _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; + 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]; } - 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; + return; } - } - } -}); - -// 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_util8(); - 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); + var partialBytes = (this.blockSize - inputLength) % this.blockSize; + if (partialBytes > 0) { + partialBytes = this.blockSize - partialBytes; } - if (msg.contentDomain) { - header = { name: "Content-Domain", values: [msg.contentDomain] }; - rval += foldHeader(header); + this._partialOutput.clear(); + for (var i = 0; i < this._ints; ++i) { + this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); } - if (msg.dekInfo) { - header = { name: "DEK-Info", values: [msg.dekInfo.algorithm] }; - if (msg.dekInfo.parameters) { - header.values.push(msg.dekInfo.parameters); + if (partialBytes > 0) { + input.read -= this.blockSize; + } else { + for (var i = 0; i < this._ints; ++i) { + this._inBlock[i] = this._outBlock[i]; } - rval += foldHeader(header); } - if (msg.headers) { - for (var i = 0; i < msg.headers.length; ++i) { - rval += foldHeader(msg.headers[i]); - } + if (this._partialBytes > 0) { + this._partialOutput.getBytes(this._partialBytes); } - if (msg.procType) { - rval += "\r\n"; + if (partialBytes > 0 && !finish) { + output.putBytes(this._partialOutput.getBytes( + partialBytes - this._partialBytes + )); + this._partialBytes = partialBytes; + return true; } - rval += forge.util.encode64(msg.body, options.maxline || 64) + "\r\n"; - rval += "-----END " + msg.type + "-----\r\n"; - return rval; + output.putBytes(this._partialOutput.getBytes( + inputLength - this._partialBytes + )); + this._partialBytes = 0; }; - pem.decode = function(str2) { - 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 match; - while (true) { - match = rMessage.exec(str2); - if (!match) { - break; + 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]); } - var type2 = match[1]; - if (type2 === "NEW CERTIFICATE REQUEST") { - type2 = "CERTIFICATE REQUEST"; + } else { + var partialBytes = (this.blockSize - inputLength) % this.blockSize; + if (partialBytes > 0) { + partialBytes = this.blockSize - partialBytes; } - var msg = { - type: type2, - procType: null, - contentDomain: null, - dekInfo: null, - headers: [], - body: forge.util.decode64(match[3]) - }; - rval.push(msg); - if (!match[2]) { - continue; + this._partialOutput.clear(); + for (var i = 0; i < this._ints; ++i) { + this._partialOutput.putInt32(input.getInt32() ^ this._outBlock[i]); } - var lines = match[2].split(rCRLF); - var li = 0; - while (match && 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; - } - match = line.match(rHeader); - if (match) { - var header = { name: match[1], values: [] }; - var values = match[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 (partialBytes > 0) { + input.read -= this.blockSize; } - 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 (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; } - if (rval.length === 0) { - throw new Error("Invalid PEM formatted message."); + 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() + ]); } - return rval; }; - function foldHeader(header) { - var rval = header.name + ": "; - var values = []; - var insertSpace = function(match, $1) { - return " " + $1; - }; - for (var i = 0; i < header.values.length; ++i) { - values.push(header.values[i].replace(/^(\S+\r\n)/, insertSpace)); + modes.gcm.prototype.encrypt = function(input, output, finish) { + var inputLength = input.length(); + if (inputLength === 0) { + return true; } - 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); + 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 { - rval = rval.substr(0, candidate) + "\r\n" + insert + rval.substr(candidate + 1); + this._cipherLength += this.blockSize; } - length = i - candidate - 1; - candidate = -1; - ++i; - } else if (rval[i] === " " || rval[i] === " " || rval[i] === ",") { - candidate = i; + 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 ltrim(str2) { - return str2.replace(/^\s+/, ""); + 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/des.js -var require_des = __commonJS({ - "node_modules/node-forge/lib/des.js"(exports2, module2) { +// 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_util8(); - module2.exports = forge.des = forge.des || {}; - forge.des.startEncrypting = function(key, iv, output, mode) { + module2.exports = forge.aes = forge.aes || {}; + forge.aes.startEncrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key, output, decrypt: false, - mode: mode || (iv === null ? "ECB" : "CBC") + mode }); cipher.start(iv); return cipher; }; - forge.des.createEncryptionCipher = function(key, mode) { + forge.aes.createEncryptionCipher = function(key, mode) { return _createCipher({ key, output: null, @@ -27695,17 +27796,17 @@ var require_des = __commonJS({ mode }); }; - forge.des.startDecrypting = function(key, iv, output, mode) { + forge.aes.startDecrypting = function(key, iv, output, mode) { var cipher = _createCipher({ key, output, decrypt: true, - mode: mode || (iv === null ? "ECB" : "CBC") + mode }); cipher.start(iv); return cipher; }; - forge.des.createDecryptionCipher = function(key, mode) { + forge.aes.createDecryptionCipher = function(key, mode) { return _createCipher({ key, output: null, @@ -27713,177 +27814,214 @@ var require_des = __commonJS({ mode }); }; - forge.des.Algorithm = function(name, mode) { + forge.aes.Algorithm = function(name, mode) { + if (!init) { + initialize(); + } var self2 = this; self2.name = name; self2.mode = new mode({ - blockSize: 8, + blockSize: 16, cipher: { encrypt: function(inBlock, outBlock) { - return _updateBlock(self2._keys, inBlock, outBlock, false); + return _updateBlock(self2._w, inBlock, outBlock, false); }, decrypt: function(inBlock, outBlock) { - return _updateBlock(self2._keys, inBlock, outBlock, true); + return _updateBlock(self2._w, inBlock, outBlock, true); } } }); self2._init = false; }; - forge.des.Algorithm.prototype.initialize = function(options) { + forge.aes.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); + 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]); } } - this._keys = _createKeys(key); + 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; }; - 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); + forge.aes._expandKey = function(key, decrypt) { + if (!init) { + 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.des.Algorithm(name, mode); + return new forge.aes.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; + var init = false; + var Nb = 4; + var sbox; + var isbox; + var rcon; + var mix; + var imix; + function initialize() { + init = 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]]; } } - 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]; + 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; } - 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]); + 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]]; + } + } } - tmp = left; - left = right; - right = tmp; + w = wnew; } - 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; + 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 = "DES-" + mode; + var algorithm = "AES-" + mode; var cipher; if (options.decrypt) { cipher = forge.cipher.createDecipher(algorithm, options.key); @@ -27907,2361 +28045,1875 @@ var require_des = __commonJS({ } }); -// node_modules/node-forge/lib/pbkdf2.js -var require_pbkdf2 = __commonJS({ - "node_modules/node-forge/lib/pbkdf2.js"(exports2, module2) { +// node_modules/node-forge/lib/oids.js +var require_oids = __commonJS({ + "node_modules/node-forge/lib/oids.js"(exports2, module2) { var forge = require_forge(); - require_hmac(); - require_md(); - require_util8(); - var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; - var crypto; - if (forge.util.isNodejs && !forge.options.usePureJavaScript) { - crypto = require("crypto"); + 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; } - module2.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function(p, s, c, dkLen, md, callback) { - if (typeof md === "function") { - callback = md; - md = null; - } - if (forge.util.isNodejs && !forge.options.usePureJavaScript && crypto.pbkdf2 && (md === null || typeof md !== "object") && (crypto.pbkdf2Sync.length > 4 || (!md || md === "sha1"))) { - if (typeof md !== "string") { - md = "sha1"; - } - p = Buffer.from(p, "binary"); - s = Buffer.from(s, "binary"); - if (!callback) { - if (crypto.pbkdf2Sync.length === 4) { - return crypto.pbkdf2Sync(p, s, c, dkLen).toString("binary"); + 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("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_util8(); + 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, type2, 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]); } - return crypto.pbkdf2Sync(p, s, c, dkLen, md).toString("binary"); - } - if (crypto.pbkdf2Sync.length === 4) { - return crypto.pbkdf2(p, s, c, dkLen, function(err2, key) { - if (err2) { - return callback(err2); - } - callback(null, key.toString("binary")); - }); } - return crypto.pbkdf2(p, s, c, dkLen, md, function(err2, key) { - if (err2) { - return callback(err2); - } - callback(null, key.toString("binary")); - }); + value = tmp; } - if (typeof md === "undefined" || md === null) { - md = "sha1"; + var obj = { + tagClass, + type: type2, + constructed, + composed: constructed || forge.util.isArray(value), + value + }; + if (options && "bitStringContents" in options) { + obj.bitStringContents = options.bitStringContents; + obj.original = asn1.copy(obj); } - if (typeof md === "string") { - if (!(md in forge.md.algorithms)) { - throw new Error("Unknown hash algorithm: " + md); + 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)); } - md = forge.md[md].create(); + return copy; } - var hLen = md.digestLength; - if (dkLen > 4294967295 * hLen) { - var err = new Error("Derived key is too long."); - if (callback) { - return callback(err); - } - throw err; + if (typeof obj === "string") { + return obj; } - var len = Math.ceil(dkLen / hLen); - var r = dkLen - (len - 1) * hLen; - var prf = forge.hmac.create(); - prf.start(md, p); - var dk = ""; - var xor, 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)); - xor = 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(); - xor = forge.util.xorBytes(xor, u_c, hLen); - u_c1 = u_c; + 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; } - dk += i < len ? xor : xor.substr(0, r); } - return dk; + return true; } - 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)); - xor = u_c1 = prf.digest().getBytes(); - j = 2; - inner(); + if (typeof obj1 !== typeof obj2) { + return false; } - function inner() { - if (j <= c) { - prf.start(null, null); - prf.update(u_c1); - u_c = prf.digest().getBytes(); - xor = forge.util.xorBytes(xor, u_c, hLen); - u_c1 = u_c; - ++j; - return forge.util.setImmediate(inner); - } - dk += i < len ? xor : xor.substr(0, r); - ++i; - outer(); + if (typeof obj1 === "string") { + return obj1 === obj2; } - outer(); - }; - } -}); - -// node_modules/node-forge/lib/sha256.js -var require_sha256 = __commonJS({ - "node_modules/node-forge/lib/sha256.js"(exports2, module2) { - var forge = require_forge(); - require_md(); - require_util8(); - var sha256 = module2.exports = forge.sha256 = forge.sha256 || {}; - forge.md.sha256 = forge.md.algorithms.sha256 = sha256; - sha256.create = function() { - if (!_initialized) { - _init(); + 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; } - var _state = null; - var _input = forge.util.createBuffer(); - var _w = new Array(64); - var md = { - 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 - }; - md.start = function() { - md.messageLength = 0; - md.fullMessageLength = md.messageLength64 = []; - var int32s = md.messageLengthSize / 4; - for (var i = 0; i < int32s; ++i) { - md.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 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 }; - return md; - }; - md.start(); - md.update = function(msg, encoding) { - if (encoding === "utf8") { - msg = forge.util.encodeUtf8(msg); - } - var len = msg.length; - md.messageLength += len; - len = [len / 4294967296 >>> 0, len >>> 0]; - for (var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + (md.fullMessageLength[i] / 4294967296 >>> 0); - md.fullMessageLength[i] = md.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 md; - }; - md.digest = function() { - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; - var overflow = remaining & md.blockLength - 1; - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for (var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.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 + } + if (typeof options === "boolean") { + options = { + strict: options, + parseAllBytes: true, + decodeBitStrings: true }; - _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 md; + } + 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; }; - 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; + 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 type2 = 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; } - 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; + 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(); + } } - 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_util8(); - 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 md = plugin.md; - var pools = new Array(32); - for (var i = 0; i < 32; ++i) { - pools[i] = md.create(); + if (value === void 0 && tagClass === asn1.Class.UNIVERSAL && type2 === asn1.Type.BITSTRING) { + bitStringContents = bytes.bytes(length); } - ctx.pools = pools; - ctx.pool = 0; - ctx.generate = function(count, callback) { - if (!callback) { - return ctx.generateSync(count); + 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 + type2 === asn1.Type.BITSTRING && length > 1) { + var savedRead = bytes.read; + var savedRemaining = remaining; + var unused = 0; + if (type2 === asn1.Type.BITSTRING) { + _checkBufferLength(bytes, remaining, 1); + unused = bytes.getByte(); + remaining--; } - 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); - }); + 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 (type2 == asn1.Type.BITSTRING) { + used++; + } + var tc = composed.tagClass; + if (used === length && (tc === asn1.Class.UNIVERSAL || tc === asn1.Class.CONTEXT_SPECIFIC)) { + value = [composed]; + } + } catch (ex) { } - 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 (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."); } - if (ctx.key === null) { - _reseedSync(); + length = remaining; + } + if (type2 === asn1.Type.BMPSTRING) { + value = ""; + for (; length > 0; length -= 2) { + _checkBufferLength(bytes, remaining, 2); + value += String.fromCharCode(bytes.getInt16()); + remaining -= 2; } - 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)); + } else { + value = bytes.getBytes(length); + remaining -= length; } - return b.getBytes(count); + } + var asn1Options = bitStringContents === void 0 ? null : { + bitStringContents }; - function _reseed(callback) { - if (ctx.pools[0].messageLength >= 32) { - _seed(); - return callback(); + return asn1.create(tagClass, type2, 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); } - 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(); + if (useBitStringContents) { + value.putBytes(obj.bitStringContents); + } else if (obj.composed) { + if (obj.constructed) { + b1 |= 32; + } else { + value.putByte(0); } - 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 md2 = ctx.plugin.md.create(); - md2.update(ctx.keyBytes); - var _2powK = 1; - for (var k = 0; k < 32; ++k) { - if (ctx.reseeds % _2powK === 0) { - md2.update(ctx.pools[k].digest().getBytes()); - ctx.pools[k].start(); + for (var i = 0; i < obj.value.length; ++i) { + if (obj.value[i] !== void 0) { + value.putBuffer(asn1.toDer(obj.value[i])); } - _2powK = _2powK << 1; - } - ctx.keyBytes = md2.digest().getBytes(); - md2.start(); - md2.update(ctx.keyBytes); - var seedBytes = md2.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; - } - } + } else { + if (obj.type === asn1.Type.BMPSTRING) { + for (var i = 0; i < obj.value.length; ++i) { + value.putInt16(obj.value.charCodeAt(i)); } - } - 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); - } + } 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); } } - 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(); - }; + bytes.putByte(b1); + if (value.length() <= 127) { + bytes.putByte(value.length() & 127); } else { - ctx.seedFile = function(needed, callback) { - try { - callback(null, defaultSeedFile(needed)); - } catch (e) { - callback(e); - } - }; - ctx.seedFileSync = defaultSeedFile; + 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)); + } } - 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; + 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."); } - }; - ctx.collectInt = function(i2, n) { - var bytes = ""; - for (var x = 0; x < n; x += 8) { - bytes += String.fromCharCode(i2 >> x & 255); + 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]); } - 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 } } }); - }; + } + 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 { - 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); + oid += "." + (value + b); + value = 0; } - }; - return ctx; + } + return oid; }; - } -}); - -// node_modules/node-forge/lib/random.js -var require_random = __commonJS({ - "node_modules/node-forge/lib/random.js"(exports2, module2) { - var forge = require_forge(); - require_aes(); - require_sha256(); - require_prng(); - require_util8(); - (function() { - if (forge.random && forge.random.getBytes) { - module2.exports = forge.random; - return; + 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; + } } - (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; + 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); + } } - 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); - }; + } + 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; } - 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]; + 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; } - } catch (e) { + } + var childRval = asn1.validate(objChild, schemaItem, capture, errors); + if (childRval) { + ++j; + rval = true; + } else if (schemaItem.optional) { + rval = true; + } else { + rval = false; + break; } } - _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 (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 + '"' + ); } - if (!forge.random) { - forge.random = _ctx; - } else { - for (var key in _ctx) { - forge.random[key] = _ctx[key]; - } + } 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 + '"' + ); } - 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_util8(); - 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]); + 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"; } - 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)]); + var indent = ""; + for (var i = 0; i < level * indentation; ++i) { + indent += " "; } - 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()); + 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 (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]; - } - }; + 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 { - 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]; - } - }; + rval += obj.type; } - var runPlan = function(plan) { - var R = []; - for (i = 0; i < 4; i++) { - var val2 = _input.getInt16Le(); - if (_iv !== null) { - if (encrypt) { - val2 ^= _iv.getInt16Le(); - } else { - _iv.putInt16Le(val2); + 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 += ","; } } - R.push(val2 & 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(); + 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] + ") "; } } - _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); - } + if (obj.type === asn1.Type.INTEGER) { + try { + rval += asn1.derToInteger(obj.value); + } catch (ex) { + rval += "0x" + forge.util.bytesToHex(obj.value); } - _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); + } else if (obj.type === asn1.Type.BITSTRING) { + if (obj.value.length > 1) { + rval += "0x" + forge.util.bytesToHex(obj.value.slice(1)); + } else { + rval += "(none)"; } - while (_input.length() >= 8) { - runPlan([ - [5, mixRound], - [1, mashRound], - [6, mixRound], - [1, mashRound], - [5, mixRound] - ]); + 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)"; + } } - }, - /** - * 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 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 { - var padding = _input.length() === 8 ? 8 : 8 - _input.length(); - _input.fillWithByte(padding, padding); + throw e; } } - 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); - } - } + } 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_util8(); + 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(md, key) { + if (md !== null) { + if (typeof md === "string") { + md = md.toLowerCase(); + if (md in forge.md.algorithms) { + _md = forge.md.algorithms[md].create(); + } else { + throw new Error('Unknown hash algorithm "' + md + '"'); } + } else { + _md = md; } - return rval; } + 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); }; - 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); + 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/jsbn.js -var require_jsbn = __commonJS({ - "node_modules/node-forge/lib/jsbn.js"(exports2, module2) { +// node_modules/node-forge/lib/md5.js +var require_md5 = __commonJS({ + "node_modules/node-forge/lib/md5.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; + require_md(); + require_util8(); + var md5 = module2.exports = forge.md5 = forge.md5 || {}; + forge.md.md5 = forge.md.algorithms.md5 = md5; + md5.create = function() { + if (!_initialized) { + _init(); } - 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); + var _state = null; + var _input = forge.util.createBuffer(); + var _w = new Array(16); + var md = { + 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 + }; + md.start = function() { + md.messageLength = 0; + md.fullMessageLength = md.messageLength64 = []; + var int32s = md.messageLengthSize / 4; + for (var i = 0; i < int32s; ++i) { + md.fullMessageLength.push(0); } - 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); + _input = forge.util.createBuffer(); + _state = { + h0: 1732584193, + h1: 4023233417, + h2: 2562383102, + h3: 271733878 + }; + return md; + }; + md.start(); + md.update = function(msg, encoding) { + if (encoding === "utf8") { + msg = forge.util.encodeUtf8(msg); } - } - 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; + var len = msg.length; + md.messageLength += len; + len = [len / 4294967296 >>> 0, len >>> 0]; + for (var i = md.fullMessageLength.length - 1; i >= 0; --i) { + md.fullMessageLength[i] += len[1]; + len[1] = len[0] + (md.fullMessageLength[i] / 4294967296 >>> 0); + md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; + len[0] = len[1] / 4294967296 >>> 0; } - c += this.s; - } else { - c += this.s; - while (i < a.t) { - c -= a.data[i]; - r.data[i++] = c & this.DM; - c >>= this.DB; + _input.putBytes(msg); + _update(_state, _w, _input); + if (_input.read > 2048 || _input.length() === 0) { + _input.compact(); } - 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; + return md; + }; + md.digest = function() { + var finalBlock = forge.util.createBuffer(); + finalBlock.putBytes(_input.bytes()); + var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; + var overflow = remaining & md.blockLength - 1; + finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); + var bits, carry = 0; + for (var i = md.fullMessageLength.length - 1; i >= 0; --i) { + bits = md.fullMessageLength[i] * 8 + carry; + carry = bits / 4294967296 >>> 0; + finalBlock.putInt32Le(bits >>> 0); } - } - 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(); + 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 md; + }; + 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 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; + 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; } - 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); + } + } +}); + +// 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_util8(); + 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); } - 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); + if (msg.contentDomain) { + header = { name: "Content-Domain", values: [msg.contentDomain] }; + rval += foldHeader(header); } - 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 (msg.dekInfo) { + header = { name: "DEK-Info", values: [msg.dekInfo.algorithm] }; + if (msg.dekInfo.parameters) { + header.values.push(msg.dekInfo.parameters); } + rval += foldHeader(header); } - if (q != null) { - r.drShiftTo(ys, q); - if (ts != ms) BigInteger.ZERO.subTo(q, q); + if (msg.headers) { + for (var i = 0; i < msg.headers.length; ++i) { + rval += foldHeader(msg.headers[i]); + } } - 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]++; + 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(str2) { + 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 match; + while (true) { + match = rMessage.exec(str2); + if (!match) { + break; + } + var type2 = match[1]; + if (type2 === "NEW CERTIFICATE REQUEST") { + type2 = "CERTIFICATE REQUEST"; + } + var msg = { + type: type2, + procType: null, + contentDomain: null, + dekInfo: null, + headers: [], + body: forge.util.decode64(match[3]) + }; + rval.push(msg); + if (!match[2]) { + continue; + } + var lines = match[2].split(rCRLF); + var li = 0; + while (match && 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; + } + match = line.match(rHeader); + if (match) { + var header = { name: match[1], values: [] }; + var values = match[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".'); } } - 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; + 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(match, $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 z.revert(r); + return rval; } - 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); + function ltrim(str2) { + return str2.replace(/^\s+/, ""); } - 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; + } +}); + +// 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_util8(); + 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; } - 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); - } + 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); } - } 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); } + 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); } - 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); + 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 { - d = this.data[i] >> (p -= 8) & 255; - if (p <= 0) { - p += this.DB; - --i; - } + left = left << 1 | left >>> 27; + right = right << 1 | right >>> 27; } - if ((d & 128) != 0) d |= -256; - if (k == 0 && (this.s & 128) != (d & 128)) ++k; - if (k > 0 || d != this.s) r[k++] = d; + 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 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; + return keys; } - 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; + 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 { - f = this.s & this.DM; - for (i = m; i < a.t; ++i) r.data[i] = op(f, a.data[i]); - r.t = a.t; + looping = decrypt ? [94, 62, -2, 32, 64, 2, 30, -2, -2] : [0, 32, 2, 62, 30, -2, 64, 96, 2]; } - 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; + 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 bnShiftLeft(n) { - var r = nbi(); - if (n < 0) this.rShiftTo(-n, r); - else this.lShiftTo(n, r); - return r; + 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; } - function bnShiftRight(n) { - var r = nbi(); - if (n < 0) this.lShiftTo(-n, r); - else this.rShiftTo(n, r); - return r; + } +}); + +// 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_util8(); + var pkcs5 = forge.pkcs5 = forge.pkcs5 || {}; + var crypto2; + if (forge.util.isNodejs && !forge.options.usePureJavaScript) { + crypto2 = require("crypto"); } - function lbit(x) { - if (x == 0) return -1; - var r = 0; - if ((x & 65535) == 0) { - x >>= 16; - r += 16; + module2.exports = forge.pbkdf2 = pkcs5.pbkdf2 = function(p, s, c, dkLen, md, callback) { + if (typeof md === "function") { + callback = md; + md = null; } - if ((x & 255) == 0) { - x >>= 8; - r += 8; + if (forge.util.isNodejs && !forge.options.usePureJavaScript && crypto2.pbkdf2 && (md === null || typeof md !== "object") && (crypto2.pbkdf2Sync.length > 4 || (!md || md === "sha1"))) { + if (typeof md !== "string") { + md = "sha1"; + } + p = Buffer.from(p, "binary"); + s = Buffer.from(s, "binary"); + if (!callback) { + if (crypto2.pbkdf2Sync.length === 4) { + return crypto2.pbkdf2Sync(p, s, c, dkLen).toString("binary"); + } + return crypto2.pbkdf2Sync(p, s, c, dkLen, md).toString("binary"); + } + if (crypto2.pbkdf2Sync.length === 4) { + return crypto2.pbkdf2(p, s, c, dkLen, function(err2, key) { + if (err2) { + return callback(err2); + } + callback(null, key.toString("binary")); + }); + } + return crypto2.pbkdf2(p, s, c, dkLen, md, function(err2, key) { + if (err2) { + return callback(err2); + } + callback(null, key.toString("binary")); + }); } - if ((x & 15) == 0) { - x >>= 4; - r += 4; + if (typeof md === "undefined" || md === null) { + md = "sha1"; } - if ((x & 3) == 0) { - x >>= 2; - r += 2; + if (typeof md === "string") { + if (!(md in forge.md.algorithms)) { + throw new Error("Unknown hash algorithm: " + md); + } + md = forge.md[md].create(); } - 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; + var hLen = md.digestLength; + if (dkLen > 4294967295 * hLen) { + var err = new Error("Derived key is too long."); + if (callback) { + return callback(err); + } + throw err; } - 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 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; + var len = Math.ceil(dkLen / hLen); + var r = dkLen - (len - 1) * hLen; + var prf = forge.hmac.create(); + prf.start(md, p); + var dk = ""; + var xor, 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)); + xor = 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(); + xor = forge.util.xorBytes(xor, u_c, hLen); + u_c1 = u_c; } + dk += i < len ? xor : xor.substr(0, r); } + return dk; } - 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) { - 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); + 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)); + xor = u_c1 = prf.digest().getBytes(); + j = 2; + inner(); } - 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]; - 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; + function inner() { + if (j <= c) { + prf.start(null, null); + prf.update(u_c1); + u_c = prf.digest().getBytes(); + xor = forge.util.xorBytes(xor, u_c, hLen); + u_c1 = u_c; + ++j; + return forge.util.setImmediate(inner); } + dk += i < len ? xor : xor.substr(0, r); + ++i; + outer(); } - 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; + outer(); + }; } }); -// node_modules/node-forge/lib/sha1.js -var require_sha1 = __commonJS({ - "node_modules/node-forge/lib/sha1.js"(exports2, module2) { +// node_modules/node-forge/lib/sha256.js +var require_sha256 = __commonJS({ + "node_modules/node-forge/lib/sha256.js"(exports2, module2) { var forge = require_forge(); require_md(); require_util8(); - var sha1 = module2.exports = forge.sha1 = forge.sha1 || {}; - forge.md.sha1 = forge.md.algorithms.sha1 = sha1; - sha1.create = function() { + 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(80); + var _w = new Array(64); var md = { - algorithm: "sha1", + algorithm: "sha256", blockLength: 64, - digestLength: 20, + digestLength: 32, // 56-bit length of message so far (does not including padding) messageLength: 0, // true message length @@ -30278,11 +29930,14 @@ var require_sha1 = __commonJS({ } _input = forge.util.createBuffer(); _state = { - h0: 1732584193, - h1: 4023233417, - h2: 2562383102, - h3: 271733878, - h4: 3285377520 + h0: 1779033703, + h1: 3144134277, + h2: 1013904242, + h3: 2773480762, + h4: 1359893119, + h5: 2600822924, + h6: 528734635, + h7: 1541459225 }; return md; }; @@ -30328,7 +29983,10 @@ var require_sha1 = __commonJS({ h1: _state.h1, h2: _state.h2, h3: _state.h3, - h4: _state.h4 + h4: _state.h4, + h5: _state.h5, + h6: _state.h6, + h7: _state.h7 }; _update(s2, _w, finalBlock); var rval = forge.util.createBuffer(); @@ -30337,5004 +29995,4622 @@ var require_sha1 = __commonJS({ 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 md; }; var _padding = null; var _initialized = false; + var _k = null; 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; + _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 < 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 < 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; } - 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; + 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 << 30 | b >>> 2) >>> 0; + c = b; b = a; - a = t; + 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/pkcs1.js -var require_pkcs1 = __commonJS({ - "node_modules/node-forge/lib/pkcs1.js"(exports2, module2) { +// 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_util8(); - require_random(); - require_sha1(); - var pkcs1 = module2.exports = forge.pkcs1 = forge.pkcs1 || {}; - pkcs1.encode_rsa_oaep = function(key, message, options) { - var label; - var seed; - var md; - var mgf1Md; - if (typeof options === "string") { - label = options; - seed = arguments[3] || void 0; - md = arguments[4] || void 0; - } else if (options) { - label = options.label || void 0; - seed = options.seed || void 0; - md = options.md || void 0; - if (options.mgf1 && options.mgf1.md) { - mgf1Md = options.mgf1.md; - } - } - if (!md) { - md = forge.md.sha1.create(); - } else { - md.start(); - } - if (!mgf1Md) { - mgf1Md = md; - } - var keyLength = Math.ceil(key.n.bitLength() / 8); - var maxLength = keyLength - 2 * md.digestLength - 2; - if (message.length > maxLength) { - var error4 = new Error("RSAES-OAEP input message length is too long."); - error4.length = message.length; - error4.maxLength = maxLength; - throw error4; - } - if (!label) { - label = ""; - } - md.update(label, "raw"); - var lHash = md.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(md.digestLength); - } else if (seed.length !== md.digestLength) { - var error4 = new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."); - error4.seedLength = seed.length; - error4.digestLength = md.digestLength; - throw error4; - } - var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); - var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); - var seedMask = rsa_mgf1(maskedDB, md.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 md; - var mgf1Md; - if (typeof options === "string") { - label = options; - md = arguments[3] || void 0; - } else if (options) { - label = options.label || void 0; - md = 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 error4 = new Error("RSAES-OAEP encoded message length is invalid."); - error4.length = em.length; - error4.expectedLength = keyLength; - throw error4; - } - if (md === void 0) { - md = forge.md.sha1.create(); - } else { - md.start(); - } - if (!mgf1Md) { - mgf1Md = md; - } - if (keyLength < 2 * md.digestLength + 2) { - throw new Error("RSAES-OAEP key is too short for the hash function."); - } - if (!label) { - label = ""; - } - md.update(label, "raw"); - var lHash = md.digest().getBytes(); - var y = em.charAt(0); - var maskedSeed = em.substring(1, md.digestLength + 1); - var maskedDB = em.substring(1 + md.digestLength); - var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); - var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); - var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); - var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); - var lHashPrime = db.substring(0, md.digestLength); - var error4 = y !== "\0"; - for (var i = 0; i < md.digestLength; ++i) { - error4 |= lHash.charAt(i) !== lHashPrime.charAt(i); - } - var in_ps = 1; - var index = md.digestLength; - for (var j = md.digestLength; j < db.length; j++) { - var code = db.charCodeAt(j); - var is_0 = code & 1 ^ 1; - var error_mask = in_ps ? 65534 : 0; - error4 |= code & error_mask; - in_ps = in_ps & is_0; - index += in_ps; - } - if (error4 || db.charCodeAt(index) !== 1) { - throw new Error("Invalid RSAES-OAEP padding."); - } - return db.substring(index + 1); - }; - function rsa_mgf1(seed, maskLength, hash) { - if (!hash) { - hash = forge.md.sha1.create(); - } - var t = ""; - var count = Math.ceil(maskLength / hash.digestLength); - for (var i = 0; i < count; ++i) { - var c = String.fromCharCode( - i >> 24 & 255, - i >> 16 & 255, - i >> 8 & 255, - i & 255 - ); - hash.start(); - hash.update(seed + c); - t += hash.digest().getBytes(); - } - return t.substring(0, maskLength); + var _crypto = null; + if (forge.util.isNodejs && !forge.options.usePureJavaScript && !process.versions["node-webkit"]) { + _crypto = require("crypto"); } - } -}); - -// 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_util8(); - require_jsbn(); - require_random(); - (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; + 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: "" }; - prime.generateProbablePrime = function(bits, options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; + var md = plugin.md; + var pools = new Array(32); + for (var i = 0; i < 32; ++i) { + pools[i] = md.create(); + } + ctx.pools = pools; + ctx.pool = 0; + ctx.generate = function(count, callback) { + if (!callback) { + return ctx.generateSync(count); } - options = options || {}; - var algorithm = options.algorithm || "PRIMEINC"; - if (typeof algorithm === "string") { - algorithm = { name: algorithm }; + 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); } - algorithm.options = algorithm.options || {}; - var prng = options.prng || forge.random; - var rng = { - // 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); - } + }; + 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 (algorithm.name === "PRIMEINC") { - return primeincFindPrime(bits, rng, algorithm.options, callback); + 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)); } - throw new Error("Invalid prime generation algorithm: " + algorithm.name); + return b.getBytes(count); }; - function primeincFindPrime(bits, rng, options, callback) { - if ("workers" in options) { - return primeincFindPrimeWithWorkers(bits, rng, options, callback); + function _reseed(callback) { + if (ctx.pools[0].messageLength >= 32) { + _seed(); + return callback(); } - return primeincFindPrimeWithoutWorkers(bits, rng, options, 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 primeincFindPrimeWithoutWorkers(bits, rng, options, callback) { - var num = generateRandom(bits, rng); - 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; + function _reseedSync() { + if (ctx.pools[0].messageLength >= 32) { + return _seed(); } - _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); + var needed = 32 - ctx.pools[0].messageLength << 5; + ctx.collect(ctx.seedFileSync(needed)); + _seed(); } - function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) { - var start = +/* @__PURE__ */ new Date(); - do { - if (num.bitLength() > bits) { - num = generateRandom(bits, rng); - } - if (num.isProbablePrime(mrTests)) { - return callback(null, num); + function _seed() { + ctx.reseeds = ctx.reseeds === 4294967295 ? 0 : ctx.reseeds + 1; + var md2 = ctx.plugin.md.create(); + md2.update(ctx.keyBytes); + var _2powK = 1; + for (var k = 0; k < 32; ++k) { + if (ctx.reseeds % _2powK === 0) { + md2.update(ctx.pools[k].digest().getBytes()); + ctx.pools[k].start(); } - num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); - } while (maxBlockTime < 0 || +/* @__PURE__ */ new Date() - start < maxBlockTime); - forge.util.setImmediate(function() { - _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback); - }); - } - function primeincFindPrimeWithWorkers(bits, rng, options, callback) { - if (typeof Worker === "undefined") { - return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); + _2powK = _2powK << 1; } - var num = generateRandom(bits, rng); - var numWorkers = options.workers; - var workLoad = options.workLoad || 100; - var range = 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(); - }); + ctx.keyBytes = md2.digest().getBytes(); + md2.start(); + md2.update(ctx.keyBytes); + var seedBytes = md2.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); + }; } - generate(); - function generate() { - numWorkers = Math.max(1, numWorkers); - var workers = []; - for (var i = 0; i < numWorkers; ++i) { - workers[i] = new Worker(workerScript); + 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; + } + } } - var running = numWorkers; - for (var i = 0; i < numWorkers; ++i) { - workers[i].addEventListener("message", workerMessage); + } + 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); + } } - var found = false; - function workerMessage(e) { - if (found) { - return; + } + return b.getBytes(needed); + } + if (_crypto) { + ctx.seedFile = function(needed, callback) { + _crypto.randomBytes(needed, function(err, bytes) { + if (err) { + return callback(err); } - --running; - var data = e.data; - if (data.found) { - for (var i2 = 0; i2 < workers.length; ++i2) { - workers[i2].terminate(); + 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); } - found = true; - return callback(null, new BigInteger(data.prime, 16)); } - if (num.bitLength() > bits) { - num = generateRandom(bits, rng); + 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 } } }); + }); } - var hex = num.toString(16); - e.target.postMessage({ - hex, - workLoad + }; + worker.addEventListener("message", listener); + } + }; + return ctx; + }; + } +}); + +// node_modules/node-forge/lib/random.js +var require_random = __commonJS({ + "node_modules/node-forge/lib/random.js"(exports2, module2) { + var forge = require_forge(); + require_aes(); + require_sha256(); + require_prng(); + require_util8(); + (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); }); - num.dAddOffset(range, 0); } } - } - function generateRandom(bits, rng) { - var num = new BigInteger(bits, rng); - var bits1 = bits - 1; - if (!num.testBit(bits1)) { - num.bitwiseTo(BigInteger.ONE.shiftLeft(bits1), op_or, num); + if (!forge.random) { + forge.random = _ctx; + } else { + for (var key in _ctx) { + forge.random[key] = _ctx[key]; + } } - 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; - } + forge.random.createInstance = spawnPrng; + module2.exports = forge.random; + })(typeof jQuery !== "undefined" ? jQuery : null); })(); } }); -// node_modules/node-forge/lib/rsa.js -var require_rsa = __commonJS({ - "node_modules/node-forge/lib/rsa.js"(exports2, module2) { +// 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_asn1(); - require_jsbn(); - require_oids(); - require_pkcs1(); - require_prime(); - require_random(); require_util8(); - if (typeof BigInteger === "undefined") { - BigInteger = forge.jsbn.BigInteger; - } - var BigInteger; - var _crypto = forge.util.isNodejs ? require("crypto") : null; - var asn1 = forge.asn1; - var util = 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 paramters - 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(md) { - var oid; - if (md.algorithm in pki2.oids) { - oid = pki2.oids[md.algorithm]; - } else { - var error4 = new Error("Unknown message digest algorithm."); - error4.algorithm = md.algorithm; - throw error4; - } - 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, - md.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; + 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; }; - 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(); + var ror = function(word, bits) { + return (word & 65535) >> bits | word << 16 - bits & 65535; }; - pki2.rsa.decrypt = function(ed, key, pub, ml) { - var k = Math.ceil(key.n.bitLength() / 8); - if (ed.length !== k) { - var error4 = new Error("Encrypted message length is invalid."); - error4.length = ed.length; - error4.expected = k; - throw error4; - } - var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); - if (y.compareTo(key.n) >= 0) { - throw new Error("Encrypted message is invalid."); + module2.exports = forge.rc2 = forge.rc2 || {}; + forge.rc2.expandKey = function(key, effKeyBits) { + if (typeof key === "string") { + key = forge.util.createBuffer(key); } - 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; + 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]); } - eb.putBytes(forge.util.hexToBytes(xhex)); - if (ml !== false) { - return _decodePkcs1_v1_5(eb.getBytes(), key, pub); + 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 eb.getBytes(); + return L; }; - pki2.rsa.createKeyPairGenerationState = function(bits, e, options) { - if (typeof bits === "string") { - bits = parseInt(bits, 10); + 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()); } - bits = bits || 2048; - options = options || {}; - var prng = options.prng || forge.random; - var rng = { - // 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 (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]; } - } - }; - var algorithm = options.algorithm || "PRIMEINC"; - var rval; - if (algorithm === "PRIMEINC") { - rval = { - algorithm, - state: 0, - bits, - rng, - 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"; + 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 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; + 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 { - state.num.dAddOffset(GCD_30_DELTA[deltaIdx++ % 8], 0); + _iv.putInt16Le(val); } - } 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; + } + 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 { - state.q = state.num; + R[i] ^= _iv.getInt16Le(); } - if (state.p !== null && state.q !== null) { - ++state.state; + } + _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); } - 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; + _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); } - ++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; + while (_input.length() >= 8) { + runPlan([ + [5, mixRound], + [1, mashRound], + [6, mixRound], + [1, mashRound], + [5, mixRound] + ]); } - } 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; + }, + /** + * 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); + } } - } 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; + if (rval) { + _finish = true; + cipher.update(); } - } 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; + 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); + } + } + } } - } else { - callback = options; - options = e; - e = void 0; + 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; } - options = options || {}; - if (bits === void 0) { - bits = options.bits || 2048; + 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; } - if (e === void 0) { - e = options.e || 65537; + 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; } - 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 util.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 util.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 = util.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 = util.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) - }; - } + 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; } - var state = pki2.rsa.createKeyPairGenerationState(bits, e, options); - if (!callback) { - pki2.rsa.stepKeyPairGenerationState(state, 0); - return state.keys; + if (k == 8 && (s[0] & 128) != 0) { + this.s = -1; + if (sh > 0) this.data[this.t - 1] |= (1 << this.DB - sh) - 1 << sh; } - _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 - }; - } - if (!("_parseAllDigestBytes" in options)) { - options._parseAllDigestBytes = true; + 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); } - if (scheme === "RSASSA-PKCS1-V1_5") { - scheme = { - verify: function(digest2, d2) { - d2 = _decodePkcs1_v1_5(d2, key, true); - var obj = asn1.fromDer(d2, { - parseAllBytes: options._parseAllDigestBytes - }); - var capture = {}; - var errors = []; - if (!asn1.validate(obj, digestInfoValidator, capture, errors)) { - var error4 = new Error( - "ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value." - ); - error4.errors = errors; - throw error4; - } - 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 error4 = new Error( - "Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier." - ); - error4.oid = oid; - throw error4; - } - 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 identifer 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); - return digest2 === d2; + 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); } - 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(md, 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 md; - } }; - bt = 1; - } - var d2 = scheme.encode(md, 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 error4 = new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey."); - error4.errors = errors; - throw error4; + 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; } - 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 error4 = new Error("Cannot read public key. Unknown OID."); - error4.oid = oid; - throw error4; - } - obj = capture.rsaPublicKey; + if ((t = x >> 8) != 0) { + x = t; + r += 8; } - errors = []; - if (!asn1.validate(obj, rsaPublicKeyValidator, capture, errors)) { - var error4 = new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey."); - error4.errors = errors; - throw error4; + if ((t = x >> 4) != 0) { + x = t; + r += 4; } - 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 error4 = new Error("Message is too long for PKCS#1 v1.5 padding."); - error4.length = m.length; - error4.max = k - 11; - throw error4; + if ((t = x >> 2) != 0) { + x = t; + r += 2; } - 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; - } + if ((t = x >> 1) != 0) { + x = t; + r += 1; } - eb.putByte(0); - eb.putBytes(m); - return eb; + return r; } - function _decodePkcs1_v1_5(em, key, pub, ml) { - 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; - } - } else if (bt === 2) { - padNum = 0; - while (eb.length() > 1) { - if (eb.getByte() === 0) { - --eb.read; - break; - } - ++padNum; - } - } - var zero = eb.getByte(); - if (zero !== 0 || padNum !== k - 3 - eb.length()) { - throw new Error("Encryption block is invalid."); - } - return eb.getBytes(); + 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 _generateKeyPair(state, options, callback) { - if (typeof options === "function") { - callback = options; - options = {}; + 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; } - 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; + 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; } - 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); - }); + 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; } - function getPrime(bits, callback2) { - forge.prime.generateProbablePrime(bits, opts, callback2); + 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; } - 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; + 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; } - state.n = state.p.multiply(state.q); - if (state.n.bitLength() !== state.bits) { - state.q = null; - getPrime(state.qBits, finish); - return; + c += this.s; + } else { + c += this.s; + while (i < a.t) { + c -= a.data[i]; + r.data[i++] = c & this.DM; + c >>= this.DB; } - 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); + 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 _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 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 _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 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 _detectNodeCrypto(fn) { - return forge.util.isNodejs && typeof _crypto[fn] === "function"; + 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 _detectSubtleCrypto(fn) { - return typeof util.globalScope !== "undefined" && typeof util.globalScope.crypto === "object" && typeof util.globalScope.crypto.subtle === "object" && typeof util.globalScope.crypto.subtle[fn] === "function"; + 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 _detectSubtleMsCrypto(fn) { - return typeof util.globalScope !== "undefined" && typeof util.globalScope.msCrypto === "object" && typeof util.globalScope.msCrypto.subtle === "object" && typeof util.globalScope.msCrypto.subtle[fn] === "function"; + function Classic(m) { + this.m = m; } - 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; + function cConvert(x) { + if (x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m); + else return x; } - } -}); - -// 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_random(); - require_rc2(); - require_rsa(); - require_util8(); - if (typeof BigInteger === "undefined") { - BigInteger = forge.jsbn.BigInteger; + function cRevert(x) { + return x; } - 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 error4 = new Error("Cannot encrypt private key. Unknown encryption algorithm."); - error4.algorithm = options.algorithm; - throw error4; + 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]++; } - var prfAlgorithm = "hmacWith" + options.prfAlgorithm.toUpperCase(); - var md = prfAlgorithmToMessageDigest(prfAlgorithm); - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); - 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 error4 = new Error("Cannot encrypt private key. Unknown encryption algorithm."); - error4.algorithm = options.algorithm; - throw error4; - } - 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 error4 = new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); - error4.errors = errors; - throw error4; - } - 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 error4 = new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".'); - error4.headerType = msg.type; - throw error4; } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted."); + 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 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 error4 = new Error('Could not encrypt RSA private key; unsupported encryption algorithm "' + options.algorithm + '".'); - error4.algorithm = options.algorithm; - throw error4; - } - 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 error4 = new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".'); - error4.headerType = error4; - throw error4; + 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); } - 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 error4 = new Error('Could not decrypt private key; unsupported encryption algorithm "' + msg.dekInfo.algorithm + '".'); - error4.algorithm = msg.dekInfo.algorithm; - throw error4; + 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; } - 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; + w = b * w + x; + if (++j >= cs) { + this.dMultiply(d); + this.dAddOffset(w, 0); + j = 0; + w = 0; } - } 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, md) { - var j, l; - if (typeof md === "undefined" || md === null) { - if (!("sha1" in forge.md)) { - throw new Error('"sha1" hash algorithm unavailable.'); - } - md = forge.md.sha1.create(); + if (j > 0) { + this.dMultiply(Math.pow(b, j)); + this.dAddOffset(w, 0); } - var u = md.digestLength; - var v = md.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)); + 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); + } } - 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)); + } 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); } - 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++) { - md.start(); - md.update(buf.getBytes()); - buf = md.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); + } + 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; + } } - Inew.putBuffer(chunk); + if ((d & 128) != 0) d |= -256; + if (k == 0 && (this.s & 128) != (d & 128)) ++k; + if (k > 0 || d != this.s) r[k++] = d; } - 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 error4 = new Error("Cannot read encrypted PBE data block. Unsupported OID."); - error4.oid = oid; - error4.supportedOids = [ - "pkcs5PBES2", - "pbeWithSHAAnd3-KeyTripleDES-CBC", - "pbewithSHAAnd40BitRC2-CBC" - ]; - throw error4; } - }; - pki2.pbe.getCipherForPBES2 = function(oid, params, password) { - var capture = {}; - var errors = []; - if (!asn1.validate(params, PBES2AlgorithmsValidator, capture, errors)) { - var error4 = new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); - error4.errors = errors; - throw error4; + 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; } - oid = asn1.derToOid(capture.kdfOid); - if (oid !== pki2.oids["pkcs5PBKDF2"]) { - var error4 = new Error("Cannot read encrypted private key. Unsupported key derivation function OID."); - error4.oid = oid; - error4.supportedOids = ["pkcs5PBKDF2"]; - throw error4; + 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; } - 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 error4 = new Error("Cannot read encrypted private key. Unsupported encryption scheme OID."); - error4.oid = oid; - error4.supportedOids = [ - "aes128-CBC", - "aes192-CBC", - "aes256-CBC", - "des-EDE3-CBC", - "desCBC" - ]; - throw error4; + if ((x & 255) == 0) { + x >>= 8; + r += 8; } - 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; + if ((x & 15) == 0) { + x >>= 4; + r += 4; } - var md = prfOidToMessageDigest(capture.prfOid); - var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); - 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 error4 = new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo."); - error4.errors = errors; - throw error4; + if ((x & 3) == 0) { + x >>= 2; + r += 2; } - 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 error4 = new Error("Cannot read PKCS #12 PBE data block. Unsupported OID."); - error4.oid = oid; - throw error4; + 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; } - var md = prfOidToMessageDigest(capture.prfOid); - var key = pki2.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md); - md.start(); - var iv = pki2.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md); - return cipherFn(key, iv); - }; - pki2.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) { - if (typeof md === "undefined" || md === null) { - if (!("md5" in forge.md)) { - throw new Error('"md5" hash algorithm unavailable.'); + 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; } - md = forge.md.md5.create(); + 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; } - if (salt === null) { - salt = ""; + 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 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]; } - var digests = [hash(md, password + salt)]; - for (var length = 16, i = 1; length < dkLen; ++i, length += 16) { - digests.push(hash(md, digests[i - 1] + password + salt)); + } + 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; } - return digests.join("").substr(0, dkLen); - }; - function hash(md, bytes) { - return md.start().update(bytes).digest().getBytes(); } - function prfOidToMessageDigest(prfOid) { - var prfAlgorithm; - if (!prfOid) { - prfAlgorithm = "hmacWithSHA1"; - } else { - prfAlgorithm = pki2.oids[asn1.derToOid(prfOid)]; - if (!prfAlgorithm) { - var error4 = new Error("Unsupported PRF OID."); - error4.oid = prfOid; - error4.supported = [ - "hmacWithSHA1", - "hmacWithSHA224", - "hmacWithSHA256", - "hmacWithSHA384", - "hmacWithSHA512" - ]; - throw error4; + 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; } } - return prfAlgorithmToMessageDigest(prfAlgorithm); + 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 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 error4 = new Error("Unsupported PRF algorithm."); - error4.algorithm = prfAlgorithm; - error4.supported = [ - "hmacWithSHA1", - "hmacWithSHA224", - "hmacWithSHA256", - "hmacWithSHA384", - "hmacWithSHA512" - ]; - throw error4; + 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; } - if (!factory || !(prfAlgorithm in factory)) { - throw new Error("Unknown hash algorithm: " + prfAlgorithm); + 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); } - return factory[prfAlgorithm].create(); + 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 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, "") - ]) - ); + 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) { + 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); + } } - return params; + 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; } - } -}); - -// 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_util8(); - 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] + 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]; + 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; } - ] - }; - 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_util8(); - forge.mgf = forge.mgf || {}; - var mgf1 = module2.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {}; - mgf1.create = function(md) { - 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 / md.digestLength); - for (var i = 0; i < len; i++) { - var c = new forge.util.ByteBuffer(); - c.putInt32(i); - md.start(); - md.update(seed + c.getBytes()); - t.putBuffer(md.digest()); + } + 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); } - 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; + } + 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; } }); -// node_modules/node-forge/lib/pss.js -var require_pss = __commonJS({ - "node_modules/node-forge/lib/pss.js"(exports2, module2) { +// 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_random(); + require_md(); require_util8(); - 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 hash = options.md; - var mgf = options.mgf; - var hLen = hash.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 sha1 = module2.exports = forge.sha1 = forge.sha1 || {}; + forge.md.sha1 = forge.md.algorithms.sha1 = sha1; + sha1.create = function() { + if (!_initialized) { + _init(); } - var prng = options.prng || forge.random; - var pssobj = {}; - pssobj.encode = function(md, modBits) { - var i; - var emBits = modBits - 1; - var emLen = Math.ceil(emBits / 8); - var mHash = md.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); - hash.start(); - hash.update(m_.getBytes()); - var h = hash.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); + var _state = null; + var _input = forge.util.createBuffer(); + var _w = new Array(80); + var md = { + 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 }; - 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."); + md.start = function() { + md.messageLength = 0; + md.fullMessageLength = md.messageLength64 = []; + var int32s = md.messageLengthSize / 4; + for (var i = 0; i < int32s; ++i) { + md.fullMessageLength.push(0); } - var dbMask = mgf.generate(h, maskLen); - var db = ""; - for (i = 0; i < maskLen; i++) { - db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i)); + _input = forge.util.createBuffer(); + _state = { + h0: 1732584193, + h1: 4023233417, + h2: 2562383102, + h3: 271733878, + h4: 3285377520 + }; + return md; + }; + md.start(); + md.update = function(msg, encoding) { + if (encoding === "utf8") { + msg = forge.util.encodeUtf8(msg); } - 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"); - } + var len = msg.length; + md.messageLength += len; + len = [len / 4294967296 >>> 0, len >>> 0]; + for (var i = md.fullMessageLength.length - 1; i >= 0; --i) { + md.fullMessageLength[i] += len[1]; + len[1] = len[0] + (md.fullMessageLength[i] / 4294967296 >>> 0); + md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; + len[0] = len[1] / 4294967296 >>> 0; } - if (db.charCodeAt(checkLen) !== 1) { - throw new Error("Inconsistent PSS signature, 0x01 marker not found"); + _input.putBytes(msg); + _update(_state, _w, _input); + if (_input.read > 2048 || _input.length() === 0) { + _input.compact(); } - var salt = db.substr(-sLen); - var m_ = new forge.util.ByteBuffer(); - m_.fillWithByte(0, 8); - m_.putBytes(mHash); - m_.putBytes(salt); - hash.start(); - hash.update(m_.getBytes()); - var h_ = hash.digest().getBytes(); - return h === h_; + return md; }; - 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(); + md.digest = function() { + var finalBlock = forge.util.createBuffer(); + finalBlock.putBytes(_input.bytes()); + var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; + var overflow = remaining & md.blockLength - 1; + finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); + var next, carry; + var bits = md.fullMessageLength[0] * 8; + for (var i = 0; i < md.fullMessageLength.length - 1; ++i) { + next = md.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 md; + }; + 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_util8(); + require_random(); + require_sha1(); + var pkcs1 = module2.exports = forge.pkcs1 = forge.pkcs1 || {}; + pkcs1.encode_rsa_oaep = function(key, message, options) { + var label; + var seed; + var md; + var mgf1Md; + if (typeof options === "string") { + label = options; + seed = arguments[3] || void 0; + md = arguments[4] || void 0; + } else if (options) { + label = options.label || void 0; + seed = options.seed || void 0; + md = options.md || void 0; + if (options.mgf1 && options.mgf1.md) { + mgf1Md = options.mgf1.md; + } + } + if (!md) { + md = forge.md.sha1.create(); + } else { + md.start(); + } + if (!mgf1Md) { + mgf1Md = md; + } + var keyLength = Math.ceil(key.n.bitLength() / 8); + var maxLength = keyLength - 2 * md.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 = ""; + } + md.update(label, "raw"); + var lHash = md.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(md.digestLength); + } else if (seed.length !== md.digestLength) { + var error3 = new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length."); + error3.seedLength = seed.length; + error3.digestLength = md.digestLength; + throw error3; + } + var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); + var maskedDB = forge.util.xorBytes(DB, dbMask, DB.length); + var seedMask = rsa_mgf1(maskedDB, md.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 md; + var mgf1Md; + if (typeof options === "string") { + label = options; + md = arguments[3] || void 0; + } else if (options) { + label = options.label || void 0; + md = 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 (md === void 0) { + md = forge.md.sha1.create(); + } else { + md.start(); + } + if (!mgf1Md) { + mgf1Md = md; + } + if (keyLength < 2 * md.digestLength + 2) { + throw new Error("RSAES-OAEP key is too short for the hash function."); + } + if (!label) { + label = ""; + } + md.update(label, "raw"); + var lHash = md.digest().getBytes(); + var y = em.charAt(0); + var maskedSeed = em.substring(1, md.digestLength + 1); + var maskedDB = em.substring(1 + md.digestLength); + var seedMask = rsa_mgf1(maskedDB, md.digestLength, mgf1Md); + var seed = forge.util.xorBytes(maskedSeed, seedMask, maskedSeed.length); + var dbMask = rsa_mgf1(seed, keyLength - md.digestLength - 1, mgf1Md); + var db = forge.util.xorBytes(maskedDB, dbMask, maskedDB.length); + var lHashPrime = db.substring(0, md.digestLength); + var error3 = y !== "\0"; + for (var i = 0; i < md.digestLength; ++i) { + error3 |= lHash.charAt(i) !== lHashPrime.charAt(i); + } + var in_ps = 1; + var index = md.digestLength; + for (var j = md.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; + index += in_ps; + } + if (error3 || db.charCodeAt(index) !== 1) { + throw new Error("Invalid RSAES-OAEP padding."); + } + return db.substring(index + 1); + }; + function rsa_mgf1(seed, maskLength, hash) { + if (!hash) { + hash = forge.md.sha1.create(); + } + var t = ""; + var count = Math.ceil(maskLength / hash.digestLength); + for (var i = 0; i < count; ++i) { + var c = String.fromCharCode( + i >> 24 & 255, + i >> 16 & 255, + i >> 8 & 255, + i & 255 + ); + hash.start(); + hash.update(seed + c); + t += hash.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_util8(); + require_jsbn(); + require_random(); + (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 rng = { + // 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, rng, algorithm.options, callback); + } + throw new Error("Invalid prime generation algorithm: " + algorithm.name); + }; + function primeincFindPrime(bits, rng, options, callback) { + if ("workers" in options) { + return primeincFindPrimeWithWorkers(bits, rng, options, callback); + } + return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); + } + function primeincFindPrimeWithoutWorkers(bits, rng, options, callback) { + var num = generateRandom(bits, rng); + 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, rng, deltaIdx, mrTests, maxBlockTime, callback); + } + function _primeinc(num, bits, rng, deltaIdx, mrTests, maxBlockTime, callback) { + var start = +/* @__PURE__ */ new Date(); + do { + if (num.bitLength() > bits) { + num = generateRandom(bits, rng); + } + 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, rng, deltaIdx, mrTests, maxBlockTime, callback); + }); + } + function primeincFindPrimeWithWorkers(bits, rng, options, callback) { + if (typeof Worker === "undefined") { + return primeincFindPrimeWithoutWorkers(bits, rng, options, callback); + } + var num = generateRandom(bits, rng); + var numWorkers = options.workers; + var workLoad = options.workLoad || 100; + var range = 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, rng); + } + var hex = num.toString(16); + e.target.postMessage({ + hex, + workLoad + }); + num.dAddOffset(range, 0); + } + } + } + function generateRandom(bits, rng) { + var num = new BigInteger(bits, rng); + 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_pem(); - require_pss(); - require_rsa(); + require_pkcs1(); + require_prime(); + require_random(); require_util8(); + if (typeof BigInteger === "undefined") { + BigInteger = forge.jsbn.BigInteger; + } + var BigInteger; + var _crypto = forge.util.isNodejs ? require("crypto") : null; 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", + var util = 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: [{ - 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", + // 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: [{ - // algorithm - name: "Certificate.signatureAlgorithm.algorithm", + name: "AlgorithmIdentifier.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" + capture: "privateKeyOid" }] }, { - // SignatureValue - name: "Certificate.signatureValue", + // PrivateKey + name: "PrivateKeyInfo", tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.BITSTRING, + type: asn1.Type.OCTETSTRING, constructed: false, - captureBitStringValue: "certSignature" + capture: "privateKey" }] }; - var rsassaPssParameterValidator = { - name: "rsapss", + var rsaPrivateKeyValidator = { + // RSAPrivateKey + name: "RSAPrivateKey", 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. */ - }] - }] + // Version (INTEGER) + name: "RSAPrivateKey.version", + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: "privateKeyVersion" }, { - 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. */ - }] - }] - }] + // modulus (n) + name: "RSAPrivateKey.modulus", + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: "privateKeyModulus" }, { - 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" - }] + // publicExponent (e) + name: "RSAPrivateKey.publicExponent", + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, + constructed: false, + capture: "privateKeyPublicExponent" }, { - 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" - }] + // 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 certificationRequestInfoValidator = { - name: "CertificationRequestInfo", + var rsaPublicKeyValidator = { + // RSAPublicKey + name: "RSAPublicKey", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, - captureAsn1: "certificationRequestInfo", - value: [ - { - name: "CertificationRequestInfo.integer", + 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.INTEGER, + type: asn1.Type.OID, constructed: false, - capture: "certificationRequestInfoVersion" - }, - { - // Name (subject) (RDNSequence) - name: "CertificationRequestInfo.subject", + 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, - 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 - }] - }] - } - ] + captureAsn1: "rsaPublicKey" + }] + }] }; - var certificationRequestValidator = { - name: "CertificationRequest", + var digestInfoValidator = { + name: "DigestInfo", 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", + 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.BITSTRING, + type: asn1.Type.OID, constructed: false, - captureBitStringValue: "csrSignature" - } - ] + 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" + }] }; - pki2.RDNAttributesAsArray = function(rdn, md) { - var rval = []; - var set2, attr, obj; - for (var si = 0; si < rdn.value.length; ++si) { - set2 = rdn.value[si]; - for (var i = 0; i < set2.value.length; ++i) { - obj = {}; - attr = set2.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 (md) { - md.update(obj.type); - md.update(obj.value); - } - rval.push(obj); - } + var emsaPkcs1v15encode = function(md) { + var oid; + if (md.algorithm in pki2.oids) { + oid = pki2.oids[md.algorithm]; + } else { + var error3 = new Error("Unknown message digest algorithm."); + error3.algorithm = md.algorithm; + throw error3; } - return rval; + 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, + md.digest().getBytes() + ); + digestInfo.value.push(digestAlgorithm); + digestInfo.value.push(digest); + return asn1.toDer(digestInfo).getBytes(); }; - pki2.CRIAttributesAsArray = function(attributes) { - var rval = []; - for (var si = 0; si < attributes.length; ++si) { - var seq2 = attributes[si]; - var type2 = asn1.derToOid(seq2.value[0].value); - var values = seq2.value[1].value; - for (var vi = 0; vi < values.length; ++vi) { - var obj = {}; - obj.type = type2; - 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; + var _modPow = function(x, key, pub) { + if (pub) { + return x.modPow(key.e, key.n); } - if (fillDefaults) { - params = { - hash: { - algorithmOid: oids["sha1"] - }, - mgf: { - algorithmOid: oids["mgf1"], - hash: { - algorithmOid: oids["sha1"] - } - }, - saltLength: 20 - }; + if (!key.p || !key.q) { + return x.modPow(key.d, key.n); } - var capture = {}; - var errors = []; - if (!asn1.validate(obj, rsassaPssParameterValidator, capture, errors)) { - var error4 = new Error("Cannot read RSASSA-PSS parameter block."); - error4.errors = errors; - throw error4; + if (!key.dP) { + key.dP = key.d.mod(key.p.subtract(BigInteger.ONE)); } - if (capture.hashOid !== void 0) { - params.hash = params.hash || {}; - params.hash.algorithmOid = asn1.derToOid(capture.hashOid); + if (!key.dQ) { + key.dQ = key.d.mod(key.q.subtract(BigInteger.ONE)); } - 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 (!key.qInv) { + key.qInv = key.q.modInverse(key.p); } - if (capture.saltLength !== void 0) { - params.saltLength = capture.saltLength.charCodeAt(0); + 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); } - return params; + 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; }; - 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 error4 = new Error( - "Could not compute " + options.type + " digest. Unknown signature OID." - ); - error4.signatureOid = options.signatureOid; - throw error4; + 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 _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 hash, mgf; - hash = oids[cert.signatureParameters.mgf.hash.algorithmOid]; - if (hash === void 0 || forge.md[hash] === void 0) { - var error4 = new Error("Unsupported MGF hash function."); - error4.oid = cert.signatureParameters.mgf.hash.algorithmOid; - error4.name = hash; - throw error4; - } - mgf = oids[cert.signatureParameters.mgf.algorithmOid]; - if (mgf === void 0 || forge.mgf[mgf] === void 0) { - var error4 = new Error("Unsupported MGF function."); - error4.oid = cert.signatureParameters.mgf.algorithmOid; - error4.name = mgf; - throw error4; - } - mgf = forge.mgf[mgf].create(forge.md[hash].create()); - hash = oids[cert.signatureParameters.hash.algorithmOid]; - if (hash === void 0 || forge.md[hash] === void 0) { - var error4 = new Error("Unsupported RSASSA-PSS hash function."); - error4.oid = cert.signatureParameters.hash.algorithmOid; - error4.name = hash; - throw error4; - } - scheme = forge.pss.create( - forge.md[hash].create(), - mgf, - cert.signatureParameters.saltLength - ); - break; + 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; } - return cert.publicKey.verify( - options.md.digest().getBytes(), - options.signature, - scheme - ); + ed.putBytes(forge.util.hexToBytes(yhex)); + return ed.getBytes(); }; - 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 error4 = new Error( - 'Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".' - ); - error4.headerType = msg.type; - throw error4; + 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; } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error( - "Could not convert certificate from PEM; PEM is encrypted." - ); + var y = new BigInteger(forge.util.createBuffer(ed).toHex(), 16); + if (y.compareTo(key.n) >= 0) { + throw new Error("Encrypted message is invalid."); } - 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 error4 = new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".'); - error4.headerType = msg.type; - throw error4; + 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; } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert public key from PEM; PEM is encrypted."); + eb.putBytes(forge.util.hexToBytes(xhex)); + if (ml !== false) { + return _decodePkcs1_v1_5(eb.getBytes(), key, pub); } - 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 }); + return eb.getBytes(); }; - pki2.getPublicKeyFingerprint = function(key, options) { - options = options || {}; - var md = options.md || forge.md.sha1.create(); - var type2 = options.type || "RSAPublicKey"; - var bytes; - switch (type2) { - 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 + '".'); + pki2.rsa.createKeyPairGenerationState = function(bits, e, options) { + if (typeof bits === "string") { + bits = parseInt(bits, 10); } - md.start(); - md.update(bytes); - var digest = md.digest(); - if (options.encoding === "hex") { - var hex = digest.toHex(); - if (options.delimiter) { - return hex.match(/.{2}/g).join(options.delimiter); + bits = bits || 2048; + options = options || {}; + var prng = options.prng || forge.random; + var rng = { + // 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); + } } - return hex; - } else if (options.encoding === "binary") { - return digest.getBytes(); - } else if (options.encoding) { - throw new Error('Unknown encoding "' + options.encoding + '".'); + }; + var algorithm = options.algorithm || "PRIMEINC"; + var rval; + if (algorithm === "PRIMEINC") { + rval = { + algorithm, + state: 0, + bits, + rng, + 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 digest; + return rval; }; - pki2.certificationRequestFromPem = function(pem, computeHash, strict) { - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "CERTIFICATE REQUEST") { - var error4 = new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".'); - error4.headerType = msg.type; - throw error4; - } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert certification request from PEM; PEM is encrypted."); + pki2.rsa.stepKeyPairGenerationState = function(state, n) { + if (!("algorithm" in state)) { + state.algorithm = "PRIMEINC"; } - 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; + var THIRTY = new BigInteger(null); + THIRTY.fromInt(30); + var deltaIdx = 0; + var op_or = function(x, y) { + return x | y; }; - cert.setExtensions = function(exts) { - for (var i = 0; i < exts.length; ++i) { - _fillMissingExtensionFields(exts[i], { cert }); + 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) + }; } - cert.extensions = exts; - }; - cert.getExtension = function(options) { - if (typeof options === "string") { - options = { name: options }; + 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; } - var rval = null; - var ext; - for (var i = 0; rval === null && i < cert.extensions.length; ++i) { - ext = cert.extensions[i]; - if (options.id && ext.id === options.id) { - rval = ext; - } else if (options.name && ext.name === options.name) { - rval = ext; + } 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; } - return rval; - }; - cert.sign = function(key, md) { - cert.md = md || forge.md.sha1.create(); - var algorithmOid = oids[cert.md.algorithm + "WithRSAEncryption"]; - if (!algorithmOid) { - var error4 = new Error("Could not compute certificate digest. Unknown message digest algorithm OID."); - error4.algorithm = cert.md.algorithm; - throw error4; - } - 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 error4 = new Error( - "The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject." - ); - error4.expectedIssuer = subject.attributes; - error4.actualIssuer = issuer.attributes; - throw error4; + } 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; } - var md = child.md; - if (md === null) { - md = _createSignatureDigest({ - signatureOid: child.signatureOid, - type: "certificate" - }); - var tbsCertificate = child.tbsCertificate || pki2.getTBSCertificate(child); - var bytes = asn1.toDer(tbsCertificate); - md.update(bytes.getBytes()); + } + 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 util.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 util.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 = util.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 = util.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) + }; + } } - if (md !== null) { - rval = _verifySignature({ - certificate: cert, - md, - signature: child.signature - }); + } + 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"; } - return rval; + 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); }; - 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; + 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 + }; + } + if (!("_parseAllDigestBytes" in options)) { + options._parseAllDigestBytes = true; + } + if (scheme === "RSASSA-PKCS1-V1_5") { + scheme = { + verify: function(digest2, d2) { + d2 = _decodePkcs1_v1_5(d2, key, true); + var obj = asn1.fromDer(d2, { + parseAllBytes: options._parseAllDigestBytes + }); + var capture = {}; + var errors = []; + if (!asn1.validate(obj, digestInfoValidator, capture, errors)) { + 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); + return digest2 === d2; + } + }; } - return rval; + var d = pki2.rsa.decrypt(signature, key, true, false); + return scheme.verify(digest, d, key.n.bitLength()); }; - cert.issued = function(child) { - return child.isIssuer(cert); + 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 }; - cert.generateSubjectKeyIdentifier = function() { - return pki2.getPublicKeyFingerprint(cert.publicKey, { type: "RSAPublicKey" }); + 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); }; - cert.verifySubjectKeyIdentifier = function() { - var oid = oids["subjectKeyIdentifier"]; - for (var i = 0; i < cert.extensions.length; ++i) { - var ext = cert.extensions[i]; - if (ext.id === oid) { - var ski = cert.generateSubjectKeyIdentifier().getBytes(); - return forge.util.hexToBytes(ext.subjectKeyIdentifier) === ski; - } + key.sign = function(md, scheme) { + var bt = false; + if (typeof scheme === "string") { + scheme = scheme.toUpperCase(); } - return false; + 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 md; + } }; + bt = 1; + } + var d2 = scheme.encode(md, key.n.bitLength()); + return pki2.rsa.encrypt(d2, key, bt); }; - return cert; + return key; }; - pki2.certificateFromAsn1 = function(obj, computeHash) { + 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, x509CertificateValidator, capture, errors)) { - var error4 = new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate."); - error4.errors = errors; - throw error4; + if (asn1.validate(obj, privateKeyValidator, capture, errors)) { + obj = asn1.fromDer(forge.util.createBuffer(capture.privateKey)); } - var oid = asn1.derToOid(capture.publicKeyOid); - if (oid !== pki2.oids.rsaEncryption) { - throw new Error("Cannot read public key. OID is not RSA."); + 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 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 + 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) ); - 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])); + 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; } - return rval; - }; - pki2.certificateExtensionFromAsn1 = function(ext) { - var e = {}; - e.id = asn1.derToOid(ext.value[0].value); - e.critical = false; - if (ext.value[1].type === asn1.Type.BOOLEAN) { - e.critical = ext.value[1].value.charCodeAt(0) !== 0; - e.value = ext.value[2].value; - } else { - e.value = ext.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 error4 = new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest."); - error4.errors = errors; - throw error4; - } - 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()); + 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 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 || [] + 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) ); - 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, md) { - csr.md = md || forge.md.sha1.create(); - var algorithmOid = oids[csr.md.algorithm + "WithRSAEncryption"]; - if (!algorithmOid) { - var error4 = new Error("Could not compute certification request digest. Unknown message digest algorithm OID."); - error4.algorithm = csr.md.algorithm; - throw error4; - } - 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 md = csr.md; - if (md === null) { - md = _createSignatureDigest({ - signatureOid: csr.signatureOid, - type: "certification request" - }); - var cri = csr.certificationRequestInfo || pki2.getCertificationRequestInfo(csr); - var bytes = asn1.toDer(cri); - md.update(bytes.getBytes()); - } - if (md !== null) { - rval = _verifySignature({ - certificate: csr, - md, - signature: csr.signature - }); - } - return rval; - }; - return csr; + 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) + ]) + ]); }; - function _dnToAsn1(obj) { - var rval = asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.SEQUENCE, - true, - [] - ); - var attr, set2; - 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); + 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; } - set2 = 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(set2); } - return rval; + eb.putByte(0); + eb.putBytes(m); + return eb; } - 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 error4 = new Error("Attribute type not specified."); - error4.attribute = attr; - throw error4; + function _decodePkcs1_v1_5(em, key, pub, ml) { + 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."); } } - if (typeof attr.shortName === "undefined") { - if (attr.name && attr.name in _shortNames) { - attr.shortName = _shortNames[attr.name]; + } else if (bt === 1) { + padNum = 0; + while (eb.length() > 1) { + if (eb.getByte() !== 255) { + --eb.read; + break; } + ++padNum; } - 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]) - )); - } + } else if (bt === 2) { + padNum = 0; + while (eb.length() > 1) { + if (eb.getByte() === 0) { + --eb.read; + break; } + ++padNum; } - if (typeof attr.value === "undefined") { - var error4 = new Error("Attribute value not specified."); - error4.attribute = attr; - throw error4; - } } + var zero = eb.getByte(); + if (zero !== 0 || padNum !== k - 3 - eb.length()) { + throw new Error("Encryption block is invalid."); + } + return eb.getBytes(); } - function _fillMissingExtensionFields(e, options) { + function _generateKeyPair(state, options, callback) { + if (typeof options === "function") { + callback = options; + options = {}; + } options = options || {}; - if (typeof e.name === "undefined") { - if (e.id && e.id in pki2.oids) { - e.name = pki2.oids[e.id]; + 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; } - if (typeof e.id === "undefined") { - if (e.name && e.name in pki2.oids) { - e.id = pki2.oids[e.name]; - } else { - var error4 = new Error("Extension ID not specified."); - error4.extension = e; - throw error4; - } + 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); + }); } - if (typeof e.value !== "undefined") { - return e; + function getPrime(bits, callback2) { + forge.prime.generateProbablePrime(bits, opts, callback2); } - 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; + function finish(err, num) { + if (err) { + return callback(err); } - if (e.keyCertSign) { - b2 |= 4; - unused = 2; + state.q = num; + if (state.p.compareTo(state.q) < 0) { + var tmp = state.p; + state.p = state.q; + state.q = tmp; } - if (e.cRLSign) { - b2 |= 2; - unused = 1; + if (state.p.subtract(BigInteger.ONE).gcd(state.e).compareTo(BigInteger.ONE) !== 0) { + state.p = null; + generate(); + return; } - if (e.encipherOnly) { - b2 |= 1; - unused = 0; + if (state.q.subtract(BigInteger.ONE).gcd(state.e).compareTo(BigInteger.ONE) !== 0) { + state.q = null; + getPrime(state.qBits, finish); + return; } - if (e.decipherOnly) { - b3 |= 128; - unused = 7; + 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; } - var value = String.fromCharCode(unused); - if (b3 !== 0) { - value += String.fromCharCode(b2) + String.fromCharCode(b3); - } else if (b2 !== 0) { - value += String.fromCharCode(b2); + state.n = state.p.multiply(state.q); + if (state.n.bitLength() !== state.bits) { + state.q = null; + getPrime(state.qBits, finish); + return; } - 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() - )); + 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 util.globalScope !== "undefined" && typeof util.globalScope.crypto === "object" && typeof util.globalScope.crypto.subtle === "object" && typeof util.globalScope.crypto.subtle[fn] === "function"; + } + function _detectSubtleMsCrypto(fn) { + return typeof util.globalScope !== "undefined" && typeof util.globalScope.msCrypto === "object" && typeof util.globalScope.msCrypto.subtle === "object" && typeof util.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_random(); + require_rc2(); + require_rsa(); + require_util8(); + 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; } - } else if (e.name === "extKeyUsage") { - e.value = asn1.create( + var prfAlgorithm = "hmacWith" + options.prfAlgorithm.toUpperCase(); + var md = prfAlgorithmToMessageDigest(prfAlgorithm); + var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); + 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, - [] - ); - var seq2 = e.value.value; - for (var key in e) { - if (e[key] !== true) { - continue; - } - if (key in oids) { - seq2.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.OID, - false, - asn1.oidToDer(oids[key]).getBytes() - )); - } else if (key.indexOf(".") !== -1) { - seq2.push(asn1.create( + [ + 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 error4 = new Error( - 'Extension "ip" value is not a valid IPv4 or IPv6 address.' - ); - error4.extension = e; - throw error4; - } - } 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 seq2 = e.value.value; - if (e.keyIdentifier) { - var keyIdentifier = e.keyIdentifier === true ? options.cert.generateSubjectKeyIdentifier().getBytes() : e.keyIdentifier; - seq2.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) - ]) - ]; - seq2.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); - seq2.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 seq2 = 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 error4 = new Error( - 'Extension "ip" value is not a valid IPv4 or IPv6 address.' - ); - error4.extension = e; - throw error4; - } - } 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] - )); - seq2.push(subSeq); - } - if (typeof e.value === "undefined") { - var error4 = new Error("Extension value not specified."); - error4.extension = e; - throw error4; - } - 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.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(params.hash.algorithmOid).getBytes() + asn1.oidToDer(oids["pkcs5PBKDF2"]).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, [ + // PBKDF2-params + params + ]), + // encryptionScheme 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.oidToDer(encOid).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, "") - ]) + // iv + asn1.create( + asn1.Class.UNIVERSAL, + asn1.Type.OCTETSTRING, + false, + iv + ) ]) - ])); - } - if (params.saltLength !== void 0) { - parts.push(asn1.create(asn1.Class.CONTEXT_SPECIFIC, 2, true, [ + ]) + ] + ); + } 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, - asn1.integerToDer(params.saltLength).getBytes() + countBytes.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 seq2 = 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(seq2); - } - 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 - ) - ]) - ); + var error3 = new Error("Cannot encrypt private key. Unknown encryption algorithm."); + error3.algorithm = options.algorithm; + throw error3; } - 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 + var rval = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, [ + // encryptionAlgorithm + encryptionAlgorithm, + // encryptedData asn1.create( asn1.Class.UNIVERSAL, - asn1.Type.BITSTRING, + asn1.Type.OCTETSTRING, false, - String.fromCharCode(0) + cert.signature + encryptedData ) ]); + return rval; }; - pki2.certificateExtensionsToAsn1 = function(exts) { - var rval = asn1.create(asn1.Class.CONTEXT_SPECIFIC, 3, true, []); - var seq2 = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); - rval.value.push(seq2); - for (var i = 0; i < exts.length; ++i) { - seq2.value.push(pki2.certificateExtensionToAsn1(exts[i])); + 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.certificateExtensionToAsn1 = function(ext) { - 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(ext.id).getBytes() - )); - if (ext.critical) { - extseq.value.push(asn1.create( - asn1.Class.UNIVERSAL, - asn1.Type.BOOLEAN, - false, - String.fromCharCode(255) - )); + 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; } - var value = ext.value; - if (typeof ext.value !== "string") { - value = asn1.toDer(value).getBytes(); + if (msg.procType && msg.procType.type === "ENCRYPTED") { + throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted."); } - 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 - ) - ]); + return asn1.fromDer(msg.body); }; - 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; - } - } + 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() }; - caStore.hasCertificate = function(cert2) { - if (typeof cert2 === "string") { - cert2 = forge.pki.certificateFromPem(cert2); + 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 match = getBySubject(cert2.subject); - if (!match) { - return false; + 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; } - if (!forge.util.isArray(match)) { - match = [match]; + } 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, md) { + var j, l; + if (typeof md === "undefined" || md === null) { + if (!("sha1" in forge.md)) { + throw new Error('"sha1" hash algorithm unavailable.'); } - var der1 = asn1.toDer(pki2.certificateToAsn1(cert2)).getBytes(); - for (var i2 = 0; i2 < match.length; ++i2) { - var der2 = asn1.toDer(pki2.certificateToAsn1(match[i2])).getBytes(); - if (der1 === der2) { - return true; - } + md = forge.md.sha1.create(); + } + var u = md.digestLength; + var v = md.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)); } - return false; - }; - caStore.listAllCertificates = function() { - var certList = []; - for (var hash in caStore.certs) { - if (caStore.certs.hasOwnProperty(hash)) { - var value = caStore.certs[hash]; - 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; + 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++) { + md.start(); + md.update(buf.getBytes()); + buf = md.digest(); } - var match = getBySubject(cert2.subject); - if (!forge.util.isArray(match)) { - result = caStore.certs[cert2.subject.hash]; - delete caStore.certs[cert2.subject.hash]; - return result; + var B = new forge.util.ByteBuffer(); + for (l = 0; l < v; l++) { + B.putByte(buf.at(l % u)); } - var der1 = asn1.toDer(pki2.certificateToAsn1(cert2)).getBytes(); - for (var i2 = 0; i2 < match.length; ++i2) { - var der2 = asn1.toDer(pki2.certificateToAsn1(match[i2])).getBytes(); - if (der1 === der2) { - result = match[i2]; - match.splice(i2, 1); + 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); } - if (match.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 md = forge.md.sha1.create(); - subject.attributes = pki2.RDNAttributesAsArray(_dnToAsn1(subject), md); - subject.hash = md.digest().toHex(); - } - } - if (certs) { - for (var i = 0; i < certs.length; ++i) { - var cert = certs[i]; - caStore.addCertificate(cert); - } + I = Inew; + result.putBuffer(buf); } - return caStore; + result.truncate(result.length() - n); + return result; }; - 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.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.verifyCertificateChain = function(caStore, chain, options) { - if (typeof options === "function") { - options = { verify: options }; + 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; } - options = options || {}; - chain = chain.slice(0); - var certs = chain.slice(0); - var validityCheckDate = options.validityCheckDate; - if (typeof validityCheckDate === "undefined") { - validityCheckDate = /* @__PURE__ */ new Date(); + 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; } - var first = true; - var error4 = 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) { - error4 = { - 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 (error4 === 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) { - error4 = { - message: "Certificate signature is invalid.", - error: pki2.certificateError.bad_certificate - }; - } - } - if (error4 === null && (!parent || selfSigned) && !caStore.hasCertificate(cert)) { - error4 = { - message: "Certificate is not trusted.", - error: pki2.certificateError.unknown_ca - }; - } - } - if (error4 === null && parent && !cert.isIssuer(parent)) { - error4 = { - message: "Certificate issuer is invalid.", - error: pki2.certificateError.bad_certificate - }; - } - if (error4 === null) { - var se = { - keyUsage: true, - basicConstraints: true + 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 md = prfOidToMessageDigest(capture.prfOid); + var dk = forge.pkcs5.pbkdf2(password, salt, count, dkLen, md); + 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; }; - for (var i = 0; error4 === null && i < cert.extensions.length; ++i) { - var ext = cert.extensions[i]; - if (ext.critical && !(ext.name in se)) { - error4 = { - message: "Certificate has an unsupported critical extension.", - error: pki2.certificateError.unsupported_certificate - }; - } - } - } - if (error4 === 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) { - error4 = { - 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 (error4 === null && bcExt !== null && !bcExt.cA) { - error4 = { - message: "Certificate basicConstraints indicates the certificate is not a CA.", - error: pki2.certificateError.bad_certificate - }; - } - if (error4 === null && keyUsageExt !== null && "pathLenConstraint" in bcExt) { - var pathLen = depth - 1; - if (pathLen > bcExt.pathLenConstraint) { - error4 = { - message: "Certificate basicConstraints pathLenConstraint violated.", - error: pki2.certificateError.bad_certificate - }; - } - } - } - var vfd = error4 === null ? true : error4.error; - var ret = options.verify ? options.verify(vfd, depth, certs) : vfd; - if (ret === true) { - error4 = null; - } else { - if (vfd === true) { - error4 = { - 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) { - error4.message = ret.message; - } - if (ret.error) { - error4.error = ret.error; - } - } else if (typeof ret === "string") { - error4.error = ret; - } - } - throw error4; + break; + default: + var error3 = new Error("Cannot read PKCS #12 PBE data block. Unsupported OID."); + error3.oid = oid; + throw error3; + } + var md = prfOidToMessageDigest(capture.prfOid); + var key = pki2.pbe.generatePkcs12Key(password, salt, 1, count, dkLen, md); + md.start(); + var iv = pki2.pbe.generatePkcs12Key(password, salt, 2, count, dIvLen, md); + return cipherFn(key, iv); + }; + pki2.pbe.opensslDeriveBytes = function(password, salt, dkLen, md) { + if (typeof md === "undefined" || md === null) { + if (!("md5" in forge.md)) { + throw new Error('"md5" hash algorithm unavailable.'); } - first = false; - ++depth; - } while (chain.length > 0); - return true; + md = forge.md.md5.create(); + } + if (salt === null) { + salt = ""; + } + var digests = [hash(md, password + salt)]; + for (var length = 16, i = 1; length < dkLen; ++i, length += 16) { + digests.push(hash(md, digests[i - 1] + password + salt)); + } + return digests.join("").substr(0, dkLen); }; + function hash(md, bytes) { + return md.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/pkcs12.js -var require_pkcs12 = __commonJS({ - "node_modules/node-forge/lib/pkcs12.js"(exports2, module2) { +// 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_hmac(); - require_oids(); - require_pkcs7asn1(); - require_pbe(); - require_random(); - require_rsa(); - require_sha1(); require_util8(); - require_x509(); var asn1 = forge.asn1; - var pki2 = forge.pki; - var p12 = module2.exports = forge.pkcs12 = forge.pkcs12 || {}; + 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, - // a ContentInfo constructed: true, value: [{ - name: "ContentInfo.contentType", + name: "ContentInfo.ContentType", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, @@ -35342,9056 +34618,11656 @@ var require_pkcs12 = __commonJS({ }, { name: "ContentInfo.content", tagClass: asn1.Class.CONTEXT_SPECIFIC, + type: 0, constructed: true, + optional: 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", - 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", + p7v.contentInfoValidator = contentInfoValidator; + var encryptedContentInfoValidator = { + name: "EncryptedContentInfo", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ - name: "SafeBag.bagId", + name: "EncryptedContentInfo.contentType", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.OID, constructed: false, - capture: "bagId" + capture: "contentType" }, { - name: "SafeBag.bagValue", - tagClass: asn1.Class.CONTEXT_SPECIFIC, + name: "EncryptedContentInfo.contentEncryptionAlgorithm", + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, constructed: true, - captureAsn1: "bagValue" + 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: "SafeBag.bagAttributes", + 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, - optional: true, - capture: "bagAttributes" - }] + captureAsn1: "recipientInfos" + }].concat(encryptedContentInfoValidator) }; - var attributeValidator = { - name: "Attribute", + p7v.encryptedDataValidator = { + name: "EncryptedData", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, value: [{ - name: "Attribute.attrId", + name: "EncryptedData.Version", tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, + type: asn1.Type.INTEGER, constructed: false, - capture: "oid" + 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: "Attribute.attrValues", + name: "SignerInfo.issuerAndSerialNumber", tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SET, + type: asn1.Type.SEQUENCE, constructed: true, - capture: "values" + 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" }] }; - var certBagValidator = { - name: "CertBag", + 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: "CertBag.certId", + name: "RecipientInfo.version", tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.OID, + type: asn1.Type.INTEGER, constructed: false, - capture: "certId" + capture: "version" }, { - name: "CertBag.certValue", - tagClass: asn1.Class.CONTEXT_SPECIFIC, + name: "RecipientInfo.issuerAndSerial", + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.SEQUENCE, 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]", + name: "RecipientInfo.issuerAndSerial.issuer", tagClass: asn1.Class.UNIVERSAL, - type: asn1.Class.OCTETSTRING, + type: asn1.Type.SEQUENCE, + constructed: true, + captureAsn1: "issuer" + }, { + name: "RecipientInfo.issuerAndSerial.serialNumber", + tagClass: asn1.Class.UNIVERSAL, + type: asn1.Type.INTEGER, constructed: false, - capture: "cert" + 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" }] }; - 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 error4 = new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX."); - error4.errors = error4; - throw error4; - } - var pfx = { - version: capture.version.charCodeAt(0), - safeContents: [], + } +}); + +// 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_util8(); + forge.mgf = forge.mgf || {}; + var mgf1 = module2.exports = forge.mgf.mgf1 = forge.mgf1 = forge.mgf1 || {}; + mgf1.create = function(md) { + var mgf = { /** - * 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. + * Generate mask of specified length. * - * @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. + * @param {String} seed The seed for mask generation. + * @param maskLen Number of bytes to generate. + * @return {String} The generated mask. */ - getBags: function(filter) { - var rval = {}; - var localKeyId; - if ("localKeyId" in filter) { - localKeyId = filter.localKeyId; - } else if ("localKeyIdHex" in filter) { - localKeyId = forge.util.hexToBytes(filter.localKeyIdHex); - } - if (localKeyId === void 0 && !("friendlyName" in filter) && "bagType" in filter) { - rval[filter.bagType] = _getBagsByAttribute( - pfx.safeContents, - null, - null, - filter.bagType - ); - } - if (localKeyId !== void 0) { - rval.localKeyId = _getBagsByAttribute( - pfx.safeContents, - "localKeyId", - localKeyId, - filter.bagType - ); - } - if ("friendlyName" in filter) { - rval.friendlyName = _getBagsByAttribute( - pfx.safeContents, - "friendlyName", - filter.friendlyName, - filter.bagType - ); + generate: function(seed, maskLen) { + var t = new forge.util.ByteBuffer(); + var len = Math.ceil(maskLen / md.digestLength); + for (var i = 0; i < len; i++) { + var c = new forge.util.ByteBuffer(); + c.putInt32(i); + md.start(); + md.update(seed + c.getBytes()); + t.putBuffer(md.digest()); } - 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 - ); + t.truncate(t.length() - maskLen); + return t.getBytes(); } }; - if (capture.version.charCodeAt(0) !== 3) { - var error4 = new Error("PKCS#12 PFX of version other than 3 not supported."); - error4.version = capture.version.charCodeAt(0); - throw error4; + 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_random(); + require_util8(); + 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] + }; } - if (asn1.derToOid(capture.contentType) !== pki2.oids.data) { - var error4 = new Error("Only PKCS#12 PFX in password integrity mode supported."); - error4.oid = asn1.derToOid(capture.contentType); - throw error4; + var hash = options.md; + var mgf = options.mgf; + var hLen = hash.digestLength; + var salt_ = options.salt || null; + if (typeof salt_ === "string") { + salt_ = forge.util.createBuffer(salt_); } - 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."); + 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."); } - data = _decodePkcs7Data(data); - if (capture.mac) { - var md = null; - var macKeyBytes = 0; - var macAlgorithm = asn1.derToOid(capture.macAlgorithm); - switch (macAlgorithm) { - case pki2.oids.sha1: - md = forge.md.sha1.create(); - macKeyBytes = 20; - break; - case pki2.oids.sha256: - md = forge.md.sha256.create(); - macKeyBytes = 32; - break; - case pki2.oids.sha384: - md = forge.md.sha384.create(); - macKeyBytes = 48; - break; - case pki2.oids.sha512: - md = forge.md.sha512.create(); - macKeyBytes = 64; - break; - case pki2.oids.md5: - md = forge.md.md5.create(); - macKeyBytes = 16; - break; - } - if (md === 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, - md - ); - var mac = forge.hmac.create(); - mac.start(md, 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?"); - } + if (salt_ !== null && salt_.length() !== sLen) { + throw new Error("Given salt length does not match length of given salt."); } - _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); + var prng = options.prng || forge.random; + var pssobj = {}; + pssobj.encode = function(md, modBits) { + var i; + var emBits = modBits - 1; + var emLen = Math.ceil(emBits / 8); + var mHash = md.digest().getBytes(); + if (emLen < hLen + sLen + 2) { + throw new Error("Message is too long to encrypt."); } - 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 error4 = new Error("Cannot read ContentInfo."); - error4.errors = errors; - throw error4; + var salt; + if (salt_ === null) { + salt = prng.getBytesSync(sLen); + } else { + salt = salt_.bytes(); } - 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 error4 = new Error("Unsupported PKCS#12 contentType."); - error4.contentType = asn1.derToOid(capture.contentType); - throw error4; + var m_ = new forge.util.ByteBuffer(); + m_.fillWithByte(0, 8); + m_.putBytes(mHash); + m_.putBytes(salt); + hash.start(); + hash.update(m_.getBytes()); + var h = hash.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)); } - 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 error4 = new Error("Cannot read EncryptedContentInfo."); - error4.errors = errors; - throw error4; - } - var oid = asn1.derToOid(capture.contentType); - if (oid !== pki2.oids.data) { - var error4 = new Error( - "PKCS#12 EncryptedContentInfo ContentType is not Data." - ); - error4.oid = oid; - throw error4; - } - 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 error4 = new Error("Cannot read SafeBag."); - error4.errors = errors; - throw error4; + 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."); } - 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 error5 = new Error( - "Unsupported certificate type, only X.509 supported." - ); - error5.oid = asn1.derToOid(capture.certId); - throw error5; - } - 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 error4 = new Error("Unsupported PKCS#12 SafeBag type."); - error4.oid = bag.type; - throw error4; + if (em.charCodeAt(emLen - 1) !== 188) { + throw new Error("Encoded message does not end in 0xBC."); } - if (validator !== void 0 && !asn1.validate(bagAsn1, validator, capture, errors)) { - var error4 = new Error("Cannot read PKCS#12 " + validator.name); - error4.errors = errors; - throw error4; + 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."); } - 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 error4 = new Error("Cannot read PKCS#12 BagAttribute."); - error4.errors = errors; - throw error4; - } - 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); - } + var dbMask = mgf.generate(h, maskLen); + var db = ""; + for (i = 0; i < maskLen; i++) { + db += String.fromCharCode(maskedDB.charCodeAt(i) ^ dbMask.charCodeAt(i)); } - } - 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); + 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"); } - 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 - ]); + if (db.charCodeAt(checkLen) !== 1) { + throw new Error("Inconsistent PSS signature, 0x01 marker not found"); } - 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 - ]); + var salt = db.substr(-sLen); + var m_ = new forge.util.ByteBuffer(); + m_.fillWithByte(0, 8); + m_.putBytes(mHash); + m_.putBytes(salt); + hash.start(); + hash.update(m_.getBytes()); + var h_ = hash.digest().getBytes(); + return h === h_; + }; + return pssobj; }; - 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(); +// 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_pbe(); require_pem(); - require_pbkdf2(); - require_pkcs12(); require_pss(); require_rsa(); require_util8(); - 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); + 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" + }] }; - pki2.privateKeyFromPem = function(pem) { - var msg = forge.pem.decode(pem)[0]; - if (msg.type !== "PRIVATE KEY" && msg.type !== "RSA PRIVATE KEY") { - var error4 = new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".'); - error4.headerType = msg.type; - throw error4; - } - 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); + 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" + }] + }] }; - pki2.privateKeyToPem = function(key, maxline) { - var msg = { - type: "RSA PRIVATE KEY", - body: asn1.toDer(pki2.privateKeyToAsn1(key)).getBytes() - }; - return forge.pem.encode(msg, { maxline }); + 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 + }] + }] + } + ] }; - pki2.privateKeyInfoToPem = function(pki3, maxline) { - var msg = { - type: "PRIVATE KEY", - body: asn1.toDer(pki3).getBytes() - }; - return forge.pem.encode(msg, { maxline }); + 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" + } + ] }; - } -}); - -// 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_random(); - require_sha1(); - require_util8(); - 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()); + pki2.RDNAttributesAsArray = function(rdn, md) { + var rval = []; + var set2, attr, obj; + for (var si = 0; si < rdn.value.length; ++si) { + set2 = rdn.value[si]; + for (var i = 0; i < set2.value.length; ++i) { + obj = {}; + attr = set2.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 (md) { + md.update(obj.type); + md.update(obj.value); + } + rval.push(obj); + } } - 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()); + return rval; + }; + pki2.CRIAttributesAsArray = function(attributes) { + var rval = []; + for (var si = 0; si < attributes.length; ++si) { + var seq2 = attributes[si]; + var type2 = asn1.derToOid(seq2.value[0].value); + var values = seq2.value[1].value; + for (var vi = 0; vi < values.length; ++vi) { + var obj = {}; + obj.type = type2; + 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); + } } - 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) { + 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 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) { + 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; } - 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(); + var _verifySignature = function(options) { + var cert = options.certificate; + var scheme; + switch (cert.signatureOid) { + case oids.sha1WithRSAEncryption: + // deprecated alias + case oids.sha1WithRSASignature: break; - case 4: - len = b.getInt32(); + case oids["RSASSA-PSS"]: + var hash, mgf; + hash = oids[cert.signatureParameters.mgf.hash.algorithmOid]; + if (hash === void 0 || forge.md[hash] === void 0) { + var error3 = new Error("Unsupported MGF hash function."); + error3.oid = cert.signatureParameters.mgf.hash.algorithmOid; + error3.name = hash; + 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[hash].create()); + hash = oids[cert.signatureParameters.hash.algorithmOid]; + if (hash === void 0 || forge.md[hash] === void 0) { + var error3 = new Error("Unsupported RSASSA-PSS hash function."); + error3.oid = cert.signatureParameters.hash.algorithmOid; + error3.name = hash; + throw error3; + } + scheme = forge.pss.create( + forge.md[hash].create(), + mgf, + cert.signatureParameters.saltLength + ); 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 + return cert.publicKey.verify( + options.md.digest().getBytes(), + options.signature, + scheme + ); }; - tls.ContentType = { - change_cipher_spec: 20, - alert: 21, - handshake: 22, - application_data: 23, - heartbeat: 24 + 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); }; - 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 + pki2.certificateToPem = function(cert, maxline) { + var msg = { + type: "CERTIFICATE", + body: asn1.toDer(pki2.certificateToAsn1(cert)).getBytes() + }; + return forge.pem.encode(msg, { maxline }); }; - tls.Alert = {}; - tls.Alert.Level = { - warning: 1, - fatal: 2 + 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); }; - 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 + pki2.publicKeyToPem = function(key, maxline) { + var msg = { + type: "PUBLIC KEY", + body: asn1.toDer(pki2.publicKeyToAsn1(key)).getBytes() + }; + return forge.pem.encode(msg, { maxline }); }; - tls.HeartbeatMessageType = { - heartbeat_request: 1, - heartbeat_response: 2 + pki2.publicKeyToRSAPublicKeyPem = function(key, maxline) { + var msg = { + type: "RSA PUBLIC KEY", + body: asn1.toDer(pki2.publicKeyToRSAPublicKey(key)).getBytes() + }; + return forge.pem.encode(msg, { maxline }); }; - 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; + pki2.getPublicKeyFingerprint = function(key, options) { + options = options || {}; + var md = options.md || forge.md.sha1.create(); + var type2 = options.type || "RSAPublicKey"; + var bytes; + switch (type2) { + 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 + '".'); + } + md.start(); + md.update(bytes); + var digest = md.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 rval; + return digest; }; - 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 - } - }); + 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; } - }; - 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); + if (msg.procType && msg.procType.type === "ENCRYPTED") { + throw new Error("Could not convert certification request from PEM; PEM is encrypted."); } - c.process(); + var obj = asn1.fromDer(msg.body, strict); + return pki2.certificationRequestFromAsn1(obj, computeHash); }; - 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); + 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; } - 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 ext = msg.extensions[i]; - if (ext.type[0] === 0 && ext.type[1] === 0) { - var snl = readVector(ext.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() - ); - } - } - } - } + 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; } - 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 - } - }); - } + cert.issuer.hash = null; + }; + cert.setExtensions = function(exts) { + for (var i = 0; i < exts.length; ++i) { + _fillMissingExtensionFields(exts[i], { cert }); } - 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; - } - } + cert.extensions = exts; + }; + cert.getExtension = function(options) { + if (typeof options === "string") { + options = { name: options }; } - 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) - }); + var rval = null; + var ext; + for (var i = 0; rval === null && i < cert.extensions.length; ++i) { + ext = cert.extensions[i]; + if (options.id && ext.id === options.id) { + rval = ext; + } else if (options.name && ext.name === options.name) { + rval = ext; + } } - if (client) { - c.session.compressionMethod = msg.compression_method; - } else { - c.session.compressionMethod = tls.CompressionMethod.none; + return rval; + }; + cert.sign = function(key, md) { + cert.md = md || 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; } - } - 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 + 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); }; - }; - 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 = ""; + 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; } - } - 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; - } + var md = child.md; + if (md === null) { + md = _createSignatureDigest({ + signatureOid: child.signatureOid, + type: "certificate" + }); + var tbsCertificate = child.tbsCertificate || pki2.getTBSCertificate(child); + var bytes = asn1.toDer(tbsCertificate); + md.update(bytes.getBytes()); } - 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) - })); + if (md !== null) { + rval = _verifySignature({ + certificate: cert, + md, + signature: child.signature + }); } - } - 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) + return rval; }; - 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 + 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; + } } - }); - } 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; + 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 ext = cert.extensions[i]; + if (ext.id === oid) { + var ski = cert.generateSubjectKeyIdentifier().getBytes(); + return forge.util.hexToBytes(ext.subjectKeyIdentifier) === ski; + } } - } - c.process(); + return false; + }; + return cert; }; - 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 - } - }); + 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; } - 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 oid = asn1.derToOid(capture.publicKeyOid); + if (oid !== pki2.oids.rsaEncryption) { + throw new Error("Cannot read public key. OID is not RSA."); } - 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 - } - }); - } + 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 (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 - } - }); + if (capture.certValidity2GeneralizedTime !== void 0) { + validity.push(asn1.generalizedTimeToDate( + capture.certValidity2GeneralizedTime + )); } - 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); + if (capture.certValidity3UTCTime !== void 0) { + validity.push(asn1.utcTimeToDate(capture.certValidity3UTCTime)); } - c.expect = CCC; - if (c.session.clientCertificate !== null) { - c.expect = CCV; + if (capture.certValidity4GeneralizedTime !== void 0) { + validity.push(asn1.generalizedTimeToDate( + capture.certValidity4GeneralizedTime + )); } - 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 - } + 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 b = record.fragment; - var msg = { - certificate_types: readVector(b, 1), - certificate_authorities: readVector(b, 2) + 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); }; - 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 - } - }); + 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; } - var b = record.fragment; - b.read -= 4; - var msgBytes = b.bytes(); - b.read += 4; - var msg = { - signature: readVector(b, 2).getBytes() + 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); }; - 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 - } - }); + 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; } - 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 - } - }); + cert.subject.hash = smd.digest().toHex(); + if (capture.certExtensions) { + cert.extensions = pki2.certificateExtensionsFromAsn1(capture.certExtensions); + } else { + cert.extensions = []; } - if (c.serverCertificate === null) { - var error4 = { - 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, error4.alert.description, depth, []); - if (ret !== true) { - if (ret || ret === 0) { - if (typeof ret === "object" && !forge.util.isArray(ret)) { - if (ret.message) { - error4.message = ret.message; - } - if (ret.alert) { - error4.alert.description = ret.alert; - } - } else if (typeof ret === "number") { - error4.alert.description = ret; - } - } - return c.error(c, error4); + 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])); } } - if (c.session.certificateRequest !== null) { - record = tls.createRecord(c, { - type: tls.ContentType.handshake, - data: tls.createCertificate(c) - }); - tls.queue(c, record); + return rval; + }; + pki2.certificateExtensionFromAsn1 = function(ext) { + var e = {}; + e.id = asn1.derToOid(ext.value[0].value); + e.critical = false; + if (ext.value[1].type === asn1.Type.BOOLEAN) { + e.critical = ext.value[1].value.charCodeAt(0) !== 0; + e.value = ext.value[2].value; + } else { + e.value = ext.value[1].value; } - 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) - })); + 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); } - 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); + return e; }; - 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); + 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; } - c.state.current.read = c.state.pending.read; - if (!c.session.resuming && client || c.session.resuming && !client) { - c.state.pending = null; + var oid = asn1.derToOid(capture.publicKeyOid); + if (oid !== pki2.oids.rsaEncryption) { + throw new Error("Cannot read public key. OID is not RSA."); } - 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 - } + 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()); } - 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 smd = forge.md.sha1.create(); + csr.subject.getField = function(sn) { + return _getAttribute(csr.subject, sn); }; - 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(); + 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; }; - tls.handleHandshake = function(c, record) { - var b = record.fragment; - var type2 = 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 (type2 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() - }; + 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, md) { + csr.md = md || 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; } - if (type2 !== tls.HandshakeType.hello_request && type2 !== tls.HandshakeType.certificate_verify && type2 !== tls.HandshakeType.finished) { - c.session.md5.update(bytes); - c.session.sha1.update(bytes); + 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 md = csr.md; + if (md === null) { + md = _createSignatureDigest({ + signatureOid: csr.signatureOid, + type: "certification request" + }); + var cri = csr.certificationRequestInfo || pki2.getCertificationRequestInfo(csr); + var bytes = asn1.toDer(cri); + md.update(bytes.getBytes()); } - hsTable[c.entity][c.expect][type2](c, record, length); - } else { - tls.handleUnexpected(c, record); - } - }; - tls.handleApplicationData = function(c, record) { - c.data.putBuffer(record.fragment); - c.dataReady(c); - c.process(); + if (md !== null) { + rval = _verifySignature({ + certificate: csr, + md, + signature: csr.signature + }); + } + return rval; + }; + return csr; }; - tls.handleHeartbeat = function(c, record) { - var b = record.fragment; - var type2 = b.getByte(); - var length = b.getInt16(); - var payload = b.getBytes(length); - if (type2 === tls.HeartbeatMessageType.heartbeat_request) { - if (c.handshaking || length > payload.length) { - return c.process(); + function _dnToAsn1(obj) { + var rval = asn1.create( + asn1.Class.UNIVERSAL, + asn1.Type.SEQUENCE, + true, + [] + ); + var attr, set2; + 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); + } } - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.heartbeat, - data: tls.createHeartbeat( - tls.HeartbeatMessageType.heartbeat_response, - payload - ) - })); - tls.flush(c); - } else if (type2 === tls.HeartbeatMessageType.heartbeat_response) { - if (payload !== c.expectedHeartbeatPayload) { - return c.process(); + set2 = 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(set2); + } + 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 (c.heartbeatReceived) { - c.heartbeatReceived(c, forge.util.createBuffer(payload)); + 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; + } } - } - 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]; - } + if (typeof attr.shortName === "undefined") { + if (attr.name && attr.name in _shortNames) { + attr.shortName = _shortNames[attr.name]; } - }; - 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 + 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]) + )); } - }); + } } - 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."); + if (typeof attr.value === "undefined") { + var error3 = new Error("Attribute value not specified."); + error3.attribute = attr; + throw error3; } } - 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 ext = forge.util.createBuffer(); - ext.putByte(0); - ext.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(ext, 2, snList); - extensions.putBuffer(ext); - } - 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; + } + 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]; } - 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 error4 = new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".'); - error4.headerType = msg.type; - throw error4; - } - 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 - } - }); + 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; } } - 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); + if (typeof e.value !== "undefined") { + return e; } - 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 (e.name === "keyUsage") { + var unused = 0; + var b2 = 0; + var b3 = 0; + if (e.digitalSignature) { + b2 |= 128; + unused = 7; } - 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); + if (e.nonRepudiation) { + b2 |= 64; + unused = 6; } - 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(type2, payload, payloadLength) { - if (typeof payloadLength === "undefined") { - payloadLength = payload.length; - } - var rval = forge.util.createBuffer(); - rval.putByte(type2); - 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 (e.keyEncipherment) { + b2 |= 32; + unused = 5; } - } - 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 (e.dataEncipherment) { + b2 |= 16; + unused = 4; } - if (data.length > 0) { - records.push(tls.createRecord(c, { - type: record.type, - data: forge.util.createBuffer(data) - })); + if (e.keyAgreement) { + b2 |= 8; + unused = 3; } - } - 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); + if (e.keyCertSign) { + b2 |= 4; + unused = 2; } - } - }; - 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(error4) { - switch (error4) { - 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]; + if (e.cRLSign) { + b2 |= 2; + unused = 1; } - 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 error4 = new Error("The application rejected the certificate."); - error4.send = true; - error4.alert = { - level: tls.Alert.Level.fatal, - description: tls.Alert.Description.bad_certificate - }; - if (ret.message) { - error4.message = ret.message; - } - if (ret.alert) { - error4.alert.description = ret.alert; - } - throw error4; + 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 seq2 = e.value.value; + for (var key in e) { + if (e[key] !== true) { + continue; + } + if (key in oids) { + seq2.push(asn1.create( + asn1.Class.UNIVERSAL, + asn1.Type.OID, + false, + asn1.oidToDer(oids[key]).getBytes() + )); + } else if (key.indexOf(".") !== -1) { + seq2.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; } - if (ret !== vfd) { - ret = _alertDescToCertError(ret); + } else if (altName.type === 8) { + if (altName.oid) { + value = asn1.oidToDer(asn1.oidToDer(altName.oid)); + } else { + value = asn1.oidToDer(value); } } - 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) - } - }; + e.value.value.push(asn1.create( + asn1.Class.CONTEXT_SPECIFIC, + altName.type, + false, + value + )); } - if (!("send" in err)) { - err.send = true; + } 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.'); } - if (!("alert" in err)) { - err.alert = { - level: tls.Alert.Level.fatal, - description: _certErrorToAlertDesc(err.error) - }; + 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 seq2 = e.value.value; + if (e.keyIdentifier) { + var keyIdentifier = e.keyIdentifier === true ? options.cert.generateSubjectKeyIdentifier().getBytes() : e.keyIdentifier; + seq2.push( + asn1.create(asn1.Class.CONTEXT_SPECIFIC, 0, false, keyIdentifier) + ); } - 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]; - } + if (e.authorityCertIssuer) { + var authorityCertIssuer = [ + asn1.create(asn1.Class.CONTEXT_SPECIFIC, 4, true, [ + _dnToAsn1(e.authorityCertIssuer === true ? options.cert.issuer : e.authorityCertIssuer) + ]) + ]; + seq2.push( + asn1.create(asn1.Class.CONTEXT_SPECIFIC, 1, true, authorityCertIssuer) + ); } - 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; - } + if (e.serialNumber) { + var serialNumber = forge.util.hexToBytes(e.serialNumber === true ? options.cert.serialNumber : e.serialNumber); + seq2.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 seq2 = 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); } } - 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; + fullNameGeneralNames.value.push(asn1.create( + asn1.Class.CONTEXT_SPECIFIC, + altName.type, + false, + value + )); } - } else { - caStore = forge.pki.createCaStore(); + subSeq.value.push(asn1.create( + asn1.Class.CONTEXT_SPECIFIC, + 0, + true, + [fullNameGeneralNames] + )); + seq2.push(subSeq); } - var cipherSuites = options.cipherSuites || null; - if (cipherSuites === null) { - cipherSuites = []; - for (var key2 in tls.CipherSuites) { - cipherSuites.push(tls.CipherSuites[key2]); - } + if (typeof e.value === "undefined") { + var error3 = new Error("Extension value not specified."); + error3.extension = e; + throw error3; } - 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); + 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, "") + ]) + ])); } - var fatal = ex.fatal !== false; - if (fatal) { - c2.fail = true; + 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, "") + ]) + ]) + ])); } - options.error(c2, ex); - if (fatal) { - c2.close(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() + ) + ])); } - }, - 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); + 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; } - }; - 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 - } - }); - } + if (valueTagClass === asn1.Type.UTF8) { + value = forge.util.encodeUtf8(value); } - 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; - } + var valueConstructed = false; + if ("valueConstructed" in attr) { + valueConstructed = attr.valueConstructed; } + var seq2 = 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(seq2); + } + 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 seq2 = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SEQUENCE, true, []); + rval.value.push(seq2); + for (var i = 0; i < exts.length; ++i) { + seq2.value.push(pki2.certificateExtensionToAsn1(exts[i])); + } + return rval; + }; + pki2.certificateExtensionToAsn1 = function(ext) { + 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(ext.id).getBytes() + )); + if (ext.critical) { + extseq.value.push(asn1.create( + asn1.Class.UNIVERSAL, + asn1.Type.BOOLEAN, + false, + String.fromCharCode(255) + )); + } + var value = ext.value; + if (typeof ext.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; }; - 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; + 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; } - 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); + caStore.hasCertificate = function(cert2) { + if (typeof cert2 === "string") { + cert2 = forge.pki.certificateFromPem(cert2); } - 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); + var match = getBySubject(cert2.subject); + if (!match) { + return false; + } + if (!forge.util.isArray(match)) { + match = [match]; + } + var der1 = asn1.toDer(pki2.certificateToAsn1(cert2)).getBytes(); + for (var i2 = 0; i2 < match.length; ++i2) { + var der2 = asn1.toDer(pki2.certificateToAsn1(match[i2])).getBytes(); + if (der1 === der2) { + return true; } } - return rval; + return false; }; - c.prepare = function(data) { - tls.queue(c, tls.createRecord(c, { - type: tls.ContentType.application_data, - data: forge.util.createBuffer(data) - })); - return tls.flush(c); + caStore.listAllCertificates = function() { + var certList = []; + for (var hash in caStore.certs) { + if (caStore.certs.hasOwnProperty(hash)) { + var value = caStore.certs[hash]; + if (!forge.util.isArray(value)) { + certList.push(value); + } else { + for (var i2 = 0; i2 < value.length; ++i2) { + certList.push(value[i2]); + } + } + } + } + return certList; }; - c.prepareHeartbeatRequest = function(payload, payloadLength) { - if (payload instanceof forge.util.ByteBuffer) { - payload = payload.bytes(); + caStore.removeCertificate = function(cert2) { + var result; + if (typeof cert2 === "string") { + cert2 = forge.pki.certificateFromPem(cert2); } - if (typeof payloadLength === "undefined") { - payloadLength = payload.length; + ensureSubjectHasHash(cert2.subject); + if (!caStore.hasCertificate(cert2)) { + return null; } - 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); + var match = getBySubject(cert2.subject); + if (!forge.util.isArray(match)) { + result = caStore.certs[cert2.subject.hash]; + delete caStore.certs[cert2.subject.hash]; + return result; } - 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); + var der1 = asn1.toDer(pki2.certificateToAsn1(cert2)).getBytes(); + for (var i2 = 0; i2 < match.length; ++i2) { + var der2 = asn1.toDer(pki2.certificateToAsn1(match[i2])).getBytes(); + if (der1 === der2) { + result = match[i2]; + match.splice(i2, 1); } - 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 + if (match.length === 0) { + delete caStore.certs[cert2.subject.hash]; + } + return result; }; - 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); + function getBySubject(subject) { + ensureSubjectHasHash(subject); + return caStore.certs[subject.hash] || null; } - 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); + function ensureSubjectHasHash(subject) { + if (!subject.hash) { + var md = forge.md.sha1.create(); + subject.attributes = pki2.RDNAttributesAsArray(_dnToAsn1(subject), md); + subject.hash = md.digest().toHex(); } } - 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_util8(); - 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"); + if (certs) { + for (var i = 0; i < certs.length; ++i) { + var cert = certs[i]; + caStore.addCertificate(cert); + } } + return caStore; }; - 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"); - } + 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" }; - 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); + pki2.verifyCertificateChain = function(caStore, chain, options) { + if (typeof options === "function") { + options = { verify: options }; } - 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; + options = options || {}; + chain = chain.slice(0); + var certs = chain.slice(0); + var validityCheckDate = options.validityCheckDate; + if (typeof validityCheckDate === "undefined") { + validityCheckDate = /* @__PURE__ */ new Date(); } - var md = { - // 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 - }; - md.start = function() { - md.messageLength = 0; - md.fullMessageLength = md.messageLength128 = []; - var int32s = md.messageLengthSize / 4; - for (var i = 0; i < int32s; ++i) { - md.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 md; - }; - md.start(); - md.update = function(msg, encoding) { - if (encoding === "utf8") { - msg = forge.util.encodeUtf8(msg); + 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 + }; + } } - var len = msg.length; - md.messageLength += len; - len = [len / 4294967296 >>> 0, len >>> 0]; - for (var i = md.fullMessageLength.length - 1; i >= 0; --i) { - md.fullMessageLength[i] += len[1]; - len[1] = len[0] + (md.fullMessageLength[i] / 4294967296 >>> 0); - md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; - len[0] = len[1] / 4294967296 >>> 0; + 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 + }; + } } - _input.putBytes(msg); - _update(_h, _w, _input); - if (_input.read > 2048 || _input.length() === 0) { - _input.compact(); + if (error3 === null && parent && !cert.isIssuer(parent)) { + error3 = { + message: "Certificate issuer is invalid.", + error: pki2.certificateError.bad_certificate + }; } - return md; - }; - md.digest = function() { - var finalBlock = forge.util.createBuffer(); - finalBlock.putBytes(_input.bytes()); - var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; - var overflow = remaining & md.blockLength - 1; - finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); - var next, carry; - var bits = md.fullMessageLength[0] * 8; - for (var i = 0; i < md.fullMessageLength.length - 1; ++i) { - next = md.fullMessageLength[i + 1] * 8; - carry = next / 4294967296 >>> 0; - bits += carry; - finalBlock.putInt32(bits >>> 0); - bits = next >>> 0; + if (error3 === null) { + var se = { + keyUsage: true, + basicConstraints: true + }; + for (var i = 0; error3 === null && i < cert.extensions.length; ++i) { + var ext = cert.extensions[i]; + if (ext.critical && !(ext.name in se)) { + error3 = { + message: "Certificate has an unsupported critical extension.", + error: pki2.certificateError.unsupported_certificate + }; + } + } } - finalBlock.putInt32(bits); - var h = new Array(_h.length); - for (var i = 0; i < _h.length; ++i) { - h[i] = _h[i].slice(0); + 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 && !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 + }; + } + } } - _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; + var vfd = error3 === null ? true : error3.error; + var ret = options.verify ? options.verify(vfd, depth, certs) : vfd; + if (ret === true) { + error3 = null; } 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]); + 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; } - return rval; - }; - return md; + first = false; + ++depth; + } while (chain.length > 0); + return true; }; - 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) { +// 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_random(); + require_rsa(); + require_sha1(); + require_util8(); + require_x509(); var asn1 = forge.asn1; - exports2.privateKeyValidator = { - // PrivateKeyInfo - name: "PrivateKeyInfo", + 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: [{ - // Version (INTEGER) - name: "PrivateKeyInfo.version", + name: "ContentInfo.contentType", tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.INTEGER, + type: asn1.Type.OID, constructed: false, - capture: "privateKeyVersion" + capture: "contentType" }, { - // privateKeyAlgorithm - name: "PrivateKeyInfo.privateKeyAlgorithm", - tagClass: asn1.Class.UNIVERSAL, - type: asn1.Type.SEQUENCE, + name: "ContentInfo.content", + tagClass: asn1.Class.CONTEXT_SPECIFIC, 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" + captureAsn1: "content" }] }; - exports2.publicKeyValidator = { - name: "SubjectPublicKeyInfo", + var pfxValidator = { + name: "PFX", tagClass: asn1.Class.UNIVERSAL, type: asn1.Type.SEQUENCE, constructed: true, - captureAsn1: "subjectPublicKeyInfo", value: [ { - name: "SubjectPublicKeyInfo.AlgorithmIdentifier", + name: "PFX.version", 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" - }] + type: asn1.Type.INTEGER, + constructed: false, + capture: "version" }, - // capture group for ed25519PublicKey + contentInfoValidator, { + name: "PFX.macData", 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, + type: asn1.Type.SEQUENCE, + constructed: true, + optional: true, + captureAsn1: "mac", value: [{ - // RSAPublicKey - name: 'SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey', + 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, - captureAsn1: 'rsaPublicKey' + capture: "macIterations" }] - } */ - ] - }; - } -}); - -// 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_random(); - require_sha512(); - require_util8(); - 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 valid2 = forge.asn1.validate(obj, privateKeyValidator, capture, errors); - if (!valid2) { - var error4 = new Error("Invalid Key."); - error4.errors = errors; - throw error4; - } - 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 }; + 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" + }] }; - ed25519.publicKeyFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - var valid2 = forge.asn1.validate(obj, publicKeyValidator, capture, errors); - if (!valid2) { - var error4 = new Error("Invalid Key."); - error4.errors = errors; - throw error4; - } - 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" - }); + 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" + }] }; - 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; + 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" + }] + }] }; - 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 - ); + 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); + } + } } - 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 result; + } + p12.pkcs12FromAsn1 = function(obj, strict, password) { + if (typeof strict === "string") { + password = strict; + strict = true; + } else if (strict === void 0) { + strict = true; } - 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 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 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 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(filter) { + var rval = {}; + var localKeyId; + if ("localKeyId" in filter) { + localKeyId = filter.localKeyId; + } else if ("localKeyIdHex" in filter) { + localKeyId = forge.util.hexToBytes(filter.localKeyIdHex); + } + if (localKeyId === void 0 && !("friendlyName" in filter) && "bagType" in filter) { + rval[filter.bagType] = _getBagsByAttribute( + pfx.safeContents, + null, + null, + filter.bagType + ); + } + if (localKeyId !== void 0) { + rval.localKeyId = _getBagsByAttribute( + pfx.safeContents, + "localKeyId", + localKeyId, + filter.bagType + ); + } + if ("friendlyName" in filter) { + rval.friendlyName = _getBagsByAttribute( + pfx.safeContents, + "friendlyName", + filter.friendlyName, + filter.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; } - 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 - ); + 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 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]; + 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."); } - for (i = 0; i < msg.length; ++i) { - sm[i + ed25519.constants.SIGN_BYTE_LENGTH] = msg[i]; + data = _decodePkcs7Data(data); + if (capture.mac) { + var md = null; + var macKeyBytes = 0; + var macAlgorithm = asn1.derToOid(capture.macAlgorithm); + switch (macAlgorithm) { + case pki2.oids.sha1: + md = forge.md.sha1.create(); + macKeyBytes = 20; + break; + case pki2.oids.sha256: + md = forge.md.sha256.create(); + macKeyBytes = 32; + break; + case pki2.oids.sha384: + md = forge.md.sha384.create(); + macKeyBytes = 48; + break; + case pki2.oids.sha512: + md = forge.md.sha512.create(); + macKeyBytes = 64; + break; + case pki2.oids.md5: + md = forge.md.md5.create(); + macKeyBytes = 16; + break; + } + if (md === 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, + md + ); + var mac = forge.hmac.create(); + mac.start(md, 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."); } - return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; + _decodeAuthenticatedSafe(pfx, data.value, strict, password); + return pfx; }; - 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.'); + 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(); } - if (typeof message === "string" && !encoding) { - throw new TypeError('"options.encoding" must be "binary" or "utf8".'); + 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"); } - if (typeof message === "string") { - if (typeof Buffer !== "undefined") { - return Buffer.from(message, encoding); + 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; } - 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); + 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); } - 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 md = forge.md.sha512.create(); - var buffer = new ByteBuffer(msg); - md.update(buffer.getBytes(msgLen), "binary"); - var hash = md.digest().getBytes(); - if (typeof Buffer !== "undefined") { - return Buffer.from(hash, "binary"); + 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 out = new NativeBuffer(ed25519.constants.HASH_BYTE_LENGTH); - for (var i = 0; i < 64; ++i) { - out[i] = hash.charCodeAt(i); + 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; } - 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]; + 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 0; + return cipher.output.getBytes(); } - 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]; + function _decodeSafeContents(safeContents, strict, password) { + if (!strict && safeContents.length === 0) { + return []; } - 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]; + 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." + ); } - for (i = 0; i < 32; ++i) { - for (j = 0; j < 32; j++) { - x[i + j] += h[i] * d[j]; + 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; } - } - 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; - } - 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)); - add(p, q); - pack(t, p); - n -= 64; - if (crypto_verify_32(sm, 0, t, 0)) { - for (i = 0; i < n; ++i) { - m[i] = 0; + 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; } - return -1; - } - for (i = 0; i < n; ++i) { - m[i] = sm[i + 64]; - } - mlen = n; - return mlen; - } - 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; + 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; } - 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 add(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); + decoder(); } + return res; } - 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; + 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); + } } - 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; } + return decodedAttrs; } - 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]); + 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; } - 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); + if (!("localKeyId" in options)) { + options.localKeyId = null; } - o[15] &= 32767; - } - function pow2523(o, i) { - var c = gf(); - var a; - for (a = 0; a < 16; ++a) { - c[a] = i[a]; + if (!("generateLocalKeyId" in options)) { + options.generateLocalKeyId = true; } - for (a = 250; a >= 0; --a) { - S(c, c); - if (a !== 1) { - M(c, c, i); + 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); } } - 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); - add(q, p); - add(p, p); - cswap(p, q, b); + 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 + ) + ]) + ]) + ); } - } - 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; + 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 + ) + ]) + ]) + ); } - } - function inv25519(o, i) { - var c = gf(); - var a; - for (a = 0; a < 16; ++a) { - c[a] = i[a]; + if (attrs.length > 0) { + bagAttrs = asn1.create(asn1.Class.UNIVERSAL, asn1.Type.SET, true, attrs); } - for (a = 253; a >= 0; --a) { - S(c, c); - if (a !== 2 && a !== 4) { - M(c, c, i); + var contents = []; + var chain = []; + if (cert !== null) { + if (forge.util.isArray(cert)) { + chain = cert; + } else { + chain = [cert]; } } - 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(init) { - var i, r = new Float64Array(16); - if (init) { - for (i = 0; i < init.length; ++i) { - r[i] = init[i]; + 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); } - return r; - } - function A(o, a, b) { - for (var i = 0; i < 16; ++i) { - o[i] = a[i] + b[i]; + 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); } - } - 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_util8(); - require_random(); - 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(md, digestLength) { - _createKDF(this, md, 0, digestLength || md.digestLength); - }; - forge.kem.kdf2 = function(md, digestLength) { - _createKDF(this, md, 1, digestLength || md.digestLength); - }; - function _createKDF(kdf, md, 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); - md.start(); - md.update(x + c.getBytes()); - var hash = md.digest(); - key.putBytes(hash.getBytes(digestLength)); + 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 + ]); } - key.truncate(key.length() - length); - return key.getBytes(); - }; - } + 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/log.js -var require_log = __commonJS({ - "node_modules/node-forge/lib/log.js"(exports2, module2) { +// 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_util8(); - 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; + 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); }; - forge.log.prepareFull = function(message) { - if (!("full" in message)) { - var args = [message.message]; - args = args.concat([]); - message.full = forge.util.format.apply(this, args); + 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; } - }; - forge.log.prepareStandardFull = function(message) { - if (!("standardFull" in message)) { - forge.log.prepareStandard(message); - message.standardFull = message.standard; + 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); }; - 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 + pki2.privateKeyToPem = function(key, maxline) { + var msg = { + type: "RSA PRIVATE KEY", + body: asn1.toDer(pki2.privateKeyToAsn1(key)).getBytes() }; - 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); + return forge.pem.encode(msg, { maxline }); }; - 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 handler = levelHandlers[message.level]; - var args = [message.standard]; - args = args.concat(message["arguments"].slice()); - handler.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() { - } + pki2.privateKeyInfoToPem = function(pki3, maxline) { + var msg = { + type: "PRIVATE KEY", + body: asn1.toDer(pki3).getBytes() }; - } - 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_sha256(); - require_sha512(); + return forge.pem.encode(msg, { maxline }); + }; } }); -// node_modules/node-forge/lib/pkcs7.js -var require_pkcs7 = __commonJS({ - "node_modules/node-forge/lib/pkcs7.js"(exports2, module2) { +// 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_aes(); require_asn1(); - require_des(); - require_oids(); + require_hmac(); + require_md5(); require_pem(); - require_pkcs7asn1(); + require_pki(); require_random(); + require_sha1(); require_util8(); - 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 error4 = new Error('Could not convert PKCS#7 message from PEM; PEM header type is not "PKCS#7".'); - error4.headerType = msg.type; - throw error4; + 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()); } - if (msg.procType && msg.procType.type === "ENCRYPTED") { - throw new Error("Could not convert PKCS#7 message from PEM; PEM is encrypted."); + 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()); } - var obj = asn1.fromDer(msg.body); - return p7.messageFromAsn1(obj); + rval.putBytes(forge.util.xorBytes( + md5bytes.getBytes(), + sha1bytes.getBytes(), + length + )); + return rval; }; - p7.messageToPem = function(msg, maxline) { - var pemObj = { - type: "PKCS7", - body: asn1.toDer(msg.toAsn1()).getBytes() - }; - return forge.pem.encode(pemObj, { maxline }); + 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(); }; - p7.messageFromAsn1 = function(obj) { - var capture = {}; - var errors = []; - if (!asn1.validate(obj, p7.asn1.contentInfoValidator, capture, errors)) { - var error4 = new Error("Cannot read PKCS#7 message. ASN.1 object is not an PKCS#7 ContentInfo."); - error4.errors = errors; - throw error4; + 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) { } - var contentType = asn1.derToOid(capture.contentType); - var msg; - switch (contentType) { - case forge.pki.oids.envelopedData: - msg = p7.createEnvelopedData(); + 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 forge.pki.oids.encryptedData: - msg = p7.createEncryptedData(); + case 2: + len = b.getInt16(); break; - case forge.pki.oids.signedData: - msg = p7.createSignedData(); + case 3: + len = b.getInt24(); + break; + case 4: + len = b.getInt32(); 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; + return forge.util.createBuffer(b.getBytes(len)); }; - 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." - ); + 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 } - if (typeof key === "string") { - key = forge.pki.privateKeyFromPem(key); + }); + } + }; + 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 } - 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 - ); + }); + } 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) + }); } - 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; + if (!client) { + for (var i = 0; i < msg.extensions.length; ++i) { + var ext = msg.extensions[i]; + if (ext.type[0] === 0 && ext.type[1] === 0) { + var snl = readVector(ext.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() + ); } - 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 (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 (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(); + 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; + } } } - 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, "") - ]) - ); + 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) + }); } - return mds; - } - function addSignerInfos(mds) { - var content; - if (msg.detachedContent) { - content = msg.detachedContent; + if (client) { + c.session.compressionMethod = msg.compression_method; } 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); + c.session.compressionMethod = tls.CompressionMethod.none; } - 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 match = true; - for (var j = 0; j < sAttr.length; ++j) { - if (rAttr[j].type !== sAttr[j].type || rAttr[j].value !== sAttr[j].value) { - match = false; - break; - } - } - if (match) { - 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); - } - } - } + 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 }; - return msg; }; - function _recipientFromAsn1(obj) { - var capture = {}; - var errors = []; - if (!asn1.validate(obj, p7.asn1.recipientInfoValidator, capture, errors)) { - var error4 = new Error("Cannot read PKCS#7 RecipientInfo. ASN.1 object is not an PKCS#7 RecipientInfo."); - error4.errors = errors; - throw error4; + tls.handleServerHello = function(c, record, length) { + var msg = tls.parseHelloMessage(c, record, length); + if (c.fail) { + return; } - 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])); + 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 + } + }); } - return ret; - } - function _recipientsToAsn1(recipients) { - var ret = []; - for (var i = 0; i < recipients.length; ++i) { - ret.push(_recipientToAsn1(recipients[i])); + 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); } - 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); + c.session.id = sessionId; + c.process(); + }; + tls.handleClientHello = function(c, record, length) { + var msg = tls.parseHelloMessage(c, record, length); + if (c.fail) { + return; } - 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)); + 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 = ""; } - rval.value.push(attrsAsn1); } - return rval; - } - function _signersToAsn1(signers) { - var ret = []; - for (var i = 0; i < signers.length; ++i) { - ret.push(_signerToAsn1(signers[i])); + if (sessionId.length === 0) { + sessionId = forge.random.getBytes(32); } - 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 timestamp2 = Date.parse(date); - if (!isNaN(timestamp2)) { - date = new Date(timestamp2); - } else if (date.length === 13) { - date = asn1.utcTimeToDate(date); - } else { - date = asn1.generalizedTimeToDate(date); + 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; } } - 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) - ); - } + c.version = { major: version.major, minor: version.minor }; + c.session.version = c.version; } - 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 error4 = new Error("Cannot read PKCS#7 message. ASN.1 object is not a supported PKCS#7 message."); - error4.errors = error4; - throw error4; - } - 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 (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); } - 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; + 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) + })); } - } else { - content = capture.encryptedContent; + tls.queue(c, tls.createRecord(c, { + type: tls.ContentType.handshake, + data: tls.createServerHelloDone(c) + })); } - 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; + 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 } - } 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."); + 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); } - msg.content = ciph.output; + } 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 + } + }); } - } - } -}); - -// 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_util8(); - 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); + 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 { - 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 type2 = "ssh-rsa"; - comment = comment || ""; - var buffer = forge.util.createBuffer(); - _addStringToBuffer(buffer, type2); - _addBigIntegerToBuffer(buffer, key.e); - _addBigIntegerToBuffer(buffer, key.n); - return type2 + " " + 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 md = options.md || forge.md.md5.create(); - var type2 = "ssh-rsa"; - var buffer = forge.util.createBuffer(); - _addStringToBuffer(buffer, type2); - _addBigIntegerToBuffer(buffer, key.e); - _addBigIntegerToBuffer(buffer, key.n); - md.start(); - md.update(buffer.getBytes()); - var digest = md.digest(); - if (options.encoding === "hex") { - var hex = digest.toHex(); - if (options.delimiter) { - return hex.match(/.{2}/g).join(options.delimiter); + if (client) { + c.session.serverCertificate = certs[0]; + } else { + c.session.clientCertificate = certs[0]; + } + if (tls.verifyCertificateChain(c, certs)) { + c.expect = client ? SKE : CKE; } - return hex; - } else if (options.encoding === "binary") { - return digest.getBytes(); - } else if (options.encoding) { - throw new Error('Unknown encoding "' + options.encoding + '".'); } - return digest; + c.process(); }; - function _addBigIntegerToBuffer(buffer, val2) { - var hexVal = val2.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, val2) { - buffer.putInt32(val2.length); - buffer.putString(val2); - } - 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_lib3 = __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_log(); - require_md_all(); - require_mgf1(); - require_pbkdf2(); - require_pem(); - require_pkcs1(); - require_pkcs12(); - require_pkcs7(); - require_pki(); - require_prime(); - require_prng(); - require_pss(); - require_random(); - require_rc2(); - require_ssh(); - require_tls(); - require_util8(); - } -}); - -// 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 _a, _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 path2 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path2} does not exist${os_1.EOL}`); + 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 } - } - 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 = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `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'"); + }); } + c.expect = SCR; + c.process(); }; - exports2.Context = Context; - } -}); - -// node_modules/@actions/github/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "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; + 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 + } + }); } - 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) { + var b = record.fragment; + var msg = { + enc_pre_master_secret: readVector(b, 2).getBytes() + }; + var privateKey = null; + if (c.getPrivateKey) { try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + 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 + } + }); } - } else { - return void 0; } - } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + 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 + } + }); } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + 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); } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; + c.expect = CCC; + if (c.session.clientCertificate !== null) { + c.expect = CCV; } + c.process(); }; - } -}); - -// node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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 + } + }); } - __setModuleDefault4(result, mod); - return result; + 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(); }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); + 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 + } }); } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + 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."); } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 } - } - function step(result) { - result.done ? resolve2(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 = __importStar4(require("http")); - var https = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); }); } + c.expect = CCC; + c.process(); }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient = class { - constructor(userAgent, 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 = userAgent; - 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; + 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 (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + }); + } + 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 } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + }; + 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); } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + if (c.session.certificateRequest !== null) { + record = tls.createRecord(c, { + type: tls.ContentType.handshake, + data: tls.createCertificate(c) }); + tls.queue(c, record); } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); + 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); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + 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 + } }); } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + var client = c.entity === tls.ConnectionEnd.client; + if (c.session.resuming && client || !c.session.resuming && !client) { + c.state.pending = tls.createConnectionState(c); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + c.state.current.read = c.state.pending.read; + if (!c.session.resuming && client || c.session.resuming && !client) { + c.state.pending = null; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); + 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 + } }); } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + 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) + })); } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + 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; } - /** - * 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 __awaiter4(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); - }); + if (alert.description === tls.Alert.Description.close_notify) { + return c.close(); } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + 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 type2 = b.getByte(); + var length = b.getInt24(); + if (length > b.length()) { + c.fragmented = record; + record.fragment = forge.util.createBuffer(); + b.read -= 4; + return c.process(); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } + c.fragmented = null; + b.read -= 4; + var bytes = b.bytes(length + 4); + b.read += 4; + if (type2 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: [] } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + }, + cipherSuite: null, + compressionMethod: null, + serverCertificate: null, + clientCertificate: null, + md5: forge.md.md5.create(), + sha1: forge.md.sha1.create() + }; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + if (type2 !== tls.HandshakeType.hello_request && type2 !== tls.HandshakeType.certificate_verify && type2 !== tls.HandshakeType.finished) { + c.session.md5.update(bytes); + c.session.sha1.update(bytes); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } + hsTable[c.entity][c.expect][type2](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 type2 = b.getByte(); + var length = b.getInt16(); + var payload = b.getBytes(length); + if (type2 === tls.HeartbeatMessageType.heartbeat_request) { + if (c.handshaking || length > payload.length) { + return c.process(); } - const req = info6.httpModule.request(info6.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: ${info6.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + tls.queue(c, tls.createRecord(c, { + type: tls.ContentType.heartbeat, + data: tls.createHeartbeat( + tls.HeartbeatMessageType.heartbeat_response, + payload + ) + })); + tls.flush(c); + } else if (type2 === tls.HeartbeatMessageType.heartbeat_response) { + if (payload !== c.expectedHeartbeatPayload) { + return c.process(); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + if (c.heartbeatReceived) { + c.heartbeatReceived(c, forge.util.createBuffer(payload)); } } - /** - * 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); + 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; } - 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); + 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; } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + 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 info6; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + 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 lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + 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 additionalHeaders[header] || clientHeader || _default2; } - _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 https.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + 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; } - _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; + 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]); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); + 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 ext = forge.util.createBuffer(); + ext.putByte(0); + ext.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(ext, 2, snList); + extensions.putBuffer(ext); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(response); + 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; } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } - } - return value; + if (msg.procType && msg.procType.type === "ENCRYPTED") { + throw new Error("Could not convert certificate from PEM; PEM is encrypted."); } - 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) { + var der = forge.util.createBuffer(msg.body); + if (asn1 === null) { + asn1 = forge.asn1.fromDer(der.bytes(), false); } - 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 { - resolve2(response); + 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; }; - exports2.HttpClient = HttpClient; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// node_modules/@actions/github/lib/internal/utils.js -var require_utils3 = __commonJS({ - "node_modules/@actions/github/lib/internal/utils.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; + 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; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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 new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { + 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 { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 + } + }); } } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + 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); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + callback2(c2, b2); + }; + c.getSignature(c, b, callback); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(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 = (url, opts) => __awaiter4(this, void 0, void 0, function* () { - return (0, undici_1.fetch)(url, 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 getUserAgent() { - if (typeof navigator === "object" && "userAgent" in navigator) { - return navigator.userAgent; + 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); } - if (typeof process === "object" && "version" in process) { - return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; + 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(type2, payload, payloadLength) { + if (typeof payloadLength === "undefined") { + payloadLength = payload.length; } - return ""; - } - exports2.getUserAgent = getUserAgent; - } -}); - -// node_modules/before-after-hook/lib/register.js -var require_register = __commonJS({ - "node_modules/before-after-hook/lib/register.js"(exports2, module2) { - module2.exports = register; - function register(state, name, method, options) { - if (typeof method !== "function") { - throw new Error("method for before hook must be a function"); + var rval = forge.util.createBuffer(); + rval.putByte(type2); + 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 (!options) { - options = {}; + 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 (Array.isArray(name)) { - return name.reverse().reduce(function(callback, name2) { - return register.bind(null, state, name2, callback, options); - }, method)(); + if (record.type === tls.ContentType.handshake) { + var bytes = record.fragment.bytes(); + c.session.md5.update(bytes); + c.session.sha1.update(bytes); + bytes = null; } - return Promise.resolve().then(function() { - if (!state.registry[name]) { - return method(options); + 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) + })); } - return state.registry[name].reduce(function(method2, registered) { - return registered.hook.bind(null, method2, options); - }, method)(); - }); - } - } -}); - -// node_modules/before-after-hook/lib/add.js -var require_add = __commonJS({ - "node_modules/before-after-hook/lib/add.js"(exports2, module2) { - module2.exports = addHook; - function addHook(state, kind, name, hook) { - var orig = hook; - if (!state.registry[name]) { - state.registry[name] = []; - } - if (kind === "before") { - hook = function(method, options) { - return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options)); - }; - } - if (kind === "after") { - hook = 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") { - hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); - }); - }; - } - state.registry[name].push({ - hook, - orig - }); - } - } -}); - -// node_modules/before-after-hook/lib/remove.js -var require_remove = __commonJS({ - "node_modules/before-after-hook/lib/remove.js"(exports2, module2) { - module2.exports = removeHook; - function removeHook(state, name, method) { - if (!state.registry[name]) { - return; - } - var index = state.registry[name].map(function(registered) { - return registered.orig; - }).indexOf(method); - if (index === -1) { - return; } - state.registry[name].splice(index, 1); - } - } -}); - -// node_modules/before-after-hook/index.js -var require_before_after_hook = __commonJS({ - "node_modules/before-after-hook/index.js"(exports2, module2) { - var register = require_register(); - var addHook = require_add(); - var removeHook = require_remove(); - var bind = Function.bind; - var bindable = bind.bind(bind); - function bindApi(hook, state, name) { - var removeHookRef = bindable(removeHook, null).apply( - null, - name ? [state, name] : [state] - ); - hook.api = { remove: removeHookRef }; - hook.remove = removeHookRef; - ["before", "error", "after", "wrap"].forEach(function(kind) { - var args = name ? [state, kind, name] : [state, kind]; - hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); - }); - } - function HookSingular() { - var singularHookName = "h"; - var singularHookState = { - registry: {} - }; - var singularHook = register.bind(null, singularHookState, singularHookName); - bindApi(singularHook, singularHookState, singularHookName); - return singularHook; - } - function HookCollection() { - var state = { - registry: {} - }; - var hook = register.bind(null, state); - bindApi(hook, state); - return hook; - } - 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; + 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); + } } - 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/@octokit/core/node_modules/@octokit/endpoint/dist-node/index.js -var require_dist_node2 = __commonJS({ - "node_modules/@octokit/core/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 }); + 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); } - return to; + c.records = []; + return c.tlsDataReady(c); }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports = {}; - __export2(dist_src_exports, { - endpoint: () => endpoint - }); - module2.exports = __toCommonJS2(dist_src_exports); - var import_universal_user_agent = require_dist_node(); - var VERSION = "9.0.6"; - var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; - var DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "" + 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; } }; - function lowercaseKeys(object) { - if (!object) { - return {}; + 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; } - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[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(defaults, options) { - const result = Object.assign({}, defaults); - Object.keys(options).forEach((key) => { - if (isPlainObject(options[key])) { - if (!(key in defaults)) - Object.assign(result, { [key]: options[key] }); - else - result[key] = mergeDeep(defaults[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]; + }; + tls.verifyCertificateChain = function(c, chain) { + try { + var options = {}; + for (var key2 in c.verifyOptions) { + options[key2] = c.verifyOptions[key2]; } - } - return obj; - } - function merge2(defaults, route, options) { - if (typeof route === "string") { - let [method, url] = route.split(" "); - options = Object.assign(url ? { method, url } : { url: method }, options); - } else { - options = Object.assign({}, route); - } - options.headers = lowercaseKeys(options.headers); - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); - if (options.url === "/graphql") { - if (defaults && defaults.mediaType.previews?.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter( - (preview) => !mergedOptions.mediaType.previews.includes(preview) - ).concat(mergedOptions.mediaType.previews); + 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) + } + }; } - mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); - } - return mergedOptions; - } - function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); - if (names.length === 0) { - return url; - } - return url + separator + names.map((name) => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + if (!("send" in err)) { + err.send = true; } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); - } - var urlVariableRegex = /\{[^{}}]+\}/g; - function removeNonChars(variableName) { - return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []); - } - function omit(object, keysToOmit) { - const result = { __proto__: null }; - for (const key of Object.keys(object)) { - if (keysToOmit.indexOf(key) === -1) { - result[key] = object[key]; + if (!("alert" in err)) { + err.alert = { + level: tls.Alert.Level.fatal, + description: _certErrorToAlertDesc(err.error) + }; } + c.error(c, err); } - return result; - } - function encodeReserved(str2) { - return str2.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(str2) { - return encodeURIComponent(str2).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; + return !c.fail; + }; + tls.createSessionCache = function(cache, capacity) { + var rval = null; + if (cache && cache.getSession && cache.setSession && cache.order) { + rval = cache; } else { - return value; - } - } - function isDefined2(value) { - return value !== void 0 && value !== null; - } - function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; - } - function getValues(context2, operator, key, modifier) { - var value = context2[key], result = []; - if (isDefined2(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( - encodeValue(operator, value, isKeyOperator(operator) ? key : "") - ); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined2).forEach(function(value2) { - result.push( - encodeValue(operator, value2, isKeyOperator(operator) ? key : "") - ); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined2(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } + 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 { - const tmp = []; - if (Array.isArray(value)) { - value.filter(isDefined2).forEach(function(value2) { - tmp.push(encodeValue(operator, value2)); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined2(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(",")); - } + delete cache[key2]; } } - } else { - if (operator === ";") { - if (isDefined2(value)) { - result.push(encodeUnreserved(key)); + 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]; } - } 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, context2) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - template = template.replace( - /\{([^\{\}]+)\}|([^\{\}]+)/g, - function(_, 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(context2, operator, tmp[1], tmp[2] || tmp[3])); - }); - if (operator && operator !== "+") { - var separator = ","; - if (operator === "?") { - separator = "&"; - } else if (operator !== "#") { - separator = operator; + 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 (values.length !== 0 ? operator : "") + values.join(separator); - } else { - return values.join(","); } - } else { - return encodeReserved(literal); } - } - ); - if (template === "/") { - return template; + 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 { - return template.replace(/\/$/, ""); + caStore = forge.pki.createCaStore(); } - } - function parse(options) { - let method = options.method.toUpperCase(); - let url = (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(url); - url = parseUrl(url).expand(parameters); - if (!/^http/.test(url)) { - url = options.baseUrl + url; + var cipherSuites = options.cipherSuites || null; + if (cipherSuites === null) { + cipherSuites = []; + for (var key2 in tls.CipherSuites) { + cipherSuites.push(tls.CipherSuites[key2]); + } } - 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(","); + 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); } - if (url.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(","); + }; + 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 + } + }); } } - } - if (["GET", "HEAD"].includes(method)) { - url = addQueryParameters(url, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; + 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 { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; + 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; } } - } - 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, headers }, - typeof body !== "undefined" ? { body } : null, - options.request ? { request: options.request } : null - ); - } - function endpointWithDefaults(defaults, route, options) { - return parse(merge2(defaults, route, options)); - } - function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS2 = merge2(oldDefaults, newDefaults); - const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); - return Object.assign(endpoint2, { - DEFAULTS: DEFAULTS2, - defaults: withDefaults.bind(null, DEFAULTS2), - merge: merge2.bind(null, DEFAULTS2), - parse - }); - } - var endpoint = withDefaults(null, DEFAULTS); - } -}); - -// 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); + 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); } - 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]; + }; + c.process = function(data) { + var rval = 0; + if (data) { + c.input.putBytes(data); } - 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]; - }); + 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 ret; + 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/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); +// 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 }; - 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); + 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 }; - var name = fn.name || "Function wrapped with `once`"; - f.onceError = name + " shouldn't be called more than once"; - f.called = false; - return f; + 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; } - } -}); - -// node_modules/@octokit/core/node_modules/@octokit/request-error/dist-node/index.js -var require_dist_node4 = __commonJS({ - "node_modules/@octokit/core/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 }); + 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); } - 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_exports = {}; - __export2(dist_src_exports, { - RequestError: () => RequestError - }); - module2.exports = __toCommonJS2(dist_src_exports); - 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 RequestError = 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( - /(?= tls.Versions.TLS_1_1.minor) { + cipher.output.putBytes(iv); } - }; - } -}); - -// node_modules/@octokit/core/node_modules/@octokit/request/dist-node/index.js -var require_dist_node5 = __commonJS({ - "node_modules/@octokit/core/node_modules/@octokit/request/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 }); + cipher.update(record.fragment); + if (cipher.finish(encrypt_aes_cbc_sha1_padding)) { + record.fragment = cipher.output; + record.length = record.fragment.length(); + rval = true; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports = {}; - __export2(dist_src_exports, { - request: () => request - }); - module2.exports = __toCommonJS2(dist_src_exports); - var import_endpoint = require_dist_node2(); - var import_universal_user_agent = require_dist_node(); - var VERSION = "8.4.1"; - 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); - } - var import_request_error = require_dist_node4(); - function getBufferResponse(response) { - return response.arrayBuffer(); + return rval; } - function fetchWrapper(requestOptions) { - var _a, _b, _c, _d; - const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; - const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; - if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); - } - let headers = {}; - let status; - let url; - 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" - ); + function encrypt_aes_cbc_sha1_padding(blockSize, input, decrypt) { + if (!decrypt) { + var padding = blockSize - input.length() % blockSize; + input.fillWithByte(padding - 1, padding); } - 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) => { - url = 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_error.RequestError(response.statusText, status, { - response: { - url, - status, - headers, - data: void 0 - }, - request: requestOptions - }); - } - if (status === 304) { - throw new import_request_error.RequestError("Not modified", status, { - response: { - url, - status, - headers, - data: await getResponseData(response) - }, - request: requestOptions - }); - } - if (status >= 400) { - const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { - response: { - url, - status, - headers, - data - }, - request: requestOptions - }); - throw error4; + 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; } - return parseSuccessResponseBody ? await getResponseData(response) : response.body; - }).then((data) => { - return { - status, - url, - headers, - data - }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; - } + if (rval) { + output.truncate(paddingLength + 1); } - throw new import_request_error.RequestError(message, 500, { - request: requestOptions - }); - }); - } - async function getResponseData(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); + return rval; } - function toErrorMessage(data) { - if (typeof data === "string") - return data; - let suffix; - if ("documentation_url" in data) { - suffix = ` - ${data.documentation_url}`; + 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 { - suffix = ""; + iv = record.fragment.getBytes(16); } - if ("message" in data) { - if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; - } - return `${data.message}${suffix}`; + 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(); } - return `Unknown error: ${JSON.stringify(data)}`; + 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 withDefaults(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 request2 = (route2, parameters2) => { - return fetchWrapper( - endpoint2.parse(endpoint2.merge(route2, parameters2)) - ); - }; - Object.assign(request2, { - endpoint: endpoint2, - defaults: withDefaults.bind(null, endpoint2) - }); - return endpointOptions.request.hook(request2, endpointOptions); - }; - return Object.assign(newApi, { - endpoint: endpoint2, - defaults: withDefaults.bind(null, endpoint2) - }); + 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; } - var request = withDefaults(import_endpoint.endpoint, { - headers: { - "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` - } - }); } }); -// node_modules/@octokit/graphql/node_modules/@octokit/endpoint/dist-node/index.js -var require_dist_node6 = __commonJS({ - "node_modules/@octokit/graphql/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 }); +// 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_util8(); + 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"); }; - 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 }); + forge.md.sha384 = forge.md.algorithms.sha384 = sha384; + forge.sha512.sha256 = forge.sha512.sha256 || { + create: function() { + return sha512.create("SHA-512/256"); } - return to; }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports = {}; - __export2(dist_src_exports, { - endpoint: () => endpoint - }); - module2.exports = __toCommonJS2(dist_src_exports); - var import_universal_user_agent = require_dist_node(); - var VERSION = "9.0.6"; - var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; - var DEFAULTS = { - method: "GET", - baseUrl: "https://api.github.com", - headers: { - accept: "application/vnd.github.v3+json", - "user-agent": userAgent - }, - mediaType: { - format: "" + 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"); } }; - function lowercaseKeys(object) { - if (!object) { - return {}; + forge.md["sha512/224"] = forge.md.algorithms["sha512/224"] = forge.sha512.sha224; + sha512.create = function(algorithm) { + if (!_initialized) { + _init(); } - return Object.keys(object).reduce((newObj, key) => { - newObj[key.toLowerCase()] = object[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(defaults, options) { - const result = Object.assign({}, defaults); - Object.keys(options).forEach((key) => { - if (isPlainObject(options[key])) { - if (!(key in defaults)) - Object.assign(result, { [key]: options[key] }); - else - result[key] = mergeDeep(defaults[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]; - } + if (typeof algorithm === "undefined") { + algorithm = "SHA-512"; } - return obj; - } - function merge2(defaults, route, options) { - if (typeof route === "string") { - let [method, url] = route.split(" "); - options = Object.assign(url ? { method, url } : { url: method }, options); - } else { - options = Object.assign({}, route); + if (!(algorithm in _states)) { + throw new Error("Invalid SHA-512 algorithm: " + algorithm); } - options.headers = lowercaseKeys(options.headers); - removeUndefinedProperties(options); - removeUndefinedProperties(options.headers); - const mergedOptions = mergeDeep(defaults || {}, options); - if (options.url === "/graphql") { - if (defaults && defaults.mediaType.previews?.length) { - mergedOptions.mediaType.previews = defaults.mediaType.previews.filter( - (preview) => !mergedOptions.mediaType.previews.includes(preview) - ).concat(mergedOptions.mediaType.previews); - } - mergedOptions.mediaType.previews = (mergedOptions.mediaType.previews || []).map((preview) => preview.replace(/-preview/, "")); + 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); } - return mergedOptions; - } - function addQueryParameters(url, parameters) { - const separator = /\?/.test(url) ? "&" : "?"; - const names = Object.keys(parameters); - if (names.length === 0) { - return url; + 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; } - return url + separator + names.map((name) => { - if (name === "q") { - return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + var md = { + // 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 + }; + md.start = function() { + md.messageLength = 0; + md.fullMessageLength = md.messageLength128 = []; + var int32s = md.messageLengthSize / 4; + for (var i = 0; i < int32s; ++i) { + md.fullMessageLength.push(0); } - return `${name}=${encodeURIComponent(parameters[name])}`; - }).join("&"); - } - var urlVariableRegex = /\{[^{}}]+\}/g; - function removeNonChars(variableName) { - return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []); - } - function omit(object, keysToOmit) { - const result = { __proto__: null }; - for (const key of Object.keys(object)) { - if (keysToOmit.indexOf(key) === -1) { - result[key] = object[key]; + _input = forge.util.createBuffer(); + _h = new Array(_state.length); + for (var i = 0; i < _state.length; ++i) { + _h[i] = _state[i].slice(0); } - } - return result; - } - function encodeReserved(str2) { - return str2.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 md; + }; + md.start(); + md.update = function(msg, encoding) { + if (encoding === "utf8") { + msg = forge.util.encodeUtf8(msg); } - return part; - }).join(""); - } - function encodeUnreserved(str2) { - return encodeURIComponent(str2).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 isDefined2(value) { - return value !== void 0 && value !== null; - } - function isKeyOperator(operator) { - return operator === ";" || operator === "&" || operator === "?"; - } - function getValues(context2, operator, key, modifier) { - var value = context2[key], result = []; - if (isDefined2(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( - encodeValue(operator, value, isKeyOperator(operator) ? key : "") - ); - } else { - if (modifier === "*") { - if (Array.isArray(value)) { - value.filter(isDefined2).forEach(function(value2) { - result.push( - encodeValue(operator, value2, isKeyOperator(operator) ? key : "") - ); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined2(value[k])) { - result.push(encodeValue(operator, value[k], k)); - } - }); - } - } else { - const tmp = []; - if (Array.isArray(value)) { - value.filter(isDefined2).forEach(function(value2) { - tmp.push(encodeValue(operator, value2)); - }); - } else { - Object.keys(value).forEach(function(k) { - if (isDefined2(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(",")); - } - } + var len = msg.length; + md.messageLength += len; + len = [len / 4294967296 >>> 0, len >>> 0]; + for (var i = md.fullMessageLength.length - 1; i >= 0; --i) { + md.fullMessageLength[i] += len[1]; + len[1] = len[0] + (md.fullMessageLength[i] / 4294967296 >>> 0); + md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0; + len[0] = len[1] / 4294967296 >>> 0; } - } else { - if (operator === ";") { - if (isDefined2(value)) { - result.push(encodeUnreserved(key)); - } - } else if (value === "" && (operator === "&" || operator === "?")) { - result.push(encodeUnreserved(key) + "="); - } else if (value === "") { - result.push(""); + _input.putBytes(msg); + _update(_h, _w, _input); + if (_input.read > 2048 || _input.length() === 0) { + _input.compact(); } - } - return result; - } - function parseUrl(template) { - return { - expand: expand.bind(null, template) + return md; }; - } - function expand(template, context2) { - var operators = ["+", "#", ".", "/", ";", "?", "&"]; - template = template.replace( - /\{([^\{\}]+)\}|([^\{\}]+)/g, - function(_, 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(context2, 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 url = (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(url); - url = parseUrl(url).expand(parameters); - if (!/^http/.test(url)) { - url = options.baseUrl + url; - } - 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(","); + md.digest = function() { + var finalBlock = forge.util.createBuffer(); + finalBlock.putBytes(_input.bytes()); + var remaining = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize; + var overflow = remaining & md.blockLength - 1; + finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow)); + var next, carry; + var bits = md.fullMessageLength[0] * 8; + for (var i = 0; i < md.fullMessageLength.length - 1; ++i) { + next = md.fullMessageLength[i + 1] * 8; + carry = next / 4294967296 >>> 0; + bits += carry; + finalBlock.putInt32(bits >>> 0); + bits = next >>> 0; } - if (url.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(","); - } + finalBlock.putInt32(bits); + var h = new Array(_h.length); + for (var i = 0; i < _h.length; ++i) { + h[i] = _h[i].slice(0); } - } - if (["GET", "HEAD"].includes(method)) { - url = addQueryParameters(url, remainingParameters); - } else { - if ("data" in remainingParameters) { - body = remainingParameters.data; + _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 { - if (Object.keys(remainingParameters).length) { - body = remainingParameters; + 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]); } } - } - 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, headers }, - typeof body !== "undefined" ? { body } : null, - options.request ? { request: options.request } : null - ); - } - function endpointWithDefaults(defaults, route, options) { - return parse(merge2(defaults, route, options)); - } - function withDefaults(oldDefaults, newDefaults) { - const DEFAULTS2 = merge2(oldDefaults, newDefaults); - const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); - return Object.assign(endpoint2, { - DEFAULTS: DEFAULTS2, - defaults: withDefaults.bind(null, DEFAULTS2), - merge: merge2.bind(null, DEFAULTS2), - parse - }); - } - var endpoint = withDefaults(null, DEFAULTS); - } -}); - -// node_modules/@octokit/graphql/node_modules/@octokit/request-error/dist-node/index.js -var require_dist_node7 = __commonJS({ - "node_modules/@octokit/graphql/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; + return rval; + }; + return md; }; - 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_exports = {}; - __export2(dist_src_exports, { - RequestError: () => RequestError - }); - module2.exports = __toCommonJS2(dist_src_exports); - 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 RequestError = 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; + 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; } - const requestCopy = Object.assign({}, options.request); - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace( - /(?>> 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; } - requestCopy.url = requestCopy.url.replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]").replace(/\baccess_token=\w+/g, "access_token=[REDACTED]"); - this.request = requestCopy; - Object.defineProperty(this, "code", { - get() { - logOnceCode( - new import_deprecation.Deprecation( - "[@octokit/request-error] `error.code` is deprecated, use `error.status`." - ) - ); - return statusCode; - } - }); - Object.defineProperty(this, "headers", { - get() { - logOnceHeaders( - new import_deprecation.Deprecation( - "[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`." - ) - ); - return headers || {}; - } - }); + 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/@octokit/graphql/node_modules/@octokit/request/dist-node/index.js -var require_dist_node8 = __commonJS({ - "node_modules/@octokit/graphql/node_modules/@octokit/request/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 }); +// 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" + }] }; - 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; + 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' + }] + } */ + ] }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports = {}; - __export2(dist_src_exports, { - request: () => request - }); - module2.exports = __toCommonJS2(dist_src_exports); - var import_endpoint = require_dist_node6(); - var import_universal_user_agent = require_dist_node(); - var VERSION = "8.4.1"; - 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); - } - var import_request_error = require_dist_node7(); - function getBufferResponse(response) { - return response.arrayBuffer(); + } +}); + +// 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_random(); + require_sha512(); + require_util8(); + var asn1Validator = require_asn1_validator(); + var publicKeyValidator = asn1Validator.publicKeyValidator; + var privateKeyValidator = asn1Validator.privateKeyValidator; + if (typeof BigInteger === "undefined") { + BigInteger = forge.jsbn.BigInteger; } - function fetchWrapper(requestOptions) { - var _a, _b, _c, _d; - const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; - const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; - if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { - requestOptions.body = JSON.stringify(requestOptions.body); - } - let headers = {}; - let status; - let url; - 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) => { - url = 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}` : ""}` + 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." ); } - if (status === 204 || status === 205) { - return; - } - if (requestOptions.method === "HEAD") { - if (status < 400) { - return; - } - throw new import_request_error.RequestError(response.statusText, status, { - response: { - url, - status, - headers, - data: void 0 - }, - request: requestOptions - }); - } - if (status === 304) { - throw new import_request_error.RequestError("Not modified", status, { - response: { - url, - status, - headers, - data: await getResponseData(response) - }, - request: requestOptions - }); - } - if (status >= 400) { - const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { - response: { - url, - status, - headers, - data - }, - request: requestOptions - }); - throw error4; - } - return parseSuccessResponseBody ? await getResponseData(response) : response.body; - }).then((data) => { - return { - status, - url, - headers, - data - }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; - } - } - throw new import_request_error.RequestError(message, 500, { - request: requestOptions - }); - }); - } - async function getResponseData(response) { - const contentType = response.headers.get("content-type"); - if (/application\/json/.test(contentType)) { - return response.json().catch(() => response.text()).catch(() => ""); + } else if (!(seed instanceof Uint8Array)) { + throw new TypeError( + '"seed" must be a node.js Buffer, Uint8Array, or a binary string.' + ); } - if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { - return response.text(); + 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]; } - return getBufferResponse(response); - } - function toErrorMessage(data) { - if (typeof data === "string") - return data; - let suffix; - if ("documentation_url" in data) { - suffix = ` - ${data.documentation_url}`; - } else { - suffix = ""; + crypto_sign_keypair(pk, sk); + return { publicKey: pk, privateKey: sk }; + }; + ed25519.privateKeyFromAsn1 = function(obj) { + var capture = {}; + var errors = []; + var valid2 = forge.asn1.validate(obj, privateKeyValidator, capture, errors); + if (!valid2) { + var error3 = new Error("Invalid Key."); + error3.errors = errors; + throw error3; } - if ("message" in data) { - if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; - } - return `${data.message}${suffix}`; + 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 + '".'); } - return `Unknown error: ${JSON.stringify(data)}`; - } - function withDefaults(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 request2 = (route2, parameters2) => { - return fetchWrapper( - endpoint2.parse(endpoint2.merge(route2, parameters2)) - ); - }; - Object.assign(request2, { - endpoint: endpoint2, - defaults: withDefaults.bind(null, endpoint2) - }); - return endpointOptions.request.hook(request2, endpointOptions); - }; - return Object.assign(newApi, { - endpoint: endpoint2, - defaults: withDefaults.bind(null, endpoint2) + var privateKey = capture.privateKey; + var privateKeyBytes = messageToNativeBuffer({ + message: forge.asn1.fromDer(privateKey).value, + encoding: "binary" }); - } - var request = withDefaults(import_endpoint.endpoint, { - headers: { - "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` - } - }); - } -}); - -// node_modules/@octokit/graphql/dist-node/index.js -var require_dist_node9 = __commonJS({ - "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 }); + return { privateKeyBytes }; }; - 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 }); + ed25519.publicKeyFromAsn1 = function(obj) { + var capture = {}; + var errors = []; + var valid2 = forge.asn1.validate(obj, publicKeyValidator, capture, errors); + if (!valid2) { + var error3 = new Error("Invalid Key."); + error3.errors = errors; + throw error3; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var index_exports = {}; - __export2(index_exports, { - GraphqlResponseError: () => GraphqlResponseError, - graphql: () => graphql2, - withCustomRequest: () => withCustomRequest - }); - module2.exports = __toCommonJS2(index_exports); - var import_request3 = require_dist_node8(); - var import_universal_user_agent = require_dist_node(); - var VERSION = "7.1.1"; - var import_request2 = require_dist_node8(); - var import_request = require_dist_node8(); - function _buildMessageForResponseErrors(data) { - return `Request failed due to following response errors: -` + data.errors.map((e) => ` - ${e.message}`).join("\n"); - } - var GraphqlResponseError = class extends Error { - constructor(request2, headers, response) { - super(_buildMessageForResponseErrors(response)); - this.request = request2; - 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 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" + }); }; - var NON_VARIABLE_OPTIONS = [ - "method", - "baseUrl", - "url", - "headers", - "request", - "query", - "mediaType" - ]; - var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; - var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; - function graphql(request2, 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` - ) - ); - } + 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 + ); } - 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 || request2.endpoint.DEFAULTS.baseUrl; - if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { - requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); + var pk = new NativeBuffer(ed25519.constants.PUBLIC_KEY_BYTE_LENGTH); + for (var i = 0; i < pk.length; ++i) { + pk[i] = privateKey[32 + i]; } - return request2(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; + return pk; + }; + ed25519.sign = function(options) { + options = options || {}; + var msg = messageToNativeBuffer(options); + var privateKey = messageToNativeBuffer({ + message: options.privateKey, + encoding: "binary" }); - } - function withDefaults(request2, newDefaults) { - const newRequest = request2.defaults(newDefaults); - const newApi = (query, options) => { - return graphql(newRequest, query, options); - }; - return Object.assign(newApi, { - defaults: withDefaults.bind(null, newRequest), - endpoint: newRequest.endpoint + 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" }); - } - var graphql2 = withDefaults(import_request3.request, { - headers: { - "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` - }, - method: "POST", - url: "/graphql" - }); - function withCustomRequest(customRequest) { - return withDefaults(customRequest, { - method: "POST", - url: "/graphql" + 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" }); - } - } -}); - -// node_modules/@octokit/auth-token/dist-node/index.js -var require_dist_node10 = __commonJS({ - "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 }); + 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 + ); } - return to; + 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; }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports = {}; - __export2(dist_src_exports, { - createTokenAuth: () => createTokenAuth - }); - module2.exports = __toCommonJS2(dist_src_exports); - var REGEX_IS_INSTALLATION_LEGACY = /^v1\./; - var REGEX_IS_INSTALLATION = /^ghs_/; - var REGEX_IS_USER_TO_SERVER = /^ghu_/; - async function auth(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 withAuthorizationPrefix(token) { - if (token.split(/\./).length === 3) { - return `bearer ${token}`; + function messageToNativeBuffer(options) { + var message = options.message; + if (message instanceof Uint8Array || message instanceof NativeBuffer) { + return message; } - return `token ${token}`; + 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; } - async function hook(token, request, route, parameters) { - const endpoint = request.endpoint.merge( - route, - parameters - ); - endpoint.headers.authorization = withAuthorizationPrefix(token); - return request(endpoint); + 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 md = forge.md.sha512.create(); + var buffer = new ByteBuffer(msg); + md.update(buffer.getBytes(msgLen), "binary"); + var hash = md.digest().getBytes(); + if (typeof Buffer !== "undefined") { + return Buffer.from(hash, "binary"); + } + var out = new NativeBuffer(ed25519.constants.HASH_BYTE_LENGTH); + for (var i = 0; i < 64; ++i) { + out[i] = hash.charCodeAt(i); + } + return out; } - var createTokenAuth = function createTokenAuth2(token) { - if (!token) { - throw new Error("[@octokit/auth-token] No token passed to createTokenAuth"); + 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]; } - if (typeof token !== "string") { - throw new Error( - "[@octokit/auth-token] Token passed to createTokenAuth is not a string" - ); + 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]; } - token = token.replace(/^(token|bearer) +/i, ""); - return Object.assign(auth.bind(null, token), { - hook: hook.bind(null, token) - }); - }; - } -}); - -// node_modules/@octokit/core/dist-node/index.js -var require_dist_node11 = __commonJS({ - "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 }); + for (i = 0; i < 32; ++i) { + sm[32 + i] = d[32 + i]; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var index_exports = {}; - __export2(index_exports, { - Octokit: () => Octokit - }); - module2.exports = __toCommonJS2(index_exports); - var import_universal_user_agent = require_dist_node(); - var import_before_after_hook = require_before_after_hook(); - var import_request = require_dist_node5(); - var import_graphql = require_dist_node9(); - var import_auth_token = require_dist_node10(); - var VERSION = "5.2.2"; - var noop = () => { - }; - var consoleWarn = console.warn.bind(console); - var consoleError = console.error.bind(console); - function createLogger(logger = {}) { - if (typeof logger.debug !== "function") { - logger.debug = noop; + 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]; } - if (typeof logger.info !== "function") { - logger.info = noop; + var h = sha512(sm, n + 64); + reduce(h); + for (i = 32; i < 64; ++i) { + x[i] = 0; } - if (typeof logger.warn !== "function") { - logger.warn = consoleWarn; + for (i = 0; i < 32; ++i) { + x[i] = r[i]; } - if (typeof logger.error !== "function") { - logger.error = consoleError; + for (i = 0; i < 32; ++i) { + for (j = 0; j < 32; j++) { + x[i + j] += h[i] * d[j]; + } } - return logger; + modL(sm.subarray(32), x); + return smlen; } - var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; - var Octokit = class { - static { - this.VERSION = VERSION; + 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; } - static defaults(defaults) { - const OctokitWithDefaults = class extends this { - constructor(...args) { - const options = args[0] || {}; - if (typeof defaults === "function") { - super(defaults(options)); - return; - } - super( - Object.assign( - {}, - defaults, - options, - options.userAgent && defaults.userAgent ? { - userAgent: `${options.userAgent} ${defaults.userAgent}` - } : null - ) - ); - } - }; - return OctokitWithDefaults; + if (unpackneg(q, pk)) { + return -1; } - static { - this.plugins = []; + for (i = 0; i < n; ++i) { + m[i] = sm[i]; } - /** - * 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; + for (i = 0; i < 32; ++i) { + m[i + 32] = pk[i]; } - constructor(options = {}) { - const hook = new import_before_after_hook.Collection(); - const requestDefaults = { - baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl, - headers: {}, - request: Object.assign({}, options.request, { - // @ts-ignore internal usage only, no need to type - hook: hook.bind(null, "request") - }), - mediaType: { - previews: [], - format: "" - } - }; - requestDefaults.headers["user-agent"] = options.userAgent ? `${options.userAgent} ${userAgentTrail}` : userAgentTrail; - if (options.baseUrl) { - requestDefaults.baseUrl = options.baseUrl; + var h = sha512(m, n); + reduce(h); + scalarmult(p, q, h); + scalarbase(q, sm.subarray(32)); + add(p, q); + pack(t, p); + n -= 64; + if (crypto_verify_32(sm, 0, t, 0)) { + for (i = 0; i < n; ++i) { + m[i] = 0; } - if (options.previews) { - requestDefaults.mediaType.previews = options.previews; + return -1; + } + for (i = 0; i < n; ++i) { + m[i] = sm[i + 64]; + } + mlen = n; + return mlen; + } + 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; } - if (options.timeZone) { - requestDefaults.headers["time-zone"] = options.timeZone; + 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 add(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; } - this.request = import_request.request.defaults(requestDefaults); - this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults); - this.log = createLogger(options.log); - this.hook = hook; - if (!options.authStrategy) { - if (!options.auth) { - this.auth = async () => ({ - type: "unauthenticated" - }); - } else { - const auth = (0, import_auth_token.createTokenAuth)(options.auth); - hook.wrap("request", auth.hook); - this.auth = auth; - } - } else { - const { authStrategy, ...otherOptions } = options; - const auth = 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 - ) - ); - hook.wrap("request", auth.hook); - this.auth = auth; + 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); } - const classConstructor = this.constructor; - for (let i = 0; i < classConstructor.plugins.length; ++i) { - Object.assign(this, classConstructor.plugins[i](this, options)); + } + 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); + add(q, p); + add(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); } } - }; - } -}); - -// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js -var require_dist_node12 = __commonJS({ - "node_modules/@actions/github/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 }); + for (a = 0; a < 16; ++a) { + o[a] = c[a]; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports = {}; - __export2(dist_src_exports, { - legacyRestEndpointMethods: () => legacyRestEndpointMethods, - restEndpointMethods: () => restEndpointMethods - }); - module2.exports = __toCommonJS2(dist_src_exports); - var VERSION = "10.4.1"; - var Endpoints = { - 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" - ], + } + 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(init) { + var i, r = new Float64Array(16); + if (init) { + for (i = 0; i < init.length; ++i) { + r[i] = init[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_util8(); + require_random(); + 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(md, digestLength) { + _createKDF(this, md, 0, digestLength || md.digestLength); + }; + forge.kem.kdf2 = function(md, digestLength) { + _createKDF(this, md, 1, digestLength || md.digestLength); + }; + function _createKDF(kdf, md, 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); + md.start(); + md.update(x + c.getBytes()); + var hash = md.digest(); + key.putBytes(hash.getBytes(digestLength)); + } + key.truncate(key.length() - length); + return key.getBytes(); + }; + } + } +}); + +// node_modules/node-forge/lib/log.js +var require_log = __commonJS({ + "node_modules/node-forge/lib/log.js"(exports2, module2) { + var forge = require_forge(); + require_util8(); + 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 handler = levelHandlers[message.level]; + var args = [message.standard]; + args = args.concat(message["arguments"].slice()); + handler.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_sha256(); + 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_random(); + require_util8(); + 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 match = true; + for (var j = 0; j < sAttr.length; ++j) { + if (rAttr[j].type !== sAttr[j].type || rAttr[j].value !== sAttr[j].value) { + match = false; + break; + } + } + if (match) { + 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 timestamp2 = Date.parse(date); + if (!isNaN(timestamp2)) { + date = new Date(timestamp2); + } 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_util8(); + 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 type2 = "ssh-rsa"; + comment = comment || ""; + var buffer = forge.util.createBuffer(); + _addStringToBuffer(buffer, type2); + _addBigIntegerToBuffer(buffer, key.e); + _addBigIntegerToBuffer(buffer, key.n); + return type2 + " " + 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 md = options.md || forge.md.md5.create(); + var type2 = "ssh-rsa"; + var buffer = forge.util.createBuffer(); + _addStringToBuffer(buffer, type2); + _addBigIntegerToBuffer(buffer, key.e); + _addBigIntegerToBuffer(buffer, key.n); + md.start(); + md.update(buffer.getBytes()); + var digest = md.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_lib3 = __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_log(); + require_md_all(); + require_mgf1(); + require_pbkdf2(); + require_pem(); + require_pkcs1(); + require_pkcs12(); + require_pkcs7(); + require_pki(); + require_prime(); + require_prng(); + require_pss(); + require_random(); + require_rc2(); + require_ssh(); + require_tls(); + require_util8(); + } +}); + +// 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 _a, _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 path2 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path2} 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 = (_a = process.env.GITHUB_API_URL) !== null && _a !== void 0 ? _a : `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/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "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 (_a) { + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; + } +}); + +// node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 https = __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((resolve2) => __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", () => { + resolve2(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + })); + }); + } + }; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; + } + exports2.isHttps = isHttps; + var HttpClient = class { + constructor(userAgent, 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 = userAgent; + 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, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve2(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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 info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); + } + } + return info6; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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 https.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((resolve2) => setTimeout(() => resolve2(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve2(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 { + resolve2(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/github/lib/internal/utils.js +var require_utils4 = __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 || 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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = (url, opts) => __awaiter2(this, void 0, void 0, function* () { + return (0, undici_1.fetch)(url, 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 getUserAgent() { + if (typeof navigator === "object" && "userAgent" in navigator) { + return navigator.userAgent; + } + if (typeof process === "object" && "version" in process) { + return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`; + } + return ""; + } + exports2.getUserAgent = getUserAgent; + } +}); + +// node_modules/before-after-hook/lib/register.js +var require_register = __commonJS({ + "node_modules/before-after-hook/lib/register.js"(exports2, module2) { + module2.exports = register; + 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(function(callback, name2) { + return register.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/before-after-hook/lib/add.js +var require_add = __commonJS({ + "node_modules/before-after-hook/lib/add.js"(exports2, module2) { + module2.exports = addHook; + function addHook(state, kind, name, hook) { + var orig = hook; + if (!state.registry[name]) { + state.registry[name] = []; + } + if (kind === "before") { + hook = function(method, options) { + return Promise.resolve().then(orig.bind(null, options)).then(method.bind(null, options)); + }; + } + if (kind === "after") { + hook = 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") { + hook = function(method, options) { + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); + }); + }; + } + state.registry[name].push({ + hook, + orig + }); + } + } +}); + +// node_modules/before-after-hook/lib/remove.js +var require_remove = __commonJS({ + "node_modules/before-after-hook/lib/remove.js"(exports2, module2) { + module2.exports = removeHook; + function removeHook(state, name, method) { + if (!state.registry[name]) { + return; + } + var index = state.registry[name].map(function(registered) { + return registered.orig; + }).indexOf(method); + if (index === -1) { + return; + } + state.registry[name].splice(index, 1); + } + } +}); + +// node_modules/before-after-hook/index.js +var require_before_after_hook = __commonJS({ + "node_modules/before-after-hook/index.js"(exports2, module2) { + var register = require_register(); + var addHook = require_add(); + var removeHook = require_remove(); + var bind = Function.bind; + var bindable = bind.bind(bind); + function bindApi(hook, state, name) { + var removeHookRef = bindable(removeHook, null).apply( + null, + name ? [state, name] : [state] + ); + hook.api = { remove: removeHookRef }; + hook.remove = removeHookRef; + ["before", "error", "after", "wrap"].forEach(function(kind) { + var args = name ? [state, kind, name] : [state, kind]; + hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args); + }); + } + function HookSingular() { + var singularHookName = "h"; + var singularHookState = { + registry: {} + }; + var singularHook = register.bind(null, singularHookState, singularHookName); + bindApi(singularHook, singularHookState, singularHookName); + return singularHook; + } + function HookCollection() { + var state = { + registry: {} + }; + var hook = register.bind(null, state); + bindApi(hook, state); + return hook; + } + 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/@octokit/core/node_modules/@octokit/endpoint/dist-node/index.js +var require_dist_node2 = __commonJS({ + "node_modules/@octokit/core/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_exports = {}; + __export2(dist_src_exports, { + endpoint: () => endpoint + }); + module2.exports = __toCommonJS2(dist_src_exports); + var import_universal_user_agent = require_dist_node(); + var VERSION = "9.0.6"; + var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; + var DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent + }, + mediaType: { + format: "" + } + }; + function lowercaseKeys(object) { + if (!object) { + return {}; + } + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[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(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach((key) => { + if (isPlainObject(options[key])) { + if (!(key in defaults)) + Object.assign(result, { [key]: options[key] }); + else + result[key] = mergeDeep(defaults[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 merge2(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { method, url } : { url: method }, options); + } else { + options = Object.assign({}, route); + } + options.headers = lowercaseKeys(options.headers); + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); + if (options.url === "/graphql") { + if (defaults && defaults.mediaType.previews?.length) { + mergedOptions.mediaType.previews = defaults.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(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); + if (names.length === 0) { + return url; + } + return url + separator + names.map((name) => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); + } + var urlVariableRegex = /\{[^{}}]+\}/g; + function removeNonChars(variableName) { + return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []); + } + function omit(object, keysToOmit) { + const result = { __proto__: null }; + for (const key of Object.keys(object)) { + if (keysToOmit.indexOf(key) === -1) { + result[key] = object[key]; + } + } + return result; + } + function encodeReserved(str2) { + return str2.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(str2) { + return encodeURIComponent(str2).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 isDefined2(value) { + return value !== void 0 && value !== null; + } + function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; + } + function getValues(context2, operator, key, modifier) { + var value = context2[key], result = []; + if (isDefined2(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( + encodeValue(operator, value, isKeyOperator(operator) ? key : "") + ); + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined2).forEach(function(value2) { + result.push( + encodeValue(operator, value2, isKeyOperator(operator) ? key : "") + ); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined2(value[k])) { + result.push(encodeValue(operator, value[k], k)); + } + }); + } + } else { + const tmp = []; + if (Array.isArray(value)) { + value.filter(isDefined2).forEach(function(value2) { + tmp.push(encodeValue(operator, value2)); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined2(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 (isDefined2(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, context2) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + template = template.replace( + /\{([^\{\}]+)\}|([^\{\}]+)/g, + function(_, 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(context2, 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 url = (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(url); + url = parseUrl(url).expand(parameters); + if (!/^http/.test(url)) { + url = options.baseUrl + url; + } + 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 (url.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)) { + url = addQueryParameters(url, 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, headers }, + typeof body !== "undefined" ? { body } : null, + options.request ? { request: options.request } : null + ); + } + function endpointWithDefaults(defaults, route, options) { + return parse(merge2(defaults, route, options)); + } + function withDefaults(oldDefaults, newDefaults) { + const DEFAULTS2 = merge2(oldDefaults, newDefaults); + const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); + return Object.assign(endpoint2, { + DEFAULTS: DEFAULTS2, + defaults: withDefaults.bind(null, DEFAULTS2), + merge: merge2.bind(null, DEFAULTS2), + parse + }); + } + var endpoint = withDefaults(null, DEFAULTS); + } +}); + +// 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/@octokit/core/node_modules/@octokit/request-error/dist-node/index.js +var require_dist_node4 = __commonJS({ + "node_modules/@octokit/core/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_exports = {}; + __export2(dist_src_exports, { + RequestError: () => RequestError + }); + module2.exports = __toCommonJS2(dist_src_exports); + 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 RequestError = 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_exports = {}; + __export2(dist_src_exports, { + request: () => request + }); + module2.exports = __toCommonJS2(dist_src_exports); + var import_endpoint = require_dist_node2(); + var import_universal_user_agent = require_dist_node(); + var VERSION = "8.4.1"; + 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); + } + var import_request_error = require_dist_node4(); + function getBufferResponse(response) { + return response.arrayBuffer(); + } + function fetchWrapper(requestOptions) { + var _a, _b, _c, _d; + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; + if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); + } + let headers = {}; + let status; + let url; + 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) => { + url = 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_error.RequestError(response.statusText, status, { + response: { + url, + status, + headers, + data: void 0 + }, + request: requestOptions + }); + } + if (status === 304) { + throw new import_request_error.RequestError("Not modified", status, { + response: { + url, + status, + headers, + data: await getResponseData(response) + }, + request: requestOptions + }); + } + if (status >= 400) { + const data = await getResponseData(response); + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { + response: { + url, + status, + headers, + data + }, + request: requestOptions + }); + throw error3; + } + return parseSuccessResponseBody ? await getResponseData(response) : response.body; + }).then((data) => { + return { + status, + url, + headers, + data + }; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { + request: requestOptions + }); + }); + } + async function getResponseData(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 toErrorMessage(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 withDefaults(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 request2 = (route2, parameters2) => { + return fetchWrapper( + endpoint2.parse(endpoint2.merge(route2, parameters2)) + ); + }; + Object.assign(request2, { + endpoint: endpoint2, + defaults: withDefaults.bind(null, endpoint2) + }); + return endpointOptions.request.hook(request2, endpointOptions); + }; + return Object.assign(newApi, { + endpoint: endpoint2, + defaults: withDefaults.bind(null, endpoint2) + }); + } + var request = withDefaults(import_endpoint.endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` + } + }); + } +}); + +// node_modules/@octokit/graphql/node_modules/@octokit/endpoint/dist-node/index.js +var require_dist_node6 = __commonJS({ + "node_modules/@octokit/graphql/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_exports = {}; + __export2(dist_src_exports, { + endpoint: () => endpoint + }); + module2.exports = __toCommonJS2(dist_src_exports); + var import_universal_user_agent = require_dist_node(); + var VERSION = "9.0.6"; + var userAgent = `octokit-endpoint.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; + var DEFAULTS = { + method: "GET", + baseUrl: "https://api.github.com", + headers: { + accept: "application/vnd.github.v3+json", + "user-agent": userAgent + }, + mediaType: { + format: "" + } + }; + function lowercaseKeys(object) { + if (!object) { + return {}; + } + return Object.keys(object).reduce((newObj, key) => { + newObj[key.toLowerCase()] = object[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(defaults, options) { + const result = Object.assign({}, defaults); + Object.keys(options).forEach((key) => { + if (isPlainObject(options[key])) { + if (!(key in defaults)) + Object.assign(result, { [key]: options[key] }); + else + result[key] = mergeDeep(defaults[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 merge2(defaults, route, options) { + if (typeof route === "string") { + let [method, url] = route.split(" "); + options = Object.assign(url ? { method, url } : { url: method }, options); + } else { + options = Object.assign({}, route); + } + options.headers = lowercaseKeys(options.headers); + removeUndefinedProperties(options); + removeUndefinedProperties(options.headers); + const mergedOptions = mergeDeep(defaults || {}, options); + if (options.url === "/graphql") { + if (defaults && defaults.mediaType.previews?.length) { + mergedOptions.mediaType.previews = defaults.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(url, parameters) { + const separator = /\?/.test(url) ? "&" : "?"; + const names = Object.keys(parameters); + if (names.length === 0) { + return url; + } + return url + separator + names.map((name) => { + if (name === "q") { + return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+"); + } + return `${name}=${encodeURIComponent(parameters[name])}`; + }).join("&"); + } + var urlVariableRegex = /\{[^{}}]+\}/g; + function removeNonChars(variableName) { + return variableName.replace(/(?:^\W+)|(?:(? a.concat(b), []); + } + function omit(object, keysToOmit) { + const result = { __proto__: null }; + for (const key of Object.keys(object)) { + if (keysToOmit.indexOf(key) === -1) { + result[key] = object[key]; + } + } + return result; + } + function encodeReserved(str2) { + return str2.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(str2) { + return encodeURIComponent(str2).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 isDefined2(value) { + return value !== void 0 && value !== null; + } + function isKeyOperator(operator) { + return operator === ";" || operator === "&" || operator === "?"; + } + function getValues(context2, operator, key, modifier) { + var value = context2[key], result = []; + if (isDefined2(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( + encodeValue(operator, value, isKeyOperator(operator) ? key : "") + ); + } else { + if (modifier === "*") { + if (Array.isArray(value)) { + value.filter(isDefined2).forEach(function(value2) { + result.push( + encodeValue(operator, value2, isKeyOperator(operator) ? key : "") + ); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined2(value[k])) { + result.push(encodeValue(operator, value[k], k)); + } + }); + } + } else { + const tmp = []; + if (Array.isArray(value)) { + value.filter(isDefined2).forEach(function(value2) { + tmp.push(encodeValue(operator, value2)); + }); + } else { + Object.keys(value).forEach(function(k) { + if (isDefined2(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 (isDefined2(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, context2) { + var operators = ["+", "#", ".", "/", ";", "?", "&"]; + template = template.replace( + /\{([^\{\}]+)\}|([^\{\}]+)/g, + function(_, 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(context2, 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 url = (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(url); + url = parseUrl(url).expand(parameters); + if (!/^http/.test(url)) { + url = options.baseUrl + url; + } + 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 (url.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)) { + url = addQueryParameters(url, 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, headers }, + typeof body !== "undefined" ? { body } : null, + options.request ? { request: options.request } : null + ); + } + function endpointWithDefaults(defaults, route, options) { + return parse(merge2(defaults, route, options)); + } + function withDefaults(oldDefaults, newDefaults) { + const DEFAULTS2 = merge2(oldDefaults, newDefaults); + const endpoint2 = endpointWithDefaults.bind(null, DEFAULTS2); + return Object.assign(endpoint2, { + DEFAULTS: DEFAULTS2, + defaults: withDefaults.bind(null, DEFAULTS2), + merge: merge2.bind(null, DEFAULTS2), + parse + }); + } + var endpoint = withDefaults(null, DEFAULTS); + } +}); + +// node_modules/@octokit/graphql/node_modules/@octokit/request-error/dist-node/index.js +var require_dist_node7 = __commonJS({ + "node_modules/@octokit/graphql/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_exports = {}; + __export2(dist_src_exports, { + RequestError: () => RequestError + }); + module2.exports = __toCommonJS2(dist_src_exports); + 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 RequestError = 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_exports = {}; + __export2(dist_src_exports, { + request: () => request + }); + module2.exports = __toCommonJS2(dist_src_exports); + var import_endpoint = require_dist_node6(); + var import_universal_user_agent = require_dist_node(); + var VERSION = "8.4.1"; + 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); + } + var import_request_error = require_dist_node7(); + function getBufferResponse(response) { + return response.arrayBuffer(); + } + function fetchWrapper(requestOptions) { + var _a, _b, _c, _d; + const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console; + const parseSuccessResponseBody = ((_a = requestOptions.request) == null ? void 0 : _a.parseSuccessResponseBody) !== false; + if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) { + requestOptions.body = JSON.stringify(requestOptions.body); + } + let headers = {}; + let status; + let url; + 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) => { + url = 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_error.RequestError(response.statusText, status, { + response: { + url, + status, + headers, + data: void 0 + }, + request: requestOptions + }); + } + if (status === 304) { + throw new import_request_error.RequestError("Not modified", status, { + response: { + url, + status, + headers, + data: await getResponseData(response) + }, + request: requestOptions + }); + } + if (status >= 400) { + const data = await getResponseData(response); + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { + response: { + url, + status, + headers, + data + }, + request: requestOptions + }); + throw error3; + } + return parseSuccessResponseBody ? await getResponseData(response) : response.body; + }).then((data) => { + return { + status, + url, + headers, + data + }; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { + request: requestOptions + }); + }); + } + async function getResponseData(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 toErrorMessage(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 withDefaults(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 request2 = (route2, parameters2) => { + return fetchWrapper( + endpoint2.parse(endpoint2.merge(route2, parameters2)) + ); + }; + Object.assign(request2, { + endpoint: endpoint2, + defaults: withDefaults.bind(null, endpoint2) + }); + return endpointOptions.request.hook(request2, endpointOptions); + }; + return Object.assign(newApi, { + endpoint: endpoint2, + defaults: withDefaults.bind(null, endpoint2) + }); + } + var request = withDefaults(import_endpoint.endpoint, { + headers: { + "user-agent": `octokit-request.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` + } + }); + } +}); + +// node_modules/@octokit/graphql/dist-node/index.js +var require_dist_node9 = __commonJS({ + "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: () => GraphqlResponseError, + graphql: () => graphql2, + withCustomRequest: () => withCustomRequest + }); + module2.exports = __toCommonJS2(index_exports); + var import_request3 = require_dist_node8(); + var import_universal_user_agent = require_dist_node(); + var VERSION = "7.1.1"; + var import_request2 = require_dist_node8(); + var import_request = require_dist_node8(); + function _buildMessageForResponseErrors(data) { + return `Request failed due to following response errors: +` + data.errors.map((e) => ` - ${e.message}`).join("\n"); + } + var GraphqlResponseError = class extends Error { + constructor(request2, headers, response) { + super(_buildMessageForResponseErrors(response)); + this.request = request2; + 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_OPTIONS = [ + "method", + "baseUrl", + "url", + "headers", + "request", + "query", + "mediaType" + ]; + var FORBIDDEN_VARIABLE_OPTIONS = ["query", "method", "url"]; + var GHES_V3_SUFFIX_REGEX = /\/api\/v3\/?$/; + function graphql(request2, 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 || request2.endpoint.DEFAULTS.baseUrl; + if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) { + requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, "/api/graphql"); + } + return request2(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 withDefaults(request2, newDefaults) { + const newRequest = request2.defaults(newDefaults); + const newApi = (query, options) => { + return graphql(newRequest, query, options); + }; + return Object.assign(newApi, { + defaults: withDefaults.bind(null, newRequest), + endpoint: newRequest.endpoint + }); + } + var graphql2 = withDefaults(import_request3.request, { + headers: { + "user-agent": `octokit-graphql.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}` + }, + method: "POST", + url: "/graphql" + }); + function withCustomRequest(customRequest) { + return withDefaults(customRequest, { + method: "POST", + url: "/graphql" + }); + } + } +}); + +// node_modules/@octokit/auth-token/dist-node/index.js +var require_dist_node10 = __commonJS({ + "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_exports = {}; + __export2(dist_src_exports, { + createTokenAuth: () => createTokenAuth + }); + module2.exports = __toCommonJS2(dist_src_exports); + var REGEX_IS_INSTALLATION_LEGACY = /^v1\./; + var REGEX_IS_INSTALLATION = /^ghs_/; + var REGEX_IS_USER_TO_SERVER = /^ghu_/; + async function auth(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 withAuthorizationPrefix(token) { + if (token.split(/\./).length === 3) { + return `bearer ${token}`; + } + return `token ${token}`; + } + async function hook(token, request, route, parameters) { + const endpoint = request.endpoint.merge( + route, + parameters + ); + endpoint.headers.authorization = withAuthorizationPrefix(token); + return request(endpoint); + } + var 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-node/index.js +var require_dist_node11 = __commonJS({ + "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: () => Octokit + }); + module2.exports = __toCommonJS2(index_exports); + var import_universal_user_agent = require_dist_node(); + var import_before_after_hook = require_before_after_hook(); + var import_request = require_dist_node5(); + var import_graphql = require_dist_node9(); + var import_auth_token = require_dist_node10(); + var VERSION = "5.2.2"; + var noop = () => { + }; + var consoleWarn = console.warn.bind(console); + var consoleError = console.error.bind(console); + function createLogger(logger = {}) { + if (typeof logger.debug !== "function") { + logger.debug = noop; + } + if (typeof logger.info !== "function") { + logger.info = noop; + } + if (typeof logger.warn !== "function") { + logger.warn = consoleWarn; + } + if (typeof logger.error !== "function") { + logger.error = consoleError; + } + return logger; + } + var userAgentTrail = `octokit-core.js/${VERSION} ${(0, import_universal_user_agent.getUserAgent)()}`; + var Octokit = class { + static { + this.VERSION = VERSION; + } + static defaults(defaults) { + const OctokitWithDefaults = class extends this { + constructor(...args) { + const options = args[0] || {}; + if (typeof defaults === "function") { + super(defaults(options)); + return; + } + super( + Object.assign( + {}, + defaults, + options, + options.userAgent && defaults.userAgent ? { + userAgent: `${options.userAgent} ${defaults.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 hook = new import_before_after_hook.Collection(); + const requestDefaults = { + baseUrl: import_request.request.endpoint.DEFAULTS.baseUrl, + headers: {}, + request: Object.assign({}, options.request, { + // @ts-ignore internal usage only, no need to type + hook: hook.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 = import_request.request.defaults(requestDefaults); + this.graphql = (0, import_graphql.withCustomRequest)(this.request).defaults(requestDefaults); + this.log = createLogger(options.log); + this.hook = hook; + if (!options.authStrategy) { + if (!options.auth) { + this.auth = async () => ({ + type: "unauthenticated" + }); + } else { + const auth = (0, import_auth_token.createTokenAuth)(options.auth); + hook.wrap("request", auth.hook); + this.auth = auth; + } + } else { + const { authStrategy, ...otherOptions } = options; + const auth = 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 + ) + ); + hook.wrap("request", auth.hook); + this.auth = auth; + } + const classConstructor = this.constructor; + for (let i = 0; i < classConstructor.plugins.length; ++i) { + Object.assign(this, classConstructor.plugins[i](this, options)); + } + } + }; + } +}); + +// node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-node/index.js +var require_dist_node12 = __commonJS({ + "node_modules/@actions/github/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_exports = {}; + __export2(dist_src_exports, { + legacyRestEndpointMethods: () => legacyRestEndpointMethods, + restEndpointMethods: () => restEndpointMethods + }); + module2.exports = __toCommonJS2(dist_src_exports); + var VERSION = "10.4.1"; + var Endpoints = { + 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" ], @@ -45848,941 +47724,3943 @@ var require_dist_node12 = __commonJS({ listPullRequestsAssociatedWithCommit: [ "GET /repos/{owner}/{repo}/commits/{commit_sha}/pulls" ], - listReleaseAssets: [ - "GET /repos/{owner}/{repo}/releases/{release_id}/assets" + 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}" ], - 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" + updateDiscussionCommentInOrg: [ + "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}" ], - 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" + updateDiscussionInOrg: [ + "PATCH /orgs/{org}/teams/{team_slug}/discussions/{discussion_number}" ], - removeAppAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", + updateInOrg: ["PATCH /orgs/{org}/teams/{team_slug}"] + }, + users: { + addEmailForAuthenticated: [ + "POST /user/emails", {}, - { mapToData: "apps" } + { renamed: ["users", "addEmailForAuthenticatedUser"] } ], - removeCollaborator: [ - "DELETE /repos/{owner}/{repo}/collaborators/{username}" + 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"] } ], - removeStatusCheckContexts: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", + createGpgKeyForAuthenticatedUser: ["POST /user/gpg_keys"], + createPublicSshKeyForAuthenticated: [ + "POST /user/keys", {}, - { mapToData: "contexts" } + { renamed: ["users", "createPublicSshKeyForAuthenticatedUser"] } ], - removeStatusCheckProtection: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" + createPublicSshKeyForAuthenticatedUser: ["POST /user/keys"], + createSshSigningKeyForAuthenticatedUser: ["POST /user/ssh_signing_keys"], + deleteEmailForAuthenticated: [ + "DELETE /user/emails", + {}, + { renamed: ["users", "deleteEmailForAuthenticatedUser"] } ], - removeTeamAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", + deleteEmailForAuthenticatedUser: ["DELETE /user/emails"], + deleteGpgKeyForAuthenticated: [ + "DELETE /user/gpg_keys/{gpg_key_id}", {}, - { mapToData: "teams" } + { renamed: ["users", "deleteGpgKeyForAuthenticatedUser"] } ], - removeUserAccessRestrictions: [ - "DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", + deleteGpgKeyForAuthenticatedUser: ["DELETE /user/gpg_keys/{gpg_key_id}"], + deletePublicSshKeyForAuthenticated: [ + "DELETE /user/keys/{key_id}", {}, - { mapToData: "users" } + { renamed: ["users", "deletePublicSshKeyForAuthenticatedUser"] } ], - 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" + deletePublicSshKeyForAuthenticatedUser: ["DELETE /user/keys/{key_id}"], + deleteSocialAccountForAuthenticatedUser: ["DELETE /user/social_accounts"], + deleteSshSigningKeyForAuthenticatedUser: [ + "DELETE /user/ssh_signing_keys/{ssh_signing_key_id}" ], - setAppAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps", + 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}", {}, - { mapToData: "apps" } + { renamed: ["users", "getGpgKeyForAuthenticatedUser"] } ], - setStatusCheckContexts: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts", + getGpgKeyForAuthenticatedUser: ["GET /user/gpg_keys/{gpg_key_id}"], + getPublicSshKeyForAuthenticated: [ + "GET /user/keys/{key_id}", {}, - { mapToData: "contexts" } + { renamed: ["users", "getPublicSshKeyForAuthenticatedUser"] } ], - setTeamAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams", - {}, - { mapToData: "teams" } + getPublicSshKeyForAuthenticatedUser: ["GET /user/keys/{key_id}"], + getSshSigningKeyForAuthenticatedUser: [ + "GET /user/ssh_signing_keys/{ssh_signing_key_id}" ], - setUserAccessRestrictions: [ - "PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users", + list: ["GET /users"], + listBlockedByAuthenticated: [ + "GET /user/blocks", {}, - { 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" + { renamed: ["users", "listBlockedByAuthenticatedUser"] } ], - updateCommitComment: ["PATCH /repos/{owner}/{repo}/comments/{comment_id}"], - updateDeploymentBranchPolicy: [ - "PUT /repos/{owner}/{repo}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}" + listBlockedByAuthenticatedUser: ["GET /user/blocks"], + listEmailsForAuthenticated: [ + "GET /user/emails", + {}, + { renamed: ["users", "listEmailsForAuthenticatedUser"] } ], - updateInformationAboutPagesSite: ["PUT /repos/{owner}/{repo}/pages"], - updateInvitation: [ - "PATCH /repos/{owner}/{repo}/invitations/{invitation_id}" + listEmailsForAuthenticatedUser: ["GET /user/emails"], + listFollowedByAuthenticated: [ + "GET /user/following", + {}, + { renamed: ["users", "listFollowedByAuthenticatedUser"] } ], - updateOrgRuleset: ["PUT /orgs/{org}/rulesets/{ruleset_id}"], - updatePullRequestReviewProtection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews" + 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"] } ], - updateRelease: ["PATCH /repos/{owner}/{repo}/releases/{release_id}"], - updateReleaseAsset: [ - "PATCH /repos/{owner}/{repo}/releases/assets/{asset_id}" + listGpgKeysForAuthenticatedUser: ["GET /user/gpg_keys"], + listGpgKeysForUser: ["GET /users/{username}/gpg_keys"], + listPublicEmailsForAuthenticated: [ + "GET /user/public_emails", + {}, + { renamed: ["users", "listPublicEmailsForAuthenticatedUser"] } ], - updateRepoRuleset: ["PUT /repos/{owner}/{repo}/rulesets/{ruleset_id}"], - updateStatusCheckPotection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks", + listPublicEmailsForAuthenticatedUser: ["GET /user/public_emails"], + listPublicKeysForUser: ["GET /users/{username}/keys"], + listPublicSshKeysForAuthenticated: [ + "GET /user/keys", {}, - { renamed: ["repos", "updateStatusCheckProtection"] } + { renamed: ["users", "listPublicSshKeysForAuthenticatedUser"] } ], - updateStatusCheckProtection: [ - "PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks" + 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"] } ], - updateWebhook: ["PATCH /repos/{owner}/{repo}/hooks/{hook_id}"], - updateWebhookConfigForRepo: [ - "PATCH /repos/{owner}/{repo}/hooks/{hook_id}/config" + setPrimaryEmailVisibilityForAuthenticatedUser: [ + "PATCH /user/email/visibility" ], - uploadReleaseAsset: [ - "POST /repos/{owner}/{repo}/releases/{release_id}/assets{?name,label}", - { baseUrl: "https://uploads.github.com" } - ] + unblock: ["DELETE /user/blocks/{username}"], + unfollow: ["DELETE /user/following/{username}"], + updateAuthenticated: ["PATCH /user"] + } + }; + var endpoints_default = Endpoints; + var endpointMethodsMap = /* @__PURE__ */ new Map(); + for (const [scope, endpoints] of Object.entries(endpoints_default)) { + for (const [methodName, endpoint] of Object.entries(endpoints)) { + const [route, defaults, decorations] = endpoint; + const [method, url] = route.split(/ /); + const endpointDefaults = Object.assign( + { + method, + url + }, + defaults + ); + if (!endpointMethodsMap.has(scope)) { + endpointMethodsMap.set(scope, /* @__PURE__ */ new Map()); + } + endpointMethodsMap.get(scope).set(methodName, { + scope, + methodName, + endpointDefaults, + decorations + }); + } + } + var 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]; + } + }; + 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, defaults, decorations) { + const requestWithDefaults = octokit.request.defaults(defaults); + 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 restEndpointMethods(octokit) { + const api = endpointsToMethods(octokit); + return { + rest: api + }; + } + restEndpointMethods.VERSION = VERSION; + function legacyRestEndpointMethods(octokit) { + const api = endpointsToMethods(octokit); + return { + ...api, + rest: api + }; + } + legacyRestEndpointMethods.VERSION = VERSION; + } +}); + +// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js +var require_dist_node13 = __commonJS({ + "node_modules/@actions/github/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_exports = {}; + __export2(dist_src_exports, { + composePaginateRest: () => composePaginateRest, + isPaginatingEndpoint: () => isPaginatingEndpoint, + paginateRest: () => paginateRest, + paginatingEndpoints: () => paginatingEndpoints + }); + module2.exports = __toCommonJS2(dist_src_exports); + var VERSION = "9.2.2"; + function normalizePaginatedListResponse(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 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 url = options.url; + return { + [Symbol.asyncIterator]: () => ({ + async next() { + if (!url) + return { done: true }; + try { + const response = await requestMethod({ method, url, headers }); + const normalizedResponse = normalizePaginatedListResponse(response); + url = ((normalizedResponse.headers.link || "").match( + /<([^<>]+)>;\s*rel="next"/ + ) || [])[1]; + return { value: normalizedResponse }; + } catch (error3) { + if (error3.status !== 409) + throw error3; + url = ""; + 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); + }); + } + var composePaginateRest = Object.assign(paginate, { + iterator + }); + var 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}/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 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) + }) + }; + } + paginateRest.VERSION = VERSION; + } +}); + +// node_modules/@actions/github/lib/utils.js +var require_utils5 = __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 || 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_context()); + var Utils = __importStar2(require_utils4()); + var core_1 = require_dist_node11(); + var plugin_rest_endpoint_methods_1 = require_dist_node12(); + var plugin_paginate_rest_1 = require_dist_node13(); + 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 auth = Utils.getAuthString(token, opts); + if (auth) { + opts.auth = auth; + } + return opts; + } + exports2.getOctokitOptions = getOctokitOptions2; + } +}); + +// 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 || 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_context()); + var utils_1 = require_utils5(); + 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; + } +}); + +// package.json +var require_package = __commonJS({ + "package.json"(exports2, module2) { + module2.exports = { + name: "codeql", + version: "4.31.10", + 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 --serial --verbose", + test: "npm run ava -- src/", + "test-debug": "npm run test -- --timeout=20m", + transpile: "tsc --build --verbose" }, - 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"] + ava: { + typescript: { + rewritePaths: { + "src/": "build/" + }, + compile: false + } }, - 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}" - ] + license: "MIT", + dependencies: { + "@actions/artifact": "^5.0.1", + "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", + "@actions/glob": "^0.5.0", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", + "@actions/tool-cache": "^2.0.2", + "@octokit/plugin-retry": "^6.0.0", + "@schemastore/package": "0.0.10", + archiver: "^7.0.1", + "fast-deep-equal": "^3.1.3", + "follow-redirects": "^1.15.11", + "get-folder-size": "^5.0.0", + "js-yaml": "^4.1.1", + jsonschema: "1.4.1", + long: "^5.3.2", + "node-forge": "^1.3.3", + semver: "^7.7.3", + uuid: "^13.0.0" }, - 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}" - ] + devDependencies: { + "@ava/typescript": "6.0.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", + "@microsoft/eslint-formatter-sarif": "^3.1.0", + "@octokit/types": "^16.0.0", + "@types/archiver": "^7.0.0", + "@types/follow-redirects": "^1.14.4", + "@types/js-yaml": "^4.0.9", + "@types/node": "^20.19.9", + "@types/node-forge": "^1.3.14", + "@types/semver": "^7.7.1", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", + ava: "^6.4.1", + esbuild: "^0.27.1", + eslint: "^8.57.1", + "eslint-import-resolver-typescript": "^3.8.7", + "eslint-plugin-filenames": "^1.3.2", + "eslint-plugin-github": "^5.1.8", + "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", + "eslint-plugin-no-async-foreach": "^0.1.1", + glob: "^11.1.0", + nock: "^14.0.10", + sinon: "^21.0.0", + typescript: "^5.9.3" + }, + 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" + }, + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" + } + }; + } +}); + +// 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, defaults, onto = {}) { + var k, ref, v; + for (k in defaults) { + v = defaults[k]; + onto[k] = (ref = received[k]) != null ? ref : v; + } + return onto; + }; + var overwrite = function(received, defaults, onto = {}) { + var k, v; + for (k in received) { + v = received[k]; + if (defaults[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, promises; + 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"; + }); + promises = 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(promises)).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, run, 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, run, free); + } + } + doExpire(clearGlobalState, run, 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, run, free); + } + async _onFailure(error3, eventInfo, clearGlobalState, run, free) { + var retry3, retryAfter; + if (clearGlobalState()) { + retry3 = await this.Events.trigger("failed", error3, eventInfo); + if (retry3 != null) { + retryAfter = ~~retry3; + this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); + this.retryCount++; + return run(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(resolve2, reject) { + return setTimeout(resolve2, 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__(index, 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__(index, 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, resolve2, returned, task; + if (this._running < 1 && this._queue.length > 0) { + this._running++; + ({ task, args, resolve: resolve2, reject } = this._queue.shift()); + cb = await (async function() { + try { + returned = await task(...args); + return function() { + return resolve2(returned); + }; + } catch (error1) { + error3 = error1; + return function() { + return reject(error3); + }; + } + })(); + this._running--; + this._tryToRun(); + return cb(); + } + } + schedule(task, ...args) { + var promise, reject, resolve2; + resolve2 = reject = null; + promise = new this.Promise(function(_resolve, _reject) { + resolve2 = _resolve; + return reject = _reject; + }); + this._queue.push({ task, args, resolve: resolve2, 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 Bottleneck, 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; + Bottleneck = (function() { + class Bottleneck2 { + 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 Bottleneck2.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 Bottleneck2.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(index) { + if (this._scheduled[index] != null) { + clearTimeout(this._scheduled[index].expiration); + delete this._scheduled[index]; + return true; + } else { + return false; + } + } + async _free(index, job, options, eventInfo) { + var e, running; + try { + ({ running } = await this._store.__free__(index, 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(index, job, wait) { + var clearGlobalState, free, run; + job.doRun(); + clearGlobalState = this._clearGlobalState.bind(this, index); + run = this._run.bind(this, index, job); + free = this._free.bind(this, index, job); + return this._scheduled[index] = { + timeout: setTimeout(() => { + return job.doExecute(this._limiter, clearGlobalState, run, free); + }, wait), + expiration: job.options.expiration != null ? setTimeout(function() { + return job.doExpire(clearGlobalState, run, free); + }, wait + job.options.expiration) : void 0, + job + }; + } + _drainOne(capacity) { + return this._registerLock.schedule(() => { + var args, index, next, options, queue; + if (this.queued() === 0) { + return this.Promise.resolve(null); + } + queue = this._queues.getFirst(); + ({ options, args } = next = queue.first()); + if (capacity != null && options.weight > capacity) { + return this.Promise.resolve(null); + } + this.Events.trigger("debug", `Draining ${options.id}`, { args, options }); + index = this._randomIndex(); + return this._store.__register__(index, options.weight, options.expiration).then(({ success, wait, reservoir }) => { + var empty; + this.Events.trigger("debug", `Drained ${options.id}`, { success, args, options }); + if (success) { + queue.shift(); + empty = this.empty(); + if (empty) { + this.Events.trigger("empty"); + } + if (reservoir === 0) { + this.Events.trigger("depleted", empty); + } + this._run(index, 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((resolve2, reject) => { + if (finished()) { + return resolve2(); + } else { + return this.on("done", () => { + if (finished()) { + this.removeAllListeners("done"); + return resolve2(); + } + }); + } + }); + }; + done = options.dropWaitingJobs ? (this._run = function(index, 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 Bottleneck2.prototype.BottleneckError(options.enqueueErrorMessage)); + }; + this.stop = () => { + return this.Promise.reject(new Bottleneck2.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 === Bottleneck2.prototype.strategy.LEAK ? this._queues.shiftLastFrom(options.priority) : strategy === Bottleneck2.prototype.strategy.OVERFLOW_PRIORITY ? this._queues.shiftLastFrom(options.priority + 1) : strategy === Bottleneck2.prototype.strategy.OVERFLOW ? job : void 0; + if (shifted != null) { + shifted.doDrop(); + } + if (shifted == null || strategy === Bottleneck2.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 Bottleneck2.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(resolve2, reject) { + return fn(...args2, function(...args3) { + return (args3[0] != null ? reject : resolve2)(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); + } + } + Bottleneck2.default = Bottleneck2; + Bottleneck2.Events = Events$4; + Bottleneck2.version = Bottleneck2.prototype.version = require$$8.version; + Bottleneck2.strategy = Bottleneck2.prototype.strategy = { + LEAK: 1, + OVERFLOW: 2, + OVERFLOW_PRIORITY: 4, + BLOCK: 3 + }; + Bottleneck2.BottleneckError = Bottleneck2.prototype.BottleneckError = BottleneckError_1; + Bottleneck2.Group = Bottleneck2.prototype.Group = Group_1; + Bottleneck2.RedisConnection = Bottleneck2.prototype.RedisConnection = require$$2; + Bottleneck2.IORedisConnection = Bottleneck2.prototype.IORedisConnection = require$$3; + Bottleneck2.Batcher = Bottleneck2.prototype.Batcher = Batcher_1; + Bottleneck2.prototype.jobDefaults = { + priority: DEFAULT_PRIORITY$1, + weight: 1, + expiration: null, + id: "" + }; + Bottleneck2.prototype.storeDefaults = { + maxConcurrent: null, + minTime: 0, + highWater: null, + strategy: Bottleneck2.prototype.strategy.LEAK, + penalty: null, + reservoir: null, + reservoirRefreshInterval: null, + reservoirRefreshAmount: null, + reservoirIncreaseInterval: null, + reservoirIncreaseAmount: null, + reservoirIncreaseMaximum: null + }; + Bottleneck2.prototype.localStoreDefaults = { + Promise, + timeout: null, + heartbeatInterval: 250 + }; + Bottleneck2.prototype.redisStoreDefaults = { + Promise, + timeout: null, + heartbeatInterval: 5e3, + clientTimeout: 1e4, + Redis: null, + clientOptions: {}, + clusterNodes: null, + clearDatastore: false, + connection: null + }; + Bottleneck2.prototype.instanceDefaults = { + datastore: "local", + connection: null, + id: "", + rejectOnDrop: true, + trackDoneStatus: false, + Promise + }; + Bottleneck2.prototype.stopDefaults = { + enqueueErrorMessage: "This limiter has been stopped and cannot accept new jobs.", + dropWaitingJobs: true, + dropErrorMessage: "This limiter has been stopped." + }; + return Bottleneck2; + }).call(commonjsGlobal); + var Bottleneck_1 = Bottleneck; + var lib = Bottleneck_1; + return lib; + })); + } +}); + +// node_modules/@octokit/plugin-retry/node_modules/@octokit/request-error/dist-node/index.js +var require_dist_node14 = __commonJS({ + "node_modules/@octokit/plugin-retry/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_exports = {}; + __export2(dist_src_exports, { + RequestError: () => RequestError + }); + module2.exports = __toCommonJS2(dist_src_exports); + 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 RequestError = 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 __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_exports = {}; + __export2(dist_src_exports, { + VERSION: () => VERSION, + retry: () => retry3 + }); + module2.exports = __toCommonJS2(dist_src_exports); + var import_core = require_dist_node11(); + async function errorRequest(state, octokit, 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; + } + var import_light = __toESM2(require_light()); + var import_request_error = require_dist_node14(); + async function wrapRequest(state, octokit, request, options) { + const limiter = new import_light.default(); + limiter.on("failed", function(error3, info6) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; + options.request.retryCount = info6.retryCount + 1; + if (maxRetries > info6.retryCount) { + return after * state.retryAfterBaseValue; + } + }); + return limiter.schedule( + requestWithGraphqlErrorHandling.bind(null, state, octokit, request), + options + ); + } + async function requestWithGraphqlErrorHandling(state, octokit, request, options) { + const response = await request(request, 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 import_request_error.RequestError(response.data.errors[0].message, 500, { + request: options, + response + }); + return errorRequest(state, octokit, error3, options); + } + return response; + } + var VERSION = "6.1.0"; + function retry3(octokit, octokitOptions) { + const state = Object.assign( + { + enabled: true, + retryAfterBaseValue: 1e3, + doNotRetry: [400, 401, 403, 404, 422, 451], + retries: 3 + }, + octokitOptions.retry + ); + if (state.enabled) { + octokit.hook.error("request", errorRequest.bind(null, state, octokit)); + octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); + } + return { + retry: { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { + retries, + retryAfter + }); + return error3; + } + } + }; + } + retry3.VERSION = VERSION; + } +}); + +// node_modules/jsonschema/lib/helpers.js +var require_helpers = __commonJS({ + "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { + "use strict"; + var uri = require("url"); + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path2, name, argument) { + if (Array.isArray(path2)) { + this.path = path2; + this.property = path2.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else if (path2 !== void 0) { + this.property = path2; + } + if (message) { + this.message = message; + } + if (schema2) { + var id = schema2.$id || schema2.id; + this.schema = id || schema2; + } + 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, schema2, options, ctx) { + this.instance = instance; + this.schema = schema2; + 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 (Error.captureStackTrace) { + 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, schema2) { + this.message = msg; + this.schema = schema2; + Error.call(this, msg); + 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(schema2, options, path2, base, schemas) { + this.schema = schema2; + this.options = options; + if (Array.isArray(path2)) { + this.path = path2; + this.propertyPath = path2.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else { + this.propertyPath = path2; + } + this.base = base; + this.schemas = schemas; + }; + SchemaContext.prototype.resolve = function resolve2(target) { + return uri.resolve(this.base, target); + }; + SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { + var path2 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var id = schema2.$id || schema2.id; + var base = uri.resolve(this.base, id || ""); + var ctx = new SchemaContext(schema2, this.options, path2, base, Object.create(this.schemas)); + if (id && !ctx.schemas[base]) { + ctx.schemas[base] = schema2; + } + 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); }, - 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}"] + // 7.3.8. regex + "regex": function(input) { + var result = true; + try { + new RegExp(input); + } catch (e) { + result = false; + } + return result; }, - 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"] + // 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 array = Array.isArray(src); + var dst = array && [] || {}; + if (array) { + 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(number) { + var decimalPlaces = 0; + if (isNaN(number)) return decimalPlaces; + if (typeof number !== "number") { + number = Number(number); + } + var parts = number.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"; + }; + } +}); + +// 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, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; + if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { + var list = types.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, schema2) { + var throwError2 = options.throwError; + var throwAll = options.throwAll; + options.throwError = false; + options.throwAll = false; + var res = this.validateSchema(instance, schema2, options, ctx); + options.throwError = throwError2; + options.throwAll = throwAll; + if (!res.valid && callback instanceof Function) { + callback(res); + } + return res.valid; + } + validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + if (!Array.isArray(schema2.anyOf)) { + throw new SchemaError("anyOf must be an array"); + } + if (!schema2.anyOf.some( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); + } + ) + )) { + var list = schema2.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, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + if (!Array.isArray(schema2.allOf)) { + throw new SchemaError("allOf must be an array"); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var self2 = this; + schema2.allOf.forEach(function(v, i) { + var valid2 = self2.validateSchema(instance, v, options, ctx); + if (!valid2.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: valid2.errors.length, valid: valid2 }, + message: "does not match allOf schema " + msg + " with " + valid2.errors.length + " error[s]:" + }); + result.importErrors(valid2); + } + }); + return result; + }; + validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + if (!Array.isArray(schema2.oneOf)) { + throw new SchemaError("oneOf must be an array"); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + var count = schema2.oneOf.filter( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); + } + ) + ).length; + var list = schema2.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, schema2, options, ctx) { + if (instance === void 0) return null; + if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); + var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); + var result = new ValidatorResult(instance, schema2, options, ctx); + var res; + if (ifValid) { + if (schema2.then === void 0) return; + if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); + res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); + result.importErrors(res); + } else { + if (schema2.else === void 0) return; + if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); + res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); + result.importErrors(res); } + return result; }; - var endpoints_default = Endpoints; - var endpointMethodsMap = /* @__PURE__ */ new Map(); - for (const [scope, endpoints] of Object.entries(endpoints_default)) { - for (const [methodName, endpoint] of Object.entries(endpoints)) { - const [route, defaults, decorations] = endpoint; - const [method, url] = route.split(/ /); - const endpointDefaults = Object.assign( - { - method, - url - }, - defaults - ); - if (!endpointMethodsMap.has(scope)) { - endpointMethodsMap.set(scope, /* @__PURE__ */ new Map()); + function getEnumerableProperty(object, key) { + if (Object.hasOwnProperty.call(object, key)) return object[key]; + if (!(key in object)) return; + while (object = Object.getPrototypeOf(object)) { + if (Object.propertyIsEnumerable.call(object, key)) return object[key]; + } + } + validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var subschema = schema2.propertyNames !== void 0 ? schema2.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); } - endpointMethodsMap.get(scope).set(methodName, { - scope, - methodName, - endpointDefaults, - decorations + } + return result; + }; + validators.properties = function validateProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var properties = schema2.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, schema2, options, ctx, property, result) { + if (!this.types.object(instance)) return; + if (schema2.properties && schema2.properties[property] !== void 0) { + return; + } + if (schema2.additionalProperties === false) { + result.addError({ + name: "additionalProperties", + argument: property, + message: "is not allowed to have the additional property " + JSON.stringify(property) }); + } else { + var additionalProperties = schema2.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); } } - var 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]; + validators.patternProperties = function validatePatternProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var patternProperties = schema2.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); } - const method = endpointMethodsMap.get(scope).get(methodName); - if (!method) { - return void 0; + if (test) { + testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); } - const { endpointDefaults, decorations } = method; - if (decorations) { - cache[methodName] = decorate( - octokit, - scope, - methodName, - endpointDefaults, - decorations - ); + } + return result; + }; + validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + if (schema2.patternProperties) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in instance) { + testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + } + return result; + }; + validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length >= schema2.minProperties)) { + result.addError({ + name: "minProperties", + argument: schema2.minProperties, + message: "does not meet minimum property length of " + schema2.minProperties + }); + } + return result; + }; + validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length <= schema2.maxProperties)) { + result.addError({ + name: "maxProperties", + argument: schema2.maxProperties, + message: "does not meet maximum property length of " + schema2.maxProperties + }); + } + return result; + }; + validators.items = function validateItems(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.items === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + instance.every(function(value, i) { + if (Array.isArray(schema2.items)) { + var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; } else { - cache[methodName] = octokit.request.defaults(endpointDefaults); + var items = schema2.items; } - return cache[methodName]; + 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, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.contains === void 0) return; + if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); + var result = new ValidatorResult(instance, schema2, options, ctx); + var count = instance.some(function(value, i) { + var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); + return res.errors.length === 0; + }); + if (count === false) { + result.addError({ + name: "contains", + argument: schema2.contains, + message: "must contain an item matching given schema" + }); } + return result; }; - function endpointsToMethods(octokit) { - const newMethods = {}; - for (const scope of endpointMethodsMap.keys()) { - newMethods[scope] = new Proxy({ octokit, scope, cache: {} }, handler); + validators.minimum = function validateMinimum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { + if (!(instance > schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than " + schema2.minimum + }); + } + } else { + if (!(instance >= schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than or equal to " + schema2.minimum + }); + } } - return newMethods; - } - function decorate(octokit, scope, methodName, defaults, decorations) { - const requestWithDefaults = octokit.request.defaults(defaults); - 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 result; + }; + validators.maximum = function validateMaximum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { + if (!(instance < schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than " + schema2.maximum }); - return requestWithDefaults(options); } - if (decorations.renamed) { - const [newScope, newMethodName] = decorations.renamed; - octokit.log.warn( - `octokit.${scope}.${methodName}() has been renamed to octokit.${newScope}.${newMethodName}()` - ); + } else { + if (!(instance <= schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than or equal to " + schema2.maximum + }); } - if (decorations.deprecated) { - octokit.log.warn(decorations.deprecated); + } + return result; + }; + validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMinimum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid2 = instance > schema2.exclusiveMinimum; + if (!valid2) { + result.addError({ + name: "exclusiveMinimum", + argument: schema2.exclusiveMinimum, + message: "must be strictly greater than " + schema2.exclusiveMinimum + }); + } + return result; + }; + validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMaximum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid2 = instance < schema2.exclusiveMaximum; + if (!valid2) { + result.addError({ + name: "exclusiveMaximum", + argument: schema2.exclusiveMaximum, + message: "must be strictly less than " + schema2.exclusiveMaximum + }); + } + return result; + }; + var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { + if (!this.types.number(instance)) return; + var validationArgument = schema2[validationType]; + if (validationArgument == 0) { + throw new SchemaError(validationType + " cannot be zero"); + } + var result = new ValidatorResult(instance, schema2, 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, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); + }; + validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); + }; + validators.required = function validateRequired(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (instance === void 0 && schema2.required === true) { + result.addError({ + name: "required", + message: "is required" + }); + } else if (this.types.object(instance) && Array.isArray(schema2.required)) { + schema2.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, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var pattern = schema2.pattern; + try { + var regexp = new RegExp(pattern, "u"); + } catch (_e) { + regexp = new RegExp(pattern); + } + if (!instance.match(regexp)) { + result.addError({ + name: "pattern", + argument: schema2.pattern, + message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) + }); + } + return result; + }; + validators.format = function validateFormat(instance, schema2, options, ctx) { + if (instance === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { + result.addError({ + name: "format", + argument: schema2.format, + message: "does not conform to the " + JSON.stringify(schema2.format) + " format" + }); + } + return result; + }; + validators.minLength = function validateMinLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length >= schema2.minLength)) { + result.addError({ + name: "minLength", + argument: schema2.minLength, + message: "does not meet minimum length of " + schema2.minLength + }); + } + return result; + }; + validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length <= schema2.maxLength)) { + result.addError({ + name: "maxLength", + argument: schema2.maxLength, + message: "does not meet maximum length of " + schema2.maxLength + }); + } + return result; + }; + validators.minItems = function validateMinItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length >= schema2.minItems)) { + result.addError({ + name: "minItems", + argument: schema2.minItems, + message: "does not meet minimum length of " + schema2.minItems + }); + } + return result; + }; + validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length <= schema2.maxItems)) { + result.addError({ + name: "maxItems", + argument: schema2.maxItems, + message: "does not meet maximum length of " + schema2.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; } - 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 true; + } + validators.uniqueItems = function validateUniqueItems(instance, schema2, options, ctx) { + if (schema2.uniqueItems !== true) return; + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!instance.every(testArrays)) { + result.addError({ + name: "uniqueItems", + message: "contains duplicate item" + }); + } + return result; + }; + validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in schema2.dependencies) { + if (instance[property] === void 0) { + continue; + } + var dep = schema2.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 requestWithDefaults(options2); } - return requestWithDefaults(...args); } - return Object.assign(withDecorations, requestWithDefaults); - } - function restEndpointMethods(octokit) { - const api = endpointsToMethods(octokit); - return { - rest: api - }; - } - restEndpointMethods.VERSION = VERSION; - function legacyRestEndpointMethods(octokit) { - const api = endpointsToMethods(octokit); - return { - ...api, - rest: api - }; - } - legacyRestEndpointMethods.VERSION = VERSION; - } -}); - -// node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest/dist-node/index.js -var require_dist_node13 = __commonJS({ - "node_modules/@actions/github/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 }); + return result; }; - 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 }); + validators["enum"] = function validateEnum(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; } - return to; - }; - var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); - var dist_src_exports = {}; - __export2(dist_src_exports, { - composePaginateRest: () => composePaginateRest, - isPaginatingEndpoint: () => isPaginatingEndpoint, - paginateRest: () => paginateRest, - paginatingEndpoints: () => paginatingEndpoints - }); - module2.exports = __toCommonJS2(dist_src_exports); - var VERSION = "9.2.2"; - function normalizePaginatedListResponse(response) { - if (!response.data) { - return { - ...response, - data: [] - }; + if (!Array.isArray(schema2["enum"])) { + throw new SchemaError("enum expects an array", schema2); } - 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; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { + result.addError({ + name: "enum", + argument: schema2["enum"], + message: "is not one of enum values: " + schema2["enum"].map(String).join(",") + }); } - if (typeof repositorySelection !== "undefined") { - response.data.repository_selection = repositorySelection; + return result; + }; + validators["const"] = function validateEnum(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; } - response.data.total_count = totalCount; - return response; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!helpers.deepCompareStrict(schema2["const"], instance)) { + result.addError({ + name: "const", + argument: schema2["const"], + message: "does not exactly match expected constant: " + schema2["const"] + }); + } + return result; + }; + validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { + var self2 = this; + if (instance === void 0) return null; + var result = new ValidatorResult(instance, schema2, options, ctx); + var notTypes = schema2.not || schema2.disallow; + if (!notTypes) return null; + if (!Array.isArray(notTypes)) notTypes = [notTypes]; + notTypes.forEach(function(type2) { + if (self2.testType(instance, schema2, options, ctx, type2)) { + var id = type2 && (type2.$id || type2.id); + var schemaId = id || type2; + 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 urilib = require("url"); + var helpers = require_helpers(); + module2.exports.SchemaScanResult = SchemaScanResult; + function SchemaScanResult(found, ref) { + this.id = found; + this.ref = ref; } - 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 url = options.url; - return { - [Symbol.asyncIterator]: () => ({ - async next() { - if (!url) - return { done: true }; - try { - const response = await requestMethod({ method, url, headers }); - const normalizedResponse = normalizePaginatedListResponse(response); - url = ((normalizedResponse.headers.link || "").match( - /<([^<>]+)>;\s*rel="next"/ - ) || [])[1]; - return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; - url = ""; - return { - value: { - status: 200, - headers: {}, - data: [] - } - }; + module2.exports.scan = function scan(base, schema2) { + function scanSchema(baseuri, schema3) { + if (!schema3 || typeof schema3 != "object") return; + if (schema3.$ref) { + var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; + return; + } + var id = schema3.$id || schema3.id; + var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + if (ourBase) { + if (ourBase.indexOf("#") < 0) ourBase += "#"; + if (found[ourBase]) { + if (!helpers.deepCompareStrict(found[ourBase], schema3)) { + throw new Error("Schema <" + ourBase + "> already exists with different definition"); } + return found[ourBase]; + } + found[ourBase] = schema3; + if (ourBase[ourBase.length - 1] == "#") { + found[ourBase.substring(0, ourBase.length - 1)] = schema3; } - }) - }; - } - 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; + scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); + scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); + scanSchema(ourBase + "/additionalItems", schema3.additionalItems); + scanObject(ourBase + "/properties", schema3.properties); + scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); + scanObject(ourBase + "/definitions", schema3.definitions); + scanObject(ourBase + "/patternProperties", schema3.patternProperties); + scanObject(ourBase + "/dependencies", schema3.dependencies); + scanArray(ourBase + "/disallow", schema3.disallow); + scanArray(ourBase + "/allOf", schema3.allOf); + scanArray(ourBase + "/anyOf", schema3.anyOf); + scanArray(ourBase + "/oneOf", schema3.oneOf); + scanSchema(ourBase + "/not", schema3.not); + } + function scanArray(baseuri, schemas) { + if (!Array.isArray(schemas)) return; + for (var i = 0; i < schemas.length; i++) { + scanSchema(baseuri + "/" + i, schemas[i]); } - results = results.concat( - mapFn ? mapFn(result.value, done) : result.value.data - ); - if (earlyExit) { - return results; + } + function scanObject(baseuri, schemas) { + if (!schemas || typeof schemas != "object") return; + for (var p in schemas) { + scanSchema(baseuri + "/" + p, schemas[p]); } - return gather(octokit, results, iterator2, mapFn); - }); - } - var composePaginateRest = Object.assign(paginate, { - iterator - }); - var 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}/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 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) - }) - }; - } - paginateRest.VERSION = VERSION; + var found = {}; + var ref = {}; + scanSchema(base, schema2); + return new SchemaScanResult(found, ref); + }; } }); -// node_modules/@actions/github/lib/utils.js -var require_utils4 = __commonJS({ - "node_modules/@actions/github/lib/utils.js"(exports2) { +// node_modules/jsonschema/lib/validator.js +var require_validator = __commonJS({ + "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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]; - } }; + var urilib = require("url"); + 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 Validator2 = function Validator3() { + this.customFormats = Object.create(Validator3.prototype.customFormats); + this.schemas = {}; + this.unresolvedRefs = []; + this.types = Object.create(types); + this.attributes = Object.create(attribute.validators); + }; + Validator2.prototype.customFormats = {}; + Validator2.prototype.schemas = null; + Validator2.prototype.types = null; + Validator2.prototype.attributes = null; + Validator2.prototype.unresolvedRefs = null; + Validator2.prototype.addSchema = function addSchema(schema2, base) { + var self2 = this; + if (!schema2) { + return null; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var scan = scanSchema(base || anonymousBase, schema2); + var ourUri = base || schema2.$id || schema2.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]; + }; + Validator2.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { + if (!Array.isArray(schemas)) return; + for (var i = 0; i < schemas.length; i++) { + this.addSubSchema(baseuri, schemas[i]); + } + }; + Validator2.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { + if (!schemas || typeof schemas != "object") return; + for (var p in schemas) { + this.addSubSchema(baseuri, schemas[p]); + } + }; + Validator2.prototype.setSchemas = function setSchemas(schemas) { + this.schemas = schemas; + }; + Validator2.prototype.getSchema = function getSchema(urn) { + return this.schemas[urn]; + }; + Validator2.prototype.validate = function validate(instance, schema2, options, ctx) { + if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { + throw new SchemaError("Expected `schema` to be an object or boolean"); + } + if (!options) { + options = {}; + } + var id = schema2.$id || schema2.id; + var base = urilib.resolve(options.base || anonymousBase, id || ""); + if (!ctx) { + ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); + if (!ctx.schemas[base]) { + ctx.schemas[base] = schema2; + } + var found = scanSchema(base, schema2); + 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, schema2, options, ctx); + result.addError("is required, but is undefined"); + return result; + } + var result = this.validateSchema(instance, schema2, options, ctx); + if (!result) { + throw new Error("Result undefined"); + } else if (options.throwAll && result.errors.length) { + throw new ValidatorResultError(result); } - __setModuleDefault4(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); - var core_1 = require_dist_node11(); - var plugin_rest_endpoint_methods_1 = require_dist_node12(); - var plugin_paginate_rest_1 = require_dist_node13(); - exports2.context = new Context.Context(); - var baseUrl = Utils.getApiBaseUrl(); - exports2.defaults = { - baseUrl, - request: { - agent: Utils.getProxyAgent(baseUrl), - fetch: Utils.getProxyFetch(baseUrl) + function shouldResolve(schema2) { + var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; + if (typeof ref == "string") return ref; + return false; + } + Validator2.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (typeof schema2 === "boolean") { + if (schema2 === true) { + schema2 = {}; + } else if (schema2 === false) { + schema2 = { type: [] }; + } + } else if (!schema2) { + throw new Error("schema is undefined"); + } + if (schema2["extends"]) { + if (Array.isArray(schema2["extends"])) { + var schemaobj = { schema: schema2, ctx }; + schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); + schema2 = schemaobj.schema; + schemaobj.schema = null; + schemaobj.ctx = null; + schemaobj = null; + } else { + schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); + } + } + var switchSchema = shouldResolve(schema2); + if (switchSchema) { + var resolved = this.resolve(schema2, 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 schema2) { + if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { + var validatorErr = null; + var validator = this.attributes[key]; + if (validator) { + validatorErr = validator.call(this, instance, schema2, options, ctx); + } else if (options.allowUnknownAttributes === false) { + throw new SchemaError("Unsupported attribute: " + key, schema2); + } + if (validatorErr) { + result.importErrors(validatorErr); + } + } + } + if (typeof options.rewrite == "function") { + var value = options.rewrite.call(this, instance, schema2, options, ctx); + result.instance = value; } + return result; }; - 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 auth = Utils.getAuthString(token, opts); - if (auth) { - opts.auth = auth; + Validator2.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { + schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); + }; + Validator2.prototype.superResolve = function superResolve(schema2, ctx) { + var ref = shouldResolve(schema2); + if (ref) { + return this.resolve(schema2, ref, ctx).subschema; } - return opts; + return schema2; + }; + Validator2.prototype.resolve = function resolve2(schema2, switchSchema, ctx) { + switchSchema = ctx.resolve(switchSchema); + if (ctx.schemas[switchSchema]) { + return { subschema: ctx.schemas[switchSchema], switchSchema }; + } + var parsed = urilib.parse(switchSchema); + var fragment = parsed && 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 + ">", schema2); + } + var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); + if (subschema === void 0) { + throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); + } + return { subschema, switchSchema }; + }; + Validator2.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { + if (type2 === void 0) { + return; + } else if (type2 === null) { + throw new SchemaError('Unexpected null in "type" keyword'); + } + if (typeof this.types[type2] == "function") { + return this.types[type2].call(this, instance); + } + if (type2 && typeof type2 == "object") { + var res = this.validateSchema(instance, type2, options, ctx); + return res === void 0 || !(res && res.errors.length); + } + return true; + }; + var types = Validator2.prototype.types = {}; + types.string = function testString(instance) { + return typeof instance == "string"; + }; + types.number = function testNumber(instance) { + return typeof instance == "number" && isFinite(instance); + }; + types.integer = function testInteger(instance) { + return typeof instance == "number" && instance % 1 === 0; + }; + types.boolean = function testBoolean(instance) { + return typeof instance == "boolean"; + }; + types.array = function testArray(instance) { + return Array.isArray(instance); + }; + types["null"] = function testNull(instance) { + return instance === null; + }; + types.date = function testDate(instance) { + return instance instanceof Date; + }; + types.any = function testAny(instance) { + return true; + }; + types.object = function testObject(instance) { + return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); + }; + module2.exports = Validator2; + } +}); + +// node_modules/jsonschema/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/jsonschema/lib/index.js"(exports2, module2) { + "use strict"; + var Validator2 = 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, schema2, options) { + var v = new Validator2(); + return v.validate(instance, schema2, options); + }; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils6 = __commonJS({ + "node_modules/@actions/glob/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.getOctokitOptions = getOctokitOptions2; + 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/github/lib/github.js -var require_github = __commonJS({ - "node_modules/@actions/github/lib/github.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -46795,38 +51673,80 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(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)); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils6(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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"); } - exports2.getOctokit = getOctokit; } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -46839,191 +51759,141 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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); } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + __setModuleDefault2(result, mod); + return result; }; - var _a; 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 fs = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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'); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils6(); + 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 (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); + if (!fs.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return p.startsWith("/"); - } - function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(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 = path2.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 = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path2.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 ""; + fs.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" }); } - function normalizeSeparators(p) { - p = p || ""; - if (exports2.IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - return p.replace(/\\\\+/g, "\\"); + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.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}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/glob/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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - 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(); + 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; } - function getCmdPath() { - var _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); + } + get username() { + return this._decodedUsername; + } + get password() { + return this._decodedPassword; + } + }; } }); -// node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib6 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -47036,31 +51906,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -47088,6754 +51948,8963 @@ var require_io3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.cp = cp; - exports2.mv = mv; - exports2.rmRF = rmRF; - exports2.mkdirP = mkdirP; - exports2.which = which4; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path2.join(dest, path2.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 (path2.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.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(path2.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which4(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which4(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 __awaiter4(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(path2.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(path2.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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); - } - }); + exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; + var http = __importStar2(require("http")); + var https = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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 : ""; } - } -}); - -// package.json -var require_package = __commonJS({ - "package.json"(exports2, module2) { - module2.exports = { - name: "codeql", - version: "4.31.3", - 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 --serial --verbose", - test: "npm run ava -- src/", - "test-debug": "npm run test -- --timeout=20m", - transpile: "tsc --build --verbose" - }, - ava: { - typescript: { - rewritePaths: { - "src/": "build/" - }, - compile: false - } - }, - license: "MIT", - dependencies: { - "@actions/artifact": "^4.0.0", - "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", - "@actions/glob": "^0.5.0", - "@actions/http-client": "^3.0.0", - "@actions/io": "^2.0.0", - "@actions/tool-cache": "^2.0.2", - "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", - "@schemastore/package": "0.0.10", - archiver: "^7.0.1", - "fast-deep-equal": "^3.1.3", - "follow-redirects": "^1.15.11", - "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", - jsonschema: "1.4.1", - long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", - semver: "^7.7.3", - uuid: "^13.0.0" - }, - devDependencies: { - "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", - "@microsoft/eslint-formatter-sarif": "^3.1.0", - "@octokit/types": "^16.0.0", - "@types/archiver": "^7.0.0", - "@types/follow-redirects": "^1.14.4", - "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", - "@types/node-forge": "^1.3.14", - "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", - ava: "^6.4.1", - esbuild: "^0.25.12", - eslint: "^8.57.1", - "eslint-import-resolver-typescript": "^3.8.7", - "eslint-plugin-filenames": "^1.3.2", - "eslint-plugin-github": "^5.1.8", - "eslint-plugin-import": "2.29.1", - "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", - nock: "^14.0.10", - sinon: "^21.0.0", - typescript: "^5.9.3" - }, - 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" - }, - "brace-expansion@2.0.1": "2.0.2" - } - }; - } -}); - -// 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, defaults, onto = {}) { - var k, ref, v; - for (k in defaults) { - v = defaults[k]; - onto[k] = (ref = received[k]) != null ? ref : v; - } - return onto; - }; - var overwrite = function(received, defaults, onto = {}) { - var k, v; - for (k in received) { - v = received[k]; - if (defaults[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; + 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((resolve2) => __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", () => { + resolve2(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + })); + }); + } + }; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; + } + exports2.isHttps = isHttps; + var HttpClient = class { + constructor(userAgent, 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 = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; } - return value; - } - first() { - if (this._first != null) { - return this._first.value; + this._socketTimeout = requestOptions.socketTimeout; + if (requestOptions.allowRedirects != null) { + this._allowRedirects = requestOptions.allowRedirects; } - } - getArray() { - var node, ref, results; - node = this._first; - results = []; - while (node != null) { - results.push((ref = node, node = node.next, ref.value)); + if (requestOptions.allowRedirectDowngrade != null) { + this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; } - return results; - } - forEachShift(cb) { - var node; - node = this.shift(); - while (node != null) { - cb(node), node = this.shift(); + if (requestOptions.maxRedirects != null) { + this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); } - 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 - })); + if (requestOptions.keepAlive != null) { + this._keepAlive = requestOptions.keepAlive; } - 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"); + if (requestOptions.allowRetries != null) { + this._allowRetries = requestOptions.allowRetries; } - 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] = []; + if (requestOptions.maxRetries != null) { + this._maxRetries = requestOptions.maxRetries; } - this._events[name].push({ cb, status }); - return this.instance; } - listenerCount(name) { - if (this._events[name] != null) { - return this._events[name].length; - } else { - return 0; + } + 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, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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."); } - } - async trigger(name, ...args) { - var e, promises; - try { - if (name !== "debug") { - this.trigger("debug", `Event triggered: ${name}`, args); - } - if (this._events[name] == null) { - return; + const parsedUrl = new URL(requestUrl); + let info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, data); + } else { + return response; + } } - this._events[name] = this._events[name].filter(function(listener) { - return listener.status !== "none"; - }); - promises = this._events[name].map(async (listener) => { - var e2, returned; - if (listener.status === "none") { - return; + 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; } - if (listener.status === "once") { - listener.status = "none"; + 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."); } - 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 (error4) { - e2 = error4; - { - this.trigger("error", e2); + yield response.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + if (header.toLowerCase() === "authorization") { + delete headers[header]; + } } - return null; } - }); - return (await Promise.all(promises)).find(function(x) { - return x != null; - }); - } catch (error4) { - e = error4; - { - this.trigger("error", e); + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, data); + redirectsRemaining--; } - 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(); - }))); + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; } - return results; - }).call(this); + 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(); } - incr() { - if (this._length++ === 0) { - return this.Events.trigger("leftzero"); + this._disposed = true; + } + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve2(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - decr() { - if (--this._length === 0) { - return this.Events.trigger("zero"); + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); } } - push(job) { - return this._lists[job.options.priority].push(job); - } - queued(priority) { - if (priority != null) { - return this._lists[priority].length; - } else { - return this._length; + const req = info6.httpModule.request(info6.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: ${info6.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); } - shiftAll(fn) { - return this._lists.forEach(function(list) { - return list.forEachShift(fn); + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); }); + data.pipe(req); + } else { + req.end(); } - 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 []; + } + /** + * 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; } - shiftLastFrom(priority) { - return this.getFirst(this._lists.slice(priority).reverse()).shift(); + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + } + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; } - }; - 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()}`; + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - 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; - } + return info6; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - _randomIndex() { - return Math.random().toString(36).slice(2); + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { - if (this._states.remove(this.options.id)) { - if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : 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; - } + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - _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`); - } + if (!useProxy) { + agent = this._agent; } - doReceive() { - this._states.start(this.options.id); - return this.Events.trigger("received", { args: this.args, options: this.options }); + if (agent) { + return agent; } - 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 }); + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - doRun() { - if (this.retryCount === 0) { - this._assertStatus("QUEUED"); - this._states.next(this.options.id); + 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 { - this._assertStatus("EXECUTING"); + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } - return this.Events.trigger("scheduled", { args: this.args, options: this.options }); + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } - async doExecute(chained, clearGlobalState, run, free) { - var error4, 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) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); - } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https.Agent(options) : new http.Agent(options); + this._agent = agent; } - doExpire(clearGlobalState, run, free) { - var error4, 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); } - async _onFailure(error4, eventInfo, clearGlobalState, run, free) { - var retry3, retryAfter; - if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); - if (retry3 != null) { - retryAfter = ~~retry3; - this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); - this.retryCount++; - return run(retryAfter); - } else { - this.doDone(eventInfo); - await free(this.options, eventInfo); - this._assertStatus("DONE"); - return this._reject(error4); - } - } + return agent; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; } - doDone(eventInfo) { - this._assertStatus("EXECUTING"); - this._states.next(this.options.id); - return this.Events.trigger("done", eventInfo); + if (proxyAgent) { + return proxyAgent; } - }; - 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(); + 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 + }); } - _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()); + 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((resolve2) => setTimeout(() => resolve2(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve2(response); + } + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } } - 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()); + 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; } - }, this.heartbeatInterval)).unref === "function" ? base.unref() : void 0; - } else { - return clearInterval(this.heartbeat); + 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 { + resolve2(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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(resolve2, reject) { - return setTimeout(resolve2, 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - async __running__() { - await this.yieldLoop(); - return this._running; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - async __queued__() { - await this.yieldLoop(); - return this.instance.queued(); + 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"); } - async __done__() { - await this.yieldLoop(); - return this._done; + 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"); } - async __groupCheck__(time) { - await this.yieldLoop(); - return this._nextRequest + this.timeout < time; + 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"); } - 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; + 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/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - isBlocked(now) { - return this._unblockTime >= now; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - check(weight, now) { - return this.conditionsCheck(weight) && this._nextRequest - now <= 0; + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OidcClient = void 0; + var http_client_1 = require_lib6(); + var auth_1 = require_auth3(); + 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"); } - async __check__(weight) { - var now; - await this.yieldLoop(); - now = Date.now(); - return this.check(weight, now); + 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"); } - async __register__(index, 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 - }; + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - } - 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}`); + 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}`); } - 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(); + }); + } + }; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return { - reachedHWM, - blocked, - strategy: this.storeOptions.strategy - }; - } - async __free__(index, 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]; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - start(id) { - var initial; - initial = 0; - this._jobs[id] = initial; - return this.counts[initial]++; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - remove(id) { - var current; - current = this._jobs[id]; - if (current != null) { - this.counts[current]--; - delete this._jobs[id]; + 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; } - return current != null; - } - jobStatus(id) { - var ref; - return (ref = this.status[this._jobs[id]]) != null ? ref : null; + 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 (_a) { + 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}>`; } - 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 `<${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); } - return results; - } else { - return Object.keys(this._jobs); + 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/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/glob/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 path2 = __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, path2.sep); + } + exports2.toPlatformPath = toPlatformPath; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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, error4, reject, resolve2, returned, task; - if (this._running < 1 && this._queue.length > 0) { - this._running++; - ({ task, args, resolve: resolve2, reject } = this._queue.shift()); - cb = await (async function() { - try { - returned = await task(...args); - return function() { - return resolve2(returned); - }; - } catch (error1) { - error4 = error1; - return function() { - return reject(error4); - }; - } - })(); - this._running--; - this._tryToRun(); - return cb(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - schedule(task, ...args) { - var promise, reject, resolve2; - resolve2 = reject = null; - promise = new this.Promise(function(_resolve, _reject) { - resolve2 = _resolve; - return reject = _reject; - }); - this._queue.push({ task, args, resolve: resolve2, reject }); - this._tryToRun(); - return promise; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - }; - var Sync_1 = Sync; - var version = "2.19.5"; - var version$1 = { - version - }; - var version$2 = /* @__PURE__ */ Object.freeze({ - version, - default: version$1 + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - 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 })); - } - } + }; + var _a; + 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 fs = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); + _a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs.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; } - 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; - })(); + 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}`); } - 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(); + } + if (stats && stats.isFile()) { + if (exports2.IS_WINDOWS) { + const upperExt = path2.extname(filePath).toUpperCase(); + if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { + return filePath; } - 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 - }); + } else { + if (isUnixExecutable(stats)) { + return filePath; } - 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)); - } + } + 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}`); } - 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); + if (stats && stats.isFile()) { + if (exports2.IS_WINDOWS) { + try { + const directory = path2.dirname(filePath); + const upperName = path2.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path2.join(directory, actualName); + break; } - } catch (error4) { - e = error4; - results.push(v.Events.trigger("error", e)); } + } 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 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; - } + } + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - _resetPromise() { - return this._promise = new this.Promise((res, rej) => { - return this._resolve = res; - }); + } + function step(result) { + result.done ? resolve2(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 path2 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); + 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 ? path2.join(dest, path2.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); } - _flush() { - clearTimeout(this._timeout); - this._lastFlush = Date.now(); - this._resolve(); - this.Events.trigger("batch", this._arr); - this._arr = []; - return this._resetPromise(); + } else { + if (path2.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); } - 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); + yield copyFile(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 = path2.join(dest, path2.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"); } - 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 Bottleneck, 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; - Bottleneck = (function() { - class Bottleneck2 { - 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 Bottleneck2.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; - }); + yield mkdirP(path2.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'); } - _validateOptions(options, invalid) { - if (!(options != null && typeof options === "object" && invalid.length === 0)) { - throw new Bottleneck2.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."); + } + 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 which4(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + if (check) { + const result = yield which4(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.`); } } - ready() { - return this._store.ready; + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); + } + exports2.which = which4; + 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(path2.delimiter)) { + if (extension) { + extensions.push(extension); + } } - clients() { - return this._store.clients; + } + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; } - channel() { - return `b_${this.id}`; + return []; + } + if (tool.includes(path2.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path2.delimiter)) { + if (p) { + directories.push(p); + } } - channel_client() { - return `b_${this.id}_${this._store.clientId}`; + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); } - publish(message) { - return this._store.__publish__(message); + } + 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 copyFile(srcFile, destFile, force); } - disconnect(flush = true) { - return this._store.__disconnect__(flush); + } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + function copyFile(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); + } } - chain(_limiter) { - this._limiter = _limiter; - return this; + 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/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - queued(priority) { - return this._queues.queued(priority); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - clusterQueued() { - return this._store.__queued__(); + } + function step(result) { + result.done ? resolve2(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 os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path2 = __importStar2(require("path")); + var io4 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner3 = 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)}`; + } } - empty() { - return this.queued() === 0 && this._submitLock.isEmpty(); + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; } - running() { - return this._store.__running__(); + } + return cmd; + } + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); } - done() { - return this._store.__done__(); + 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"; } - jobStatus(id) { - return this._states.jobStatus(id); + } + 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]; } - jobs(status) { - return this._states.statusJobs(status); + } + return this.args; + } + _endsWith(str2, end) { + return str2.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; } - counts() { - return this._states.statusCounts(); + } + 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; } - _randomIndex() { - return Math.random().toString(36).slice(2); + } + 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; } - check(weight = 1) { - return this._store.__check__(weight); + } + 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 = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - _clearGlobalState(index) { - if (this._scheduled[index] != null) { - clearTimeout(this._scheduled[index].expiration); - delete this._scheduled[index]; - return true; - } else { - return false; + this.toolPath = yield io4.which(this.toolPath, true); + return new Promise((resolve2, 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}`); } - } - async _free(index, job, options, eventInfo) { - var e, running; - try { - ({ running } = await this._store.__free__(index, options.weight)); - this.Events.trigger("debug", `Freed ${options.id}`, eventInfo); - if (running === 0 && this.empty()) { - return this.Events.trigger("idle"); + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os2.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); } - } catch (error1) { - e = error1; - return this.Events.trigger("error", e); + if (errbuffer.length > 0) { + this.emit("errline", errbuffer); + } + cp.removeAllListeners(); + if (error3) { + reject(error3); + } else { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } + })); + }); + } + }; + exports2.ToolRunner = ToolRunner3; + 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); } - _run(index, job, wait) { - var clearGlobalState, free, run; - job.doRun(); - clearGlobalState = this._clearGlobalState.bind(this, index); - run = this._run.bind(this, index, job); - free = this._free.bind(this, index, job); - return this._scheduled[index] = { - timeout: setTimeout(() => { - return job.doExecute(this._limiter, clearGlobalState, run, free); - }, wait), - expiration: job.options.expiration != null ? setTimeout(function() { - return job.doExpire(clearGlobalState, run, free); - }, wait + job.options.expiration) : void 0, - job - }; + 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/glob/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - _drainOne(capacity) { - return this._registerLock.schedule(() => { - var args, index, next, options, queue; - if (this.queued() === 0) { - return this.Promise.resolve(null); - } - queue = this._queues.getFirst(); - ({ options, args } = next = queue.first()); - if (capacity != null && options.weight > capacity) { - return this.Promise.resolve(null); - } - this.Events.trigger("debug", `Draining ${options.id}`, { args, options }); - index = this._randomIndex(); - return this._store.__register__(index, options.weight, options.expiration).then(({ success, wait, reservoir }) => { - var empty; - this.Events.trigger("debug", `Drained ${options.id}`, { success, args, options }); - if (success) { - queue.shift(); - empty = this.empty(); - if (empty) { - this.Events.trigger("empty"); - } - if (reservoir === 0) { - this.Events.trigger("depleted", empty); - } - this._run(index, next, wait); - return this.Promise.resolve(options.weight); - } else { - return this.Promise.resolve(null); - } - }); - }); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - _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); - }); + } + function step(result) { + result.done ? resolve2(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_toolrunner3()); + function exec(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 = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - _dropAllQueued(message) { - return this._queues.shiftAll(function(job) { - return job.doDrop({ message }); - }); + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - 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((resolve2, reject) => { - if (finished()) { - return resolve2(); - } else { - return this.on("done", () => { - if (finished()) { - this.removeAllListeners("done"); - return resolve2(); - } - }); - } - }); - }; - done = options.dropWaitingJobs ? (this._run = function(index, 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 Bottleneck2.prototype.BottleneckError(options.enqueueErrorMessage)); - }; - this.stop = () => { - return this.Promise.reject(new Bottleneck2.prototype.BottleneckError("stop() has already been called")); - }; - return done; + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; - ({ args, options } = job); - try { - ({ reachedHWM, blocked, strategy } = await this._store.__submit__(this.queued(), options.weight)); - } catch (error1) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); - return false; - } - if (blocked) { - job.doDrop(); - return true; - } else if (reachedHWM) { - shifted = strategy === Bottleneck2.prototype.strategy.LEAK ? this._queues.shiftLastFrom(options.priority) : strategy === Bottleneck2.prototype.strategy.OVERFLOW_PRIORITY ? this._queues.shiftLastFrom(options.priority + 1) : strategy === Bottleneck2.prototype.strategy.OVERFLOW ? job : void 0; - if (shifted != null) { - shifted.doDrop(); - } - if (shifted == null || strategy === Bottleneck2.prototype.strategy.OVERFLOW) { - if (shifted == null) { - job.doDrop(); - } - return reachedHWM; - } - } - job.doQueue(reachedHWM, blocked); - this._queues.push(job); - await this._drainAll(); - return reachedHWM; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - _receive(job) { - if (this._states.jobStatus(job.options.id) != null) { - job._reject(new Bottleneck2.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); - } + } + function step(result) { + result.done ? resolve2(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 exec = __importStar2(require_exec3()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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/glob/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils6(); + var os2 = __importStar2(require("os")); + var path2 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable4(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 = exportVariable4; + function setSecret2(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret2; + function addPath(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}${path2.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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 setOutput2(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(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug5(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug5; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning7(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning7; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + 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 getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); + } +}); + +// 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 || 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.getOptions = void 0; + var core12 = __importStar2(require_core3()); + 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; + core12.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + } + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core12.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core12.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core12.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core12.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + } + } + return result; + } + exports2.getOptions = getOptions; + } +}); + +// 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 || 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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path2 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; + } + let result = path2.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname; + 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 { - 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(resolve2, reject) { - return fn(...args2, function(...args3) { - return (args3[0] != null ? reject : resolve2)(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; + if (!cwd.endsWith("\\")) { + cwd += "\\"; } - }); - return this._receive(job); - } - schedule(...args) { - var job, options, task; - if (typeof args[0] === "function") { - [task, ...args] = args; - options = {}; - } else { - [options, task, ...args] = args; + return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; } - 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); + } 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)}`; } - Bottleneck2.default = Bottleneck2; - Bottleneck2.Events = Events$4; - Bottleneck2.version = Bottleneck2.prototype.version = require$$8.version; - Bottleneck2.strategy = Bottleneck2.prototype.strategy = { - LEAK: 1, - OVERFLOW: 2, - OVERFLOW_PRIORITY: 4, - BLOCK: 3 - }; - Bottleneck2.BottleneckError = Bottleneck2.prototype.BottleneckError = BottleneckError_1; - Bottleneck2.Group = Bottleneck2.prototype.Group = Group_1; - Bottleneck2.RedisConnection = Bottleneck2.prototype.RedisConnection = require$$2; - Bottleneck2.IORedisConnection = Bottleneck2.prototype.IORedisConnection = require$$3; - Bottleneck2.Batcher = Bottleneck2.prototype.Batcher = Batcher_1; - Bottleneck2.prototype.jobDefaults = { - priority: DEFAULT_PRIORITY$1, - weight: 1, - expiration: null, - id: "" - }; - Bottleneck2.prototype.storeDefaults = { - maxConcurrent: null, - minTime: 0, - highWater: null, - strategy: Bottleneck2.prototype.strategy.LEAK, - penalty: null, - reservoir: null, - reservoirRefreshInterval: null, - reservoirRefreshAmount: null, - reservoirIncreaseInterval: null, - reservoirIncreaseAmount: null, - reservoirIncreaseMaximum: null - }; - Bottleneck2.prototype.localStoreDefaults = { - Promise, - timeout: null, - heartbeatInterval: 250 - }; - Bottleneck2.prototype.redisStoreDefaults = { - Promise, - timeout: null, - heartbeatInterval: 5e3, - clientTimeout: 1e4, - Redis: null, - clientOptions: {}, - clusterNodes: null, - clearDatastore: false, - connection: null - }; - Bottleneck2.prototype.instanceDefaults = { - datastore: "local", - connection: null, - id: "", - rejectOnDrop: true, - trackDoneStatus: false, - Promise - }; - Bottleneck2.prototype.stopDefaults = { - enqueueErrorMessage: "This limiter has been stopped and cannot accept new jobs.", - dropWaitingJobs: true, - dropErrorMessage: "This limiter has been stopped." - }; - return Bottleneck2; - }).call(commonjsGlobal); - var Bottleneck_1 = Bottleneck; - var lib = Bottleneck_1; - return lib; - })); + } + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path2.sep; + } + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path2.sep)) { + return p; + } + if (p === path2.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); + } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@octokit/plugin-retry/node_modules/@octokit/request-error/dist-node/index.js -var require_dist_node14 = __commonJS({ - "node_modules/@octokit/plugin-retry/node_modules/@octokit/request-error/dist-node/index.js"(exports2, module2) { +// 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"; - 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 }); + 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 || 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 __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 }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return to; + 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; + } + exports2.getSearchPaths = getSearchPaths; + function match(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; + } + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + } + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; }; - 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_exports = {}; - __export2(dist_src_exports, { - RequestError: () => RequestError - }); - module2.exports = __toCommonJS2(dist_src_exports); - 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 RequestError = class extends Error { - constructor(message, statusCode, options) { - super(message); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; + } + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; + } + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.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 = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - this.name = "HttpError"; - this.status = statusCode; - let headers; - if ("headers" in options && typeof options.headers !== "undefined") { - headers = options.headers; + 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + } + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + } + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + } + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var 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 expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); + } + return expand(escapeBraces(str2), true).map(unescapeBraces); + } + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte4(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); } - if ("response" in options) { - this.response = options.response; - headers = options.response.headers; + return [str2]; + } + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - const requestCopy = Object.assign({}, options.request); - if (options.request.headers.authorization) { - requestCopy.headers = Object.assign({}, options.request.headers, { - authorization: options.request.headers.authorization.replace( - /(? 0) { + var z = new Array(need + 1).join("0"); + if (i < 0) + c = "-" + z + c.slice(1); + else + c = z + c; + } + } } + N.push(c); + } + } else { + N = concatMap(n, function(el) { + return expand(el, false); }); } - }; + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + return expansions; + } } }); -// node_modules/@octokit/plugin-retry/dist-node/index.js -var require_dist_node15 = __commonJS({ - "node_modules/@octokit/plugin-retry/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 }); +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path2 = (function() { + try { + return require("path"); + } catch (e) { + } + })() || { + sep: "/" }; - 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 }); + minimatch.sep = path2.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } - return to; + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; }; - 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_exports = {}; - __export2(dist_src_exports, { - VERSION: () => VERSION, - retry: () => retry3 - }); - module2.exports = __toCommonJS2(dist_src_exports); - var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.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(error4, retries, retryAfter); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - throw error4; + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path2.sep !== "/") { + pattern = pattern.split(path2.sep).join("/"); + } + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - var import_light = __toESM2(require_light()); - var import_request_error = require_dist_node14(); - async function wrapRequest(state, octokit, request, options) { - const limiter = new import_light.default(); - limiter.on("failed", function(error4, info6) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; - options.request.retryCount = info6.retryCount + 1; - if (maxRetries > info6.retryCount) { - return after * state.retryAfterBaseValue; + Minimatch.prototype.debug = function() { + }; + Minimatch.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 set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug5() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; + } + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = 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++) { + negate = !negate; + negateOffset++; + } + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + 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 && reSpecials[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; + } + 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 (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; } - }); - return limiter.schedule( - requestWithGraphqlErrorHandling.bind(null, state, octokit, request), - options - ); - } - async function requestWithGraphqlErrorHandling(state, octokit, request, options) { - const response = await request(request, 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { - request: options, - response - }); - return errorRequest(state, octokit, error4, options); } - return response; - } - var VERSION = "6.1.0"; - function retry3(octokit, octokitOptions) { - const state = Object.assign( - { - enabled: true, - retryAfterBaseValue: 1e3, - doNotRetry: [400, 401, 403, 404, 422, 451], - retries: 3 - }, - octokitOptions.retry - ); - if (state.enabled) { - octokit.hook.error("request", errorRequest.bind(null, state, octokit)); - octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit)); + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; } - return { - retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { - retries, - retryAfter - }); - return error4; + 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(_, $1, $2) { + if (!$2) { + $2 = "\\"; } - } - }; - } - retry3.VERSION = VERSION; - } -}); - -// node_modules/jsonschema/lib/helpers.js -var require_helpers = __commonJS({ - "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { - "use strict"; - var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path2, name, argument) { - if (Array.isArray(path2)) { - this.path = path2; - this.property = path2.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else if (path2 !== void 0) { - this.property = path2; - } - if (message) { - this.message = message; - } - if (schema2) { - var id = schema2.$id || schema2.id; - this.schema = id || schema2; + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - if (instance !== void 0) { - this.instance = instance; + clearStateChar(); + if (escaping) { + re += "\\\\"; } - 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, schema2, options, ctx) { - this.instance = instance; - this.schema = schema2; - 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); + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; } - this.errors.push(err); - if (this.throwFirst) { - throw new ValidatorResultError(this); - } else if (this.throwError) { - throw err; + 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; } - 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); + if (re !== "" && hasMagic) { + re = "(?=.)" + re; } - }; - 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 (Error.captureStackTrace) { - Error.captureStackTrace(this, ValidatorResultError); + if (addPatternStart) { + re = patternStart + re; } - 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, schema2) { - this.message = msg; - this.schema = schema2; - Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); - }; - SchemaError.prototype = Object.create( - Error.prototype, - { - constructor: { value: SchemaError, enumerable: false }, - name: { value: "SchemaError", enumerable: false } + if (isSub === SUBPARSE) { + return [re, hasMagic]; } - ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path2, base, schemas) { - this.schema = schema2; - this.options = options; - if (Array.isArray(path2)) { - this.path = path2; - this.propertyPath = path2.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else { - this.propertyPath = path2; + if (!hasMagic) { + return globUnescape(pattern); } - this.base = base; - this.schemas = schemas; - }; - SchemaContext.prototype.resolve = function resolve2(target) { - return uri.resolve(this.base, target); - }; - SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path2 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); - var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path2, base, Object.create(this.schemas)); - if (id && !ctx.schemas[base]) { - ctx.schemas[base] = schema2; + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re + "$", flags); + } catch (er) { + return new RegExp("$."); } - 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]+$/ + regExp._glob = pattern; + regExp._src = re; + return regExp; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); }; - 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); + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; } - return true; - }; - var makeSuffix = exports2.makeSuffix = function makeSuffix2(key) { - key = key.toString(); - if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { - return "." + key; + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; + }).join("\\/"); + }).join("|"); + re = "^(?:" + re + ")$"; + if (this.negate) re = "^(?!" + re + ").*$"; + try { + this.regexp = new RegExp(re, flags); + } catch (ex) { + this.regexp = false; } - if (key.match(/^\d+$/)) { - return "[" + key + "]"; + return this.regexp; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); } - return "[" + JSON.stringify(key) + "]"; + return list; }; - exports2.deepCompareStrict = function deepCompareStrict(a, b) { - if (typeof a !== typeof b) { - return false; + Minimatch.prototype.match = function match(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 (path2.sep !== "/") { + f = f.split(path2.sep).join("/"); } - 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]); - }); + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; } - if (typeof a === "object") { - if (!a || !b) { - return a === b; + for (i = 0; i < set2.length; i++) { + var pattern = set2[i]; + var file = f; + if (options.matchBase && pattern.length === 1) { + file = [filename]; } - var aKeys = Object.keys(a); - var bKeys = Object.keys(b); - if (aKeys.length !== bKeys.length) { - return false; + var hit = this.matchOne(file, pattern, partial); + if (hit) { + if (options.flipNegate) return true; + return !this.negate; } - return aKeys.every(function(v) { - return deepCompareStrict(a[v], b[v]); - }); } - return a === b; + if (options.flipNegate) return false; + return this.negate; }; - 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 array = Array.isArray(src); - var dst = array && [] || {}; - if (array) { - 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)); + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + return false; } - 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(number) { - var decimalPlaces = 0; - if (isNaN(number)) return decimalPlaces; - if (typeof number !== "number") { - number = Number(number); - } - var parts = number.toString().split("e"); - if (parts.length === 2) { - if (parts[1][0] !== "-") { - return decimalPlaces; + var hit; + if (typeof p === "string") { + hit = f === p; + this.debug("string match", p, f, hit); } else { - decimalPlaces = Number(parts[1].slice(1)); + hit = f.match(p); + this.debug("pattern match", p, f, hit); } + if (!hit) return false; } - var decimalParts = parts[0].split("."); - if (decimalParts.length === 2) { - decimalPlaces += decimalParts[1].length; + if (fi === fl && pi === pl) { + return true; + } else if (fi === fl) { + return partial; + } else if (pi === pl) { + return fi === fl - 1 && file[fi] === ""; } - return decimalPlaces; - }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + throw new Error("wtf?"); }; + function globUnescape(s) { + return s.replace(/\\(.)/g, "$1"); + } + function regExpEscape(s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + } } }); -// node_modules/jsonschema/lib/attribute.js -var require_attribute = __commonJS({ - "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { +// 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 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, schema2, options, ctx) { - if (instance === void 0) { - return null; + 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]; + } }; } - var result = new ValidatorResult(instance, schema2, options, ctx); - var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; - if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { - var list = types.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 - }); + 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; }; - function testSchemaNoThrow(instance, options, ctx, callback, schema2) { - var throwError2 = options.throwError; - var throwAll = options.throwAll; - options.throwError = false; - options.throwAll = false; - var res = this.validateSchema(instance, schema2, options, ctx); - options.throwError = throwError2; - options.throwAll = throwAll; - if (!res.valid && callback instanceof Function) { - callback(res); - } - return res.valid; - } - validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - if (!Array.isArray(schema2.anyOf)) { - throw new SchemaError("anyOf must be an array"); + 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 path2 = __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(path2.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path2.basename(remaining); + this.segments.unshift(basename); + 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(path2.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } + } + } } - if (!schema2.anyOf.some( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path2.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path2.sep; } - ) - )) { - var list = schema2.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 += this.segments[i]; } - result.addError({ - name: "anyOf", - argument: list, - message: "is not any of " + list.join(",") - }); + return result; } - return result; }; - validators.allOf = function validateAllOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + 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]; + } }; } - if (!Array.isArray(schema2.allOf)) { - throw new SchemaError("allOf must be an array"); + 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); } - var result = new ValidatorResult(instance, schema2, options, ctx); - var self2 = this; - schema2.allOf.forEach(function(v, i) { - var valid2 = self2.validateSchema(instance, v, options, ctx); - if (!valid2.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: valid2.errors.length, valid: valid2 }, - message: "does not match allOf schema " + msg + " with " + valid2.errors.length + " error[s]:" - }); - result.importErrors(valid2); - } - }); + __setModuleDefault2(result, mod); return result; }; - validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - if (!Array.isArray(schema2.oneOf)) { - throw new SchemaError("oneOf must be an array"); - } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - var count = schema2.oneOf.filter( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); + 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 os2 = __importStar2(require("os")); + var path2 = __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, homedir) { + 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}`; } - ) - ).length; - var list = schema2.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, schema2, options, ctx) { - if (instance === void 0) return null; - if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); - var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); - var result = new ValidatorResult(instance, schema2, options, ctx); - var res; - if (ifValid) { - if (schema2.then === void 0) return; - if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); - res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); - result.importErrors(res); - } else { - if (schema2.else === void 0) return; - if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); - res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); - result.importErrors(res); - } - return result; - }; - function getEnumerableProperty(object, key) { - if (Object.hasOwnProperty.call(object, key)) return object[key]; - if (!(key in object)) return; - while (object = Object.getPrototypeOf(object)) { - if (Object.propertyIsEnumerable.call(object, key)) return object[key]; - } - } - validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var subschema = schema2.propertyNames !== void 0 ? schema2.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); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path2.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); } - return result; - }; - validators.properties = function validateProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var properties = schema2.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"'); + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path2.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path2.sep}`; + } + } else { + itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); } - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, subschema, options, ctx); + if (this.minimatch.match(itemPath)) { + return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; } - 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, schema2, options, ctx, property, result) { - if (!this.types.object(instance)) return; - if (schema2.properties && schema2.properties[property] !== void 0) { - return; + return internal_match_kind_1.MatchKind.None; } - if (schema2.additionalProperties === false) { - result.addError({ - name: "additionalProperties", - argument: property, - message: "is not allowed to have the additional property " + JSON.stringify(property) - }); - } else { - var additionalProperties = schema2.additionalProperties || {}; - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, additionalProperties, options, ctx); + /** + * 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); } - 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); + return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\+/ : /\/+/), this.minimatch.set[0], true); } - } - validators.patternProperties = function validatePatternProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var patternProperties = schema2.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"'); + /** + * 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, homedir) { + (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(`.${path2.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path2.sep}`)) { + homedir = homedir || os2.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 += "\\"; } - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); + 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 += "\\"; } - if (!regexp.test(property)) { + 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; + } else { + set2 += c2; + } + } + if (closed >= 0) { + if (set2.length > 1) { + return ""; + } + if (set2) { + literal += set2; + i = closed; + 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, schema2, options, ctx, property, result); + literal += c; } + return literal; } - return result; - }; - validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - if (schema2.patternProperties) { - return null; + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); } - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in instance) { - testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + }; + 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(path2, level) { + this.path = path2; + this.level = level; } - return result; }; - validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length >= schema2.minProperties)) { - result.addError({ - name: "minProperties", - argument: schema2.minProperties, - message: "does not meet minimum property length of " + schema2.minProperties - }); + 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 || 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; }; - validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length <= schema2.maxProperties)) { - result.addError({ - name: "maxProperties", - argument: schema2.maxProperties, - message: "does not meet maximum property length of " + schema2.maxProperties + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); } - return result; - }; - validators.items = function validateItems(instance, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.items === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - instance.every(function(value, i) { - if (Array.isArray(schema2.items)) { - var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; - } else { - var items = schema2.items; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (items === void 0) { - return true; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (items === false) { - result.addError({ - name: "items", - message: "additionalItems not permitted" - }); - return false; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.contains === void 0) return; - if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); - var result = new ValidatorResult(instance, schema2, options, ctx); - var count = instance.some(function(value, i) { - var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); - return res.errors.length === 0; + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - if (count === false) { - result.addError({ - name: "contains", - argument: schema2.contains, - message: "must contain an item matching given schema" - }); - } - return result; - }; - validators.minimum = function validateMinimum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { - if (!(instance > schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than " + schema2.minimum - }); - } - } else { - if (!(instance >= schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than or equal to " + schema2.minimum - }); - } - } - return result; }; - validators.maximum = function validateMaximum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { - if (!(instance < schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than " + schema2.maximum - }); - } - } else { - if (!(instance <= schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than or equal to " + schema2.maximum + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); }); - } + }; } - return result; - }; - validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMinimum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid2 = instance > schema2.exclusiveMinimum; - if (!valid2) { - result.addError({ - name: "exclusiveMinimum", - argument: schema2.exclusiveMinimum, - message: "must be strictly greater than " + schema2.exclusiveMinimum - }); + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d }); + }, reject); } - return result; }; - validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMaximum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid2 = instance < schema2.exclusiveMaximum; - if (!valid2) { - result.addError({ - name: "exclusiveMaximum", - argument: schema2.exclusiveMaximum, - message: "must be strictly less than " + schema2.exclusiveMaximum - }); - } - return result; + var __await2 = exports2 && exports2.__await || function(v) { + return this instanceof __await2 ? (this.v = v, this) : new __await2(v); }; - var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { - if (!this.types.number(instance)) return; - var validationArgument = schema2[validationType]; - if (validationArgument == 0) { - throw new SchemaError(validationType + " cannot be zero"); + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - var result = new ValidatorResult(instance, schema2, 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) - }); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); + } } - return result; - }; - validators.multipleOf = function validateMultipleOf(instance, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); - }; - validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); - }; - validators.required = function validateRequired(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (instance === void 0 && schema2.required === true) { - result.addError({ - name: "required", - message: "is required" - }); - } else if (this.types.object(instance) && Array.isArray(schema2.required)) { - schema2.required.forEach(function(n) { - if (getEnumerableProperty(instance, n) === void 0) { - result.addError({ - name: "required", - argument: n, - message: "requires property " + JSON.stringify(n) - }); - } - }); + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - return result; - }; - validators.pattern = function validatePattern(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var pattern = schema2.pattern; - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); + function fulfill(value) { + resume("next", value); } - if (!instance.match(regexp)) { - result.addError({ - name: "pattern", - argument: schema2.pattern, - message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) - }); + function reject(value) { + resume("throw", value); } - return result; - }; - validators.format = function validateFormat(instance, schema2, options, ctx) { - if (instance === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { - result.addError({ - name: "format", - argument: schema2.format, - message: "does not conform to the " + JSON.stringify(schema2.format) + " format" - }); + function settle(f, v) { + if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } - return result; }; - validators.minLength = function validateMinLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length >= schema2.minLength)) { - result.addError({ - name: "minLength", - argument: schema2.minLength, - message: "does not meet minimum length of " + schema2.minLength - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.DefaultGlobber = void 0; + var core12 = __importStar2(require_core3()); + var fs = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path2 = __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); } - return result; - }; - validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length <= schema2.maxLength)) { - result.addError({ - name: "maxLength", - argument: schema2.maxLength, - message: "does not meet maximum length of " + schema2.maxLength - }); + getSearchPaths() { + return this.searchPaths.slice(); } - return result; - }; - validators.minItems = function validateMinItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length >= schema2.minItems)) { - result.addError({ - name: "minItems", - argument: schema2.minItems, - message: "does not meet minimum length of " + schema2.minItems + glob() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } + } + return result; }); } - return result; - }; - validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length <= schema2.maxItems)) { - result.addError({ - name: "maxItems", - argument: schema2.maxItems, - message: "does not meet maximum length of " + schema2.maxItems + 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)) { + core12.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs.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 match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !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 && path2.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & 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(fs.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path2.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); + } + } }); } - 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, schema2, options, ctx) { - if (schema2.uniqueItems !== true) return; - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!instance.every(testArrays)) { - result.addError({ - name: "uniqueItems", - message: "contains duplicate item" + /** + * 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; }); } - return result; - }; - validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in schema2.dependencies) { - if (instance[property] === void 0) { - continue; - } - var dep = schema2.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 - }); + static stat(item, options, traversalChain) { + return __awaiter2(this, void 0, void 0, function* () { + let stats; + if (options.followSymbolicLinks) { + try { + stats = yield fs.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core12.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 { - 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); + } else { + stats = yield fs.promises.lstat(item.path); } - } - } - return result; - }; - validators["enum"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + if (traversalChain.some((x) => x === realPath)) { + core12.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; + }); } - if (!Array.isArray(schema2["enum"])) { - throw new SchemaError("enum expects an array", schema2); + }; + 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]; + } }; } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { - result.addError({ - name: "enum", - argument: schema2["enum"], - message: "is not one of enum values: " + schema2["enum"].map(String).join(",") - }); + 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; }; - validators["const"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!helpers.deepCompareStrict(schema2["const"], instance)) { - result.addError({ - name: "const", - argument: schema2["const"], - message: "does not exactly match expected constant: " + schema2["const"] + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); } - return result; + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { - var self2 = this; - if (instance === void 0) return null; - var result = new ValidatorResult(instance, schema2, options, ctx); - var notTypes = schema2.not || schema2.disallow; - if (!notTypes) return null; - if (!Array.isArray(notTypes)) notTypes = [notTypes]; - notTypes.forEach(function(type2) { - if (self2.testType(instance, schema2, options, ctx, type2)) { - var id = type2 && (type2.$id || type2.id); - var schemaId = id || type2; - result.addError({ - name: "not", - argument: schemaId, - message: "is of prohibited type " + schemaId + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); }); + }; + } + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d }); + }, reject); + } + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core12 = __importStar2(require_core3()); + var fs = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path2 = __importStar2(require("path")); + function hashFiles(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core12.info : core12.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path2.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_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 ""; } }); - return result; - }; - module2.exports = attribute; + } + exports2.hashFiles = hashFiles; } }); -// node_modules/jsonschema/lib/scan.js -var require_scan = __commonJS({ - "node_modules/jsonschema/lib/scan.js"(exports2, module2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.js"(exports2) { "use strict"; - var urilib = require("url"); - var helpers = require_helpers(); - module2.exports.SchemaScanResult = SchemaScanResult; - function SchemaScanResult(found, ref) { - this.id = found; - this.ref = ref; - } - module2.exports.scan = function scan(base, schema2) { - function scanSchema(baseuri, schema3) { - if (!schema3 || typeof schema3 != "object") return; - if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); - ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; - return; - } - var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; - if (ourBase) { - if (ourBase.indexOf("#") < 0) ourBase += "#"; - if (found[ourBase]) { - if (!helpers.deepCompareStrict(found[ourBase], schema3)) { - throw new Error("Schema <" + ourBase + "> already exists with different definition"); - } - return found[ourBase]; - } - found[ourBase] = schema3; - if (ourBase[ourBase.length - 1] == "#") { - found[ourBase.substring(0, ourBase.length - 1)] = schema3; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); - scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); - scanSchema(ourBase + "/additionalItems", schema3.additionalItems); - scanObject(ourBase + "/properties", schema3.properties); - scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); - scanObject(ourBase + "/definitions", schema3.definitions); - scanObject(ourBase + "/patternProperties", schema3.patternProperties); - scanObject(ourBase + "/dependencies", schema3.dependencies); - scanArray(ourBase + "/disallow", schema3.disallow); - scanArray(ourBase + "/allOf", schema3.allOf); - scanArray(ourBase + "/anyOf", schema3.anyOf); - scanArray(ourBase + "/oneOf", schema3.oneOf); - scanSchema(ourBase + "/not", schema3.not); - } - function scanArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - scanSchema(baseuri + "/" + i, schemas[i]); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - function scanObject(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - scanSchema(baseuri + "/" + p, schemas[p]); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - var found = {}; - var ref = {}; - scanSchema(base, schema2); - return new SchemaScanResult(found, ref); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = exports2.create = void 0; + var internal_globber_1 = require_internal_globber(); + var internal_hash_files_1 = require_internal_hash_files(); + function create(patterns, options) { + return __awaiter2(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); + } + exports2.create = create; + function hashFiles(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create(patterns, { followSymbolicLinks }); + return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); + }); + } + exports2.hashFiles = hashFiles; } }); -// node_modules/jsonschema/lib/validator.js -var require_validator = __commonJS({ - "node_modules/jsonschema/lib/validator.js"(exports2, module2) { - "use strict"; - var urilib = require("url"); - 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 Validator2 = function Validator3() { - this.customFormats = Object.create(Validator3.prototype.customFormats); - this.schemas = {}; - this.unresolvedRefs = []; - this.types = Object.create(types); - this.attributes = Object.create(attribute.validators); - }; - Validator2.prototype.customFormats = {}; - Validator2.prototype.schemas = null; - Validator2.prototype.types = null; - Validator2.prototype.attributes = null; - Validator2.prototype.unresolvedRefs = null; - Validator2.prototype.addSchema = function addSchema(schema2, base) { - var self2 = this; - if (!schema2) { - return null; - } - var scan = scanSchema(base || anonymousBase, schema2); - var ourUri = base || schema2.$id || schema2.id; - for (var uri in scan.id) { - this.schemas[uri] = scan.id[uri]; - } - for (var uri in scan.ref) { - this.unresolvedRefs.push(uri); +// 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 debug5; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug5 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug5 = 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 + "}"); } - this.unresolvedRefs = this.unresolvedRefs.filter(function(uri2) { - return typeof self2.schemas[uri2] === "undefined"; - }); - return this.schemas[ourUri]; - }; - Validator2.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - this.addSubSchema(baseuri, schemas[i]); + 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++) { + debug5(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); } - }; - Validator2.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - this.addSubSchema(baseuri, schemas[p]); + } + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - }; - Validator2.prototype.setSchemas = function setSchemas(schemas) { - this.schemas = schemas; - }; - Validator2.prototype.getSchema = function getSchema(urn) { - return this.schemas[urn]; - }; - Validator2.prototype.validate = function validate(instance, schema2, options, ctx) { - if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { - throw new SchemaError("Expected `schema` to be an object or boolean"); + if (version instanceof SemVer) { + return version; } - if (!options) { - options = {}; + if (typeof version !== "string") { + return null; } - var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); - if (!ctx) { - ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); - if (!ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - var found = scanSchema(base, schema2); - for (var n in found.id) { - var sch = found.id[n]; - ctx.schemas[n] = sch; - } + if (version.length > MAX_LENGTH) { + return null; } - if (options.required && instance === void 0) { - var result = new ValidatorResult(instance, schema2, options, ctx); - result.addError("is required, but is undefined"); - return result; + var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; + if (!r.test(version)) { + return null; } - var result = this.validateSchema(instance, schema2, options, ctx); - if (!result) { - throw new Error("Result undefined"); - } else if (options.throwAll && result.errors.length) { - throw new ValidatorResultError(result); + try { + return new SemVer(version, options); + } catch (er) { + return null; } - return result; - }; - function shouldResolve(schema2) { - var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; - if (typeof ref == "string") return ref; - return false; } - Validator2.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (typeof schema2 === "boolean") { - if (schema2 === true) { - schema2 = {}; - } else if (schema2 === false) { - schema2 = { type: [] }; - } - } else if (!schema2) { - throw new Error("schema is undefined"); - } - if (schema2["extends"]) { - if (Array.isArray(schema2["extends"])) { - var schemaobj = { schema: schema2, ctx }; - schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); - schema2 = schemaobj.schema; - schemaobj.schema = null; - schemaobj.ctx = null; - schemaobj = null; - } else { - schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); - } - } - var switchSchema = shouldResolve(schema2); - if (switchSchema) { - var resolved = this.resolve(schema2, 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 schema2) { - if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { - var validatorErr = null; - var validator = this.attributes[key]; - if (validator) { - validatorErr = validator.call(this, instance, schema2, options, ctx); - } else if (options.allowUnknownAttributes === false) { - throw new SchemaError("Unsupported attribute: " + key, schema2); - } - if (validatorErr) { - result.importErrors(validatorErr); - } + exports2.valid = valid2; + function valid2(version, options) { + var v = parse(version, options); + return v ? v.version : null; + } + exports2.clean = clean; + function clean(version, options) { + var s = parse(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 (typeof options.rewrite == "function") { - var value = options.rewrite.call(this, instance, schema2, options, ctx); - result.instance = value; + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } - return result; - }; - Validator2.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { - schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); - }; - Validator2.prototype.superResolve = function superResolve(schema2, ctx) { - var ref = shouldResolve(schema2); - if (ref) { - return this.resolve(schema2, ref, ctx).subschema; + if (!(this instanceof SemVer)) { + return new SemVer(version, options); } - return schema2; - }; - Validator2.prototype.resolve = function resolve2(schema2, switchSchema, ctx) { - switchSchema = ctx.resolve(switchSchema); - if (ctx.schemas[switchSchema]) { - return { subschema: ctx.schemas[switchSchema], switchSchema }; + debug5("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); } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && 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 + ">", schema2); + 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"); } - var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); - if (subschema === void 0) { - throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); } - return { subschema, switchSchema }; - }; - Validator2.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { - if (type2 === void 0) { - return; - } else if (type2 === null) { - throw new SchemaError('Unexpected null in "type" keyword'); + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); } - if (typeof this.types[type2] == "function") { - return this.types[type2].call(this, instance); + 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; + }); } - if (type2 && typeof type2 == "object") { - var res = this.validateSchema(instance, type2, options, ctx); - return res === void 0 || !(res && res.errors.length); + 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 true; - }; - var types = Validator2.prototype.types = {}; - types.string = function testString(instance) { - return typeof instance == "string"; - }; - types.number = function testNumber(instance) { - return typeof instance == "number" && isFinite(instance); - }; - types.integer = function testInteger(instance) { - return typeof instance == "number" && instance % 1 === 0; - }; - types.boolean = function testBoolean(instance) { - return typeof instance == "boolean"; - }; - types.array = function testArray(instance) { - return Array.isArray(instance); - }; - types["null"] = function testNull(instance) { - return instance === null; - }; - types.date = function testDate(instance) { - return instance instanceof Date; - }; - types.any = function testAny(instance) { - return true; - }; - types.object = function testObject(instance) { - return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); + return this.version; }; - module2.exports = Validator2; - } -}); - -// node_modules/jsonschema/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/jsonschema/lib/index.js"(exports2, module2) { - "use strict"; - var Validator2 = 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, schema2, options) { - var v = new Validator2(); - return v.validate(instance, schema2, options); + SemVer.prototype.toString = function() { + return this.version; }; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + SemVer.prototype.compare = function(other) { + debug5("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - __setModuleDefault4(result, mod); - return result; + return this.compareMain(other) || this.comparePre(other); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core12 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core12.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core12.debug(`implicitDescendants '${result.implicitDescendants}'`); - } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core12.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); - } - } - return result; - } - exports2.getOptions = getOptions; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + SemVer.prototype.compareMain = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path2 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - let result = path2.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + 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; } - return result; - } - exports2.dirname = dirname; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`); - if (hasAbsoluteRoot(itemPath)) { - return itemPath; + var i2 = 0; + do { + var a = this.prerelease[i2]; + var b = other.prerelease[i2]; + debug5("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); } - if (IS_WINDOWS) { - if (itemPath.match(/^[A-Z]:[^\\/]|^[A-Z]:$/i)) { - let cwd = process.cwd(); - 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 += "\\"; + var i2 = 0; + do { + var a = this.build[i2]; + var b = other.build[i2]; + debug5("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; } - return `${itemPath[0]}:\\${cwd.substr(3)}${itemPath.substr(2)}`; } - } else { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; + if (i2 === -1) { + this.prerelease.push(0); + } } - } else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { - const cwd = process.cwd(); - 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)}`; - } - } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path2.sep; - } - return root + itemPath; - } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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("/"); - } - exports2.hasRoot = hasRoot; - 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, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; - } - p = normalizeSeparators(p); - if (!p.endsWith(path2.sep)) { - return p; + 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); } - if (p === path2.sep) { - return p; + 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; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + try { + return new SemVer(version, loose).inc(release2, identifier).version; + } catch (er) { + return null; } - return p.substr(0, p.length - 1); } - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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; + exports2.diff = diff; + function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + var prefix = ""; + if (v1.prerelease.length || v2.prerelease.length) { + prefix = "pre"; + var defaultResult = "prerelease"; } - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; + for (var key in v1) { + if (key === "major" || key === "minor" || key === "patch") { + if (v1[key] !== v2[key]) { + return prefix + key; + } } - tempKey = parent; - parent = pathHelper.dirname(tempKey); - } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; } + return defaultResult; } - return result; } - exports2.getSearchPaths = getSearchPaths; - function match(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); - } + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; } - return result; + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - exports2.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; - }; - var isArray = 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 = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); - } - i = ai < bi && ai >= 0 ? ai : bi; - } - if (begs.length) { - result = [left, right]; - } - } - return result; + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - } -}); - -// 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + exports2.compare = compare; + function compare(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare(a, b, true); } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + 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); } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); - } - parts.push.apply(parts, p); - return parts; + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare(b, a, loose); } - function expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); - } - return expand(escapeBraces(str2), true).map(unescapeBraces); + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - function embrace(str2) { - return "{" + str2 + "}"; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - function isPadded(el) { - return /^-?0\d/.test(el); + exports2.gt = gt; + function gt(a, b, loose) { + return compare(a, b, loose) > 0; } - function lte(i, y) { - return i <= y; + exports2.lt = lt; + function lt(a, b, loose) { + return compare(a, b, loose) < 0; } - function gte3(i, y) { - return i >= y; + exports2.eq = eq; + function eq(a, b, loose) { + return compare(a, b, loose) === 0; } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + exports2.neq = neq; + function neq(a, b, loose) { + return compare(a, b, loose) !== 0; + } + exports2.gte = gte4; + function gte4(a, b, loose) { + return compare(a, b, loose) >= 0; + } + exports2.lte = lte; + function lte(a, b, loose) { + return compare(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 gte4(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + } + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte3; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - } else { - N = concatMap(n, function(el) { - return expand(el, false); - }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - return expansions; + comp = comp.trim().split(/\s+/).join(" "); + debug5("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; + } + debug5("comp", this); } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path2 = (function() { - try { - return require("path"); - } catch (e) { + 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); } - })() || { - sep: "/" }; - minimatch.sep = path2.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } + Comparator.prototype.toString = function() { + return this.value; }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + Comparator.prototype.test = function(version) { + debug5("Comparator.test", version, this.options.loose); + if (this.semver === ANY || version === ANY) { + return true; } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; + if (typeof version === "string") { + try { + version = new SemVer(version, this.options); + } catch (er) { + return false; + } + } + return cmp(version, this.operator, this.semver, this.options); }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + Comparator.prototype.intersects = function(comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError("a Comparator is required"); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path2.sep !== "/") { - pattern = pattern.split(path2.sep).join("/"); + 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(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; + } + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); + } + } + if (range instanceof Comparator) { + return new Range2(range.value, options); + } + if (!(this instanceof Range2)) { + return new Range2(range, options); } this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - Minimatch.prototype.debug = function() { + Range2.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(" ").trim(); + }).join("||").trim(); + return this.range; }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + Range2.prototype.toString = function() { + return this.range; + }; + Range2.prototype.parseRange = function(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug5("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); + }); } - if (!pattern) { - this.empty = true; - return; + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; + }; + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug5() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { + return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; + }; + 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(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); }); - this.debug(this.pattern, set2); - this.set = set2; } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = 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++) { - negate = !negate; - negateOffset++; - } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate; + function parseComparator(comp, options) { + debug5("comp", comp, options); + comp = replaceCarets(comp, options); + debug5("caret", comp); + comp = replaceTildes(comp, options); + debug5("tildes", comp); + comp = replaceXRanges(comp, options); + debug5("xrange", comp); + comp = replaceStars(comp, options); + debug5("stars", comp); + return comp; } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; + 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(_, M, m, p, pr) { + debug5("tilde", comp, _, 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) { + debug5("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; } else { - options = {}; + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; - } - return expand(pattern); + debug5("tilde return", ret); + return ret; + }); } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); - } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); - } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); + } + function replaceCaret(comp, options) { + debug5("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug5("caret", comp, _, 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) { + debug5("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 { + debug5("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"; } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + debug5("caret return", ret); + return ret; + }); + } + function replaceXRanges(comp, options) { + debug5("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) { + debug5("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 = ""; } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + pr = options.includePrerelease ? "-0" : ""; + if (xM) { + if (gtlt === ">" || gtlt === "<") { + ret = "<0.0.0-0"; + } else { + ret = "*"; } - 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; - } - 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; + } 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; } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M = +M + 1; + } else { + m = +m + 1; } - re += c; + } + 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; + } + debug5("xRange return", ret); + return ret; + }); + } + function replaceStars(comp, options) { + debug5("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; } } - if (inClass) { - cs = pattern.substr(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; + for (var i2 = 0; i2 < this.set.length; i2++) { + if (testSet(this.set[i2], version, this.options)) { + return true; + } } - 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(_, $1, $2) { - if (!$2) { - $2 = "\\"; + return false; + }; + function testSet(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug5(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + return false; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + return true; + } + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + return range.test(version); + } + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, options); + } catch (er) { + return null; } - 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 = "$"; + versions.forEach(function(v) { + if (rangeObj.test(v)) { + if (!max || maxSV.compare(v) === -1) { + max = v; + maxSV = new SemVer(max, options); + } } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + }); + return max; + } + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, options); + } catch (er) { + return null; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + 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(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - if (addPatternStart) { - re = patternStart + re; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 (!hasMagic) { - return globUnescape(pattern); + if (minver && range.test(minver)) { + return minver; } - var flags = options.nocase ? "i" : ""; + return null; + } + exports2.validRange = validRange; + function validRange(range, options) { try { - var regExp = new RegExp("^" + re + "$", flags); + return new Range2(range, options).range || "*"; } catch (er) { - return new RegExp("$."); + return null; } - regExp._glob = pattern; - regExp._src = re; - return regExp; } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte4; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src; - }).join("\\/"); - }).join("|"); - re = "^(?:" + re + ")$"; - if (this.negate) re = "^(?!" + re + ").*$"; - try { - this.regexp = new RegExp(re, flags); - } catch (ex) { - this.regexp = false; + if (satisfies2(version, range, options)) { + return false; } - return this.regexp; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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; } - minimatch.match = function(list, pattern, options) { + exports2.prerelease = prerelease; + function prerelease(version, options) { + var parsed = parse(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 = coerce2; + function coerce2(version, options) { + if (version instanceof SemVer) { + return version; + } + if (typeof version === "number") { + version = String(version); + } + if (typeof version !== "string") { + return null; + } options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); + var match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } + safeRe[t.COERCERTL].lastIndex = -1; } - return list; - }; - Minimatch.prototype.match = function match(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 (path2.sep !== "/") { - f = f.split(path2.sep).join("/"); + if (match === null) { + return null; } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; + return parse(match[2] + "." + (match[3] || "0") + "." + (match[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.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); + } +}); + +// 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]; + } }; } - for (i = 0; i < set2.length; i++) { - var pattern = set2[i]; - var file = f; - if (options.matchBase && pattern.length === 1) { - file = [filename]; + 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]); } - var hit = this.matchOne(file, pattern, partial); - if (hit) { - if (options.flipNegate) return true; - return !this.negate; + __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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); + }); + }; + } + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d }); + }, reject); } - if (options.flipNegate) return false; - return this.negate; }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; + 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 core12 = __importStar2(require_core()); + var exec = __importStar2(require_exec()); + var glob = __importStar2(require_glob()); + var io4 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs = __importStar2(require("fs")); + var path2 = __importStar2(require("path")); + var semver6 = __importStar2(require_semver3()); + var util = __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"; } - return true; } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; + tempDirectory = path2.join(baseLocation, "actions", "temp"); + } + const dest = path2.join(tempDirectory, crypto2.randomUUID()); + yield io4.mkdirP(dest); + return dest; + }); + } + function getArchiveFileSizeInBytes(filePath) { + return fs.statSync(filePath).size; + } + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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 glob.create(patterns.join("\n"), { + implicitDescendants: false + }); + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path2.relative(workspace, file).replace(new RegExp(`\\${path2.sep}`, "g"), "/"); + core12.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; + paths.push(`${relativeFile}`); + } + } + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_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 util.promisify(fs.unlink)(filePath); + }); + } + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core12.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - return false; + }); + } catch (err) { + core12.debug(err.message); } - var hit; - if (typeof p === "string") { - hit = f === p; - this.debug("string match", p, f, hit); + versionOutput = versionOutput.trim(); + core12.debug(versionOutput); + return versionOutput; + }); + } + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver6.clean(versionOutput); + core12.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; } else { - hit = f.match(p); - this.debug("pattern match", p, f, hit); + return constants_1.CompressionMethod.ZstdWithoutLong; } - if (!hit) return false; + }); + } + 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 (fs.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; + } + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io4.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - if (fi === fl && pi === pl) { - return true; - } else if (fi === fl) { - return partial; - } else if (pi === pl) { - return fi === fl - 1 && file[fi] === ""; + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - throw new Error("wtf?"); - }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); + } + components.push(versionSalt); + return crypto2.createHash("sha256").update(components.join("|")).digest("hex"); } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + 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/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; +// 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 _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.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], context2); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; + } + } + 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(resolve2) { + resolve2(value); }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { 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]); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path2.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path2.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); + } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) 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: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path2.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; } - } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path2.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path2.sep; + if (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; } - result += this.segments[i]; - } - return result; + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; + } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; + } + op = body.call(thisArg, _); + } 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); + }); + }; + } + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ 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); } }; - exports2.Path = Path; + env.stack.push({ value, dispose, async }); + } else if (async) { + env.stack.push({ async: true }); } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + } + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path2, preserveJsx) { + if (typeof path2 === "string" && /^\.\.?\//.test(path2)) { + return path2.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path2; +} +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); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os2 = __importStar4(require("os")); - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path2.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(path2.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path2.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, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path2.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path2.sep}`)) { - homedir = homedir || os2.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } - } - } - literal += c; + __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 literal; - } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); - } - }; - exports2.Pattern = Pattern; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path2, level) { - this.path = path2; - this.level = level; - } + return t; + }; + return __assign.apply(this, arguments); }; - exports2.SearchState = SearchState; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + __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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + }); + __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); - } }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(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); }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await4 ? 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]); - } + _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; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core12 = __importStar4(require_core()); - var fs = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path2 = __importStar4(require("path")); - var patternHelper = __importStar4(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() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); - } - globGenerator() { - return __asyncGenerator4(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)) { - core12.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path2.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); - } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core12.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 fs.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core12.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; - } - traversalChain.push(realPath); - } - return stats; - }); - } + 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 }; - exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError = class extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); }; + exports2.AbortError = AbortError; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/log.js +var require_log2 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/logger/log.js"(exports2) { + "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + 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}`); } - exports2.create = create; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + Object.defineProperty(exports2, "__esModule", { value: true }); + var log_js_1 = require_log2(); + 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 }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); + } } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - return new (P || (P = Promise))(function(resolve2, 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 enabled(namespace) { + if (namespace.endsWith("*")) { + return true; + } + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a; - 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 fs = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - try { - yield exports2.stat(fsPath); - } catch (err) { - if (err.code === "ENOENT") { + } + 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; } - throw err; + while (namespace[namespaceIndex] !== pattern[patternIndex]) { + namespaceIndex++; + if (namespaceIndex === namespaceLength) { + return false; + } + } + lastWildcardNamespace = namespaceIndex; + namespaceIndex++; + patternIndex++; + continue; + } else { + return false; } - return true; - }); + } + const namespaceDone = namespaceIndex === namespace.length; + const patternDone = patternIndex === pattern.length; + const trailingWildCard = patternIndex === pattern.length - 1 && pattern[patternIndex] === "*"; + return namespaceDone && (patternDone || trailingWildCard); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); - return stats.isDirectory(); - }); + function disable() { + const result = enabledString || ""; + enable(""); + return result; } - exports2.isDirectory = isDirectory; - function isRooted(p) { - p = normalizeSeparators(p); - if (!p) { - throw new Error('isRooted() parameter "p" cannot be empty'); + function createDebugger(namespace) { + const newDebugger = Object.assign(debug5, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug5(...args) { + if (!newDebugger.enabled) { + return; + } + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); } - if (exports2.IS_WINDOWS) { - return p.startsWith("\\") || /^[A-Z]:/i.test(p); + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; } - return p.startsWith("/"); + return false; } - exports2.isRooted = isRooted; - function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(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}`); + function extend3(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); } } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path2.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; - } + 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 createLogger(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: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; + } + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.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(map2) { + for (const entry of map2.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]); } } - 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}`); - } + } + /** + * 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; } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - try { - const directory = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path2.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; - } - } + } else { + for (const [normalizedName, entry] of this._headersMap) { + result[normalizedName] = entry.value; } } - return ""; - }); - } - exports2.tryGetExecutablePath = tryGetExecutablePath; - function normalizeSeparators(p) { - p = p || ""; - if (exports2.IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - return p.replace(/\\\\+/g, "\\"); + return result; } - 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(); + /** + * 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); } - function getCmdPath() { - var _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } +}); + +// 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(); } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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; } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - 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 path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); - function cp(source, dest, options = {}) { - return __awaiter4(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; + 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, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); + } + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } - const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path2.join(dest, path2.basename(source)) : dest; - if (!(yield ioUtil.exists(source))) { - throw new Error(`no such file or directory: ${source}`); + 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 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.`); + 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 { - yield cpDirRecursive(source, newDest, 0, force); - } - } else { - if (path2.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); + return noPhase; } - yield copyFile(source, newDest, force); } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.basename(source)); - destExists = yield ioUtil.exists(dest); + 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"); } - if (destExists) { - if (options.force == null || options.force) { - yield rmRF(dest); - } else { - throw new Error("Destination already exists"); - } + 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); } - yield mkdirP(path2.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - exports2.mv = mv; - function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { - if (ioUtil.IS_WINDOWS) { - if (/[*"<>|]/.test(inputPath)) { - throw new Error('File path must not contain `*`, `"`, `<`, `>` or `|` on Windows'); + 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}`); } - } - 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 __awaiter4(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 which4(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which4(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.`); + if (options.afterPolicies) { + for (const afterPolicyName of options.afterPolicies) { + const afterNode = policyMap.get(afterPolicyName); + if (afterNode) { + node.dependsOn.add(afterNode); + afterNode.dependants.add(node); + } } } - return result; - } - const matches = yield findInPath(tool); - if (matches && matches.length > 0) { - return matches[0]; - } - return ""; - }); - } - exports2.which = which4; - function findInPath(tool) { - return __awaiter4(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(path2.delimiter)) { - if (extension) { - extensions.push(extension); + if (options.beforePolicies) { + for (const beforePolicyName of options.beforePolicies) { + const beforeNode = policyMap.get(beforePolicyName); + if (beforeNode) { + beforeNode.dependsOn.add(node); + node.dependants.add(beforeNode); + } } } } - if (ioUtil.isRooted(tool)) { - const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); - if (filePath) { - return [filePath]; - } - return []; - } - if (tool.includes(path2.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { - if (p) { - directories.push(p); + 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); } } } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.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 __awaiter4(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 copyFile(srcFile, destFile, force); + 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); + } } } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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); - } + 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."); } - 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); } - }); + return result; + } + }; + function createEmptyPipeline() { + return HttpPipeline.create(); } } }); -// 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 debug5; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug5 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug5 = 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++; +// 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); } - 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 + "}"); + } +}); + +// 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 value; + return false; } - 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++) { - debug5(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); + } +}); + +// 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())); } - } - var i; - exports2.parse = parse; - function parse(version, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + /** + * 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); } - if (version instanceof SemVer) { - return version; + /** + * 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 url = new URL(value); + if (!url.search) { + return value; + } + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } + } + return url.toString(); } - if (typeof version !== "string") { - return null; + 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; } - if (version.length > MAX_LENGTH) { - return null; + 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; } - var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version)) { - return null; + }; + 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); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + }; + exports2.RestError = RestError; + function isRestError(e) { + if (e instanceof RestError) { + return true; } + return (0, error_js_1.isError)(e) && e.name === "RestError"; } - exports2.valid = valid2; - function valid2(version, options) { - var v = parse(version, options); - return v ? v.version : null; + } +}); + +// 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); } - exports2.clean = clean; - function clean(version, options) { - var s = parse(version.trim().replace(/^[=v]+/, ""), options); - return s ? s.version : null; + function stringToUint8Array(value, format) { + return Buffer.from(value, format); } - 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); - } - debug5("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(); + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/log.js +var require_log3 = __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_log3(); + var sanitizer_js_1 = require_sanitizer(); + var DEFAULT_TLS_SETTINGS = {}; + function isReadableStream(body) { + return body && typeof body.pipe === "function"; } - SemVer.prototype.format = function() { - this.version = this.major + "." + this.minor + "." + this.patch; - if (this.prerelease.length) { - this.version += "-" + this.prerelease.join("."); + function isStreamComplete(stream) { + if (stream.readable === false) { + return Promise.resolve(); } - return this.version; - }; - SemVer.prototype.toString = function() { - return this.version; - }; - SemVer.prototype.compare = function(other) { - debug5("SemVer.compare", this.version, this.options, other); - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + return new Promise((resolve2) => { + const handler = () => { + resolve2(); + stream.removeListener("close", handler); + stream.removeListener("end", handler); + stream.removeListener("error", handler); + }; + stream.on("close", handler); + stream.on("end", handler); + stream.on("error", handler); + }); + } + 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); + } } - return this.compareMain(other) || this.comparePre(other); - }; - SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + constructor(progressCallback) { + super(); + this.progressCallback = progressCallback; } - 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]; - debug5("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); + 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(request) { + const abortController = new AbortController(); + let abortListener; + if (request.abortSignal) { + if (request.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(); + } + }; + request.abortSignal.addEventListener("abort", abortListener); } - } 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]; - debug5("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); + let timeoutId; + if (request.timeout > 0) { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); + abortController.abort(); + }, request.timeout); } - } 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); + const acceptEncoding = request.headers.get("Accept-Encoding"); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); + let body = typeof request.body === "function" ? request.body() : request.body; + if (body && !request.headers.has("Content-Length")) { + const bodyLength = getBodyLength(body); + if (bodyLength !== null) { + request.headers.set("Content-Length", bodyLength); } - this.inc("pre", identifier); - break; - case "major": - if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) { - this.major++; + } + let responseStream; + try { + if (body && request.onUploadProgress) { + const onUploadProgress = request.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; } - this.minor = 0; - this.patch = 0; - this.prerelease = []; - break; - case "minor": - if (this.patch !== 0 || this.prerelease.length === 0) { - this.minor++; + const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); } - this.patch = 0; - this.prerelease = []; - break; - case "patch": - if (this.prerelease.length === 0) { - this.patch++; + const headers = getResponseHeaders(res); + const status = res.statusCode ?? 0; + const response = { + status, + headers, + request + }; + if (request.method === "HEAD") { + res.resume(); + return response; } - 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]; + responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res; + const onDownloadProgress = request.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 + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) + ) { + response.readableStreamBody = responseStream; } else { - var i2 = this.prerelease.length; - while (--i2 >= 0) { - if (typeof this.prerelease[i2] === "number") { - this.prerelease[i2]++; - i2 = -2; - } + response.bodyAsText = await streamToText(responseStream); + } + return response; + } finally { + if (request.abortSignal && abortListener) { + let uploadStreamDone = Promise.resolve(); + if (isReadableStream(body)) { + uploadStreamDone = isStreamComplete(body); } - if (i2 === -1) { - this.prerelease.push(0); + let downloadStreamDone = Promise.resolve(); + if (isReadableStream(responseStream)) { + downloadStreamDone = isStreamComplete(responseStream); } - } - if (identifier) { - if (this.prerelease[0] === identifier) { - if (isNaN(this.prerelease[1])) { - this.prerelease = [identifier, 0]; + Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { + if (abortListener) { + request.abortSignal?.removeEventListener("abort", abortListener); } + }).catch((e) => { + log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); + }); + } + } + } + makeRequest(request, abortController, body) { + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (isInsecure && !request.allowInsecureConnection) { + throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); + } + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); + const options = { + agent, + hostname: url.hostname, + path: `${url.pathname}${url.search}`, + port: url.port, + method: request.method, + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides + }; + return new Promise((resolve2, reject) => { + const req = isInsecure ? node_http_1.default.request(options, resolve2) : node_https_1.default.request(options, resolve2); + req.once("error", (err) => { + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + }); + 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 { - this.prerelease = [identifier, 0]; + log_js_1.logger.error("Unrecognized body type", body); + reject(new restError_js_1.RestError("Unrecognized body type")); } + } else { + req.end(); } - break; - default: - throw new Error("invalid increment argument: " + release2); + }); + } + getOrCreateAgent(request, isInsecure) { + const disableKeepAlive = request.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 && !request.tlsSettings) { + return node_https_1.default.globalAgent; + } + const tlsSettings = request.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; + } } - 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 = parse(version1); - var v2 = parse(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; - } + 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 defaultResult; } + return headers; } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; + function getDecodedResponseStream(stream, headers) { + const contentEncoding = headers.get("Content-Encoding"); + if (contentEncoding === "gzip") { + const unzip = node_zlib_1.default.createGunzip(); + stream.pipe(unzip); + return unzip; + } else if (contentEncoding === "deflate") { + const inflate = node_zlib_1.default.createInflate(); + stream.pipe(inflate); + return inflate; } - 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); + return stream; } - exports2.major = major; - function major(a, loose) { - return new SemVer(a, loose).major; + function streamToText(stream) { + return new Promise((resolve2, reject) => { + const buffer = []; + stream.on("data", (chunk) => { + if (Buffer.isBuffer(chunk)) { + buffer.push(chunk); + } else { + buffer.push(Buffer.from(chunk)); + } + }); + stream.on("end", () => { + resolve2(Buffer.concat(buffer).toString("utf8")); + }); + stream.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 + })); + } + }); + }); } - exports2.minor = minor; - function minor(a, loose) { - return new SemVer(a, loose).minor; + 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; + } } - exports2.patch = patch; - function patch(a, loose) { - return new SemVer(a, loose).patch; + function createNodeHttpClient() { + return new NodeHttpClient(); } - exports2.compare = compare; - function compare(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); + } +}); + +// 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)(); } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare(a, b, true); + } +}); + +// 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_log3(); + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + logger(`Response status code: ${response.status}`); + logger(`Headers: ${sanitizer.sanitize(response.headers)}`); + return response; + } + }; } - 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); + } +}); + +// 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; } - exports2.rcompare = rcompare; - function rcompare(a, b, loose) { - return compare(b, a, loose); + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); + } + return response; } - exports2.sort = sort; - function sort(list, loose) { - return list.sort(function(a, b) { - return exports2.compareBuild(a, b, loose); - }); + } +}); + +// 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"; } - exports2.rsort = rsort; - function rsort(list, loose) { - return list.sort(function(a, b) { - return exports2.compareBuild(b, a, loose); - }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } - exports2.gt = gt; - function gt(a, b, loose) { - return compare(a, b, loose) > 0; + } +}); + +// 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(" "); } - exports2.lt = lt; - function lt(a, b, loose) { - return compare(a, b, loose) < 0; + function getUserAgentHeaderName() { + return (0, userAgentPlatform_js_1.getHeaderName)(); } - exports2.eq = eq; - function eq(a, b, loose) { - return compare(a, b, loose) === 0; + 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; } - exports2.neq = neq; - function neq(a, b, loose) { - return compare(a, b, loose) !== 0; + } +}); + +// 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } + }; } - exports2.gte = gte3; - function gte3(a, b, loose) { - return compare(a, b, loose) >= 0; + } +}); + +// 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(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); + } + return next(request); + } + }; } - exports2.lte = lte; - function lte(a, b, loose) { - return compare(a, b, loose) <= 0; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/random.js +var require_random2 = __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; } - 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 gte3(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); - } + } +}); + +// 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_random2(); + 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 }; } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + } +}); + +// 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((resolve2, reject) => { + let timer = void 0; + let onAborted = void 0; + const rejectOnAbort = () => { + return reject(new AbortError_js_1.AbortError(options?.abortErrorMsg ? options?.abortErrorMsg : StandardAbortMessage)); }; - } - 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(" "); - debug5("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; - } - debug5("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) { - debug5("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 + const removeListeners = () => { + if (options?.abortSignal && onAborted) { + options.abortSignal.removeEventListener("abort", onAborted); + } }; - } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + onAborted = () => { + if (timer) { + clearTimeout(timer); + } + removeListeners(); + return rejectOnAbort(); }; - } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + if (options?.abortSignal && options.abortSignal.aborted) { + return rejectOnAbort(); + } + timer = setTimeout(() => { + removeListeners(); + resolve2(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - } - if (range instanceof Comparator) { - return new Range2(range.value, options); - } - if (!(this instanceof Range2)) { - return new Range2(range, options); - } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.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(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug5("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug5("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); - }); - } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.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(); + 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; } - return result; } - exports2.toComparators = toComparators; - function toComparators(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function parseComparator(comp, options) { - debug5("comp", comp, options); - comp = replaceCarets(comp, options); - debug5("caret", comp); - comp = replaceTildes(comp, options); - debug5("tildes", comp); - comp = replaceXRanges(comp, options); - debug5("xrange", comp); - comp = replaceStars(comp, options); - debug5("stars", comp); - return comp; + function throttlingRetryStrategy() { + return { + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; + } + return { + retryAfterInMs + }; + } + }; } - function isX(id) { - return !id || id.toLowerCase() === "x" || id === "*"; + } +}); + +// 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 replaceTildes(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceTilde(comp2, options); - }).join(" "); + function isExponentialRetryResponse(response) { + return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); } - function replaceTilde(comp, options) { - var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; - return comp.replace(r, function(_, M, m, p, pr) { - debug5("tilde", comp, _, 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) { - debug5("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + 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(request, 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; + } + } } - debug5("tilde return", ret); - return ret; - }); + }; } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); + } +}); + +// 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 + }; } - function replaceCaret(comp, options) { - debug5("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug5("caret", comp, _, 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) { - debug5("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"; + } +}); + +// 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(request, next) { + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - } else { - debug5("no pr"); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + await prepareFormData(request.formData, request); } - } else { - ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; + request.formData = void 0; } + return next(request); } - debug5("caret return", ret); - return ret; - }); - } - function replaceXRanges(comp, options) { - debug5("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) { - debug5("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 = ""; + 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()); } - pr = options.includePrerelease ? "-0" : ""; - if (xM) { - if (gtlt === ">" || gtlt === "<") { - ret = "<0.0.0-0"; + } + return urlSearchParams.toString(); + } + async function prepareFormData(formData, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 { - 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; - } + 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 + }); } - 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; } - debug5("xRange return", ret); - return ret; - }); + } + request.multipartBody = { parts }; } - function replaceStars(comp, options) { - debug5("replaceStars", comp, options); - return comp.trim().replace(safeRe[t.STAR], ""); + } +}); + +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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 parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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 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; + function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + "d"; } - 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; + if (msAbs >= h) { + return Math.round(ms / h) + "h"; } - return (from + " " + to).trim(); + if (msAbs >= m) { + return Math.round(ms / m) + "m"; + } + if (msAbs >= s) { + return Math.round(ms / s) + "s"; + } + return ms + "ms"; } - Range2.prototype.test = function(version) { - if (!version) { - return false; + function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, "day"); } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } + if (msAbs >= h) { + return plural(ms, msAbs, h, "hour"); } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + if (msAbs >= m) { + return plural(ms, msAbs, m, "minute"); } - return false; - }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; + 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 = coerce2; + 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 hash = 0; + for (let i = 0; i < namespace.length; i++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i); + hash |= 0; } + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug5(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug5(...args) { + if (!debug5.enabled) { + return; } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; + const self2 = debug5; + 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 index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; + }); + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); + } + debug5.namespace = namespace; + debug5.useColors = createDebug.useColors(); + debug5.color = createDebug.selectColor(namespace); + debug5.extend = extend3; + debug5.destroy = createDebug.destroy; + Object.defineProperty(debug5, "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(debug5); } - return false; - } - return true; - } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + return debug5; } - return range.test(version); - } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + function extend3(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); + 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); } } - }); - return max; - } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, 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); + 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; } } - }); - return min; - } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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); + 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; } - if (minver && range.test(minver)) { - return minver; + function coerce2(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; } - return null; - } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + 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; } - exports2.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); - } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); - } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte3; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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 (satisfies2(version, range, options)) { + if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + index++; + if (match === "%c") { + lastC = index; } - } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + }); + args.splice(lastC, 0, c); } - exports2.coerce = coerce2; - function coerce2(version, options) { - if (version instanceof SemVer) { - return version; - } - if (typeof version === "number") { - version = String(version); + exports2.log = console.debug || console.log || (() => { + }); + function save(namespaces) { + try { + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { } - if (typeof version !== "string") { - return null; + } + function load2() { + let r; + try { + r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); + } catch (error3) { } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; - } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } - safeRe[t.COERCERTL].lastIndex = -1; + if (!r && typeof process !== "undefined" && "env" in process) { + r = process.env.DEBUG; } - if (match === null) { - return null; + return r; + } + function localstorage() { + try { + return localStorage; + } catch (error3) { } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } + 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/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// node_modules/has-flag/index.js +var require_has_flag = __commonJS({ + "node_modules/has-flag/index.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - 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); + 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/@actions/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// node_modules/supports-color/index.js +var require_supports_color = __commonJS({ + "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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]; - } }; + var os2 = 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); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + } + function translateLevel(level) { + if (level === 0) { + return false; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; + } + function supportsColor(haveStream, streamIsTTY) { + if (forceColor === 0) { + return 0; } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); + if (hasFlag("color=256")) { + return 2; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core12 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob = __importStar4(require_glob()); - var io4 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - var semver5 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path2.join(baseLocation, "actions", "temp"); - } - const dest = path2.join(tempDirectory, crypto.randomUUID()); - yield io4.mkdirP(dest); - return dest; - }); - } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs.statSync(filePath).size; - } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const paths = []; - const workspace = (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const globber = yield glob.create(patterns.join("\n"), { - implicitDescendants: false - }); - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path2.relative(workspace, file).replace(new RegExp(`\\${path2.sep}`, "g"), "/"); - core12.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); - } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs.unlink)(filePath); - }); - } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core12.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() - } - }); - } catch (err) { - core12.debug(err.message); + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; + } + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; + } + if (process.platform === "win32") { + const osRelease = os2.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } - versionOutput = versionOutput.trim(); - core12.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver5.clean(versionOutput); - core12.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + 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; } - }); - } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; - } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; + 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; } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io4.which("tar") : ""; - }); - } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); } - return value; - } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); + if (/-256(color)?$/i.test(env.TERM)) { + return 2; } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + 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(stream) { + const level = supportsColor(stream, stream && stream.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 util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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 + ]; } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + } catch (error3) { } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + 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, (_, 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); } - return token; + obj[prop] = val; + return obj; + }, {}); + function useColors() { + return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/cache/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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); - } + 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 { - return void 0; + args[0] = getDate() + name + " " + args[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; - } + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; } - return false; + return (/* @__PURE__ */ new Date()).toISOString() + " "; } - 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]"); + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; } - get password() { - return this._decodedPassword; + } + function load2() { + return process.env.DEBUG; + } + function init(debug5) { + debug5.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug5.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); + }; + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -53848,2220 +60917,2185 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = __importStar4(require("http")); - var https = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https = __importStar2(require("https")); + async function toBuffer(stream) { + let length = 0; + const chunks = []; + for await (const chunk of stream) { + length += chunk.length; + chunks.push(chunk); } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + return Buffer.concat(chunks, length); } - exports2.isHttps = isHttps; - var HttpClient = class { - constructor(userAgent, 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 = userAgent; - 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 __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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; + exports2.toBuffer = toBuffer; + async function json2(stream) { + const buf = await toBuffer(stream); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); + } + exports2.json = json2; + function req(url, opts = {}) { + const href = typeof url === "string" ? url : url.href; + const req2 = (href.startsWith("https:") ? https : http).request(url, opts); + const promise = new Promise((resolve2, reject) => { + req2.once("response", resolve2).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; + } + exports2.req = req; + } +}); + +// node_modules/agent-base/dist/index.js +var require_dist = __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] = {}; } /** - * Raw request with callback. - * @param info - * @param data - * @param onResult + * Determine whether this is an `http` or `https` request. */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; + isSecureEndpoint(options) { + if (options) { + if (typeof options.secureEndpoint === "boolean") { + return options.secureEndpoint; } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + if (typeof options.protocol === "string") { + return options.protocol === "https:"; } } - const req = info6.httpModule.request(info6.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: ${info6.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); - }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + 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 (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + if (!this.sockets[name]) { + this.sockets[name] = []; } + const fakeSocket = new net.Socket({ writable: false }); + this.sockets[name].push(fakeSocket); + this.totalSocketCount++; + return fakeSocket; } - /** - * 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) { + decrementSockets(name, socket) { + if (!this.sockets[name] || socket === null) { return; } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + const sockets = this.sockets[name]; + const index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; + } + } } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; + // 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); } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.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 info6; + return socket; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + get defaultPort() { + return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; } - return lowercaseKeys(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + get protocol() { + return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; } - return additionalHeaders[header] || clientHeader || _default2; } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + }; + 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 debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve2, reject) => { + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once("readable", read); } - if (!useProxy) { - agent = this._agent; + function cleanup() { + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("readable", read); } - if (agent) { - return agent; + function onend() { + cleanup(); + debug5("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + function onerror(err) { + cleanup(); + debug5("onerror %o", err); + reject(err); } - 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; + 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) { + debug5("have not received end of HTTP headers yet..."); + read(); + return; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https.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 __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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) { + 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}"`)); } - 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); + 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 { - resolve2(response); + headers[key] = value; } - })); - }); - } - }; - exports2.HttpClient = HttpClient; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } + debug5("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve2({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); + } + socket.on("error", onerror); + socket.on("end", onend); + read(); + }); + } + exports2.parseProxyResponse = parseProxyResponse; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __commonJS({ + "node_modules/https-proxy-agent/dist/index.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; - var BasicCredentialHandler = class { - constructor(username, password) { - this.username = username; - this.password = password; + 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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug5 = (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 + }; } - prepareRequest(options) { - if (!options.headers) { - throw Error("The request has no headers"); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug5("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 ? omit(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:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + } else { + debug5("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); + 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) { + debug5("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; + } + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug5("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); }); + return fakeSocket; } }; - 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"); + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); + } + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + return ret; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __commonJS({ + "node_modules/http-proxy-agent/dist/index.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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - 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, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); + 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]; + } }; } - getOrderedPolicies() { - if (!this._orderedPolicies) { - this._orderedPolicies = this.orderPolicies(); - } - return this._orderedPolicies; + 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); } - clone() { - return new _HttpPipeline(this._policies); + __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_dist(); + var url_1 = require("url"); + var debug5 = (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 ?? {}; + debug5("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 ? omit(opts, "headers") : null, + host, + port + }; } - static create() { - return new _HttpPipeline(); + addRequest(req, opts) { + req._header = null; + this.setRequestProps(req, opts); + super.addRequest(req, opts); } - orderPolicies() { - const result = []; - const policyMap = /* @__PURE__ */ new Map(); - function createPhase(name) { - return { - name, - policies: /* @__PURE__ */ new Set(), - hasRun: false, - hasAfterPolicies: false - }; + setRequestProps(req, opts) { + const { proxy } = this; + const protocol = opts.secureEndpoint ? "https:" : "http:"; + const hostname = req.getHeader("host") || "localhost"; + const base = `${protocol}//${hostname}`; + const url = new url_1.URL(req.path, base); + if (opts.port !== 80) { + url.port = String(opts.port); } - 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; - } + req.path = String(url); + const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; + if (proxy.username || proxy.password) { + const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - 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); + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - 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); - } - } + for (const name of Object.keys(headers)) { + const value = headers[name]; + if (value) { + req.setHeader(name, value); } } - 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); - } - } + } + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); } - 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 first; + let endOfHeaders; + debug5("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug5("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); + debug5("Output buffer: %o", req.outputData[0].data); } - 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."); - } + let socket; + if (this.proxy.protocol === "https:") { + debug5("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug5("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - return result; + await (0, events_1.once)(socket, "connect"); + return socket; } }; - function createEmptyPipeline() { - return HttpPipeline.create(); + HttpProxyAgent.protocols = ["http", "https"]; + exports2.HttpProxyAgent = HttpProxyAgent; + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; } } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { +// 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 }); - var os2 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os2.EOL}`); - } - 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 - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } + exports2.globalNoProxyList = exports2.proxyPolicyName = void 0; + exports2.loadNoProxy = loadNoProxy; + exports2.getDefaultProxySettings = getDefaultProxySettings; + exports2.proxyPolicy = proxyPolicy; + var https_proxy_agent_1 = require_dist2(); + var http_proxy_agent_1 = require_dist3(); + var log_js_1 = require_log3(); + 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()]; } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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 enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + function isBypassed(uri, noProxyList, bypassedMap) { + if (noProxyList.length === 0) { + return false; } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + const host = new URL(uri).hostname; + if (bypassedMap?.has(host)) { + return bypassedMap.get(host); } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; + 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; + } } } - return false; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function disable() { - const result = enabledString || ""; - enable(""); - return result; + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); + } + return []; } - function createDebugger(namespace) { - const newDebugger = Object.assign(debug6, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend: extend3 - }); - function debug6(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; } - newDebugger.log(...args); } - debuggers.push(newDebugger); - return newDebugger; + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + parsedUrl.hostname, + port: Number.parseInt(parsedUrl.port || "80"), + username: parsedUrl.username, + password: parsedUrl.password + }; } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; + 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 false; - } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; + return parsedProxyUrl; } - var debug5 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug5("azure"); - AzureLogger.log = (...args) => { - debug5.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (request.tlsSettings) { + log_js_1.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored."); } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); + const headers = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + } + request.agent = cachedAgents.httpsProxyAgent; } - debug5.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 - }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); + } + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + } + return next(request); + } }; } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug5.disable(); - debug5.enable(enabledNamespaces2 + "," + logger.namespace); - } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log2 = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __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_commonjs = __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_AbortError(); - 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) { +// 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.createAbortablePromise = createAbortablePromise; - var abort_controller_1 = require_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve2, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); - } - try { - buildPromise((x) => { - removeListeners(); - resolve2(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + 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); } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); + }; } } }); -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/random.js"(exports2) { +// 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.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; + 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/@azure/core-util/dist/commonjs/delay.js -var require_delay = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/delay.js"(exports2) { +// 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.delay = delay2; - exports2.calculateRetryDelay = calculateRetryDelay; - var createAbortablePromise_js_1 = require_createAbortablePromise(); - var random_js_1 = require_random2(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve2) => { - token = setTimeout(resolve2, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage - }); + 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 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 }; + 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/@azure/core-util/dist/commonjs/aborterUtils.js -var require_aborterUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/aborterUtils.js"(exports2) { +// 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.cancelablePromiseRace = cancelablePromiseRace; - async function cancelablePromiseRace(abortablePromiseBuilders, options) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); + exports2.concat = concat; + var stream_1 = require("stream"); + var typeGuards_js_1 = require_typeGuards(); + async function* streamAsyncIterator() { + const reader = this.getReader(); try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); + while (true) { + const { done, value } = await reader.read(); + if (done) { + return; + } + yield value; + } } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); + reader.releaseLock(); } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); + } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - return false; } - function getErrorMessage2(e) { - if (isError(e)) { - return e.message; + function ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); } 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}`; + return stream; } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha2562 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + 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 computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + 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 stream of streams) { + for await (const chunk of stream) { + yield chunk; + } + } + })()); + }; } } }); -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { +// 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.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + 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 isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } + function encodeHeaders(headers) { + let result = ""; + for (const [key, value] of headers) { + result += `${key}: ${value}\r +`; } - return true; + return result; } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; + 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; + } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID() { - return uuidFunction(); + 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; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); + } + request.body = await (0, concat_js_1.concat)(sources); } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); + 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(request, next) { + if (!request.multipartBody) { + return next(request); + } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); + } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); + } + }; } } }); -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 random_js_1 = require_random2(); - 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - var sha256_js_1 = require_sha2562(); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { +// 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.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); - } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); - } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - const url = new URL(value); - if (!url.search) { - return value; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; + } + } +}); + +// 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 url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.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_log3(); + var insecureConnectionWarningEmmitted = false; + function allowInsecureConnection(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url = new URL(request.url); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; } - return url.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 false; + } + function emitInsecureConnectionWarning() { + const warning7 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning7); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning7); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); + } else { + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } - return sanitized; } - sanitizeQuery(value) { - if (typeof value !== "object" || value === null) { - return value; + } + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); } - const sanitized = {}; - for (const k of Object.keys(value)) { - if (this.allowedQueryParameters.has(k.toLowerCase())) { - sanitized[k] = value[k]; - } else { - sanitized[k] = RedactedString; + }; + } + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); } - return sanitized; - } - }; - exports2.Sanitizer = Sanitizer; + }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js"(exports2) { +// 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.logPolicyName = void 0; - exports2.logPolicy = logPolicy; - var log_js_1 = require_log2(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); + exports2.bearerAuthenticationPolicyName = void 0; + exports2.bearerAuthenticationPolicy = bearerAuthenticationPolicy; + var checkInsecureConnection_js_1 = require_checkInsecureConnection(); + exports2.bearerAuthenticationPolicyName = "bearerAuthenticationPolicy"; + function bearerAuthenticationPolicy(options) { return { - name: exports2.logPolicyName, + name: exports2.bearerAuthenticationPolicyName, async sendRequest(request, next) { - if (!logger.enabled) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { return next(request); } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js"(exports2) { +// 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.redirectPolicyName = void 0; - exports2.redirectPolicy = redirectPolicy; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; + exports2.oauth2AuthenticationPolicyName = void 0; + exports2.oauth2AuthenticationPolicy = oauth2AuthenticationPolicy; + var checkInsecureConnection_js_1 = require_checkInsecureConnection(); + exports2.oauth2AuthenticationPolicyName = "oauth2AuthenticationPolicy"; + function oauth2AuthenticationPolicy(options) { return { - name: exports2.redirectPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); } - return response; + return pipeline; + } + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); + } + return cachedHttpClient; } } }); -// node_modules/@azure/core-rest-pipeline/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, - __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]]; +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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; } - 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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + 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) }; } } - 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(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { +}); + +// 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_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); try { - step(generator.next(value)); + const response = await pipeline.sendRequest(httpClient, request); + const headers = response.headers.toJSON(); + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; + if (options?.onResponse) { + options.onResponse({ ...response, request, rawHeaders: headers, parsedBody }); + } + return { + request, + headers, + status: `${response.status}`, + body + }; } catch (e) { - reject(e); + if ((0, restError_js_1.isRestError)(e) && e.response && options.onResponse) { + const { response } = e; + const rawHeaders = response.headers.toJSON(); + options?.onResponse({ ...response, request, rawHeaders }, e); + } + throw e; } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(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 step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + function buildPipelineRequest(method, url, 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, + 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 + }); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; + 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) }; } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; + return { body: JSON.stringify(body) }; + case "text/plain": + return { body: String(body) }; + default: + if (typeof body === "string") { + return { body }; } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + return { body: JSON.stringify(body) }; } - op = body.call(thisArg, _); - } 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 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 + }); + } } -} -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 }; +}); + +// 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.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}`; } - }; - 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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + function appendQueryParams(url, options = {}) { + if (!options.queryParameters) { + return url; + } + const parsedUrl = new URL(url); + 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(); } - } - 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]; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; + } + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; + } + return endpoint; + } + 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 || ""); } } - 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); - }; +}); + +// 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); + } + } + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path2, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path2, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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."); + } + } + }; + } } - 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); - }); +}); + +// 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 }; - if (f) i[n] = f(i[n]); } } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); +}); + +// 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; } } - function step(r) { - r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); +}); + +// 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; + } }); } - function fulfill(value) { - resume("next", value); +}); + +// 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)(); + } } - function reject(value) { - resume("throw", value); +}); + +// 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; + } }); } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); +}); + +// 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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); + } } -} -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; +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js +var require_log4 = __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"); } -} -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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); +}); + +// 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 }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + } } - __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]; +}); + +// 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 + }; } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + } +}); + +// 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 + }; } - 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; +}); + +// 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; + } }); } - 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); - } +}); + +// 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_log4(); + 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 + }); } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; +}); + +// 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_userAgentPlatform = __commonJS({ +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 os2 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); + 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(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; + 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) { - map2.set("Bun", versions.bun); + map2.set("Bun", `${versions.bun} (${osInfo})`); } else if (versions.deno) { - map2.set("Deno", versions.deno); + map2.set("Deno", `${versions.deno} (${osInfo})`); } else if (versions.node) { - map2.set("Node", versions.node); + map2.set("Node", `${versions.node} (${osInfo})`); } } - map2.set("OS", `(${os2.arch()}-${os2.type()}-${os2.release()})`); } } }); // node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __commonJS({ +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.17.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_userAgent = __commonJS({ +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_userAgentPlatform(); - var constants_js_1 = require_constants8(); + var userAgentPlatform_js_1 = require_userAgentPlatform2(); + var constants_js_1 = require_constants9(); function getUserAgentString(telemetryInfo) { const parts = []; for (const [key, value] of telemetryInfo) { @@ -56085,13 +63119,13 @@ var require_userAgent = __commonJS({ }); // node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __commonJS({ +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_userAgent(); + var userAgent_js_1 = require_userAgent2(); var UserAgentHeaderName = (0, userAgent_js_1.getUserAgentHeaderName)(); exports2.userAgentPolicyName = "userAgentPolicy"; function userAgentPolicy(options = {}) { @@ -56109,268 +63143,456 @@ var require_userAgentPolicy = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.js +var require_sha2562 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/sha256.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - 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 isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + 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); } - function isBlob(x) { - return typeof x.stream === "function"; + async function computeSha256Hash(content, encoding) { + return (0, node_crypto_1.createHash)("sha256").update(content).digest(encoding); } } }); -// 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) { +// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); + 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_random2(); + 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_sha2562(); + 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(); } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; - } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); + 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); } } - function createFileFromStream(stream, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); - } - return s; - }, [rawContent]: stream }); - } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); + } +}); + +// 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-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { +// 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.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); + 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((resolve2, 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 { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); - } - yield yield tslib_1.__await(value); - } - } finally { - reader.releaseLock(); + buildPromise((x) => { + removeListeners(); + resolve2(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } + abortSignal?.addEventListener("abort", onAbort); }); } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } + } +}); + +// 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)((resolve2) => { + token = setTimeout(resolve2, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage + }); } - function ensureNodeStream(stream) { - if (stream instanceof ReadableStream) { - makeAsyncIterable(stream); - return node_stream_1.Readable.fromWeb(stream); + 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 { - return stream; + 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}`; } } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); - } else { - return ensureNodeStream(source); + } +}); + +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } } + return true; } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } - } - }); - })()); - }; + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js"(exports2) { +// 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.multipartPolicyName = void 0; - exports2.multipartPolicy = multipartPolicy; - var core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); + 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(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; + 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 encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; - } - return result; + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - 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 computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - 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; - } + 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"); } - return total; + }; + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); + } else { + return blob; } - request.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`); + function createFileFromStream(stream, 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 = stream(); + if (isNodeReadableStream(s)) { + throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + } + return s; + }, + [rawContent]: stream + }; + } + 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); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + } + 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, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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 !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); + sendRequest: async (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } + } } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); + return tspPolicy.sendRequest(request, next); } }; } @@ -56378,19 +63600,83 @@ var require_multipartPolicy = __commonJS({ }); // node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __commonJS({ +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; - exports2.decompressResponsePolicyName = "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.decompressResponsePolicyName, + name: exports2.setClientRequestIdPolicyName, async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } return next(request); } @@ -56399,277 +63685,492 @@ var require_decompressResponsePolicy = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// 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.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; + 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; + } + 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.AbortError = AbortError; + exports2.TracingContextImpl = TracingContextImpl; } }); -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError2(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + exports2.state = void 0; + exports2.state = { + instrumenterImplementation: void 0 + }; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { +// 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.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve2, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); - }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); - } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); - } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); + 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: () => { } - timer = setTimeout(() => { - removeListeners(); - resolve2(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + }; + } + 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 parseHeaderValueAsNumber(response, headerName) { - const value = response.headers.get(headerName); - if (!value) - return; - const valueAsNum = Number(value); - if (Number.isNaN(valueAsNum)) - return; - return valueAsNum; + 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-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { +// 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.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))) + 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(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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_log4(); + 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(request, next) { + if (!tracingClient) { + return next(request); + } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; + } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); + } + try { + const response = await tracingClient.withContext(tracingContext, next, request); + 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, request, spanAttributes) { 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 { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.tracingOptions }, { + spanKind: "client", + spanAttributes + }); + if (!span.isRecording()) { + span.end(); + return void 0; } - 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 (_a) { + const headers = tracingClient.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); + for (const [key, value] of Object.entries(headers)) { + request.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 isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + 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 throttlingRetryStrategy() { + 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: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; + name: exports2.wrapAbortSignalLikePolicyName, + sendRequest: async (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); } - return { - retryAfterInMs - }; } }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { +// 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.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; - } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - }; - } - 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; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); + } + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js"(exports2) { +// 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.retryPolicy = retryPolicy; - var helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline retryPolicy"); - var retryPolicyName = "retryPolicy"; - function retryPolicy(strategies, options = { maxRetries: constants_js_1.DEFAULT_RETRY_POLICY_COUNT }) { - const logger = options.logger || retryPolicyLogger; + 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 { - name: retryPolicyName, - async sendRequest(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.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; - } + async sendRequest(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); } } }; @@ -56677,12237 +64178,13294 @@ var require_retryPolicy = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { +// 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.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + exports2.createPipelineRequest = createPipelineRequest; + var ts_http_runtime_1 = require_commonjs(); + function createPipelineRequest(options) { + return (0, ts_http_runtime_1.createPipelineRequest)(options); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + } +}); + +// 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); } - var HttpHeadersImpl = class { - 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.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/@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/formDataPolicy.js -var require_formDataPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js"(exports2) { +// 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.formDataPolicyName = void 0; - exports2.formDataPolicy = formDataPolicy; - var core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); - } - return formDataMap; + 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); } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); - } - }; + } +}); + +// 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 + }); } - 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()); + } +}); + +// 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 { - urlSearchParams.append(key, value.toString()); + const finalToken = await getAccessToken(); + if (finalToken === null) { + throw new Error("Failed to refresh access token."); + } + return finalToken; } } - return urlSearchParams.toString(); - } - async function prepareFormData(formData, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); + 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; } - request.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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); - }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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; - } + 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; + }; } - 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"; + } +}); + +// 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_log4(); + var restError_js_1 = require_restError3(); + exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; + async function trySendRequest(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } - 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"); + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true + }; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - return ms + " ms"; } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + function isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - } -}); - -// 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 = coerce2; - 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]; + async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { + const { scopes } = onChallengeOptions; + const accessToken = await onChallengeOptions.getAccessToken(scopes, { + enableCae: true, + claims: caeClaims }); - createDebug.names = []; - createDebug.skips = []; - createDebug.formatters = {}; - function selectColor(namespace) { - let hash = 0; - for (let i = 0; i < namespace.length; i++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i); - hash |= 0; - } - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + if (!accessToken) { + return false; } - createDebug.selectColor = selectColor; - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - function debug5(...args) { - if (!debug5.enabled) { - return; - } - const self2 = debug5; - 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"); + 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(request, next) { + if (!request.url.toLowerCase().startsWith("https://")) { + throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; + await callbacks.authorizeRequest({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + getAccessToken, + logger }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug5.namespace = namespace; - debug5.useColors = createDebug.useColors(); - debug5.color = createDebug.selectColor(namespace); - debug5.extend = extend3; - debug5.destroy = createDebug.destroy; - Object.defineProperty(debug5, "enabled", { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } } - return enabledCache; - }, - set: (v) => { - enableOverride = v; } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug5); - } - return debug5; - } - function extend3(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)); + if (error3) { + throw error3; } else { - createDebug.names.push(ns); + return response; } } + }; + } + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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; } - 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++; + 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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); } - } 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 next(request); } - return false; - } - function coerce2(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; - } - 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`."); +// 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_log4(); + exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; + var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; + async function sendAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } }; - })(); - 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; + } +}); + +// 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; } - const c = "color: " + this.color; - args.splice(1, 0, c, "color: inherit"); - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } - }); - 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"); + /** + * 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"); } - } catch (error4) { - } - } - function load2() { - let r; - try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; - } - return r; - } - function localstorage() { - try { - return localStorage; - } catch (error4) { + this._key = key; } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.message; + /** + * 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/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports2, module2) { +// 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"; - 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); - }; + 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/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { +// 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"; - var os2 = 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; + 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; } - if (process.platform === "win32") { - const osRelease = os2.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; + /** + * The value of the name to be used in authentication. + */ + get name() { + return this._name; } - if ("CI" in env) { - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; + /** + * 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"); } - 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; + this._name = name; + this._key = key; } - 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; + /** + * 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; } - 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(stream) { - const level = supportsColor(stream, stream && stream.isTTY); - return translateLevel(level); - } - module2.exports = { - supportsColor: getSupportLevel, - stdout: translateLevel(supportsColor(true, tty.isatty(1))), - stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; + 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/debug/src/node.js -var require_node = __commonJS({ - "node_modules/debug/src/node.js"(exports2, module2) { - var tty = require("tty"); - var util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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 - ]; +// 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; } - } catch (error4) { - } - 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, (_, k) => { - return k.toUpperCase(); - }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); + /** + * 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; } - obj[prop] = val2; - 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]; + /** + * 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"; } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; - } - return (/* @__PURE__ */ new Date()).toISOString() + " "; + } +}); + +// 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 log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + function isPopToken(accessToken) { + return accessToken.tokenType === "pop"; } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; - } + function isTokenCredential(credential) { + const castCredential = credential; + return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); } - function load2() { - return process.env.DEBUG; + } +}); + +// 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } + }; } - function init(debug5) { - debug5.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug5.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; - } + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.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/@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/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https = __importStar4(require("https")); - async function toBuffer(stream) { - let length = 0; - const chunks = []; - for await (const chunk of stream) { - length += chunk.length; - chunks.push(chunk); - } - return Buffer.concat(chunks, length); + 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_utils7 = __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); } - exports2.toBuffer = toBuffer; - async function json2(stream) { - const buf = await toBuffer(stream); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; + 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; } } - exports2.json = json2; - function req(url, opts = {}) { - const href = typeof url === "string" ? url : url.href; - const req2 = (href.startsWith("https:") ? https : http).request(url, opts); - const promise = new Promise((resolve2, reject) => { - req2.once("response", resolve2).once("error", reject).end(); + 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) }); - 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) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = Symbol("AgentBaseInternalState"); - var Agent = class extends http.Agent { - constructor(opts) { - super(opts); - this[INTERNAL] = {}; + 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_utils7(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Determine whether this is an `http` or `https` request. + * @deprecated Removing the constraints validation on client side. */ - isSecureEndpoint(options) { - if (options) { - if (typeof options.secureEndpoint === "boolean") { - return options.secureEndpoint; + 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 (typeof options.protocol === "string") { - return options.protocol === "https:"; + 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); } } - 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 index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; + /** + * 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, object, 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; } - } - // 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); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - 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"); + if (mapper.isConstant) { + object = mapper.defaultValue; } - return socket; - } - get defaultPort() { - return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); - } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); } - } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); - } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); } - } - }; - 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 __importDefault4 = 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 = __importDefault4(require_src()); - var debug5 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve2, reject) => { - let buffersLength = 0; - const buffers = []; - function read() { - const b = socket.read(); - if (b) - ondata(b); - else - socket.once("readable", read); + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); } - function cleanup() { - socket.removeListener("end", onend); - socket.removeListener("error", onerror); - socket.removeListener("readable", read); + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } } - function onend() { - cleanup(); - debug5("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + 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; } - function onerror(err) { - cleanup(); - debug5("onerror %o", err); - reject(err); + let payload; + const mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; } - 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) { - debug5("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")); + 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]; + } } - 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}"`)); + if (mapperType.match(/^Number$/i) !== null) { + payload = parseFloat(responseBody); + if (isNaN(payload)) { + payload = responseBody; } - 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 if (mapperType.match(/^Boolean$/i) !== null) { + if (responseBody === "true") { + payload = true; + } else if (responseBody === "false") { + payload = false; } else { - headers[key] = value; + 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); } - debug5("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve2({ - connect: { - statusCode, - statusText, - headers - }, - buffered - }); } - socket.on("error", onerror); - socket.on("end", onend); - read(); - }); + if (mapper.isConstant) { + payload = mapper.defaultValue; + } + return payload; + } + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); } - 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 __createBinding4 = 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]; - } }; + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + return str2.substr(0, len); + } + function bufferToBase64Url(buffer) { + if (!buffer) { + return void 0; } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug5 = (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 - }; + if (!(buffer instanceof Uint8Array)) { + throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); } - return options; - }; - var HttpsProxyAgent = 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 ?? {}; - debug5("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 ? omit(opts, "headers") : null, - host, - port - }; + const str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; } - /** - * 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:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); - } else { - debug5("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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) { - debug5("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); - } - return socket; - } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug5("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); } - }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); } - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; + 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 ret; + return classes; } - } -}); - -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + function dateToUnixTime(d) { + if (!d) { + return void 0; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + if (typeof d.valueOf() === "string") { + d = new Date(d); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug5 = (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 ?? {}; - debug5("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 ? omit(opts, "headers") : null, - host, - port - }; + return Math.floor(d.getTime() / 1e3); + } + function unixTimeToDate(n) { + if (!n) { + return void 0; } - addRequest(req, opts) { - req._header = null; - this.setRequestProps(req, opts); - super.addRequest(req, opts); + 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.`); + } + } } - setRequestProps(req, opts) { - const { proxy } = this; - const protocol = opts.secureEndpoint ? "https:" : "http:"; - const hostname = req.getHeader("host") || "localhost"; - const base = `${protocol}//${hostname}`; - const url = new url_1.URL(req.path, base); - if (opts.port !== 80) { - url.port = String(opts.port); + 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(); } - req.path = String(url); - const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders }; - if (proxy.username || proxy.password) { - const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; + 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.`); } - if (!headers["Proxy-Connection"]) { - headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; + 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.`); } - for (const name of Object.keys(headers)) { - const value = headers[name]; - if (value) { - req.setHeader(name, value); + 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}".`); } } } - async connect(req, opts) { - req._header = null; - if (!req.path.includes("://")) { - this.setRequestProps(req, opts); - } - let first; - let endOfHeaders; - debug5("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug5("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); - debug5("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug5("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); + return value; + } + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + 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 < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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 { - debug5("Creating `net.Socket`: %o", this.connectOpts); - socket = net.connect(this.connectOpts); + tempArray[i] = serializedValue; } - await (0, events_1.once)(socket, "connect"); - return socket; } - }; - HttpProxyAgent.protocols = ["http", "https"]; - exports2.HttpProxyAgent = HttpProxyAgent; - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } + return tempArray; + } + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "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(object)) { + const serializedValue = serializer.serialize(valueType, object[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 ret; + return tempDictionary; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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()]; + 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 void 0; + return additionalProperties; } - function loadEnvironmentProxyValue() { - if (!process) { - return void 0; + 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)}".`); } - const httpsProxy = getEnvironmentValue(HTTPS_PROXY); - const allProxy = getEnvironmentValue(ALL_PROXY); - const httpProxy = getEnvironmentValue(HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; + return serializer.modelMappers[className]; } - function isBypassed(uri, noProxyList, bypassedMap) { - if (noProxyList.length === 0) { - return false; + 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}".`); + } } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + return modelProps; + } + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - let isBypassedFlag = false; - for (const pattern of noProxyList) { - if (pattern[0] === ".") { - if (host.endsWith(pattern)) { - isBypassedFlag = true; + if (object !== void 0 && object !== 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 { - if (host.length === pattern.length - 1 && host === pattern.slice(1)) { - isBypassedFlag = true; + const paths = splitSerializeName(propertyMapper.serializedName); + propName = paths.pop(); + for (const pathName of paths) { + const childObject = parentObject[pathName]; + if ((childObject === void 0 || childObject === null) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { + parentObject[pathName] = {}; + } + parentObject = parentObject[pathName]; } } - } else { - if (host === pattern) { - isBypassedFlag = true; + 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 = object[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 object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } } } + return payload; } - bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.set(host, isBypassedFlag); - return isBypassedFlag; + return object; } - function loadNoProxy() { - const noProxy = getEnvironmentValue(NO_PROXY); - noProxyListLoaded = true; - if (noProxy) { - return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); + function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; } - return []; - } - function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return void 0; + 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 parsedUrl = new URL(proxyUrl); - const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + parsedUrl.hostname, - port: Number.parseInt(parsedUrl.port || "80"), - username: parsedUrl.username, - password: parsedUrl.password - }; + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - function getDefaultProxySettingsInternal() { - const envProxy = loadEnvironmentProxyValue(); - return envProxy ? new URL(envProxy) : void 0; + function isSpecialXmlProperty(propertyName, options) { + return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); } - function getUrlFromProxySettings(settings) { - let parsedProxyUrl; - try { - parsedProxyUrl = new URL(settings.host); - } catch (_a) { - throw new Error(`Expecting a valid host string in proxy settings, but found "${settings.host}".`); + 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"); } - parsedProxyUrl.port = String(settings.port); - if (settings.username) { - parsedProxyUrl.username = settings.username; + 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; + } + } } - if (settings.password) { - parsedProxyUrl.password = settings.password; + 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 parsedProxyUrl; + return instance; } - function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; + 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}`); } - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (request.tlsSettings) { - log_js_1.logger.warning("TLS settings are not supported in combination with custom Proxy, certificates provided to the client will be ignored."); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); + } + return tempDictionary; } - const headers = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + 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]; } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + if (element.type.name === "Composite" && element.type.className) { + element = serializer.modelMappers[element.type.className] ?? element; } - request.agent = cachedAgents.httpsProxyAgent; + 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 proxyPolicy(proxySettings, options) { - if (!noProxyListLoaded) { - exports2.globalNoProxyList.push(...loadNoProxy()); + 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); + } + } + } } - const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); - const cachedAgents = {}; - return { - name: exports2.proxyPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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 next(request); } - }; + } + 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-rest-pipeline/dist/commonjs/policies/setClientRequestIdPolicy.js -var require_setClientRequestIdPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/setClientRequestIdPolicy.js"(exports2) { +// 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.setClientRequestIdPolicyName = void 0; - exports2.setClientRequestIdPolicy = setClientRequestIdPolicy; - exports2.setClientRequestIdPolicyName = "setClientRequestIdPolicy"; - function setClientRequestIdPolicy(requestIdHeaderName = "x-ms-client-request-id") { - return { - name: exports2.setClientRequestIdPolicyName, - async sendRequest(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); - } - return next(request); - } - }; - } + exports2.state = void 0; + exports2.state = { + operationRequestMap: /* @__PURE__ */ new WeakMap() + }; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { +// 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.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; + 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; } - return next(req); } - }; + } 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; } - } -}); - -// 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.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + 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 (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; } - return context2; + return result; } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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); + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; + } + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } - deleteValue(key) { - const newContext = new _TracingContextImpl(this); - newContext._contextMap.delete(key); - return newContext; + let info6 = state_js_1.state.operationRequestMap.get(request); + if (!info6) { + info6 = {}; + state_js_1.state.operationRequestMap.set(request, info6); } - }; - 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 - }; + return info6; + } } }); -// node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js -var require_instrumenter = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/instrumenter.js"(exports2) { +// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { + 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 } }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); + name: exports2.deserializationPolicyName, + async sendRequest(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); } }; } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; + } else { + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); + } + } + return result; } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return state_js_1.state.instrumenterImplementation; + return result; } - exports2.getInstrumenter = getInstrumenter; - } -}); - -// 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 = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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); + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(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 }); } - span.setAttribute("az.namespace", tracingContext.getValue(tracingContext_js_1.knownContextKeys.namespace)); - const updatedOptions = Object.assign({}, operationOptions, { - tracingOptions: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(); + 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 }; } } - function withContext(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); + 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; } - function parseTraceparentHeader(traceparentHeader) { - return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); + 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.`; } - function createRequestHeaders(tracingContext) { - return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + return { error: error3, shouldReturnResponse: false }; + } + async function parse(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 { - startSpan, - withSpan, - withContext, - parseTraceparentHeader, - createRequestHeaders - }; + return operationResponse; } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { +// 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.RestError = void 0; - exports2.isRestError = isRestError; - var core_util_1 = require_commonjs2(); - 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 { - 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 }); - Object.setPrototypeOf(this, _RestError.prototype); - } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; + 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)); + } } - }; - exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - function isRestError(e) { - if (e instanceof RestError) { - return true; + 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 (0, core_util_1.isError)(e) && e.name === "RestError"; + return result; } } }); -// 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) { +// 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.tracingPolicyName = void 0; - exports2.tracingPolicy = tracingPolicy; - var core_tracing_1 = require_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log2(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); + 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.tracingPolicyName, + name: exports2.serializationPolicyName, async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - tryProcessResponse(span, response); - return response; - } catch (err) { - tryProcessError(span, err); - throw err; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); } + return next(request); } }; } - 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 serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.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)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } } } - function tryCreateSpan(tracingClient, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.tracingOptions }, { - spanKind: "client", - spanAttributes - }); - if (!span.isRecording()) { - span.end(); - return void 0; + function serializeRequestBody(request, 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 headers = tracingClient.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); - for (const [key, value] of Object.entries(headers)) { - request.headers.set(key, value); + }; + const xmlCharKey = updatedOptions.xml.xmlCharKey; + if (operationSpec.requestBody && operationSpec.requestBody.mapper) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); + } } - 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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.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 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 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); - } - span.setStatus({ - status: "success" - }); - span.end(); - } catch (e) { - log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); + 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-rest-pipeline/dist/commonjs/createPipelineFromOptions.js -var require_createPipelineFromOptions = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { +// 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.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 multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); return pipeline; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { +// 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.getBodyLength = getBodyLength; - exports2.createNodeHttpClient = createNodeHttpClient; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var http = tslib_1.__importStar(require("node:http")); - var https = tslib_1.__importStar(require("node:https")); - var zlib = tslib_1.__importStar(require("node:zlib")); - var node_stream_1 = require("node:stream"); - var abort_controller_1 = require_commonjs3(); - var httpHeaders_js_1 = require_httpHeaders(); - var restError_js_1 = require_restError(); - var log_js_1 = require_log2(); - var DEFAULT_TLS_SETTINGS = {}; - function isReadableStream(body) { - return body && typeof body.pipe === "function"; + 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; } - function isStreamComplete(stream) { - return new Promise((resolve2) => { - const handler = () => { - resolve2(); - stream.removeListener("close", handler); - stream.removeListener("end", handler); - stream.removeListener("error", handler); - }; - stream.on("close", handler); - stream.on("end", handler); - stream.on("error", handler); - }); + } +}); + +// 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 path2 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path2.startsWith("/")) { + path2 = path2.substring(1); + } + if (isAbsoluteUrl(path2)) { + requestUrl = path2; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path2); + } + } + const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); + requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); + return requestUrl; } - function isArrayBuffer(body) { - return body && typeof body.byteLength === "number"; + function replaceAll(input, replacements) { + let result = input; + for (const [searchValue, replaceValue] of replacements) { + result = result.split(searchValue).join(replaceValue); + } + return result; } - var ReportTransform = class extends node_stream_1.Transform { - // 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); + 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); } } - constructor(progressCallback) { - super(); - this.loadedBytes = 0; - this.progressCallback = progressCallback; + return result; + } + function isAbsoluteUrl(url) { + return url.includes("://"); + } + function appendPath(url, pathToAppend) { + if (!pathToAppend) { + return url; } - }; - var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); + const parsedUrl = new URL(url); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - /** - * Makes a request over an underlying transport layer and returns the response. - * @param request - The request to be made. - */ - async sendRequest(request) { - var _a, _b, _c; - const abortController = new AbortController(); - let abortListener; - if (request.abortSignal) { - if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); + } + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path2 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path2; + 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); } - abortListener = (event) => { - if (event.type === "abort") { - abortController.abort(); + 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; + }); } - }; - request.abortSignal.addEventListener("abort", abortListener); - } - if (request.timeout > 0) { - setTimeout(() => { - abortController.abort(); - }, request.timeout); + 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); + } } - const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); - let body = typeof request.body === "function" ? request.body() : request.body; - if (body && !request.headers.has("Content-Length")) { - const bodyLength = getBodyLength(body); - if (bodyLength !== null) { - request.headers.set("Content-Length", bodyLength); + } + return { + queryParams: result, + sequenceParams + }; + } + function simpleParseQueryParams(queryString) { + const result = /* @__PURE__ */ new Map(); + if (!queryString || queryString[0] !== "?") { + return result; + } + queryString = queryString.slice(1); + const pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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); } - let responseStream; - try { - if (body && request.onUploadProgress) { - const onUploadProgress = request.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; + } + return result; + } + function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url; + } + const parsedUrl = new URL(url); + 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); } - const res = await this.makeRequest(request, abortController, body); - const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; - const response = { - status, - headers, - request - }; - if (request.method === "HEAD") { - res.resume(); - return response; + } else if (existingValue) { + if (Array.isArray(value)) { + value.unshift(existingValue); + } else if (sequenceParams.has(name)) { + combinedParams.set(name, [existingValue, value]); } - responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res; - const onDownloadProgress = request.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 (!noOverwrite) { + combinedParams.set(name, value); } - if ( - // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) - ) { - response.readableStreamBody = responseStream; - } else { - response.bodyAsText = await streamToText(responseStream); + } 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}`); } - return response; - } finally { - if (request.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(() => { - var _a2; - if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); - } - }).catch((e) => { - log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); + } 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_log5 = __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_utils7(); + 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_log5(); + 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 }); } } } - makeRequest(request, abortController, body) { - var _a; - const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (isInsecure && !request.allowInsecureConnection) { - throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); + /** + * Send the provided httpRequest. + */ + async sendRequest(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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 agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); - const options = { - agent, - hostname: url.hostname, - path: `${url.pathname}${url.search}`, - port: url.port, - method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) - }; - return new Promise((resolve2, reject) => { - const req = isInsecure ? http.request(options, resolve2) : https.request(options, resolve2); - req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); - }); - abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); - 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")); + const url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; } - } else { - req.end(); } - }); - } - getOrCreateAgent(request, isInsecure) { - var _a; - const disableKeepAlive = request.disableKeepAlive; - if (isInsecure) { - if (disableKeepAlive) { - return http.globalAgent; + if (options.abortSignal) { + request.abortSignal = options.abortSignal; } - if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; } - return this.cachedHttpAgent; - } else { - if (disableKeepAlive && !request.tlsSettings) { - return https.globalAgent; + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); + if (options?.onResponse) { + options.onResponse(rawResponse, flatResponse); } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; - let agent = this.cachedHttpsAgents.get(tlsSettings); - if (agent && agent.options.keepAlive === !disableKeepAlive) { - return agent; + 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); + } } - log_js_1.logger.info("No cached TLS Agent exist, creating a new Agent"); - agent = new https.Agent(Object.assign({ - // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); - this.cachedHttpsAgents.set(tlsSettings, agent); - return agent; + throw error3; } } }; - 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(stream, headers) { - const contentEncoding = headers.get("Content-Encoding"); - if (contentEncoding === "gzip") { - const unzip = zlib.createGunzip(); - stream.pipe(unzip); - return unzip; - } else if (contentEncoding === "deflate") { - const inflate = zlib.createInflate(); - stream.pipe(inflate); - return inflate; - } - return stream; - } - function streamToText(stream) { - return new Promise((resolve2, reject) => { - const buffer = []; - stream.on("data", (chunk) => { - if (Buffer.isBuffer(chunk)) { - buffer.push(chunk); - } else { - buffer.push(Buffer.from(chunk)); - } - }); - stream.on("end", () => { - resolve2(Buffer.concat(buffer).toString("utf8")); - }); - stream.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : 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 - })); - } - }); + 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 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 getCredentialScopes(options) { + if (options.credentialScopes) { + return options.credentialScopes; } - } - function createNodeHttpClient() { - return new NodeHttpClient(); + 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-rest-pipeline/dist/commonjs/defaultHttpClient.js -var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { +// 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.createDefaultHttpClient = createDefaultHttpClient; - var nodeHttpClient_js_1 = require_nodeHttpClient(); - function createDefaultHttpClient() { - return (0, nodeHttpClient_js_1.createNodeHttpClient)(); + exports2.parseCAEChallenge = parseCAEChallenge; + exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; + var log_js_1 = require_log5(); + 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-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; + exports2.authorizeRequestOnTenantChallenge = void 0; + var Constants = { + DefaultScope: "/.default", + /** + * Defines constants for use with HTTP headers. + */ + HeaderConstants: { + /** + * The Authorization header. + */ + AUTHORIZATION: "authorization" } }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + 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); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __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 exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.exponentialRetryPolicyName = "exponentialRetryPolicy"; - function exponentialRetryPolicy(options = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __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 exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants8(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; - function systemErrorRetryPolicy(options = {}) { - var _a; + 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(request) { return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.tracingOptions }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; - } + 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-rest-pipeline/dist/commonjs/util/tokenCycler.js -var require_tokenCycler = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/tokenCycler.js"(exports2) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); - } - return finalToken; + 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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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; } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, exports2.DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions); - const cycler = { - /** - * Produces true if a refresh job is currently in progress. - */ - get isRefreshing() { - return refreshWorker !== null; + function toWebResourceLike(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.requestOverrides, + clone() { + throw new Error("Cannot clone a non-proxied WebResourceLike"); }, - /** - * Produces true if the cycler SHOULD refresh (we are within the refresh - * window and not already refreshing) - */ - get shouldRefresh() { - var _a; - if (cycler.isRefreshing) { - return false; + 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 request; + } 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") { + request.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)) { + request[prop] = value; + } + return Reflect.set(target, prop, value, receiver); } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + }); + } 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]); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + /** + * 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]); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + 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 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; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log2(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + return headerNames; } - } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; + /** + * 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; } - return; - } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; - } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + /** + * 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; } - if (error4) { - throw error4; - } else { - return response; + } else { + for (const headerKey in this._headersMap) { + const header = this._headersMap[headerKey]; + result[getHeaderKey(header.name)] = header.value; } } - }; - } - } -}); - -// 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(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); - } - } - return next(request); + 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-rest-pipeline/dist/commonjs/policies/auxiliaryAuthenticationHeaderPolicy.js -var require_auxiliaryAuthenticationHeaderPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/auxiliaryAuthenticationHeaderPolicy.js"(exports2) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log2(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; - } - 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(request, next) { - if (!request.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(request); - } - 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); + 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 request = (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 request; + } else if (prop === originalResponse) { + return response; } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + return Reflect.get(target, prop, receiver); + }, + set(target, prop, value, receiver) { + if (prop === "headers") { + headers = value; + } else if (prop === "request") { + request = value; + } + return Reflect.set(target, prop, value, receiver); } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); - return next(request); - } - }; + }); + } else { + return { + ...response, + request, + 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-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js"(exports2) { +// 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.createFileFromStream = exports2.createFile = 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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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; + 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(request, 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)(request, { 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 (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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 ndJsonPolicy_js_1 = require_ndJsonPolicy(); - Object.defineProperty(exports2, "ndJsonPolicy", { enumerable: true, get: function() { - return ndJsonPolicy_js_1.ndJsonPolicy; + var requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); + Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { + return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; } }); - Object.defineProperty(exports2, "ndJsonPolicyName", { enumerable: true, get: function() { - return ndJsonPolicy_js_1.ndJsonPolicyName; + Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { + return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; } }); - var auxiliaryAuthenticationHeaderPolicy_js_1 = require_auxiliaryAuthenticationHeaderPolicy(); - Object.defineProperty(exports2, "auxiliaryAuthenticationHeaderPolicy", { enumerable: true, get: function() { - return auxiliaryAuthenticationHeaderPolicy_js_1.auxiliaryAuthenticationHeaderPolicy; + Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { + return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; } }); - Object.defineProperty(exports2, "auxiliaryAuthenticationHeaderPolicyName", { enumerable: true, get: function() { - return auxiliaryAuthenticationHeaderPolicy_js_1.auxiliaryAuthenticationHeaderPolicyName; + var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); + Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { + return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; } }); - var file_js_1 = require_file2(); - Object.defineProperty(exports2, "createFile", { enumerable: true, get: function() { - return file_js_1.createFile; + var httpClientAdapter_js_1 = require_httpClientAdapter(); + Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { + return httpClientAdapter_js_1.convertHttpClient; } }); - Object.defineProperty(exports2, "createFileFromStream", { enumerable: true, get: function() { - return file_js_1.createFileFromStream; + var util_js_1 = require_util9(); + Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { + return util_js_1.toHttpHeadersLike; } }); } }); -// node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); +// 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } - } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; + } + return e2; + } + function h(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; } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; + } 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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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; } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); + } + return e2; + } + const d = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; } - op = body.call(thisArg, _); - } 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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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 __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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); - }); + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; }; - 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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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); + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + module2.exports = e; + })(); } - __setModuleDefault2(result, mod); - return result; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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]; +}); + +// 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + 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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(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); + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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; } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; } - return next(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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 __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - } }; +}); + +// 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_log6 = __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"; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 }; + exports2.AbortError = AbortError; } }); -// node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js -var require_azureKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js"(exports2) { +// 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.AzureKeyCredential = void 0; - var AzureKeyCredential = class { + 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 value of the key to be used in authentication + * The main method to implement that manipulates a request/response. */ - get key() { - return this._key; + constructor(_nextPolicy, _options) { + this._nextPolicy = _nextPolicy; + this._options = _options; } /** - * Create an instance of an AzureKeyCredential for use - * with a service client. - * - * @param key - The initial value of the key to use in authentication + * 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. */ - constructor(key) { - if (!key) { - throw new Error("key must be a non-empty string"); - } - this._key = key; + shouldLog(logLevel) { + return this._options.shouldLog(logLevel); } /** - * 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 + * 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. */ - update(newKey) { - this._key = newKey; + log(logLevel, message) { + this._options.log(logLevel, message); } }; - exports2.AzureKeyCredential = AzureKeyCredential; + exports2.BaseRequestPolicy = BaseRequestPolicy; } }); -// node_modules/@azure/core-auth/dist/commonjs/keyCredential.js -var require_keyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/keyCredential.js"(exports2) { +// 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.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs2(); - function isKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; - } + 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/core-auth/dist/commonjs/azureNamedKeyCredential.js -var require_azureNamedKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureNamedKeyCredential.js"(exports2) { +// 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.AzureNamedKeyCredential = void 0; - exports2.isNamedKeyCredential = isNamedKeyCredential; - var core_util_1 = require_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * 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"); + 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(url) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 || "/"; + path2 = escape2(path2); + urlParsed.pathname = path2; + 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]; + } } - 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"); + 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]; } - 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"; + return ""; } - } -}); - -// 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + function extractConnectionStringParts(connectionString) { + let proxyUri = ""; + if (connectionString.startsWith("UseDevelopmentStorage=true")) { + proxyUri = getProxyUriFromDevConnString(connectionString); + connectionString = constants_js_1.DevelopmentConnectionString; } - /** - * 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"); + 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}`; } - 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"); + 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"); } - this._signature = newSignature; + 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 }; } - }; - 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); + function escape2(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); } - } -}); - -// node_modules/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); - } - }; + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; + urlParsed.pathname = path2; + return urlParsed.toString(); } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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(); } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; - } -}); - -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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]]; + function getURLParameter(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; } - return t; -} -function __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { + function getURLPath(url) { try { - step(generator.next(value)); + const urlParsed = new URL(url); + return urlParsed.pathname; } catch (e) { - reject(e); + return void 0; } } - function rejected(value) { + function getURLScheme(url) { try { - step(generator["throw"](value)); + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; } catch (e) { - reject(e); + return void 0; } } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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}`; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + function getURLQueries(url) { + let queryString = new URL(url).search; + if (!queryString) { + return {}; } - op = body.call(thisArg, _); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; + 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; } - if (op[0] & 5) throw op[1]; - return { value: op[0] ? op[1] : void 0, done: true }; - } -} -function __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 }; + function appendToURLQuery(url, queryParts) { + const urlParsed = new URL(url); + let query = urlParsed.search; + if (query) { + query += "&" + queryParts; + } else { + query = queryParts; + } + urlParsed.search = query; + return urlParsed.toString(); } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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"; } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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]; + function base64encode(content) { + return !core_util_1.isNodeLike ? btoa(content) : Buffer.from(content).toString("base64"); } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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 base64decode(encodedString) { + return !core_util_1.isNodeLike ? atob(encodedString) : Buffer.from(encodedString, "base64").toString(); } - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + 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); } - } - function step(r) { - r.value instanceof __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); + async function delay2(timeInMs, aborter, abortError) { + return new Promise((resolve2, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve2(); + }; + timeout = setTimeout(resolveHandler, timeInMs); + if (aborter !== void 0) { + aborter.addEventListener("abort", abortHandler); + } }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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; + 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; + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + function sanitizeURL(url) { + let safeURL = url; + if (getURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE)) { + safeURL = setURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE, "*****"); } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; - } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { + 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(url) { + const parsedUrl = new URL(url); + let accountName; 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(); + 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 }); - } else s |= 1; - } catch (e) { - fail(e); + } } + return res; } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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]; + 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; + }) + } }; - return extendStatics3(d, b); - }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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]; + } + 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; + }) } - return t; }; - return __assign3.apply(this, arguments); - }; - __createBinding3 = 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]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 - }; - } -}); - -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); + 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 + }; + } } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); + function EscapePath(blobName) { + const split = blobName.split("/"); + for (let i = 0; i < split.length; i++) { + split[i] = encodeURIComponent(split[i]); + } + return split.join("/"); } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); + function assertResponse(response) { + if (`_response` in response) { + return response; + } + throw new TypeError(`Unexpected response object ${response}`); } - exports2.decodeStringToString = decodeStringToString; } }); -// node_modules/@azure/core-client/dist/commonjs/interfaces.js -var require_interfaces = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/interfaces.js"(exports2) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + 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/core-client/dist/commonjs/utils.js -var require_utils5 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { +// 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.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); + 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_log6(); + var StorageRetryPolicyType_js_1 = require_StorageRetryPolicyType(); + function NewRetryPolicyFactory(retryOptions) { + return { + create: (nextPolicy, options) => { + return new StorageRetryPolicy(nextPolicy, options, retryOptions); + } + }; } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; + 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 + }; } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); + /** + * Sends request. + * + * @param request - + */ + async sendRequest(request) { + return this.attemptSendRequest(request, false, 1); } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, parsedHeaders), { blobBody: fullResponse.blobBody, readableStreamBody: fullResponse.readableStreamBody }); + /** + * 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, secondaryHas404, ++attempt); } - const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {}; - const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); - if (expectedBodyTypeName === "Sequence" || isPageableResponse) { - const arrayResponse = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; + /** + * 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 (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + 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; } - return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + return (0, utils_common_js_1.delay)(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); } - return handleNullableResponseAndWrappableBody({ - body: fullResponse.parsedBody, - headers: parsedHeaders, - hasNullableType: isNullable, - shouldWrapBody: isPrimitiveBody(fullResponse.parsedBody, expectedBodyTypeName) - }); - } - exports2.flattenResponse = flattenResponse; + }; + exports2.StorageRetryPolicy = StorageRetryPolicy; } }); -// node_modules/@azure/core-client/dist/commonjs/serializer.js -var require_serializer = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { +// 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.MapperTypeNames = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + 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; } /** - * @deprecated Removing the constraints validation on client side. + * Creates a StorageRetryPolicy object. + * + * @param nextPolicy - + * @param options - */ - 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); - } + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 { /** - * 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 + * Reference to StorageSharedKeyCredential which generates StorageSharedKeyCredentialPolicy */ - serialize(mapper, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : 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) { - object = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); - } - if (object === void 0 || object === null) { - payload = object; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } - } - return payload; + factory; + /** + * Creates an instance of StorageSharedKeyCredentialPolicy. + * @param nextPolicy - + * @param options - + * @param factory - + */ + constructor(nextPolicy, options, factory) { + super(nextPolicy, options); + this.factory = factory; } /** - * 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. + * Signs request. * - * @returns A valid deserialized Javascript object + * @param request - */ - deserialize(mapper, responseBody, objectName, options = { xml: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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); - } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; - } - return str2.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 str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; - } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); - } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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.`); + signRequest(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } - value = base64.encodeByteArray(value); + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; } - 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.`); + /** + * 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(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; } - 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}".`); - } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; } + return value; } - return value; - } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - 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 = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; - } - const tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, 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 }; + /** + * 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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; } - } else { - tempArray[i] = serializedValue; - } - } - return tempArray; - } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "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(object)) { - const serializedValue = serializer.serialize(valueType, object[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 === null || modelMapper === void 0 ? void 0 : 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 === null || modelMapper === void 0 ? void 0 : 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, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; } - if (object !== void 0 && object !== 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) && (object[key] !== void 0 && object[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] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } + /** + * Retrieves the webResource canonicalized resource string. + * + * @param request - + */ + getCanonicalizedResourceString(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path2}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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); } } - } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + queryKeys.sort(); + for (const key of queryKeys) { + canonicalizedResourceString += ` +${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } - return payload; + return canonicalizedResourceString; } - return object; - } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + }; + 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."); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + }; + 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"); } - 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) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + /** + * Creates a StorageSharedKeyCredentialPolicy object. + * + * @param nextPolicy - + * @param options - + */ + create(nextPolicy, options) { + return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this); } - 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; + /** + * 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; } - 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; - } + 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 propertyName = xmlElementName || xmlName || serializedName; - if (propertyMapper.xmlIsWrapped) { - const wrapped = responseBody[xmlName]; - const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options); - handledPropertyNames.push(xmlName); + const end = this.byteOffsetInCurrentBuffer + remaining; + outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end)); + if (remaining === remainingCapacityInThisBuffer) { + this.byteOffsetInCurrentBuffer = 0; + this.bufferIndex++; } 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; - } + this.byteOffsetInCurrentBuffer = end; } - instance = arrayInstance; - } else if (propertyInstance !== void 0 || propertyMapper.defaultValue !== void 0) { - serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options); - instance[key] = serializedValue; + this.pushedBytesLength += remaining; + i += remaining; } } + if (outBuffers.length > 1) { + this.push(Buffer.concat(outBuffers)); + } else if (outBuffers.length === 1) { + this.push(outBuffers[0]); + } } - 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); + }; + 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)); } - } 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]; - } + if (buffers) { + this.fill(buffers, totalLength); } } - 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); + /** + * 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); } - return tempDictionary; } - return responseBody; - } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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}`); + /** + * Get the readable stream assembled from all the data in the internal buffers. + * + */ + getReadableStream() { + return new BuffersStream_js_1.BuffersStream(this.buffers, this.size); } - if (responseBody) { - if (!Array.isArray(responseBody)) { - responseBody = [responseBody]; + }; + 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 (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + if (maxBuffers <= 0) { + throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + if (concurrency <= 0) { + throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`); } - return tempArray; + this.bufferSize = bufferSize; + this.maxBuffers = maxBuffers; + this.readable = readable; + this.outgoingHandler = outgoingHandler; + this.concurrency = concurrency; + this.encoding = encoding; } - 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]; + /** + * Start the scheduler, will return error when stream of any of the outgoingHandlers + * returns error. + * + */ + async do() { + return new Promise((resolve2, 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(resolve2).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve2(); + } + } + }); + }); + } + /** + * 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 { - for (const [name, mapper] of Object.entries(discriminators)) { - if (name.startsWith(currentName + ".") && mapper.type.uberParent === currentName && mapper.type.className) { - typeNamesToCheck.push(mapper.type.className); + 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; } - return void 0; - } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); + /** + * 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; } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + 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(); } } - 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" }; + exports2.BufferScheduler = BufferScheduler; } }); -// node_modules/@azure/core-client/dist/commonjs/state.js -var require_state2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/state.js"(exports2) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; - } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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; - } + 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; } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; + /** + * 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); } - return result; - } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; - } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); + /** + * 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); } - let info6 = state_js_1.state.operationRequestMap.get(request); - if (!info6) { - info6 = {}; - state_js_1.state.operationRequestMap.set(request, info6); + }; + 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" } - return info6; - } - exports2.getOperationRequestInfo = getOperationRequestInfo; + }; + 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/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY - } - }; - return { - name: exports2.deserializationPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); - } - }; + 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(url) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 || "/"; + path2 = escape2(path2); + urlParsed.pathname = path2; + return urlParsed.toString(); } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + 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 result; + return proxyUri; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + 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 result; + return ""; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; - } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; - } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + function extractConnectionStringParts(connectionString) { + let proxyUri = ""; + if (connectionString.startsWith("UseDevelopmentStorage=true")) { + proxyUri = getProxyUriFromDevConnString(connectionString); + connectionString = constants_js_1.DevelopmentConnectionString; } - 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] : []; + 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'"); } - 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; + endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); + if (!endpointSuffix) { + throw new Error("Invalid EndpointSuffix in the provided Connection String"); } - } else if (operationSpec.httpMethod === "HEAD") { - parsedResponse.parsedBody = response.status >= 200 && response.status < 300; + blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; } - if (responseSpec.headersMapper) { - parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); + 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 }; } - return parsedResponse; } - function isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escape2(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path2 = urlParsed.pathname; + path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; + urlParsed.pathname = path2; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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); } - } else { - return { error: null, shouldReturnResponse: false }; } } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (encodedValue) { + searchPieces.push(`${encodedName}=${encodedValue}`); } - const defaultBodyMapper = errorResponseSpec.bodyMapper; - const defaultHeadersMapper = errorResponseSpec.headersMapper; + urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; + return urlParsed.toString(); + } + function getURLParameter(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; } - return { error: error4, shouldReturnResponse: false }; } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; - } + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; } - 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + const pathString = urlParsed.pathname; + if (!pathString) { + throw new RangeError("Invalid url without valid path."); } - return result; + let queryString = urlParsed.search || ""; + queryString = queryString.trim(); + if (queryString !== "") { + queryString = queryString.startsWith("?") ? queryString : `?${queryString}`; + } + return `${pathString}${queryString}`; } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - function getPathStringFromParameter(parameter) { - const { parameterPath, mapper } = parameter; - let result; - if (typeof parameterPath === "string") { - result = parameterPath; - } else if (Array.isArray(parameterPath)) { - result = parameterPath.join("."); + function getURLQueries(url) { + let queryString = new URL(url).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(url, queryParts) { + const urlParsed = new URL(url); + let query = urlParsed.search; + if (query) { + query += "&" + queryParts; } else { - result = mapper.serializedName; + query = queryParts; } - return result; + urlParsed.search = query; + return urlParsed.toString(); } - exports2.getPathStringFromParameter = getPathStringFromParameter; - } -}); - -// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; + 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"; } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } + 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((resolve2, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); } + resolve2(); + }; + 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); } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + 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; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + function sanitizeURL(url) { + let safeURL = url; + 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; } - exports2.serializeRequestBody = serializeRequestBody; - 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; + function iEqual(str1, str2) { + return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); + } + function getAccountNameFromUrl(url) { + const parsedUrl = new URL(url); + 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."); } - return serializedValue; } - function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + 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]); } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + return split.join("/"); + } + function assertResponse(response) { + if (`_response` in response) { + return response; } - const result = { [elementName]: obj }; - result[interfaces_js_1.XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace }; - return result; + throw new TypeError(`Unexpected response object ${response}`); } } }); -// node_modules/@azure/core-client/dist/commonjs/pipeline.js -var require_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { +// 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.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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); } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; - } - exports2.createClientPipeline = createClientPipeline; + /** + * Sends out request. + * + * @param request - + */ + async sendRequest(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + exports2.StorageBrowserPolicy = StorageBrowserPolicy; } }); -// node_modules/@azure/core-client/dist/commonjs/httpClientCache.js -var require_httpClientCache = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/httpClientCache.js"(exports2) { +// 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.getCachedDefaultHttpClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; - } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; + }; + exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js -var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { +// 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.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path2 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path2.startsWith("/")) { - path2 = path2.substring(1); - } - if (isAbsoluteUrl(path2)) { - requestUrl = path2; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path2); - } - } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - 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) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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(url) { - return url.includes("://"); - } - function appendPath(url, pathToAppend) { - if (!pathToAppend) { - return url; - } - const parsedUrl = new URL(url); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path2 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path2; - 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) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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 pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); - } + exports2.CredentialPolicy = void 0; + var RequestPolicy_js_1 = require_RequestPolicy2(); + var CredentialPolicy = class extends RequestPolicy_js_1.BaseRequestPolicy { + /** + * Sends out request. + * + * @param request - + */ + sendRequest(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); } - return result; - } - function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url; + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; } - const parsedUrl = new URL(url); - 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); - } + }; + 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); } - 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}`); - } + }; + 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."); } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); - } - exports2.appendQueryParams = appendQueryParams; + }; + exports2.Credential = Credential2; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log3 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log3(); - var ServiceClient = class { + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. + * 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 - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri; - if (options.baseUri) { - log_js_1.logger.warning("The baseUri option for SDK Clients has been deprecated, please use endpoint instead."); + getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; } - this._allowInsecureConnection = options.allowInsecureConnection; - this._httpClient = options.httpClient || (0, httpClientCache_js_1.getCachedDefaultHttpClient)(); - this.pipeline = options.pipeline || createDefaultPipeline(options); - if ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.length) { - for (const { policy, position } of options.additionalPolicies) { - const afterPhase = position === "perRetry" ? "Sign" : void 0; - this.pipeline.addPolicy(policy, { - afterPhase - }); - } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; } + return value; } /** - * Send the provided httpRequest. + * 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 - */ - async sendRequest(request) { - return this.pipeline.sendRequest(this._httpClient, request); + getCanonicalizedHeadersString(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; } /** - * 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. + * Retrieves the webResource canonicalized resource string. + * + * @param request - */ - async sendOperationRequest(operationArguments, operationSpec) { - const endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; + getCanonicalizedResourceString(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path2}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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); } } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } + queryKeys.sort(); + for (const key of queryKeys) { + canonicalizedResourceString += ` +${key}:${decodeURIComponent(lowercaseQueries[key])}`; } - throw error4; } + return canonicalizedResourceString; } }; - 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)(Object.assign(Object.assign({}, 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; - } + exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log3(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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; + 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"); } - 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; + /** + * Creates a StorageSharedKeyCredentialPolicy object. + * + * @param nextPolicy - + * @param options - + */ + create(nextPolicy, options) { + return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this); } - const accessToken = await onChallengeOptions.getAccessToken(parsedChallenge.scope ? [parsedChallenge.scope] : scopes, { - claims: (0, base64_js_1.decodeStringToString)(parsedChallenge.claims) - }); - if (!accessToken) { - return false; + /** + * 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"); } - onChallengeOptions.request.headers.set("Authorization", `Bearer ${accessToken.token}`); - return true; - } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; + }; + exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${accessToken.token}`); - return true; + exports2.AbortError = void 0; + var AbortError = class extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; } - 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) => Object.assign(Object.assign({}, a), b), {}); - } - function requestToOptions(request) { - return { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions - }; - } + exports2.AbortError = AbortError; } }); -// node_modules/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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_pipeline2(); - 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; + 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/core-http-compat/dist/commonjs/util.js -var require_util9 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// node_modules/@azure/storage-common/dist/commonjs/log.js +var require_log7 = __commonJS({ + "node_modules/@azure/storage-common/dist/commonjs/log.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } - } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); - } - var HttpHeaders = class _HttpHeaders { - 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; - } + 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_log7(); + 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 { /** - * Get whether or not this header collection contains a header entry for the provided header name. + * RetryOptions. */ - contains(headerName) { - return !!this._headersMap[getHeaderKey(headerName)]; - } + retryOptions; /** - * 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. + * Creates an instance of RetryPolicy. + * + * @param nextPolicy - + * @param options - + * @param retryOptions - */ - remove(headerName) { - const result = this.contains(headerName); - delete this._headersMap[getHeaderKey(headerName)]; - return result; + 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 + }; } /** - * Get the headers that are contained this collection as an object. + * Sends request. + * + * @param request - */ - rawHeaders() { - return this.toJson({ preserveCase: true }); + async sendRequest(request) { + return this.attemptSendRequest(request, false, 1); } /** - * Get the headers that are contained in this collection as an array. + * 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. */ - headersArray() { - const headers = []; - for (const headerKey in this._headersMap) { - headers.push(this._headersMap[headerKey]); + async attemptSendRequest(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; + if (!isPrimaryRetry) { + newRequest.url = (0, utils_common_js_1.setURLHost)(newRequest.url, this.retryOptions.secondaryHost); } - 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); + 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()); } - 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); + 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; + } } - return headerValues; + await this.delay(isPrimaryRetry, attempt, request.abortSignal); + return this.attemptSendRequest(request, secondaryHas404, ++attempt); } /** - * Get the JSON object representation of this HTTP header collection. + * Decide whether to retry according to last HTTP response and retry counters. + * + * @param isPrimaryRetry - + * @param attempt - + * @param response - + * @param err - */ - toJson(options = {}) { - const result = {}; - if (options.preserveCase) { - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - result[header.name] = header.value; + 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; + } } - } else { - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - result[getHeaderKey(header.name)] = header.value; + } + 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; } } - return result; - } - /** - * Get the string representation of this HTTP header collection. - */ - toString() { - return JSON.stringify(this.toJson({ preserveCase: 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; } /** - * Create a deep clone/copy of this HttpHeaders collection. + * Delay a calculated time between retries. + * + * @param isPrimaryRetry - + * @param attempt - + * @param abortSignal - */ - clone() { - const resultPreservingCasing = {}; - for (const headerKey in this._headersMap) { - const header = this._headersMap[headerKey]; - resultPreservingCasing[header.name] = header.value; + 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; } - return new _HttpHeaders(resultPreservingCasing); + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + return (0, utils_common_js_1.delay)(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR); } }; - 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util9(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } - } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); - } - } - exports2.toPipelineResponse = toPipelineResponse; + exports2.StorageRetryPolicy = StorageRetryPolicy; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.handleRedirects) === false) { - this.pipeline.removePolicy({ - name: core_rest_pipeline_1.redirectPolicyName - }); - } + 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; } /** - * Compatible send operation request function. + * Creates a StorageRetryPolicy object. * - * @param operationArguments - Operation arguments - * @param operationSpec - Operation Spec - * @returns + * @param nextPolicy - + * @param options - */ - async sendOperationRequest(operationArguments, operationSpec) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + create(nextPolicy, options) { + return new StorageRetryPolicy_js_1.StorageRetryPolicy(nextPolicy, options, this.retryOptions); } }; - exports2.ExtendedServiceClient = ExtendedServiceClient; + exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; } }); -// 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) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - 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(); + 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.requestPolicyFactoryPolicyName, + name: exports2.storageBrowserPolicyName, async sendRequest(request, 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); + if (core_util_1.isNodeLike) { + return next(request); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util9(); - function convertHttpClient(requestPolicyClient) { + exports2.storageCorrectContentLengthPolicyName = void 0; + exports2.storageCorrectContentLengthPolicy = storageCorrectContentLengthPolicy; + var constants_js_1 = require_constants11(); + exports2.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; + function storageCorrectContentLengthPolicy() { + function correctContentLength(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); } }; } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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/src/util.js -var require_util10 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } - } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; - } - }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; - } -}); - -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { - "use strict"; - var util = require_util10(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] + 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_log7(); + 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 }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; + 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 (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); + } + 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; } - tagFound = true; } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; + } + } + 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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 { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${(0, core_util_1.getErrorMessage)(e)}`); + throw e; } } - if (xmlData[i] === "<") { - i--; + retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error3 }); + if (retryAgain) { + await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); } + attempt++; } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; + if (response) { + return response; } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; } + return value; } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.headers) { + if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { + headersArray.push({ name, value }); } } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; + headersArray.sort((a, b) => { + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); + }); + headersArray = headersArray.filter((value, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; } - } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; } - return i; - } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; + function getCanonicalizedResourceString(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path2}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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); + } } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; + queryKeys.sort(); + for (const key of queryKeys) { + canonicalizedResourceString += ` +${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); - } - } - return true; - } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; - } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; + return canonicalizedResourceString; } - return i; - } - function getErrorObject(code, message, lineNumber) { return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col + name: exports2.storageSharedKeyCredentialPolicyName, + async sendRequest(request, next) { + signRequest(request); + return next(request); } }; } - function validateAttrName(attrName) { - return util.isName(attrName); - } - function validateTagName(tagname) { - return util.isName(tagname); - } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); + } +}); + +// 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 { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; - } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util10(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; + name: exports2.storageRequestFailureDetailsParserPolicyName, + async sendRequest(request, next) { + try { + const response = await next(request); + 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"; } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; + throw err; } } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); - } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); - } - return { entities, i }; - } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; - } - return [entityName2, val2, i]; - } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; - } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; - } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; - } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; - } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; - } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); + }; } - module2.exports = readDocType; } }); -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; - } - } else { - return str2; - } - } - } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; - } - module2.exports = toNumber; +// 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/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } +// 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); } - }; - } - return () => false; + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util10(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; + 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_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; + } } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; + 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; } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } + if (statusCode === 503 || statusCode === 500) { + log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + return true; } } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; + 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; } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; } } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } - } - var replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); - } - return val2; - }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; - } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; + return false; } - return false; - } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; + 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 if (ch === " ") { - ch = " "; - } - tagExp += ch; - } - } - function findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); - } else { - return closingIndex + str2.length - 1; - } - } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); + } else { + delayTimeInMs = Math.random() * 1e3; } + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + return delayTimeInMs; } return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName - }; - } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; + name: exports2.storageRetryPolicyName, + async sendRequest(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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; } } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; + retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error3 }); + if (retryAgain) { + await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); } + attempt++; } + if (response) { + return response; + } + throw error3 ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error."); } - } - } - function parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } - } + }; } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; - } - } + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; } + return value; } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; + function getCanonicalizedResourceString(request) { + const path2 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path2}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 false; + return { + name: exports2.storageSharedKeyCredentialPolicyName, + async sendRequest(request, next) { + signRequest(request); + return next(request); + } + }; } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); +// 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); } /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption + * Sends out request. + * + * @param request - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); + async sendRequest(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); } + }; + 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 { /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value + * Creates a StorageBrowserPolicyFactory object. + * + * @param nextPolicy - + * @param options - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } + create(nextPolicy, options) { + return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); } }; - module2.exports = XMLParser; + exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } } - return attrStr; - } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; - } - function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); } - } - return textValue; + }; } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; + 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_log6(); + 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 }; - this.tagEndChar = ">"; - this.newLine = ""; } + }; + exports2.Pipeline = Pipeline; + function newPipeline(credential, pipelineOptions = {}) { + if (!credential) { + credential = new AnonymousCredential_js_1.AnonymousCredential(); + } + const pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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 this.j2x(jObj, 0, []).val; } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); + return void 0; + } + function getCoreClientOptions(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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: "#" } } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); + }, + deserializationOptions: { + parseXML: core_xml_1.parseXML, + serializerOptions: { + xml: { + // Use customized XML char key of "#" so we can deserialize metadata + // with "_" key + xmlCharKey: "#" + } } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); } + }); + 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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } - } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; + const credential = getCredentialFromPipeline(pipeline); + 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" }); } + pipeline._corePipeline = corePipeline; } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } + return credential; + } + function isStorageSharedKeyCredential(factory) { + if (factory instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + return true; } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); + return factory.constructor.name === "StorageSharedKeyCredential"; } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; + function isAnonymousCredential(factory) { + if (factory instanceof AnonymousCredential_js_1.AnonymousCredential) { + return true; } + return factory.constructor.name === "AnonymousCredential"; } - module2.exports = Builder; - } -}); - -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { - "use strict"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder - }; - } -}); - -// 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 _a; - return { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false - }; + function isCoreHttpBearerTokenFactory(factory) { + return (0, core_auth_1.isTokenCredential)(factory.credential); } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + function isStorageBrowserPolicyFactory(factory) { + if (factory instanceof StorageBrowserPolicyFactory_js_1.StorageBrowserPolicyFactory) { + return true; + } + return factory.constructor.name === "StorageBrowserPolicyFactory"; } - function getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function isStorageRetryPolicyFactory(factory) { + if (factory instanceof StorageRetryPolicyFactory_js_1.StorageRetryPolicyFactory) { + return true; + } + return factory.constructor.name === "StorageRetryPolicyFactory"; } - 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, ""); + function isStorageTelemetryPolicyFactory(factory) { + return factory.constructor.name === "TelemetryPolicyFactory"; } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); - } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; - } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - 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; + function isInjectorPolicyFactory(factory) { + return factory.constructor.name === "InjectorPolicyFactory"; + } + function isCoreHttpPolicyFactory(factory) { + const knownPolicies = [ + "GenerateClientRequestIdPolicy", + "TracingPolicy", + "LogPolicy", + "ProxyPolicy", + "DisableResponseDecompressionPolicy", + "KeepAlivePolicy", + "DeserializationPolicy" + ]; + const mockHttpClient = { + sendRequest: async (request) => { + return { + request, + headers: request.headers.clone(), + status: 500 + }; } - } - return parsedXml; + }; + 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/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; - } }); + 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/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) { +// 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.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; + 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.AbortError = AbortError; - } -}); - -// node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs10 = __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/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."); + 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" + } + } } - 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."); + }; + 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" + } + } } - 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."); + }; + 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" + } + } } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + } + }; + 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" + } + } } } - /** - * 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"; + 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" + } + } + } } }; - 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(); - }); + 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" + } } } } - /** - * 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(); + }; + exports2.BlobServiceStatistics = { + serializedName: "BlobServiceStatistics", + xmlName: "StorageServiceStats", + type: { + name: "Composite", + className: "BlobServiceStatistics", + modelProperties: { + geoReplication: { + serializedName: "GeoReplication", + xmlName: "GeoReplication", + type: { + name: "Composite", + className: "GeoReplication" + } + } } - return signal; } }; - exports2.AbortController = AbortController2; - exports2.AbortError = AbortError; - exports2.AbortSignal = AbortSignal2; - } -}); - -// node_modules/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); + 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" + } + } } - throw error4; - }; - } - 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}`; + }; + 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" + } } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - 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, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation - }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; - } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; + }; + 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" } } + } + } } } - return { response, status }; - } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); + }; + 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" + } + } } - updateState === null || updateState === void 0 ? void 0 : updateState(state, response); } - } - 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) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; + }; + 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" + } + } } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; + } + }; + 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" } - case "original-uri": { - return requestPath; + }, + 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" } - case "location": - default: { - return location; + }, + value: { + serializedName: "Value", + required: true, + xmlName: "Value", + type: { + name: "String" } } } } - } - 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; - } - } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + }; + 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" + } + } } } - } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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; - } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error4; - } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + }; + 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" + } + } + } } - return void 0; - } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case void 0: - return toOperationStatus(response.rawResponse.statusCode); - case "Body": - return getOperationStatus(response, state); - default: - return "running"; + }; + 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" + } + } + } + } } } - const status = helper(); - return status === "running" && operationLocation === void 0 ? "succeeded" : status; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return 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 - }); - } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); + }; + 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" + } + } } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + } + }; + 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" + } + } } - case "Body": - default: { - return void 0; + } + }; + 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" + } + } } } - } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); + }; + 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" + } + } } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); + } + }; + 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" + } + } + } + } } - case "Body": { - return getProvisioningState(rawResponse); + } + }; + 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" + } + } } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); } - } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + }; + 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" + } + } } } - return state.config.resourceLocation; - } - function isOperationError(e) { - return e.name === "RestError"; - } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); - } - var createStateProxy$1 = () => ({ - /** - * 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, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); + }; + exports2.BlobPropertiesInternal = { + serializedName: "BlobPropertiesInternal", + xmlName: "Properties", + type: { + name: "Composite", + className: "BlobPropertiesInternal", + modelProperties: { + createdOn: { + serializedName: "Creation-Time", + xmlName: "Creation-Time", + type: { + name: "DateTimeRfc1123" + } }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); + 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"] + } }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } + lastAccessedOn: { + serializedName: "LastAccessTime", + xmlName: "LastAccessTime", + type: { + name: "DateTimeRfc1123" } - 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`); - } + }, + immutabilityPolicyExpiresOn: { + serializedName: "ImmutabilityPolicyUntilDate", + xmlName: "ImmutabilityPolicyUntilDate", + type: { + name: "DateTimeRfc1123" } - })().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; - } + }, + immutabilityPolicyMode: { + serializedName: "ImmutabilityPolicyMode", + xmlName: "ImmutabilityPolicyMode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } - await pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; - } + }, + legalHold: { + serializedName: "LegalHold", + xmlName: "LegalHold", + type: { + name: "Boolean" } } - }; - return poller; - }; - } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); - } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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 _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await 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 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 - }); } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; - } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; - } - /** - * Serializes the Poller operation. - */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); } }; - 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((resolve2, reject) => { - this.resolve = resolve2; - 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 error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; - } - } - 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.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" + } + } + } } }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + 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" + } + } + } + } + } } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve2) => setTimeout(() => resolve2(), this.config.intervalInMs)); + }; + exports2.BlobPrefix = { + serializedName: "BlobPrefix", + type: { + name: "Composite", + className: "BlobPrefix", + modelProperties: { + name: { + serializedName: "Name", + xmlName: "Name", + type: { + name: "Composite", + className: "BlobName" + } + } + } } }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; + 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" + } + } + } } - }); - } - n.default = e; - return Object.freeze(n); - } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * 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); + } } }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + 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" + } + } + } + } + } } }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 + 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" + } + } + } + } }; - var 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.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" + } + } + } + } }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path2 = urlParsed.pathname; - path2 = path2 || "/"; - path2 = escape2(path2); - urlParsed.pathname = path2; - 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]; + 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" + } } } } - 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]; + }; + 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" + } + } } } - return ""; - } - function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = 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"); + }; + 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" + } } - 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 escape2(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 path2 = urlParsed.pathname; - path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; - urlParsed.pathname = path2; - 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); + }; + exports2.QuerySerialization = { + serializedName: "QuerySerialization", + type: { + name: "Composite", + className: "QuerySerialization", + modelProperties: { + format: { + serializedName: "Format", + xmlName: "Format", + type: { + name: "Composite", + className: "QueryFormat" + } } } } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); - } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : 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; + }; + 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" } } + } + } + } } - 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 !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); - } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + }; + 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" + } + } + } } - const res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve2, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); + }; + exports2.JsonTextConfiguration = { + serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", + type: { + name: "Composite", + className: "JsonTextConfiguration", + modelProperties: { + recordSeparator: { + serializedName: "RecordSeparator", + xmlName: "RecordSeparator", + type: { + name: "String" + } } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); + } + } + }; + 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" + } + } + } } - resolve2(); - }; - 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); + }; + 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" + } + } } - return padString.slice(0, targetLength) + currentString; } - } - 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 = ""; + }; + 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" + } + } } - return accountName; - } catch (error4) { - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + }; + 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" + } + } + } } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + }; + 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" + } + } } } - return tagPairs.join("&"); - } - function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; - } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + }; + 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" + } + } } } - return res; - } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; - } - const res = {}; - for (const blobTag of tags2.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 - } + }; + 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" } - }; - case "json": - return { - format: { - type: "json", - jsonTextConfiguration: { - recordSeparator: textConfiguration.recordSeparator - } + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", + type: { + name: "String" } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" } - }; - case "parquet": - return { - format: { - type: "parquet" + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } - }; - 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] - }); + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } } } - return orProperties; - } - 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 Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, 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; + }; + 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" + } + } } } - 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}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; - } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); - } - if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); - } - let response; - try { - 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) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw err; + 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" + } } } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; - } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + }; + 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" } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } + }; + 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" + } } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + }; + 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" + } + } } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + }; + 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" + } } - } else { - delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } }; - var StorageRetryPolicyFactory = class { - /** - * 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(nextPolicy, options, this.retryOptions); + 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" + } + } + } } }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + 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" + } + } + } } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + }; + 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" + } + } + } } }; - 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; + 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" + } + } } - 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; + } + }; + 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" + } + } } } - return false; - } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { - /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - - */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; + }; + 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" + } + } + } } - /** - * Signs request. - * - * @param request - - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + }; + 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" + } + } } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; } - /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; + }; + 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" + } + } } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + } + }; + 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" + } + } } - 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + }; + 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" + } } - 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(request) { - const path2 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path2}`; - const queries = getURLQueries(request.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); + }; + 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" } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } - return canonicalizedResourceString; } }; - 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.ContainerSetAccessPolicyExceptionHeaders = { + serializedName: "Container_setAccessPolicyExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSetAccessPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } } }; - var StorageSharedKeyCredential = class extends Credential2 { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + 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" + } + } + } } }; - var AnonymousCredentialPolicy = class extends 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.ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", + type: { + name: "Composite", + className: "ContainerRestoreExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } + } + } } }; - var AnonymousCredential = class extends Credential2 { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + 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" + } + } + } } }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + 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" + } } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; - } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + 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" } - } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; } } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } + }; + 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" + } } } - return false; } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; + }; + 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" + } } - } else { - delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + }; + 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" + } } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } + } + } + }; + exports2.ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", + type: { + name: "Composite", + className: "ContainerAcquireLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay2(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + }, + 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" } - attempt++; - } - if (response) { - return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); - } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; } - return value; } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); + }; + 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" + } } } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; } - function getCanonicalizedResourceString(request) { - const path2 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path2}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; - } - var StorageBrowserPolicy = class extends 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(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); - } - }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + 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" + } + } } } - return { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); + }; + 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" + } + } } - }; - } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * 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 - }; } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); - } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; - } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; + 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" + } + } } } - return void 0; - } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }; + exports2.ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", + type: { + name: "Composite", + className: "ContainerBreakLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", + type: { + name: "String" } - } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }, + 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" } } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); - } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); } - pipeline._corePipeline = corePipeline; - } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); - } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; + }; + 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" + } + } } } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; - } - return factory.constructor.name === "StorageSharedKeyCredential"; - } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; - } - return factory.constructor.name === "AnonymousCredential"; - } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); - } - function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; - } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof 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 (request) => { - return { - request, - headers: request.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); - }); - } - var BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", + }; + 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: "BlobServiceProperties", + className: "ContainerChangeLeaseExceptionHeaders", modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "Logging" + name: "String" } - }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", + } + } + } + }; + exports2.ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", + type: { + name: "Composite", + className: "ContainerListBlobFlatSegmentHeaders", + modelProperties: { + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "Composite", - className: "Metrics" + name: "String" } }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "Metrics" + name: "String" } }, - cors: { - serializedName: "Cors", - xmlName: "Cors", - xmlIsWrapped: true, - xmlElementName: "CorsRule", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "CorsRule" - } - } + name: "String" } }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "RetentionPolicy" + name: "DateTimeRfc1123" } }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "StaticWebsite" + name: "String" } } } } }; - var Logging = { - serializedName: "Logging", + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "Logging", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { - version: { - serializedName: "Version", - required: true, - xmlName: "Version", + 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" } }, - deleteProperty: { - serializedName: "Delete", - required: true, - xmlName: "Delete", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - read: { - serializedName: "Read", - required: true, - xmlName: "Read", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - write: { - serializedName: "Write", - required: true, - xmlName: "Write", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "RetentionPolicy" + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; - var RetentionPolicy = { - serializedName: "RetentionPolicy", + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { + serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", type: { name: "Composite", - className: "RetentionPolicy", + className: "ContainerListBlobHierarchySegmentExceptionHeaders", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", - type: { - name: "Boolean" - } - }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var Metrics = { - serializedName: "Metrics", + exports2.ContainerGetAccountInfoHeaders = { + serializedName: "Container_getAccountInfoHeaders", type: { name: "Composite", - className: "Metrics", + 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: "Version", - xmlName: "Version", + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { - name: "Boolean" + name: "Enum", + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { - name: "Composite", - className: "RetentionPolicy" + name: "Enum", + allowedValues: [ + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" + ] + } + }, + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", + type: { + name: "Boolean" } } } } }; - var CorsRule = { - serializedName: "CorsRule", + exports2.ContainerGetAccountInfoExceptionHeaders = { + serializedName: "Container_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "CorsRule", + className: "ContainerGetAccountInfoExceptionHeaders", modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", - required: true, - xmlName: "AllowedOrigins", + 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" + } }, - allowedMethods: { - serializedName: "AllowedMethods", - required: true, - xmlName: "AllowedMethods", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", + 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" } - } - } - } - }; - var StaticWebsite = { - serializedName: "StaticWebsite", - type: { - name: "Composite", - className: "StaticWebsite", - modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + }, + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "Boolean" + name: "String" } }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", + contentRange: { + serializedName: "content-range", + xmlName: "content-range", type: { name: "String" } }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } - } - } - } - }; - var StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", + }, + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, - code: { - serializedName: "Code", - xmlName: "Code", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } - } - } - } - }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", - type: { - name: "Composite", - className: "BlobServiceStatistics", - modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", + }, + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Composite", - className: "GeoReplication" + name: "Number" } - } - } - } - }; - var GeoReplication = { - serializedName: "GeoReplication", - type: { - name: "Composite", - className: "GeoReplication", - modelProperties: { - status: { - serializedName: "Status", - required: true, - xmlName: "Status", + }, + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", + copyCompletedOn: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListContainersSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + }, + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + 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: "String" + name: "Enum", + allowedValues: ["locked", "unlocked"] } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - } - } - } - }; - var ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", - type: { - name: "Composite", - className: "ContainerItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { name: "Boolean" } }, - version: { - serializedName: "Version", - xmlName: "Version", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "ContainerProperties" + name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } - } - } - } - }; - var ContainerProperties = { - serializedName: "ContainerProperties", - type: { - name: "Composite", - className: "ContainerProperties", - modelProperties: { - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "ByteArray" } }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "Number" } }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", + contentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } } } } }; - var KeyInfo = { - serializedName: "KeyInfo", + exports2.BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", - className: "KeyInfo", + className: "BlobDownloadExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -68915,457 +77473,391 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { - serializedName: "UserDelegationKey", + exports2.BlobGetPropertiesHeaders = { + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", - className: "UserDelegationKey", + className: "BlobGetPropertiesHeaders", modelProperties: { - signedObjectId: { - serializedName: "SignedOid", - required: true, - xmlName: "SignedOid", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", + objectReplicationPolicyId: { + serializedName: "x-ms-or-policy-id", + xmlName: "x-ms-or-policy-id", type: { name: "String" } }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", + objectReplicationRules: { + serializedName: "x-ms-or", + headerCollectionPrefix: "x-ms-or-", + xmlName: "x-ms-or", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", + 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" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } - } - } - } - }; - var FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "FilterBlobSegment", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + }, + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, - where: { - serializedName: "Where", - required: true, - xmlName: "Where", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - blobs: { - serializedName: "Blobs", - required: true, - xmlName: "Blobs", - xmlIsWrapped: true, - xmlElementName: "Blob", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + isIncrementalCopy: { + serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { - name: "String" + name: "Boolean" } - } - } - } - }; - var FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", - type: { - name: "Composite", - className: "FilterBlobItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + destinationSnapshot: { + serializedName: "x-ms-copy-destination-snapshot", + xmlName: "x-ms-copy-destination-snapshot", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", + leaseDuration: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", type: { - name: "String" + name: "Enum", + allowedValues: ["infinite", "fixed"] } }, - tags: { - serializedName: "Tags", - xmlName: "Tags", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { - name: "Composite", - className: "BlobTags" + name: "Enum", + allowedValues: [ + "available", + "leased", + "expired", + "breaking", + "broken" + ] } - } - } - } - }; - var BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", - type: { - name: "Composite", - className: "BlobTags", - modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", + }, + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } + name: "Enum", + allowedValues: ["locked", "unlocked"] } - } - } - } - }; - var BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", - type: { - name: "Composite", - className: "BlobTag", - modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", + }, + contentLength: { + serializedName: "content-length", + xmlName: "content-length", + type: { + name: "Number" + } + }, + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } - } - } - } - }; - var SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", - type: { - name: "Composite", - className: "SignedIdentifier", - modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { - name: "Composite", - className: "AccessPolicy" + name: "String" } - } - } - } - }; - var AccessPolicy = { - serializedName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy", - modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", + }, + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", - type: { - name: "Composite", - className: "ListBlobsFlatSegmentResponse", - modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { name: "Number" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "Boolean" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } - } - } - } - }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobFlatListSegment", - modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + }, + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } - } - } - } - }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", - type: { - name: "Composite", - className: "BlobItemInternal", - modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + }, + accessTier: { + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { - name: "Composite", - className: "BlobName" + name: "String" } }, - deleted: { - serializedName: "Deleted", - required: true, - xmlName: "Deleted", + accessTierInferred: { + serializedName: "x-ms-access-tier-inferred", + xmlName: "x-ms-access-tier-inferred", type: { name: "Boolean" } }, - snapshot: { - serializedName: "Snapshot", - required: true, - xmlName: "Snapshot", + 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: "VersionId", - xmlName: "VersionId", + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, isCurrentVersion: { - serializedName: "IsCurrentVersion", - xmlName: "IsCurrentVersion", + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { name: "Boolean" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { - name: "Composite", - className: "BlobPropertiesInternal" + name: "Number" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + expiresOn: { + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTimeRfc1123" } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "Composite", - className: "BlobTags" + name: "Boolean" } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + rehydratePriority: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Enum", + allowedValues: ["High", "Standard"] } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + 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" + } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "BlobGetPropertiesExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -69373,833 +77865,839 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.BlobDeleteHeaders = { + serializedName: "Blob_deleteHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "BlobDeleteHeaders", modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + } + } + } + }; + 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" } - }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + } + } + } + }; + 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" } }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" - } - }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "String" } - }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + } + } + } + }; + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", + type: { + name: "Composite", + className: "BlobUndeleteExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } - }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + } + } + } + }; + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", + type: { + name: "Composite", + className: "BlobSetExpiryHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", - type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] - } - }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + } + } + } + }; + 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" } - }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", - type: { - name: "Boolean" - } - }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", - type: { - name: "Boolean" - } - }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + } + } + } + }; + exports2.BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", + type: { + name: "Composite", + className: "BlobSetHttpHeadersHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", - type: { - name: "Number" - } - }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "DateTimeRfc1123" } }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Boolean" + name: "Number" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "String" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", + } + } + } + }; + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetHttpHeadersExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + 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" } }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { name: "DateTimeRfc1123" } }, immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { name: "Enum", allowedValues: ["Mutable", "Unlocked", "Locked"] } - }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", + } + } + } + }; + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetImmutabilityPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", + exports2.BlobDeleteImmutabilityPolicyHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ListBlobsHierarchySegmentResponse", + className: "BlobDeleteImmutabilityPolicyHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } - }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + } + } + } + }; + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + type: { + name: "Composite", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + } + } + } + }; + 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" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } - } - } - } - }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment", - modelProperties: { - blobPrefixes: { - serializedName: "BlobPrefixes", - xmlName: "BlobPrefixes", - xmlElementName: "BlobPrefix", + }, + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobPrefix" - } - } + name: "DateTimeRfc1123" } }, - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "Boolean" } } } } }; - var BlobPrefix = { - serializedName: "BlobPrefix", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "BlobPrefix", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "BlobName" + name: "String" } } } } }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "BlockLookupList", + className: "BlobSetMetadataHeaders", modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTimeRfc1123" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } - } - } - } - }; - var BlockList = { - serializedName: "BlockList", - type: { - name: "Composite", - className: "BlockList", - modelProperties: { - committedBlocks: { - serializedName: "CommittedBlocks", - xmlName: "CommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } }, - uncommittedBlocks: { - serializedName: "UncommittedBlocks", - xmlName: "UncommittedBlocks", - xmlIsWrapped: true, - xmlElementName: "Block", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + 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" } } } } }; - var Block = { - serializedName: "Block", + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", - className: "Block", + className: "BlobSetMetadataExceptionHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", - type: { - name: "Number" - } } } } }; - var PageList = { - serializedName: "PageList", + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", - className: "PageList", + className: "BlobAcquireLeaseHeaders", modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "String" } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } - } - } - } - }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", - type: { - name: "Composite", - className: "PageRange", - modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + 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" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } } } } }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "ClearRange", + className: "BlobAcquireLeaseExceptionHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", - className: "QueryRequest", + className: "BlobReleaseLeaseHeaders", modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + 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" } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "BlobRenewLeaseHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "String" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "String" } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "any" } } + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "DelimitedTextConfiguration", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + 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" } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + 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" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "JsonTextConfiguration", + className: "BlobChangeLeaseExceptionHeaders", modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -70207,77 +78705,107 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "ArrowConfiguration", + className: "BlobBreakLeaseHeaders", modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + name: "String" } - } - } - } - }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", - type: { - name: "Composite", - className: "ArrowField", - modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + }, + 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" } }, - name: { - serializedName: "Name", - xmlName: "Name", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } } } } }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesHeaders", + 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", @@ -70299,6 +78827,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -70309,11 +78858,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -70325,12 +78874,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesHeaders", + 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", @@ -70352,6 +78915,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -70362,11 +78954,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -70374,16 +78966,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsHeaders", + 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", @@ -70405,6 +79025,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -70412,6 +79039,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -70422,11 +79085,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -70434,15 +79097,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -70465,6 +79142,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -70475,11 +79159,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -70491,11 +79175,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", + className: "BlobSetTierHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -70518,13 +79202,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -70535,11 +79212,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -70551,11 +79228,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -70619,22 +79296,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "Boolean" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -70646,227 +79316,147 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "BlobQueryHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "String" + name: "Dictionary", + value: { type: { name: "String" } } } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", - type: { - name: "Composite", - className: "ServiceFilterBlobsHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + contentRange: { + serializedName: "content-range", + xmlName: "content-range", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } - } - } - } - }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", - type: { - name: "Composite", - className: "ContainerCreateHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + }, + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { - name: "DateTimeRfc1123" + name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + blobType: { + serializedName: "x-ms-blob-type", + xmlName: "x-ms-blob-type", type: { - name: "String" + name: "Enum", + allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - date: { - serializedName: "date", - xmlName: "date", + copyCompletionTime: { + serializedName: "x-ms-copy-completion-time", + xmlName: "x-ms-copy-completion-time", type: { name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } - } - } - } - }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", - type: { - name: "Composite", - className: "ContainerCreateExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } - } - } - } - }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", - type: { - name: "Composite", - className: "ContainerGetPropertiesHeaders", - modelProperties: { - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", + }, + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - etag: { - serializedName: "etag", - xmlName: "etag", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "DateTimeRfc1123" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, leaseDuration: { @@ -70920,6 +79510,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -70927,47 +79524,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "Number" } }, - hasImmutabilityPolicy: { - serializedName: "x-ms-has-immutability-policy", - xmlName: "x-ms-has-immutability-policy", + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { name: "Boolean" } }, - hasLegalHold: { - serializedName: "x-ms-has-legal-hold", - xmlName: "x-ms-has-legal-hold", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Boolean" + name: "String" } }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - denyEncryptionScopeOverride: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", + blobContentMD5: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", type: { - name: "Boolean" + name: "ByteArray" } }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "x-ms-immutable-storage-with-versioning-enabled", - xmlName: "x-ms-immutable-storage-with-versioning-enabled", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + 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: { @@ -70980,11 +79636,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -70996,11 +79652,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + className: "BlobSetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -71040,11 +79696,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71056,11 +79712,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "PageBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -71076,6 +79732,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -71097,6 +79760,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -71104,6 +79774,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -71114,11 +79805,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71130,20 +79821,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "PageBlobUploadPagesHeaders", 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", @@ -71158,6 +79841,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -71186,6 +79890,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -71196,11 +79921,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71212,11 +79937,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "PageBlobClearPagesHeaders", modelProperties: { etag: { serializedName: "etag", @@ -71229,7 +79954,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; serializedName: "last-modified", xmlName: "last-modified", type: { - name: "DateTimeRfc1123" + 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: { @@ -71270,11 +80016,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71286,19 +80032,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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", @@ -71320,6 +80094,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -71330,11 +80125,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71342,16 +80137,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -71390,11 +80220,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71406,58 +80236,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", - type: { - name: "String" - } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -71485,15 +80290,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71505,11 +80317,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "PageBlobResizeHeaders", modelProperties: { etag: { serializedName: "etag", @@ -71525,11 +80337,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } }, clientRequestId: { @@ -71559,15 +80371,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71579,11 +80398,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "PageBlobUpdateSequenceNumberHeaders", modelProperties: { etag: { serializedName: "etag", @@ -71599,6 +80418,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -71626,15 +80452,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71646,11 +80479,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "PageBlobCopyIncrementalHeaders", modelProperties: { etag: { serializedName: "etag", @@ -71666,13 +80499,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -71700,15 +80526,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71720,11 +80568,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "AppendBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -71740,11 +80588,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Number" + name: "ByteArray" } }, clientRequestId: { @@ -71768,21 +80616,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71794,11 +80677,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", @@ -71814,11 +80697,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" + } + }, + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" } }, clientRequestId: { @@ -71848,65 +80738,40 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", - type: { - name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", - modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + }, + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "DateTimeRfc1123" + name: "String" } }, errorCode: { @@ -71919,11 +80784,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -71935,24 +80800,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + 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: { @@ -71976,109 +80855,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", - type: { - name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ContainerGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "String" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + name: "Boolean" } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -72086,76 +80912,104 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "AppendBlobSealHeaders", modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "DateTimeRfc1123" + name: "String" } }, - createdOn: { - serializedName: "x-ms-creation-time", - xmlName: "x-ms-creation-time", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - objectReplicationPolicyId: { - serializedName: "x-ms-or-policy-id", - xmlName: "x-ms-or-policy-id", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - objectReplicationRules: { - serializedName: "x-ms-or", - headerCollectionPrefix: "x-ms-or-", - xmlName: "x-ms-or", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "String" + name: "Boolean" } - }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", + } + } + } + }; + 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", @@ -72163,6 +81017,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, contentMD5: { serializedName: "content-md5", xmlName: "content-md5", @@ -72170,120 +81031,113 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "ByteArray" } }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", 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", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + } + } + } + }; + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobUploadExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } - }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + } + } + } + }; + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", + type: { + name: "Composite", + className: "BlockBlobPutBlobFromUrlHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, clientRequestId: { @@ -72314,20 +81168,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -72335,16 +81175,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -72363,78 +81196,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" - } } } } }; - var BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -72442,211 +81218,260 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobGetPropertiesHeaders = { - serializedName: "Blob_getPropertiesHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "BlobGetPropertiesHeaders", + className: "BlockBlobStageBlockHeaders", modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - createdOn: { - serializedName: "x-ms-creation-time", - xmlName: "x-ms-creation-time", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - metadata: { - serializedName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - xmlName: "x-ms-meta", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - objectReplicationPolicyId: { - serializedName: "x-ms-or-policy-id", - xmlName: "x-ms-or-policy-id", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - objectReplicationRules: { - serializedName: "x-ms-or", - headerCollectionPrefix: "x-ms-or-", - xmlName: "x-ms-or", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTimeRfc1123" } }, - blobType: { - serializedName: "x-ms-blob-type", - xmlName: "x-ms-blob-type", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "ByteArray" } }, - copyCompletedOn: { - serializedName: "x-ms-copy-completion-time", - xmlName: "x-ms-copy-completion-time", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - copyStatusDescription: { - serializedName: "x-ms-copy-status-description", - xmlName: "x-ms-copy-status-description", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + } + } + } + }; + 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" } - }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + } + } + } + }; + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", + type: { + name: "Composite", + className: "BlockBlobStageBlockFromURLHeaders", + modelProperties: { + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "ByteArray" } }, - isIncrementalCopy: { - serializedName: "x-ms-incremental-copy", - xmlName: "x-ms-incremental-copy", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Boolean" + name: "ByteArray" } }, - destinationSnapshot: { - serializedName: "x-ms-copy-destination-snapshot", - xmlName: "x-ms-copy-destination-snapshot", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "DateTimeRfc1123" } }, - contentLength: { - serializedName: "content-length", - xmlName: "content-length", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "Number" + name: "Boolean" } }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - etag: { - serializedName: "etag", - xmlName: "etag", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "ByteArray" + name: "String" } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + } + } + } + }; + 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" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { name: "String" } }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + 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" } }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Number" + name: "ByteArray" + } + }, + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" } }, clientRequestId: { @@ -72670,30 +81495,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -72712,106 +81530,110 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", 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", + } + } + } + }; + 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" } - }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", + } + } + } + }; + exports2.BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobGetBlockListHeaders", + modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "Boolean" + name: "String" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + date: { + serializedName: "date", + xmlName: "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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, + } + } + } + }; + exports2.BlockBlobGetBlockListExceptionHeaders = { + serializedName: "BlockBlob_getBlockListExceptionHeaders", + type: { + name: "Composite", + className: "BlockBlobGetBlockListExceptionHeaders", + modelProperties: { errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -72822,9797 +81644,7765 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", - 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" } } }; - var 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.leaseId = { + parameterPath: ["options", "leaseAccessConditions", "leaseId"], + mapper: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", + type: { + name: "String" } } }; - var 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.ifModifiedSince = { + parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], + mapper: { + serializedName: "If-Modified-Since", + xmlName: "If-Modified-Since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.ifUnmodifiedSince = { + parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], + mapper: { + serializedName: "If-Unmodified-Since", + xmlName: "If-Unmodified-Since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.comp6 = { + parameterPath: "comp", + mapper: { + defaultValue: "metadata", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.comp7 = { + parameterPath: "comp", + mapper: { + defaultValue: "acl", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", - type: { - name: "Composite", - className: "BlobSetExpiryExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + exports2.containerAcl = { + parameterPath: ["options", "containerAcl"], + mapper: { + serializedName: "containerAcl", + xmlName: "SignedIdentifiers", + xmlIsWrapped: true, + xmlElementName: "SignedIdentifier", + type: { + name: "Sequence", + element: { type: { - name: "String" + name: "Composite", + className: "SignedIdentifier" } } } } }; - var 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.comp8 = { + parameterPath: "comp", + mapper: { + defaultValue: "undelete", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.deletedContainerName = { + parameterPath: ["options", "deletedContainerName"], + mapper: { + serializedName: "x-ms-deleted-container-name", + xmlName: "x-ms-deleted-container-name", + type: { + name: "String" } } }; - var 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", + 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: ["Mutable", "Unlocked", "Locked"] + 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" + } } }; - var 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.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var 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.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], + mapper: { + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", + type: { + name: "Boolean" } } }; - var 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.rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], + mapper: { + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", + type: { + name: "Boolean" } } }; - var 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.encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], + mapper: { + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", + type: { + name: "String" } } }; - var 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.encryptionKeySha256 = { + parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], + mapper: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" } } }; - var 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.encryptionAlgorithm = { + parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], + mapper: { + serializedName: "x-ms-encryption-algorithm", + xmlName: "x-ms-encryption-algorithm", + type: { + name: "String" } } }; - var 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.ifMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], + mapper: { + serializedName: "If-Match", + xmlName: "If-Match", + type: { + name: "String" } } }; - var 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.ifNoneMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], + mapper: { + serializedName: "If-None-Match", + xmlName: "If-None-Match", + type: { + name: "String" } } }; - var 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.ifTags = { + parameterPath: ["options", "modifiedAccessConditions", "ifTags"], + mapper: { + serializedName: "x-ms-if-tags", + xmlName: "x-ms-if-tags", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.blobCacheControl = { + parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], + mapper: { + serializedName: "x-ms-blob-cache-control", + xmlName: "x-ms-blob-cache-control", + type: { + name: "String" } } }; - var 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.blobContentType = { + parameterPath: ["options", "blobHttpHeaders", "blobContentType"], + mapper: { + serializedName: "x-ms-blob-content-type", + xmlName: "x-ms-blob-content-type", + type: { + name: "String" } } }; - var 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.blobContentMD5 = { + parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], + mapper: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", + type: { + name: "ByteArray" } } }; - var 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.blobContentEncoding = { + parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], + mapper: { + serializedName: "x-ms-blob-content-encoding", + xmlName: "x-ms-blob-content-encoding", + type: { + name: "String" } } }; - var 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.blobContentLanguage = { + parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], + mapper: { + serializedName: "x-ms-blob-content-language", + xmlName: "x-ms-blob-content-language", + type: { + name: "String" } } }; - var 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.blobContentDisposition = { + parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], + mapper: { + serializedName: "x-ms-blob-content-disposition", + xmlName: "x-ms-blob-content-disposition", + type: { + name: "String" } } }; - var 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.comp12 = { + parameterPath: "comp", + mapper: { + defaultValue: "immutabilityPolicies", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.immutabilityPolicyExpiry = { + parameterPath: ["options", "immutabilityPolicyExpiry"], + mapper: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", + type: { + name: "DateTimeRfc1123" } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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"] } } }; - var 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.comp13 = { + parameterPath: "comp", + mapper: { + defaultValue: "legalhold", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var 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.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] } } }; - var 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.sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfMatch = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], + mapper: { + serializedName: "x-ms-source-if-match", + xmlName: "x-ms-source-if-match", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.copySource = { + parameterPath: "copySource", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.blobTagsString = { + parameterPath: ["options", "blobTagsString"], + mapper: { + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", + type: { + name: "String" } } }; - var 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.sealBlob = { + parameterPath: ["options", "sealBlob"], + mapper: { + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", + type: { + name: "Boolean" } } }; - var 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.legalHold1 = { + parameterPath: ["options", "legalHold"], + mapper: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var 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.xMsRequiresSync = { + parameterPath: "xMsRequiresSync", + mapper: { + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", + type: { + name: "String" } } }; - var 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.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], + mapper: { + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", + type: { + name: "ByteArray" } } }; - var 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.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", + mapper: { + defaultValue: "query", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.comp18 = { + parameterPath: "comp", + mapper: { + defaultValue: "tags", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var 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.transactionalContentCrc64 = { + parameterPath: ["options", "transactionalContentCrc64"], + mapper: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", + type: { + name: "ByteArray" } } }; - var 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.blobType = { + parameterPath: "blobType", + mapper: { + defaultValue: "PageBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" } } }; - var 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.blobContentLength = { + parameterPath: "blobContentLength", + mapper: { + serializedName: "x-ms-blob-content-length", + required: true, + xmlName: "x-ms-blob-content-length", + type: { + name: "Number" } } }; - var 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.blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], + mapper: { + defaultValue: 0, + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" } } }; - var 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.contentType1 = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/octet-stream", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" } } }; - var 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.body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" } } }; - var 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.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" } } }; - var 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.ifSequenceNumberEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-eq", + xmlName: "x-ms-if-sequence-number-eq", + type: { + name: "Number" } } }; - var 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.pageWrite1 = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "clear", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" } } }; - var 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.sourceUrl = { + parameterPath: "sourceUrl", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.sourceRange = { + parameterPath: "sourceRange", + mapper: { + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", + type: { + name: "String" } } }; - var 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.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], + mapper: { + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", + type: { + name: "ByteArray" } } }; - var 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.range1 = { + parameterPath: "range", + mapper: { + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.comp20 = { + parameterPath: "comp", + mapper: { + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var 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.appendPosition = { + parameterPath: [ + "options", + "appendPositionAccessConditions", + "appendPosition" + ], + mapper: { + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", + type: { + name: "Number" } } }; - var 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.sourceRange1 = { + parameterPath: ["options", "sourceRange"], + mapper: { + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", + type: { + name: "String" } } }; - var 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.comp23 = { + parameterPath: "comp", + mapper: { + defaultValue: "seal", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blobType2 = { + parameterPath: "blobType", + mapper: { + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" } } }; - var 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.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], + mapper: { + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", + type: { + name: "Boolean" } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.comp24 = { + parameterPath: "comp", + mapper: { + defaultValue: "block", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.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 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" - } - } + 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 BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } + 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" }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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); } }; - var 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.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 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" - } - } + 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 BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + 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 blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + 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 accept = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 url = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" + var restoreOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.ContainerRestoreHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerRestoreExceptionHeaders } }, - skipEncoding: true + 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 restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 + var filterBlobsOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.FilterBlobSegment, + headersMapper: Mappers.ContainerFilterBlobsHeaders }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" + 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 version = { - parameterPath: "version", - mapper: { - defaultValue: "2024-11-04", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" + 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 requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" + 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 accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" + 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 marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" + 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 maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 + var getAccountInfoOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: Mappers.ContainerGetAccountInfoHeaders }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" + 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); } - }; - var include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } - } - }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo - }; - var comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } + /** + * 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); } - }; - var comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } + /** + * 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); } - }; - var multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } + /** + * [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); } - }; - var comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } + /** + * [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); } - }; - var restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * [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); } - }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + /** + * [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); } - }; - var access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } + /** + * 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); } - }; - var defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } + /** + * 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); } - }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * 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); } - }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * 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); } - }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } + /** + * 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); } }; - var comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" + 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 deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" + 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 comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" + 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 sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" + 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 comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" + 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 proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" + 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 action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 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" - ] - } - } + var copyFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.BlobCopyFromURLHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobCopyFromURLExceptionHeaders } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 }; - var encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } + /** + * 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); } - }; - var encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" - } + /** + * 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); } - }; - var ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" - } + /** + * 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); } - }; - var ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } + /** + * 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); } - }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + /** + * 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); } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" + 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 expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" + 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 blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" + 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 blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" + 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 blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" + 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 blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" + 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 blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" + 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 blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" + 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 comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 }; - var immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } + } +}); + +// 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; } - }; - var immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } + /** + * 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); } - }; - var comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } + /** + * 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); } }; - var comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + 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 rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + var appendBlockFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.AppendBlobAppendBlockFromUrlHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.AppendBlobAppendBlockFromUrlExceptionHeaders } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" + 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 }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * 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); } - }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * 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); } }; - var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" + 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 sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" + 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 copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" + 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 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"] + 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 comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" + 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 }; - var copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" + } +}); + +// 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(url, options) { + if (url === void 0) { + throw new Error("'url' cannot be null"); } - } - }; - var comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (!options) { + options = {}; } - } - }; - var 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" - ] + const defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; + super(optionsWithDefaults); + this.url = url; + 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); } }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest - }; - var comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + 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(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + const storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = void 0; } }; - var comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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; } - }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags - }; - var transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + /** + * 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; } - } - }; - var transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" + if (permissionLike.add) { + blobSASPermissions.add = true; } - } - }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.create) { + blobSASPermissions.create = true; } - } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + if (permissionLike.write) { + blobSASPermissions.write = true; } - } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + if (permissionLike.delete) { + blobSASPermissions.delete = true; } - } - }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + if (permissionLike.deleteVersion) { + blobSASPermissions.deleteVersion = true; } - } - }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + if (permissionLike.tag) { + blobSASPermissions.tag = true; } - } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + if (permissionLike.move) { + blobSASPermissions.move = true; } - } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.execute) { + blobSASPermissions.execute = true; } - } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.setImmutabilityPolicy) { + blobSASPermissions.setImmutabilityPolicy = true; + } + if (permissionLike.permanentDelete) { + blobSASPermissions.permanentDelete = true; } + return blobSASPermissions; } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + /** + * 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"); } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" + if (this.add) { + permissions.push("a"); } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" + if (this.create) { + permissions.push("c"); } - } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (this.write) { + permissions.push("w"); } - } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + if (this.delete) { + permissions.push("d"); } - } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + if (this.deleteVersion) { + permissions.push("x"); } - } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + if (this.tag) { + permissions.push("t"); } - } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + if (this.move) { + permissions.push("m"); } - } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.execute) { + permissions.push("e"); } - } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + if (this.permanentDelete) { + permissions.push("y"); } + return permissions.join(""); } }; - var 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.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; } - }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + /** + * 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; } - } - }; - var blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.add) { + containerSASPermissions.add = true; } - } - }; - var comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.create) { + containerSASPermissions.create = true; } - } - }; - var maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + if (permissionLike.write) { + containerSASPermissions.write = true; } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + if (permissionLike.delete) { + containerSASPermissions.delete = true; } - } - }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.list) { + containerSASPermissions.list = true; } - } - }; - var comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.deleteVersion) { + containerSASPermissions.deleteVersion = true; } - } - }; - var blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.tag) { + containerSASPermissions.tag = true; } - } - }; - var copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + if (permissionLike.move) { + containerSASPermissions.move = true; } - } - }; - var comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.execute) { + containerSASPermissions.execute = true; } - } - }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + if (permissionLike.setImmutabilityPolicy) { + containerSASPermissions.setImmutabilityPolicy = true; } - } - }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList - }; - var comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.permanentDelete) { + containerSASPermissions.permanentDelete = true; } - } - }; - var listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + if (permissionLike.filterByTags) { + containerSASPermissions.filterByTags = true; } + return containerSASPermissions; } - }; - var ServiceImpl = class { /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client + * Specifies Read access granted. */ - constructor(client) { - this.client = client; - } + read = false; /** - * 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. + * Specifies Add access granted. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); - } + add = false; /** - * 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. + * Specifies Create access granted. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); - } + create = false; /** - * 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. + * Specifies Write access granted. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); - } + write = false; /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. + * Specifies Delete access granted. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); - } + deleteVersion = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Specifies List access granted. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); - } + list = false; /** - * 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. + * Specfies Tag access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); - } + tag = false; /** - * 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. + * Specifies Move access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); - } - }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + 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"); } - }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + if (this.delete) { + permissions.push("d"); + } + if (this.deleteVersion) { + permissions.push("x"); + } + if (this.list) { + permissions.push("l"); + } + if (this.tag) { + permissions.push("t"); } - }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + if (this.move) { + permissions.push("m"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + if (this.execute) { + permissions.push("e"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + if (this.permanentDelete) { + permissions.push("y"); + } + if (this.filterByTags) { + permissions.push("f"); + } + return permissions.join(""); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * Azure Storage account name; readonly. */ - constructor(client) { - this.client = client; - } + accountName; /** - * 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. + * Azure Storage user delegation key; readonly. */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); + 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 { /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * The storage API version. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + version; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + protocol; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); - } + startsOn; /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); - } + expiresOn; /** - * 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. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); - } + permissions; /** - * 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. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } + services; /** - * [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. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); - } + resourceTypes; /** - * [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. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); - } + identifier; /** - * [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. + * Optional. Encryption scope to use when sending requests authorized with this SAS URI. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); - } + encryptionScope; /** - * [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. + * 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 */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); - } + resource; /** - * [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. + * The signature for the SAS token. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); - } + signature; /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. + * Value for cache-control header in Blob/File Service SAS. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); - } + cacheControl; /** - * [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. + * Value for content-disposition header in Blob/File Service SAS. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); - } + contentDisposition; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Value for content-encoding header in Blob/File Service SAS. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); - } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + 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 + }; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + 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; + } } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + } + /** + * 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; + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + 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; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 + } }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + } + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + } + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + } + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var BlobImpl = class { - /** - * 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); + 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(); + } } - /** - * 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); + 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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(); + } } - /** - * 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(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + 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, + timestamp2, + 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."); } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * 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); + 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(); + } } - /** - * 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(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + 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, + timestamp2, + 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}`); } - /** - * 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); + 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'."); } - /** - * [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); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - /** - * [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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - /** - * 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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + 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."); } - /** - * 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(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - /** - * 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(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + if (version < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + 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; /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * Gets the lease Id. + * + * @readonly */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); + get leaseId() { + return this._leaseId; } /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * Gets the url. + * + * @readonly */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); + get url() { + return this._url; } /** - * 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); - } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders + * 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; } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders + if (!leaseId) { + leaseId = (0, core_util_1.randomUUID)(); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + 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."); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + 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."); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + 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."); } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var PageBlobImpl = class { + 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 + }); + }); + } /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * 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. */ - constructor(client) { - this.client = client; + 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; /** - * 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. + * 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 - */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + 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 { /** - * 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. + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * 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. + * Returns if it was previously specified + * for the file. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * 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. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * 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. + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + 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; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - constructor(client) { - this.client = client; + get contentRange() { + return this.originalResponse.contentRange; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get contentType() { + return this.originalResponse.contentType; } /** - * 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. + * 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 */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyId() { + return this.originalResponse.copyId; } /** - * 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. + * 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 */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + get copyProgress() { + return this.originalResponse.copyProgress; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get copySource() { + return this.originalResponse.copySource; } /** - * 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. + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get leaseState() { + return this.originalResponse.leaseState; } /** - * 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. + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get leaseStatus() { + return this.originalResponse.leaseStatus; } /** - * 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. + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. + * + * @readonly */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get date() { + return this.originalResponse.date; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + */ + get etag() { + return this.originalResponse.etag; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * The number of tags associated with the blob + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get tagCount() { + return this.originalResponse.tagCount; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * The error code. + * + * @readonly + */ + get errorCode() { + return this.originalResponse.errorCode; } /** - * 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. + * 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). * - * @param permissions - + * @readonly */ - 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; + 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; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * - * @param permissionLike - + * @readonly */ - 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; + get requestId() { + return this.originalResponse.requestId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); + get clientRequestId() { + return this.originalResponse.clientRequestId; } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + /** + * Indicates the version of the Blob service used + * to execute the request. + * + * @readonly + */ + get version() { + return this.originalResponse.version; } /** - * 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. + * Indicates the versionId of the downloaded blob version. * - * @param permissions - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates whether version of this blob is a current version. * - * @param permissionLike - + * @readonly */ - 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; + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * 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. * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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 */ - 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(""); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * + * @readonly */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * If this blob has been sealed. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get isSealed() { + return this.originalResponse.isSealed; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * Indicates if a legal hold is present on the blob. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + 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 { /** - * A private helper method used to filter and append query key/value pairs into an array. + * Reads a fixed number of bytes from the stream. * - * @param queries - - * @param key - - * @param value - + * @param stream - + * @param length - + * @param options - */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); + static async readFixedBytes(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); + if (bytes.length !== length) { + throw new Error("Hit stream end."); } + return bytes; } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } + /** + * Reads a single byte from the stream. + * + * @param stream - + * @param options - + */ + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 1, options); + return buf[0]; } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); + // 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(stream, options = {}) { + let zigZagEncoded = 0; + let significanceInBit = 0; + let byte, haveMoreByte, significanceInFloat; + do { + byte = await _AvroParser.readByte(stream, 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(stream, 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); } - if (version2 >= "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."); - } + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - 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."); + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; + static async readNull() { + return null; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); + if (b === 1) { + return true; + } else if (b === 0) { + return false; } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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."); + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat32(0, true); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat64(0, true); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); + if (size < 0) { + throw new Error("Bytes size was negative."); } + return stream.read(size, { abortSignal: options.abortSignal }); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); + return { key, value }; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readMap(stream, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } + return dict; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static async readArray(stream, readItemMethod, options = {}) { + const items = []; + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { + if (count < 0) { + await _AvroParser.readLong(stream, options); + count = -count; + } + while (count--) { + const item = await readItemMethod(stream, options); + items.push(item); + } } + return items; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + return _AvroType.fromObjectSchema(schema2); } } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { } - } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "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'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + switch (this._primitive) { + case AvroPrimitive.NULL: + return AvroParser.readNull(); + case AvroPrimitive.BOOLEAN: + return AvroParser.readBoolean(stream, options); + case AvroPrimitive.INT: + return AvroParser.readInt(stream, options); + case AvroPrimitive.LONG: + return AvroParser.readLong(stream, options); + case AvroPrimitive.FLOAT: + return AvroParser.readFloat(stream, options); + case AvroPrimitive.DOUBLE: + return AvroParser.readDouble(stream, options); + case AvroPrimitive.BYTES: + return AvroParser.readBytes(stream, options); + case AvroPrimitive.STRING: + return AvroParser.readString(stream, options); + default: + throw new Error("Unknown Avro Primitive"); + } } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); + return this._symbols[value]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "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."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + const readItemMethod = (s, opts) => { + return this._itemType.read(s, opts); + }; + return AvroParser.readMap(stream, readItemMethod, options); } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, 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(stream, options); + } + } + return record; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + }; + } +}); + +// 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; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + return true; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + _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; } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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."); } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + this._metadata = await AvroParser_js_1.AvroParser.readMap(this._headerStream, AvroParser_js_1.AvroParser.readString, { + abortSignal: options.abortSignal }); - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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"); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal }); - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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; + } } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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((resolve2, 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(); + resolve2(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); + } + }); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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. @@ -82728,7 +89518,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -82835,14 +89625,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -82885,23 +89667,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -82926,99 +89691,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * @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; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * Indicates immutability policy mode. + * Indicates the version of the File service used + * to execute the request. * * @readonly */ - get immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; + get version() { + return this.originalResponse.version; } /** - * Indicates if a legal hold is present on the blob. + * 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 legalHold() { - return this.originalResponse.legalHold; + 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. @@ -83026,19 +89727,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * @readonly */ - get contentAsBlob() { - return this.originalResponse.blobBody; + get blobBody() { + return void 0; } /** * The response body as a node.js Readable stream. * Always undefined in the browser. * - * It will automatically retry when internal read stream unexpected ends. + * It will parse avor data returned by blob query. * * @readonly */ get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** * The HTTP response. @@ -83046,1032 +89747,1289 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get _response() { return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** - * Creates an instance of BlobDownloadResponse. + * Creates an instance of BlobQueryResponse. * * @param originalResponse - - * @param getter - - * @param offset - - * @param count - * @param options - */ - constructor(originalResponse, getter, offset, count, options = {}) { + constructor(originalResponse, options = {}) { this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + this.blobDownloadStream = new BlobQuickQueryStream_js_1.BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - 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); + 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; } - static async readInt(stream2, options = {}) { - return _AvroParser.readZigZagLong(stream2, options); + return tier; + } + function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } - static async readNull() { - return null; + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25; } - 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."); + } + 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}`); } - 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."); + } + exports2.deserializeState = deserializeState; + function setStateError(inputs) { + const { state, stateProxy, isOperationError } = inputs; + return (error3) => { + if (isOperationError(error3)) { + stateProxy.setError(state, error3); + stateProxy.setFailed(state); } - 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); + throw error3; + }; + } + function appendReadableErrorMessage(currentMessage, innerMessage) { + let message = currentMessage; + if (message.slice(-1) !== ".") { + message = message + "."; } - static async readMapPair(stream2, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream2, options); - const value = await readItemMethod(stream2, options); - return { key, value }; + 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); } - static async readMap(stream2, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; + return { + code, + message + }; + } + function processOperationStatus(result) { + const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result; + switch (status) { + case "succeeded": { + stateProxy.setSucceeded(state); + break; } - 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); + 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; } - return items; - } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); + case "canceled": { + stateProxy.setCanceled(state); + break; } } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); + 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, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 + }; } } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); + 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); } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + case "DELETE": { + return void 0; } - } - }; - var AvroPrimitiveType = class extends AvroType { - 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"); + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); } } - }; - var AvroEnumType = class extends AvroType { - 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 { - constructor(types) { - super(); - this._types = types; - } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); - } - }; - var AvroMapType = class extends AvroType { - 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 { - 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); + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; + } + case "original-uri": { + return requestPath; + } + case "location": + default: { + return location; } } - return record; } - }; - 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; + } + 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; } - return true; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; - } - get objectIndex() { - return this._objectIndex; - } - 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; + 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.`); } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); - } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - }); - await 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--; - } + 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; } } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } - } - yield yield tslib.__await(result); - } - }); + } + 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; } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); - } - return data; + 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; } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + 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; } - get position() { - return this._position; + 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; } - async read(size, options = {}) { + return void 0; + } + function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - throw ABORT_ERROR; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); + } + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); } - if (size === 0) { - return new Uint8Array(); + case "ResourceLocation": { + return getLocationHeader(rawResponse); } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); + case "Body": + default: { + return void 0; } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve2, 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(); - resolve2(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.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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}`); } - }; - var BlobQuickQueryStream = class extends stream.Readable { + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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 = () => ({ /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * 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. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new 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 schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 }); + 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, 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, + 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 }); } } - 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 }); + } 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`); } - 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 - }); + } + })().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; } - break; - default: - throw Error(`Unknown schema ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); - } - }; - 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; + } + 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; } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * 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; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * The number of bytes present in the - * response body. - * - * @readonly + * Serializes the Poller operation. */ - get contentLength() { - return this.originalResponse.contentLength; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * 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; + }; + 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); } - /** - * 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; + }; + 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 { /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @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. + * 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. * - * @readonly - */ - get copyCompletedOn() { - return void 0; - } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @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. + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @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. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @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' + * // You can assign more local properties here. + * } + * } + * ``` * - * @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. + * 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. * - * @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'. + * 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: * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get leaseState() { - return this.originalResponse.leaseState; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve2, reject) => { + this.resolve = resolve2; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The error code. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get errorCode() { - return this.originalResponse.errorCode; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * 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 + * Invokes the underlying operation's cancel method. */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * 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. + * 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. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get lastModified() { - return this.originalResponse.lastModified; + 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; } - /** - * A name-value pair - * to associate with a file storage object. - * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; + 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()); + } } /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get requestId() { - return this.originalResponse.requestId; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get clientRequestId() { - return this.originalResponse.clientRequestId; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * Indicates the version of the File service used - * to execute the request. - * - * @readonly + * Returns true if the poller has finished polling. */ - get version() { - return this.originalResponse.version; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * 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 + * Stops the poller from continuing to poll. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * 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) + * Returns true if the poller is stopped. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + isStopped() { + return this.stopped; } /** - * The response body as a browser Blob. - * Always undefined in node.js. + * Attempts to cancel the underlying operation. * - * @readonly + * 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. */ - get blobBody() { - return void 0; + 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; } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * Returns the state of the operation. * - * It will parse avor data returned by blob query. + * 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. * - * @readonly + * 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. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve2) => setTimeout(() => resolve2(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -84079,20 +91037,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -84100,10 +91059,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -84143,12 +91102,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + 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.`); @@ -84158,27 +91126,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -84193,8 +91195,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -84209,9 +91211,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve2, reject) => { this.emitter.on("finish", resolve2); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -84248,333 +91250,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve2, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve2).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve2(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream2, buffer2, offset, end, encoding) { + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils8 = __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(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve2, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream2.on("readable", () => { + const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); resolve2(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -84582,28 +91287,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve2(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream2, buffer2, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve2, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -84614,18 +91319,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream.on("end", () => { resolve2(pos); }); - stream2.on("error", reject); + stream.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve2, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve2, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -84636,9 +91353,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_utils8(); + 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. */ @@ -84654,49 +91410,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -84705,8 +91461,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -84715,8 +91471,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -84746,7 +91502,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -84755,76 +91511,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -84832,8 +91618,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -84841,9 +91626,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -84852,7 +91637,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -84869,9 +91657,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -84882,7 +91670,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -84892,7 +91680,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -84903,17 +91691,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -84921,19 +91717,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -84943,19 +91741,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -84965,13 +91771,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -84982,7 +91788,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -84994,14 +91800,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -85012,22 +91820,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -85043,15 +91853,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -85061,15 +91873,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -85080,24 +91899,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -85118,57 +91939,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * Example using copy cancellation: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -85176,15 +91998,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -85196,14 +92018,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -85213,36 +92035,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -85253,31 +92078,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -85285,12 +92111,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -85301,26 +92127,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -85334,8 +92163,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await streamToBuffer(stream2, buffer2, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -85343,7 +92172,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -85363,10 +92192,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -85381,7 +92213,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -85397,7 +92229,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -85409,21 +92241,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -85431,12 +92265,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -85448,18 +92282,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve2) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve2(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve2((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -85468,17 +92308,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve2) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve2((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. @@ -85486,8 +92376,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -85498,8 +92388,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -85512,8 +92402,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -85523,60 +92413,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -85587,40 +92482,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -85628,20 +92538,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -85654,20 +92575,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -85676,29 +92599,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -85713,7 +92651,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -85727,74 +92665,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -85806,8 +92759,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -85816,15 +92769,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -85840,26 +92810,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -85877,7 +92849,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -85888,32 +92860,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -85938,22 +92926,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -85961,10 +92964,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -85982,7 +92985,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -85999,18 +93002,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -86021,30 +93025,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -86052,20 +93058,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -86094,18 +93102,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -86132,7 +93140,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -86153,23 +93161,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -86179,32 +93186,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -86230,15 +93237,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -86257,27 +93267,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream2, + const scheduler = new storage_common_1.BufferScheduler( + stream, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -86295,50 +93305,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -86349,13 +93367,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -86363,23 +93381,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -86388,21 +93408,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -86410,7 +93442,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -86418,19 +93450,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -86443,7 +93477,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -86454,32 +93488,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -86488,13 +93525,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -86504,7 +93543,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -86513,16 +93552,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -86530,22 +93571,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -86565,17 +93608,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -86584,94 +93625,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```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); * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * // 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()`: * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -86697,13 +93723,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -86713,17 +93742,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -86732,7 +93763,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -86740,20 +93771,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -86774,17 +93807,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -86794,94 +93825,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -86890,7 +93915,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -86908,13 +93935,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -86922,24 +93952,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -86947,12 +93979,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -86960,22 +93994,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -86985,38 +94021,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_utils8(); + var constants_js_1 = require_constants10(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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_log6(); 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."); @@ -87027,15 +94097,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -87047,18 +94117,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -87078,7 +94148,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -87093,7 +94163,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -87108,6 +94178,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -87147,6 +94227,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve2(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -87163,11 +94245,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -87191,13 +94298,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -87209,13 +94316,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; + let url; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -87224,28 +94331,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; + let url; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -87253,24 +94360,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + await new Clients_js_1.BlobClient(url, 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -87283,9 +94398,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -87294,19 +94409,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -87315,23 +94430,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path2 = getURLPath(subRequest.url); + const path2 = (0, utils_common_js_1.getURLPath)(subRequest.url); if (!path2 || path2 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } @@ -87342,7 +94457,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -87359,7 +94474,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -87370,7 +94485,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -87381,18 +94496,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url2, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path2 = getURLPath(url2); + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path2 = (0, utils_common_js_1.getURLPath)(url); if (path2 && path2 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { @@ -87404,10 +94537,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -87418,7 +94551,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -87436,11 +94569,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -87448,17 +94595,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -87467,10 +94629,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -87487,7 +94651,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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. */ @@ -87496,48 +94688,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -87545,34 +94737,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -87589,7 +94799,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -87611,7 +94821,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -87619,7 +94829,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -87629,15 +94839,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * const content = "Hello world!"; * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); * ``` */ getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -87645,12 +94867,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -87663,14 +94885,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -87678,8 +94904,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -87690,19 +94916,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -87714,24 +94947,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -87744,7 +94977,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -87752,8 +94985,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -87802,29 +95035,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -87839,7 +95072,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -87853,7 +95086,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -87863,10 +95096,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -87878,14 +95111,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -87898,18 +95131,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -87918,23 +95171,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -87950,44 +95226,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -87995,64 +95253,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: - * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -88060,41 +95317,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -88113,7 +95373,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -88130,17 +95393,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -88148,35 +95409,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -88184,118 +95432,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -88313,7 +95581,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -88334,23 +95605,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -88370,18 +95645,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -88392,27 +95665,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -88422,53 +95679,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: - * - * ```js - * let i = 1; + * // 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 @@ -88476,11 +95734,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -88492,7 +95749,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -88511,7 +95770,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -88520,14 +95782,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -88539,7 +95801,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -88549,7 +95811,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -88559,18 +95821,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve2) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve2(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve2((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -88579,45 +95844,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve2) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve2((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -88721,6 +96019,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -88728,7 +96078,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -88775,12 +96125,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -88806,10 +96161,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -88826,13 +96193,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -88861,6 +96232,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -88882,44 +96269,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -88930,22 +96335,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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. @@ -88960,35 +96393,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url2, credentialOrPipeline, options) { + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url2, pipeline); + super(url, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -88999,22 +96432,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -89031,7 +96473,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -89045,47 +96487,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -89094,15 +96518,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -89112,14 +96536,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -89130,14 +96554,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -89145,7 +96569,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -89157,9 +96581,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -89180,23 +96610,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -89216,18 +96650,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -89238,27 +96670,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -89266,57 +96682,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // 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 @@ -89328,7 +96740,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -89340,7 +96752,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -89359,7 +96773,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -89375,45 +96792,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -89421,45 +96820,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientListContainers + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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}`); * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -89481,7 +96876,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -89493,17 +96888,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -89522,7 +96920,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -89532,16 +96933,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -89555,19 +96956,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -89575,7 +96984,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -89583,21 +96992,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -89605,7 +97015,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -89613,66 +97023,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential2; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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_log6(); + Object.defineProperty(exports2, "logger", { enumerable: true, get: function() { + return log_js_1.logger; + } }); } }); @@ -89757,7 +97225,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -89770,21 +97238,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -89812,9 +97290,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core12 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core12 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs15(); var errors_1 = require_errors2(); var UploadProgress = class { constructor(contentLength) { @@ -89897,15 +97376,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -89916,15 +97397,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core12.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core12.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -89932,7 +97412,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -89945,21 +97425,31 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -89987,9 +97477,14 @@ var require_requestUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core12 = __importStar4(require_core()); - var http_client_1 = require_lib6(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core12 = __importStar2(require_core()); + var http_client_1 = require_lib(); var constants_1 = require_constants7(); function isSuccessStatusCode(statusCode) { if (!statusCode) { @@ -89997,14 +97492,12 @@ var require_requestUtils = __commonJS({ } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -90016,14 +97509,13 @@ var require_requestUtils = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(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) { @@ -90032,12 +97524,12 @@ var require_requestUtils = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -90060,9 +97552,8 @@ var require_requestUtils = __commonJS({ throw Error(`${name} failed: ${errorMessage}`); }); } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3( name, method, @@ -90071,13 +97562,13 @@ var require_requestUtils = __commonJS({ delay2, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { + (error3) => { + if (error3 instanceof http_client_1.HttpClientError) { return { - statusCode: error4.statusCode, + statusCode: error3.statusCode, result: null, headers: {}, - error: error4 + error: error3 }; } else { return void 0; @@ -90086,13 +97577,155 @@ var require_requestUtils = __commonJS({ ); }); } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + 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 retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); }); } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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; } }); @@ -90100,7 +97733,7 @@ var require_requestUtils = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -90113,21 +97746,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -90155,20 +97798,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core12 = __importStar4(require_core()); - var http_client_1 = require_lib6(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core12 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); + var abort_controller_1 = require_dist4(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream.pipeline); yield pipeline(response.message, output); }); @@ -90270,10 +97916,10 @@ var require_downloadUtils = __commonJS({ }; exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const writeStream = fs.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { + 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, () => { @@ -90293,17 +97939,16 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const archiveDescriptor = yield fs.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", () => __awaiter4(this, void 0, void 0, function* () { + 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"]; @@ -90320,7 +97965,7 @@ var require_downloadUtils = __commonJS({ const count = Math.min(blockSize, length - offset); downloads.push({ offset, - promiseGetter: () => __awaiter4(this, void 0, void 0, function* () { + promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); }) }); @@ -90333,7 +97978,7 @@ var require_downloadUtils = __commonJS({ const progressFn = progress.onProgress(); const activeDownloads = []; let nextDownload; - const waitAndWrite = () => __awaiter4(this, void 0, void 0, function* () { + 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--; @@ -90357,9 +98002,8 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const retries = 5; let failures = 0; while (true) { @@ -90380,8 +98024,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { + 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}` }); @@ -90397,8 +98041,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { retryOptions: { // Override the timeout used when downloading each 4 MB chunk @@ -90442,8 +98086,7 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; const timeoutPromise = new Promise((resolve2) => { timeoutHandle = setTimeout(() => resolve2("timeout"), timeoutMs); @@ -90460,7 +98103,7 @@ var require_downloadUtils = __commonJS({ var require_options = __commonJS({ "node_modules/@actions/cache/lib/options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -90473,23 +98116,34 @@ var require_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core12 = __importStar4(require_core()); + exports2.getUploadOptions = getUploadOptions; + exports2.getDownloadOptions = getDownloadOptions; + var core12 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -90514,7 +98168,6 @@ var require_options = __commonJS({ core12.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } - exports2.getUploadOptions = getUploadOptions; function getDownloadOptions(copy) { const result = { useAzureSdk: false, @@ -90556,7 +98209,6 @@ var require_options = __commonJS({ core12.debug(`Lookup only: ${result.lookupOnly}`); return result; } - exports2.getDownloadOptions = getDownloadOptions; } }); @@ -90565,7 +98217,9 @@ var require_config = __commonJS({ "node_modules/@actions/cache/lib/internal/config.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; + exports2.isGhes = isGhes; + exports2.getCacheServiceVersion = getCacheServiceVersion; + exports2.getCacheServiceURL = getCacheServiceURL; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); @@ -90574,13 +98228,11 @@ var require_config = __commonJS({ const isLocalHost = hostname.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } - exports2.isGhes = isGhes; function getCacheServiceVersion() { if (isGhes()) return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } - exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { const version = getCacheServiceVersion(); switch (version) { @@ -90592,7 +98244,6 @@ var require_config = __commonJS({ throw new Error(`Unsupported cache service version: ${version}`); } } - exports2.getCacheServiceURL = getCacheServiceURL; } }); @@ -90601,7 +98252,7 @@ var require_package2 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", - version: "4.1.0", + version: "5.0.1", preview: true, description: "Actions cache lib", keywords: [ @@ -90638,22 +98289,26 @@ var require_package2 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", + "@azure/core-rest-pipeline": "^1.22.0", + "@azure/storage-blob": "^12.29.1", semver: "^6.3.1" }, devDependencies: { - "@types/node": "^22.13.9", + "@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" } }; } @@ -90664,12 +98319,11 @@ 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 = void 0; + exports2.getUserAgentString = getUserAgentString; var packageJson = require_package2(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } - exports2.getUserAgentString = getUserAgentString; } }); @@ -90677,7 +98331,7 @@ var require_user_agent = __commonJS({ var require_cacheHttpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -90690,21 +98344,31 @@ var require_cacheHttpClient = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -90732,13 +98396,16 @@ var require_cacheHttpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core12 = __importStar4(require_core()); - var http_client_1 = require_lib6(); - var auth_1 = require_auth2(); - var fs = __importStar4(require("fs")); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache3; + var core12 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs = __importStar2(require("fs")); var url_1 = require("url"); - var utils = __importStar4(require_cacheUtils()); + var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); var downloadUtils_1 = require_downloadUtils(); var options_1 = require_options(); @@ -90771,11 +98438,11 @@ var require_cacheHttpClient = __commonJS({ return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); } function getCacheEntry(keys, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { @@ -90798,11 +98465,10 @@ var require_cacheHttpClient = __commonJS({ return cacheResult; }); } - exports2.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { @@ -90819,7 +98485,7 @@ Other caches with similar key:`); }); } function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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")) { @@ -90835,9 +98501,8 @@ Other caches with similar key:`); } }); } - exports2.downloadCache = downloadCache; function reserveCache(key, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -90845,24 +98510,23 @@ Other caches with similar key:`); version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); })); return response; }); } - exports2.reserveCache = reserveCache; function getContentRange(start, end) { return `bytes ${start}-${end}/*`; } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { core12.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})`, () => __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -90871,7 +98535,7 @@ Other caches with similar key:`); }); } function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); const fd = fs.openSync(archivePath, "r"); @@ -90882,7 +98546,7 @@ Other caches with similar key:`); core12.debug("Awaiting all uploads"); let offset = 0; try { - yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -90893,8 +98557,8 @@ Other caches with similar key:`); start, end, autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); + }).on("error", (error3) => { + throw new Error(`Cache upload failed because file read failed with ${error3.message}`); }), start, end); } }))); @@ -90905,15 +98569,15 @@ Other caches with similar key:`); }); } function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); } function saveCache3(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { if (!signedUploadURL) { @@ -90935,7 +98599,6 @@ Other caches with similar key:`); } }); } - exports2.saveCache = saveCache3; } }); @@ -91107,7 +98770,7 @@ var require_binary_format_contract = __commonJS({ exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; var UnknownFieldHandler; (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = Symbol.for("protobuf-ts/unknown"); + 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 }); @@ -92032,7 +99695,7 @@ var require_message_type_contract = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); } }); @@ -92530,26 +100193,26 @@ var require_reflection_json_reader = __commonJS({ const fieldObj = target[localName]; for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { this.assert(jsonObjValue !== null, field.name + " map value", null); - let val2; + let val; switch (field.V.kind) { case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); + val = field.V.T().internalJsonRead(jsonObjValue, options); break; case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); break; } - this.assert(val2 !== void 0, field.name + " map value", jsonObjValue); + 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] = val2; + fieldObj[key] = val; } } else if (field.repeat) { if (jsonValue === null) @@ -92558,22 +100221,22 @@ var require_reflection_json_reader = __commonJS({ const fieldArr = target[localName]; for (const jsonItem of jsonValue) { this.assert(jsonItem !== null, field.name, null); - let val2; + let val; switch (field.kind) { case "message": - val2 = field.T().internalJsonRead(jsonItem, options); + val = field.T().internalJsonRead(jsonItem, options); break; case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); + val = this.scalar(jsonItem, field.T, field.L, field.name); break; } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); + this.assert(val !== void 0, field.name, jsonValue); + fieldArr.push(val); } } else { switch (field.kind) { @@ -92587,10 +100250,10 @@ var require_reflection_json_reader = __commonJS({ case "enum": if (jsonValue === null) continue; - let val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; - target[localName] = val2; + target[localName] = val; break; case "scalar": if (jsonValue === null) @@ -92740,8 +100403,8 @@ var require_reflection_json_reader = __commonJS({ break; return base64_1.base64decode(json2); } - } catch (error4) { - e = error4.message; + } catch (error3) { + e = error3.message; } this.assert(false, fieldName + (e ? " - " + e : ""), json2); } @@ -92795,26 +100458,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== void 0); + jsonObj[entryKey.toString()] = val; } break; } @@ -92826,26 +100489,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { - const val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== void 0); + jsonArr.push(val); } break; } @@ -93095,7 +100758,7 @@ var require_reflection_binary_reader = __commonJS({ let length = reader.uint32(); let end = reader.pos + length; let key = void 0; - let val2 = void 0; + let val = void 0; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -93108,13 +100771,13 @@ var require_reflection_binary_reader = __commonJS({ case 2: switch (field.V.kind) { case "scalar": - val2 = this.scalar(reader, field.V.T, field.V.L); + val = this.scalar(reader, field.V.T, field.V.L); break; case "enum": - val2 = reader.int32(); + val = reader.int32(); break; case "message": - val2 = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); break; } break; @@ -93126,19 +100789,19 @@ var require_reflection_binary_reader = __commonJS({ let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; } - if (val2 === void 0) + if (val === void 0) switch (field.V.kind) { case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); break; case "enum": - val2 = 0; + val = 0; break; case "message": - val2 = field.V.T().create(); + val = field.V.T().create(); break; } - return [key, val2]; + return [key, val]; } scalar(reader, type2, longType) { switch (type2) { @@ -93243,8 +100906,8 @@ var require_reflection_binary_writer = __commonJS({ break; case "map": assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); break; } } @@ -93814,18 +101477,18 @@ var require_enum_object = __commonJS({ } exports2.listEnumValues = listEnumValues; function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + return listEnumValues(enumObject).map((val) => val.name); } exports2.listEnumNames = listEnumNames; function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } exports2.listEnumNumbers = listEnumNumbers; } }); // node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ +var require_commonjs16 = __commonJS({ "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -94016,7 +101679,7 @@ var require_reflection_info2 = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function normalizeMethodInfo(method, service) { var _a, _b, _c; let m = method; @@ -94125,7 +101788,7 @@ var require_rpc_options = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function mergeRpcOptions(defaults, options) { if (!options) return defaults; @@ -94133,7 +101796,7 @@ var require_rpc_options = __commonJS({ copy(defaults, o); copy(options, o); for (let key of Object.keys(options)) { - let val2 = options[key]; + let val = options[key]; switch (key) { case "jsonOptions": o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); @@ -94147,7 +101810,7 @@ var require_rpc_options = __commonJS({ copy(options.meta, o.meta); break; case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); break; } } @@ -94239,9 +101902,9 @@ var require_deferred = __commonJS({ /** * Resolve the promise. Ignore if not pending. */ - resolvePending(val2) { + resolvePending(val) { if (this._state === DeferredState.PENDING) - this.resolve(val2); + this.resolve(val); } /** * Reject the promise. Ignore if not pending. @@ -94262,7 +101925,7 @@ var require_rpc_output_stream = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.RpcOutputStreamController = void 0; var deferred_1 = require_deferred(); - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); var RpcOutputStreamController = class { constructor() { this._lis = { @@ -94312,12 +101975,12 @@ var require_rpc_output_stream = __commonJS({ * at a time. * Can be used to wrap a stream by using the other stream's `onNext`. */ - notifyNext(message, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); + 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 (error4) - this.notifyError(error4); + if (error3) + this.notifyError(error3); if (complete) this.notifyComplete(); } @@ -94337,12 +102000,12 @@ var require_rpc_output_stream = __commonJS({ * * Triggers onNext and onError callbacks. */ - notifyError(error4) { + notifyError(error3) { runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); + 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(); } /** @@ -94411,7 +102074,7 @@ var require_rpc_output_stream = __commonJS({ var require_unary_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/unary-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -94458,7 +102121,7 @@ var require_unary_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -94480,7 +102143,7 @@ var require_unary_call = __commonJS({ var require_server_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -94529,7 +102192,7 @@ var require_server_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -94550,7 +102213,7 @@ var require_server_streaming_call = __commonJS({ var require_client_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/client-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -94598,7 +102261,7 @@ var require_client_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -94619,7 +102282,7 @@ var require_client_streaming_call = __commonJS({ var require_duplex_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/duplex-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -94667,7 +102330,7 @@ var require_duplex_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -94687,7 +102350,7 @@ var require_duplex_streaming_call = __commonJS({ var require_test_transport = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/test-transport.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -94717,7 +102380,7 @@ var require_test_transport = __commonJS({ Object.defineProperty(exports2, "__esModule", { value: true }); exports2.TestTransport = void 0; var rpc_error_1 = require_rpc_error(); - var runtime_1 = require_commonjs11(); + 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(); @@ -94791,7 +102454,7 @@ var require_test_transport = __commonJS({ * not reject. If it does, code is broken. */ streamResponses(method, stream, abort) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const messages = []; if (this.data.response === void 0) { messages.push(method.O.create()); @@ -94806,8 +102469,8 @@ var require_test_transport = __commonJS({ } try { yield delay2(this.responseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); + } catch (error3) { + stream.notifyError(error3); return; } if (this.data.response instanceof rpc_error_1.RpcError) { @@ -94818,8 +102481,8 @@ var require_test_transport = __commonJS({ stream.notifyMessage(msg); try { yield delay2(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); + } catch (error3) { + stream.notifyError(error3); return; } } @@ -94961,7 +102624,7 @@ var require_rpc_interceptor = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.stackDuplexStreamingInterceptors = exports2.stackClientStreamingInterceptors = exports2.stackServerStreamingInterceptors = exports2.stackUnaryInterceptors = exports2.stackIntercept = void 0; - var runtime_1 = require_commonjs11(); + var runtime_1 = require_commonjs16(); function stackIntercept(kind, transport, method, options, input) { var _a, _b, _c, _d; if (kind == "unary") { @@ -95085,7 +102748,7 @@ var require_server_call_context = __commonJS({ }); // node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js -var require_commonjs12 = __commonJS({ +var require_commonjs17 = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -95171,11 +102834,11 @@ var require_cachescope = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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", [ @@ -95247,11 +102910,11 @@ var require_cachemetadata = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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() { @@ -95313,17 +102976,17 @@ var require_cachemetadata = __commonJS({ }); // node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __commonJS({ +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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); + 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() { @@ -95798,7 +103461,7 @@ var require_cache_twirp_client = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); + var cache_1 = require_cache3(); var CacheServiceClientJSON = class { constructor(rpc) { this.rpc = rpc; @@ -95866,11 +103529,12 @@ var require_cache_twirp_client = __commonJS({ }); // node_modules/@actions/cache/lib/internal/shared/util.js -var require_util11 = __commonJS({ +var require_util10 = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; var core_1 = require_core(); function maskSigUrl(url) { if (!url) @@ -95882,11 +103546,10 @@ var require_util11 = __commonJS({ (0, core_1.setSecret)(signature); (0, core_1.setSecret)(encodeURIComponent(signature)); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${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"); @@ -95899,7 +103562,6 @@ var require_util11 = __commonJS({ maskSigUrl(body.signed_download_url); } } - exports2.maskSecretUrls = maskSecretUrls; } }); @@ -95907,7 +103569,7 @@ var require_util11 = __commonJS({ var require_cacheTwirpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -95935,16 +103597,16 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; + 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_auth2(); - var http_client_1 = require_lib6(); + var auth_1 = require_auth(); + var http_client_1 = require_lib(); var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util11(); + var util_1 = require_util10(); var CacheServiceClient = class { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -95968,24 +103630,24 @@ var require_cacheTwirpClient = __commonJS({ // This function satisfies the Rpc interface. It is compatible with the JSON // JSON generated client. request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; (0, core_1.debug)(`[Request] ${method} ${url}`); const headers = { "Content-Type": contentType }; try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { return this.httpClient.post(url, JSON.stringify(data), headers); })); return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); } }); } retryableRequest(operation) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let attempt = 0; let errorMessage = ""; let rawBody = ""; @@ -96011,18 +103673,18 @@ var require_cacheTwirpClient = __commonJS({ } errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { + } catch (error3) { + if (error3 instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); } - if (error4 instanceof errors_1.UsageError) { - throw error4; + if (error3 instanceof errors_1.UsageError) { + throw error3; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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 = error4.message; + errorMessage = error3.message; } if (!isRetryable) { throw new Error(`Received non-retryable error: ${errorMessage}`); @@ -96056,7 +103718,7 @@ var require_cacheTwirpClient = __commonJS({ return retryableStatusCodes.includes(statusCode); } sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } @@ -96076,7 +103738,6 @@ var require_cacheTwirpClient = __commonJS({ 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); } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; } }); @@ -96084,7 +103745,7 @@ var require_cacheTwirpClient = __commonJS({ var require_tar = __commonJS({ "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -96097,21 +103758,31 @@ var require_tar = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -96139,16 +103810,18 @@ var require_tar = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; + exports2.listTar = listTar; + exports2.extractTar = extractTar2; + exports2.createTar = createTar; var exec_1 = require_exec(); - var io4 = __importStar4(require_io4()); + var io4 = __importStar2(require_io()); var fs_1 = require("fs"); - var path2 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); + var path2 = __importStar2(require("path")); + var utils = __importStar2(require_cacheUtils()); var constants_1 = require_constants7(); var IS_WINDOWS = process.platform === "win32"; function getTarPath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { switch (process.platform) { case "win32": { const gnuTar = yield utils.getGnuTarPathOnWindows(); @@ -96180,8 +103853,8 @@ var require_tar = __commonJS({ }; }); } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getTarArgs(tarPath_1, compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (tarPath, compressionMethod, type2, archivePath = "") { const args = [`"${tarPath.path}"`]; const cacheFileName = utils.getCacheFileName(compressionMethod); const tarFile = "cache.tar"; @@ -96211,8 +103884,8 @@ var require_tar = __commonJS({ return args; }); } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { let args; const tarPath = yield getTarPath(); const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); @@ -96234,7 +103907,7 @@ var require_tar = __commonJS({ return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); } function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + 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: @@ -96258,7 +103931,7 @@ var require_tar = __commonJS({ }); } function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -96283,51 +103956,48 @@ var require_tar = __commonJS({ }); } function execCommands(commands, cwd) { - return __awaiter4(this, void 0, void 0, function* () { + 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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + } 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commands = yield getCommands(compressionMethod, "list", archivePath); yield execCommands(commands); }); } - exports2.listTar = listTar; function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const workingDirectory = getWorkingDirectory(); yield io4.mkdirP(workingDirectory); const commands = yield getCommands(compressionMethod, "extract", archivePath); yield execCommands(commands); }); } - exports2.extractTar = extractTar2; function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { (0, fs_1.writeFileSync)(path2.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); } - exports2.createTar = createTar; } }); // node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ +var require_cache4 = __commonJS({ "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -96340,21 +104010,31 @@ var require_cache3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -96382,15 +104062,18 @@ var require_cache3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core12 = __importStar4(require_core()); - var path2 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache3; + exports2.saveCache = saveCache3; + var core12 = __importStar2(require_core()); + var path2 = __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_lib6(); + var http_client_1 = require_lib(); var ValidationError = class _ValidationError extends Error { constructor(message) { super(message); @@ -96439,9 +104122,8 @@ var require_cache3 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCache3(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)(); core12.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -96454,9 +104136,8 @@ var require_cache3 = __commonJS({ } }); } - exports2.restoreCache = restoreCache3; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; core12.debug("Resolved Keys:"); @@ -96492,29 +104173,29 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core12.info("Cache restored successfully"); return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to restore: ${error4.message}`); + core12.error(`Failed to restore: ${error3.message}`); } else { - core12.warning(`Failed to restore: ${error4.message}`); + core12.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core12.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core12.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; @@ -96562,15 +104243,15 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core12.info("Cache restored successfully"); return response.matchedKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to restore: ${error4.message}`); + core12.error(`Failed to restore: ${error3.message}`); } else { - core12.warning(`Failed to restore: ${error4.message}`); + core12.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -96578,15 +104259,15 @@ var require_cache3 = __commonJS({ if (archivePath) { yield utils.unlinkFile(archivePath); } - } catch (error4) { - core12.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core12.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function saveCache3(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function saveCache3(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core12.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -96600,10 +104281,9 @@ var require_cache3 = __commonJS({ } }); } - exports2.saveCache = saveCache3; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { + function saveCacheV1(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + var _a, _b, _c, _d, _e; const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); @@ -96641,10 +104321,10 @@ var require_cache3 = __commonJS({ } core12.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else if (typedError.name === ReserveCacheError.name) { core12.info(`Failed to save: ${typedError.message}`); } else { @@ -96657,15 +104337,15 @@ var require_cache3 = __commonJS({ } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core12.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core12.debug(`Failed to delete archive: ${error3}`); } } return cacheId; }); } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { options = Object.assign(Object.assign({}, options), { uploadChunkSize: 64 * 1024 * 1024, uploadConcurrency: 8, useAzureSdk: true }); const compressionMethod = yield utils.getCompressionMethod(); const twirpClient = cacheTwirpClient.internalCacheTwirpClient(); @@ -96703,8 +104383,8 @@ var require_cache3 = __commonJS({ throw new Error(response.message || "Response was not ok"); } signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core12.debug(`Failed to reserve cache: ${error4}`); + } catch (error3) { + core12.debug(`Failed to reserve cache: ${error3}`); throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } core12.debug(`Attempting to upload cache located at: ${archivePath}`); @@ -96723,10 +104403,10 @@ var require_cache3 = __commonJS({ throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`); } cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else if (typedError.name === ReserveCacheError.name) { core12.info(`Failed to save: ${typedError.message}`); } else if (typedError.name === FinalizeCacheError.name) { @@ -96741,8 +104421,8 @@ var require_cache3 = __commonJS({ } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core12.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core12.debug(`Failed to delete archive: ${error3}`); } } return cacheId; @@ -96762,13 +104442,12 @@ var import_node_forge = __toESM(require_lib3()); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io3()); +var io2 = __toESM(require_io()); // src/util.ts var fsPromises = __toESM(require("fs/promises")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io3()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -96785,14 +104464,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs.lstat(itemPath, { bigint: true }) : await fs.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs.lstat(itemPath, { bigint: true }) : await fs.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 fs.readdir(itemPath) : await fs.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs.readdir(itemPath) : await fs.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -96803,13 +104482,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -97689,6 +105368,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -97808,7 +105499,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -97848,16 +105539,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -99465,11 +107147,11 @@ function getTestingEnvironment() { } return testingEnvironment; } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } async function checkDiskUsage(logger) { try { @@ -99492,9 +107174,9 @@ async function checkDiskUsage(logger) { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, numTotalBytes: diskUsage.blocks * blockSizeInBytes }; - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to check available disk space: ${getErrorMessage(error4)}` + `Failed to check available disk space: ${getErrorMessage(error3)}` ); return void 0; } @@ -99569,7 +107251,7 @@ var persistInputs = function() { // src/api-client.ts var core5 = __toESM(require_core()); -var githubUtils = __toESM(require_utils4()); +var githubUtils = __toESM(require_utils5()); var retry = __toESM(require_dist_node15()); // src/repository.ts @@ -99682,8 +107364,8 @@ function getActionsLogger() { var core7 = __toESM(require_core()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.23.3"; -var cliVersion = "2.23.3"; +var bundleVersion = "codeql-bundle-v2.23.8"; +var cliVersion = "2.23.8"; // src/languages.ts var KnownLanguage = /* @__PURE__ */ ((KnownLanguage2) => { @@ -99867,15 +107549,16 @@ var PACK_IDENTIFIER_PATTERN = (function() { })(); // src/feature-flags.ts -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); // src/overlay-database-utils.ts -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts var core9 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io3()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; @@ -99894,13 +107577,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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."; } core9.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error4; + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -99965,12 +107648,12 @@ async function getRef() { } // src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); // src/feature-flags.ts var featureConfig = { @@ -99979,11 +107662,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -99995,6 +107673,16 @@ var featureConfig = { 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", @@ -100023,12 +107711,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -100129,6 +107811,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -100140,21 +107827,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -100164,9 +107852,12 @@ var featureConfig = { }; // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -100199,9 +107890,9 @@ function isFirstPartyAnalysis(actionName) { } return process.env["CODEQL_ACTION_INIT_HAS_RUN" /* INIT_ACTION_HAS_RUN */] === "true"; } -function getActionsStatus(error4, otherFailureCause) { - if (error4 || otherFailureCause) { - return error4 instanceof ConfigurationError ? "user-error" : "failure"; +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; } else { return "success"; } @@ -100476,11 +108167,11 @@ async function runWrapper() { logger ); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); - core11.setFailed(`start-proxy action failed: ${error4.message}`); + const error3 = wrapError(unwrappedError); + core11.setFailed(`start-proxy action failed: ${error3.message}`); const errorStatusReportBase = await createStatusReportBase( "start-proxy" /* StartProxy */, - getActionsStatus(error4), + getActionsStatus(error3), startedAt, { languages: language && [language] @@ -100512,8 +108203,8 @@ async function startProxy(binPath, config, logFilePath, logger) { if (subprocess.pid) { core11.saveState("proxy-process-pid", `${subprocess.pid}`); } - subprocess.on("error", (error4) => { - subprocessError = error4; + subprocess.on("error", (error3) => { + subprocessError = error3; }); subprocess.on("exit", (code) => { if (code !== 0) { @@ -100580,5 +108271,5 @@ undici/lib/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) */ diff --git a/lib/upload-lib.js b/lib/upload-lib.js index bd363f7ffe..2c58ca5655 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os2 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os2 = __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() + os2.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs12 = __importStar4(require("fs")); - var os2 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs12 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug4("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); + supportedHashes = crypto2.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable2 { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable2 { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay: delay2, persist } = mockDispatch2; + 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 (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable2({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve6({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url2, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve6, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path11 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path11 = __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, path11.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs12 = __importStar4(require("fs")); - var path11 = __importStar4(require("path")); - _a = fs12.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs12 = __importStar2(require("fs")); + var path11 = __importStar2(require("path")); + _a = fs12.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs12.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs12.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path11.dirname(filePath); const upperName = path11.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path11.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which6; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path11 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path11 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os2 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path11 = __importStar4(require("path")); - var io6 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path11 = __importStar2(require("path")); + var io6 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner6 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path11.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io6.which(this.toolPath, true); - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve6(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + exports2.exec = exec; + exports2.getExecOutput = getExecOutput; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner()); + function exec(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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 exec = __importStar2(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 = exportVariable5; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed; + exports2.isDebug = isDebug2; + exports2.debug = debug4; + exports2.error = error3; + exports2.warning = warning9; + exports2.notice = notice; + exports2.info = info6; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os2 = __importStar4(require("os")); - var path11 = __importStar4(require("path")); + var os2 = __importStar2(require("os")); + var path11 = __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 exportVariable5(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable5(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable5; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19681,18 +19872,16 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path11.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,19 +19889,17 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { @@ -19721,50 +19908,39 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.stdout.write(os2.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug4(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug4; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning8(message, properties = {}) { + function warning9(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning8; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info6(message) { process.stdout.write(message + os2.EOL); } - exports2.info = info6; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -20130,8 +20302,8 @@ var require_helpers = __commonJS({ } return decimalPlaces; }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; }; } }); @@ -21258,7 +21430,7 @@ var require_proxy2 = __commonJS({ var require_lib3 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -21271,21 +21443,21 @@ var require_lib3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -21314,10 +21486,10 @@ var require_lib3 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -21392,8 +21564,8 @@ var require_lib3 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -21405,8 +21577,8 @@ var require_lib3 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -21463,42 +21635,42 @@ var require_lib3 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -21507,14 +21679,14 @@ var require_lib3 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -21523,7 +21695,7 @@ var require_lib3 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -21532,7 +21704,7 @@ var require_lib3 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -21546,7 +21718,7 @@ var require_lib3 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -21620,7 +21792,7 @@ var require_lib3 = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve6, reject) => { function callbackForResult(err, res) { if (err) { @@ -21807,15 +21979,15 @@ var require_lib3 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -21877,7 +22049,7 @@ var require_lib3 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -21890,21 +22062,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -21933,7 +22105,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib3()); + var httpClient = __importStar2(require_lib3()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -21956,7 +22128,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url2, opts) => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -22042,8 +22214,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -22775,7 +22947,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url: url2, status, @@ -22784,7 +22956,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22794,17 +22966,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -23423,7 +23595,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url: url2, status, @@ -23432,7 +23604,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -23442,17 +23614,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -26124,9 +26296,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url2 = ""; return { value: { @@ -26431,7 +26603,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -26444,24 +26616,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -26491,7 +26663,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -26504,23 +26676,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -26531,532 +26703,74 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs12 = __importStar4(require("fs")); - var path11 = __importStar4(require("path")); - _a = fs12.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs12.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs12.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path11.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 = path11.dirname(filePath); - const upperName = path11.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path11.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 = which6; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path11 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path11.join(dest, path11.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 (path11.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path11.join(dest, path11.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(path11.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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 __awaiter4(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(path11.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(path11.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path11.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path11.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { - }; - module2.exports = debug4; - } -}); - -// 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 debug4 = 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}}`); + var debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + }; + module2.exports = debug4; + } +}); + +// 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 debug4 = 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; }; @@ -27710,8 +27424,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare3 = require_compare(); - var gte5 = (a, b, loose) => compare3(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare3(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -27732,7 +27446,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -27762,7 +27476,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -28240,7 +27954,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -28521,7 +28235,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -28536,7 +28250,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -28851,7 +28565,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -28889,7 +28603,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -28924,7 +28638,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -28948,56 +28662,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -29021,7 +28734,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -29207,8 +28921,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -29218,8 +28932,8 @@ var require_light = __commonJS({ return (await Promise.all(promises3)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -29331,10 +29045,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -29368,7 +29082,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -29386,24 +29100,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } } doExpire(clearGlobalState, run, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -29413,7 +29127,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -29692,7 +29406,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve6, returned, task; + var args, cb, error3, reject, resolve6, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve6, reject } = this._queue.shift()); @@ -29703,9 +29417,9 @@ var require_light = __commonJS({ return resolve6(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -29839,8 +29553,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -30173,14 +29887,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -30476,24 +30190,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info6) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info6) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -30509,11 +30223,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -30534,12 +30248,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -30548,1424 +30262,1097 @@ var require_dist_node15 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core12 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core12.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core12.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core12.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path11 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs12 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path11.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs12.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs12.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname3; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path11.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path11.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path11.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __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", () => { + resolve6(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve6(Buffer.concat(chunks)); + }); + })); + }); + } }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var 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 expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path11 = (function() { - try { - return require("path"); - } catch (e) { + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path11.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + /** + * 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); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path11.sep !== "/") { - pattern = pattern.split(path11.sep).join("/"); + 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); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + 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); + }); } - if (!pattern) { - this.empty = true; - return; + 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); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug4() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.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++; + /** + * 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate2; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve6(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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(); + } } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + /** + * 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); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; } + return info6; } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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; } - 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; - } - 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve6) => setTimeout(() => resolve6(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve6(response); } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } - var cs = pattern.substring(classStart + 1, i); + let obj; + let contents; 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; + 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) { } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + 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 { + resolve6(response); } - 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]; + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/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(resolve6) { + resolve6(value); + }); } - 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(_, $1, $2) { - if (!$2) { - $2 = "\\"; + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve6(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; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - 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 = "$"; + 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"); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + options.headers["Authorization"] = `Bearer ${this.token}`; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - if (addPatternStart) { - re = patternStart + re; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - if (!hasMagic) { - return globUnescape(pattern); + // 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")}`; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path11.sep !== "/") { - f = f.split(path11.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - 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] === ""; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - throw new Error("wtf?"); }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path11 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path11.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path11.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path11.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path11.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path11.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os2 = __importStar4(require("os")); - var path11 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path11.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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path11.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path11.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; + 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 internal_match_kind_1.MatchKind.None; + return token; } - /** - * 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); + 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 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, "[*]"); + return runtimeUrl; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path11.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path11.sep}`)) { - homedir = homedir || os2.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path11, level) { - this.path = path11; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -31992,263 +31379,323 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); - }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); - }, reject); + 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 = ""; } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + /** + * 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}`; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * 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(); + }); } - function fulfill(value) { - resume("next", value); + /** + * 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 }); + }); } - function reject(value) { - resume("throw", value); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core12 = __importStar4(require_core()); - var fs12 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path11 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - globGenerator() { - return __asyncGenerator4(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)) { - core12.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs12.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs12.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path11.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; - }); + 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(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs12.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core12.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 fs12.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs12.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core12.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + /** + * 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); } - traversalChain.push(realPath); - } - return stats; - }); + 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path11 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.create = create; + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path11.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32257,21 +31704,21 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -32301,14 +31748,14 @@ var require_io_util3 = __commonJS({ var _a; 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 fs12 = __importStar4(require("fs")); - var path11 = __importStar4(require("path")); + var fs12 = __importStar2(require("fs")); + var path11 = __importStar2(require("path")); _a = fs12.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs12.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -32322,7 +31769,7 @@ var require_io_util3 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -32340,7 +31787,7 @@ var require_io_util3 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -32417,11 +31864,11 @@ var require_io_util3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -32430,21 +31877,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -32474,10 +31921,10 @@ var require_io3 = __commonJS({ 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 path11 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); + var path11 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -32504,7 +31951,7 @@ var require_io3 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -32525,7 +31972,7 @@ var require_io3 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -32545,14 +31992,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32576,7 +32023,7 @@ var require_io3 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -32624,7 +32071,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -32644,7 +32091,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -32665,1200 +32112,1171 @@ var require_io3 = __commonJS({ } }); -// 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 debug4; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug4 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug4 = 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 + "}"); +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - 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++) { - debug4(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); - } - } - var i; - exports2.parse = parse; - function parse(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; + __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(resolve6) { + resolve6(value); + }); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path11 = __importStar2(require("path")); + var io6 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + _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 { - version = version.version; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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); - } - debug4("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"); + return cmd; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - 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; + _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 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) { - debug4("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 this.args; } - 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug4("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); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } 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]; - debug4("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); + if (!arg) { + return '""'; } - } while (++i2); - }; - SemVer.prototype.inc = function(release, identifier) { - switch (release) { - 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++; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - 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]; + } + 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 { - 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]; - } + quoteHit = false; } - break; - default: - throw new Error("invalid increment argument: " + release); - } - this.format(); - this.raw = this.version; - return this; - }; - exports2.inc = inc; - function inc(version, release, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; - } - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.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 = rcompare; - function rcompare(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 = lt; - function lt(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 = gte5; - function gte5(a, b, loose) { - return compare3(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + 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(""); } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _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; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug4("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; - } - debug4("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); + /** + * 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 = path11.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve6, 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) + os2.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 { + resolve6(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug4("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; + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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; }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug4("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); }); } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - 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(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug4("comp", comp, options); - comp = replaceCarets(comp, options); - debug4("caret", comp); - comp = replaceTildes(comp, options); - debug4("tildes", comp); - comp = replaceXRanges(comp, options); - debug4("xrange", comp); - comp = replaceStars(comp, options); - debug4("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(_, M, m, p, pr) { - debug4("tilde", comp, _, 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) { - debug4("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + 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 exec(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.`); } - debug4("tilde return", ret); - return ret; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); } - function replaceCarets(comp, options) { - return comp.trim().split(/\s+/).map(function(comp2) { - return replaceCaret(comp2, options); - }).join(" "); - } - function replaceCaret(comp, options) { - debug4("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_, M, m, p, pr) { - debug4("caret", comp, _, 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) { - debug4("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"; + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } else { - debug4("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"; + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - debug4("caret return", ret); - return ret; + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; }); } - function replaceXRanges(comp, options) { - debug4("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) { - debug4("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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; } - debug4("xRange return", ret); - return ret; + function step(result) { + result.done ? resolve6(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 exec = __importStar2(require_exec2()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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 + }); }); } - function replaceStars(comp, options) { - debug4("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; - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + 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); } - return false; + __setModuleDefault2(result, mod); + return result; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug4(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve6(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_utils5(); + var os2 = __importStar2(require("os")); + var path11 = __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 exportVariable5(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable5; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path11.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; + return inputs.map((input) => input.trim()); } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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 && range.test(minver)) { - return minver; - } - return null; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(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.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); + exports2.getState = getState2; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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/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]; + } }; } - if (satisfies2(version, range, options)) { - return false; + 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); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core12 = __importStar2(require_core2()); + 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; + core12.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core12.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core12.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core12.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core12.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + return result; } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path11 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname3(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + let result = path11.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname3; + 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)}`; } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } 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)}`; } - safeRe[t.COERCERTL].lastIndex = -1; } - if (match === null) { - return null; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path11.sep; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path11.sep)) { + return p; + } + if (p === path11.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -33871,313 +33289,871 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); - }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); - }, reject); } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core12 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob = __importStar4(require_glob()); - var io6 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs12 = __importStar4(require("fs")); - var path11 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path11.join(baseLocation, "actions", "temp"); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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); } - const dest = path11.join(tempDirectory, crypto.randomUUID()); - yield io6.mkdirP(dest); - return dest; - }); + } + return result; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs12.statSync(filePath).size; + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const paths = []; - const workspace = (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const globber = yield glob.create(patterns.join("\n"), { - implicitDescendants: false - }); - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path11.relative(workspace, file).replace(new RegExp(`\\${path11.sep}`, "g"), "/"); - core12.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; + }; + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs12.unlink)(filePath); - }); + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core12.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - }); - } catch (err) { - core12.debug(err.message); + bi = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - versionOutput = versionOutput.trim(); - core12.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core12.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + if (begs.length) { + result = [left, right]; } - }); + } + return result; } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs12.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; - }); + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + parts.push.apply(parts, p); + return parts; } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - return token; + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } else { - return void 0; + N = concatMap(n, function(el) { + return expand(el, false); + }); + } + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } + return expansions; } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path11 = (function() { + try { + return require("path"); + } catch (e) { } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + })() || { + sep: "/" + }; + minimatch.sep = path11.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { 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}`); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - 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; - } + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path11.sep !== "/") { + pattern = pattern.split(path11.sep).join("/"); } - 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]"); + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - var DecodedURL = class extends URL { - constructor(url2, base) { - super(url2, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern = this.pattern; + var options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; } - get username() { - return this._decodedUsername; + if (!pattern) { + this.empty = true; + return; } - get password() { - return this._decodedPassword; + this.parseNegate(); + var set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug4() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; + } + Minimatch.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; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); }; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + 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 && reSpecials[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; + } + 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 (reSpecials[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(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = 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 (addPatternStart) { + 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; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path11.sep !== "/") { + f = f.split(path11.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + 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 regExpEscape(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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -34190,613 +34166,615 @@ var require_lib4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 path11 = __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(path11.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path11.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); + } + this.segments.unshift(remaining); } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + } 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(path11.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } } } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path11.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path11.sep; + } + result += this.segments[i]; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 || 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.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(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", () => { - resolve6(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve6(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(userAgent, 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 = userAgent; - 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; + exports2.Pattern = void 0; + var os2 = __importStar2(require("os")); + var path11 = __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, homedir) { + 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}`; } } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path11.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); } /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + * Matches the pattern against the specified path */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(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 __awaiter4(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); - }); + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path11.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path11.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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * Escapes glob patterns within a path + */ + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * Normalizes slashes and ensures absolute root */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + static fixupPattern(pattern, homedir) { + (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(`.${path11.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path11.sep}`)) { + homedir = homedir || os2.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 += "\\"; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, data); + 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; } else { - return response; + set2 += c2; } } - 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."); + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + if (set2) { + literal += set2; + i = closed; + continue; } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + } + literal += c; } - this._disposed = true; + return literal; } /** - * Raw request. - * @param info - * @param data + * Escapes regexp special characters + * https://javascript.info/regexp-escaping */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve6(res); - } - } - this.requestRawWithCallback(info6, data, callbackForResult); - }); + 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(path11, level) { + this.path = path11; + 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 || 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(resolve6) { + resolve6(value); }); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - const req = info6.httpModule.request(info6.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(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - handleResult(new Error(`Request timeout: ${info6.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(); + function step(result) { + result.done ? resolve6(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(resolve6, reject) { + v = o[n](v), settle(resolve6, reject, v.done, v.value); + }); + }; } - /** - * 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); + function settle(resolve6, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve6({ value: v2, done: d }); + }, reject); } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } - } - return info6; + }; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - return lowercaseKeys(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + function fulfill(value) { + resume("next", value); } - _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; + function reject(value) { + resume("throw", value); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); + 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 core12 = __importStar2(require_core2()); + var fs12 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path11 = __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() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } + } + return result; }); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve6(response); + 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("**"))); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + } + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core12.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs12.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } - return value; + throw err; } - let obj; - let contents; + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !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 && path11.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & 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(fs12.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path11.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & 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 { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); + stats = yield fs12.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core12.debug(`Broken symlink '${item.path}'`); + return void 0; } - response.result = obj; + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); } - response.headers = res.message.headers; - } catch (err) { + throw 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 { - resolve6(response); + } else { + stats = yield fs12.promises.lstat(item.path); + } + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs12.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); } - })); + if (traversalChain.some((x) => x === realPath)) { + core12.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -34823,4390 +34801,3087 @@ var require_auth2 = __commonJS({ 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; + 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(resolve6, reject) { + v = o[n](v), settle(resolve6, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve6, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve6({ value: v2, done: d }); + }, reject); } }; - 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"); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core12 = __importStar2(require_core2()); + var fs12 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path11 = __importStar2(require("path")); + function hashFiles(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core12.info : core12.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path11.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs12.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash2 = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(fs12.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 && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; + } } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + result.end(); + if (hasMatch) { + writeDelegate(`Found ${count} files to hash.`); + return result.digest("hex"); + } else { + writeDelegate(`No matches found for glob`); + return ""; } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + }); + } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - addPolicy(policy, options = {}) { - if (options.phase && options.afterPhase) { - throw new Error("Policies inside a phase cannot specify afterPhase."); + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (options.phase && !ValidPhaseNames.has(options.phase)) { - throw new Error(`Invalid phase name: ${options.phase}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { - throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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; - } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - function createEmptyPipeline() { - return HttpPipeline.create(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = exports2.create = void 0; + var internal_globber_1 = require_internal_globber(); + var internal_hash_files_1 = require_internal_hash_files(); + function create(patterns, options) { + return __awaiter2(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); + } + exports2.create = create; + function hashFiles(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create(patterns, { followSymbolicLinks }); + return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); + }); } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os2 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os2.EOL}`); +// 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 debug4; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug4 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug4 = function() { + }; } - var debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; - var enabledString; - var enabledNamespaces = []; - var skippedNamespaces = []; - var debuggers = []; - if (debugEnvVariable) { - enable(debugEnvVariable); + 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 debugObj = Object.assign((namespace) => { - return createDebugger(namespace); - }, { - enable, - enabled, - disable, - log - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } + 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 + "}"); } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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++) { + debug4(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); } } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + if (version instanceof SemVer) { + return version; } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; - } + if (typeof version !== "string") { + return null; } - return false; - } - function disable() { - const result = enabledString || ""; - enable(""); - return result; - } - function createDebugger(namespace) { - const newDebugger = Object.assign(debug5, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend: extend3 - }); - function debug5(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); + if (version.length > MAX_LENGTH) { + return null; } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; + 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; } - return false; } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - var debug4 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug4("azure"); - AzureLogger.log = (...args) => { - debug4.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); + 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); } - debug4.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); + } + if (!(this instanceof SemVer)) { + return new SemVer(version, options); + } + debug4("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(); } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 + SemVer.prototype.format = function() { + this.version = this.major + "." + this.minor + "." + this.patch; + if (this.prerelease.length) { + this.version += "-" + this.prerelease.join("."); + } + return this.version; }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug4.disable(); - debug4.enable(enabledNamespaces2 + "," + logger.namespace); + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug4("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __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"; + 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); }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve6, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); + 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]; + debug4("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); } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + } 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]; + debug4("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); } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + } while (++i2); + }; + SemVer.prototype.inc = function(release, identifier) { + switch (release) { + 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: " + release); + } + this.format(); + this.raw = this.version; + return this; + }; + exports2.inc = inc; + function inc(version, release, loose, identifier) { + if (typeof loose === "string") { + identifier = loose; + loose = void 0; + } + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } + } + exports2.diff = diff; + function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + var prefix = ""; + if (v1.prerelease.length || v2.prerelease.length) { + prefix = "pre"; + var defaultResult = "prerelease"; } - try { - buildPromise((x) => { - removeListeners(); - resolve6(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + for (var key in v1) { + if (key === "major" || key === "minor" || key === "patch") { + if (v1[key] !== v2[key]) { + return prefix + key; + } + } } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); + return defaultResult; + } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/delay.js -var require_delay = __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 random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve6) => { - token = setTimeout(resolve6, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage - }); + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - 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 }; + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } -}); - -// 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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + exports2.compare = compare3; + function compare3(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - function getErrorMessage2(e) { - if (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}`; - } + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare3(a, b, true); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + 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); } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare3(b, a, loose); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; + exports2.gt = gt; + function gt(a, b, loose) { + return compare3(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID2; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID2() { - return uuidFunction(); + exports2.lt = lt; + function lt(a, b, loose) { + return compare3(a, b, loose) < 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.eq = eq; + function eq(a, b, loose) { + return compare3(a, b, loose) === 0; } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); + exports2.neq = neq; + function neq(a, b, loose) { + return compare3(a, b, loose) !== 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare3(a, b, loose) >= 0; + } + exports2.lte = lte; + function lte(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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); + } + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - 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); - } + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - 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; + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - 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; + comp = comp.trim().split(/\s+/).join(" "); + debug4("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; + } + debug4("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); } }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; + Comparator.prototype.toString = function() { + return this.value; + }; + Comparator.prototype.test = function(version) { + debug4("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; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); + } + 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; } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url2 = new URL(locationHeader, request.url); - request.url = url2.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; + rangeTmp = new Range2(comp.value, options); + return satisfies2(this.value, rangeTmp, options); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + rangeTmp = new Range2(this.value, options); + return satisfies2(comp.semver, rangeTmp, options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); + 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; }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - 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(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + exports2.Range = Range2; + function Range2(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); + } } + if (range instanceof Comparator) { + return new Range2(range.value, options); + } + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { 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]); + Range2.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(" ").trim(); + }).join("||").trim(); + return this.range; }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } 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 (error4) { - e = { error: error4 }; - } 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); + Range2.prototype.toString = function() { + return this.range; }; - } - 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); + Range2.prototype.parseRange = function(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug4("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); }); - }; - 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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); - }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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); } + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; }; - 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); + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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); + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { + return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); }; - __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]; - } }; + 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(); } - 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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os2 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + return result; } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os2.arch()}-${os2.type()}-${os2.release()})`); + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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 parseComparator(comp, options) { + debug4("comp", comp, options); + comp = replaceCarets(comp, options); + debug4("caret", comp); + comp = replaceTildes(comp, options); + debug4("tildes", comp); + comp = replaceXRanges(comp, options); + debug4("xrange", comp); + comp = replaceStars(comp, options); + debug4("stars", comp); + return comp; } - function getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + function isX(id) { + return !id || id.toLowerCase() === "x" || id === "*"; } - 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; + function replaceTildes(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceTilde(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); + function replaceTilde(comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug4("tilde", comp, _, 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) { + debug4("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - 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"); + debug4("tilde return", ret); + return ret; + }); } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); } - function isBlob(x) { - return typeof x.stream === "function"; - } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; - } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); - } - } - function createFileFromStream(stream2, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream2(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + function replaceCaret(comp, options) { + debug4("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug4("caret", comp, _, 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) { + debug4("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 { + debug4("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"; + } } - return s; - }, [rawContent]: stream2 }); + debug4("caret return", ret); + return ret; + }); } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); - } + function replaceXRanges(comp, options) { + debug4("replaceXRanges", comp, options); + return comp.split(/\s+/).map(function(comp2) { + return replaceXRange(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); + 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) { + debug4("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; } - yield yield tslib_1.__await(value); } - } finally { - reader.releaseLock(); + 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; } + debug4("xRange return", ret); + return ret; }); } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } + function replaceStars(comp, options) { + debug4("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return node_stream_1.Readable.fromWeb(stream2); + 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 { - return stream2; + from = ">=" + from; } - } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); + 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 { - return ensureNodeStream(source); + to = "<=" + to; } + return (from + " " + to).trim(); } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream2 of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream2)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } + 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(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug4(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; + } + } + return false; + } + return true; } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - return result; + return range.test(version); } - 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; + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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; } - 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; + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - return total; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 && range.test(minver)) { + return minver; + } + return null; } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; } - request.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`); + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + if (satisfies2(version, range, options)) { + return false; } - } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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}`); + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.set[i2]; + var high = null; + var low = null; + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); } - 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`); + 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; } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); + }); + 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 = parse(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 match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } - }; + safeRe[t.COERCERTL].lastIndex = -1; + } + if (match === null) { + return null; + } + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { +// 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.decompressResponsePolicyName = void 0; - exports2.decompressResponsePolicy = decompressResponsePolicy; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; - } + 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); } }); -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/cache/lib/internal/cacheUtils.js +var require_cacheUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/cacheUtils.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"; + 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]; + } }; } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve6, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); + 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; }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); + 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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); } - timer = setTimeout(() => { - removeListeners(); - resolve6(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - 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/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { - "use strict"; + }; + 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(resolve6, reject) { + v = o[n](v), settle(resolve6, reject, v.done, v.value); + }); + }; + } + function settle(resolve6, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve6({ value: v2, done: d }); + }, reject); + } + }; 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; + 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 core12 = __importStar2(require_core()); + var exec = __importStar2(require_exec()); + var glob = __importStar2(require_glob()); + var io6 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs12 = __importStar2(require("fs")); + var path11 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 = path11.join(baseLocation, "actions", "temp"); } - 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 (_a) { - return void 0; - } - } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + const dest = path11.join(tempDirectory, crypto2.randomUUID()); + yield io6.mkdirP(dest); + return dest; + }); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; - } - return { - retryAfterInMs - }; - } - }; + function getArchiveFileSizeInBytes(filePath) { + return fs12.statSync(filePath).size; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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 glob.create(patterns.join("\n"), { + implicitDescendants: false + }); + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path11.relative(workspace, file).replace(new RegExp(`\\${path11.sep}`, "g"), "/"); + core12.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); + } else { + paths.push(`${relativeFile}`); + } } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + return paths; + }); } - 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"; + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs12.unlink)(filePath); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers2(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.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; + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core12.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() } - } + }); + } catch (err) { + core12.debug(err.message); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + versionOutput = versionOutput.trim(); + core12.debug(versionOutput); + return versionOutput; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core12.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; + } + }); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + function getCacheFileName(compressionMethod) { + return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); - } + function getGnuTarPathOnWindows() { + return __awaiter2(this, void 0, void 0, function* () { + if (fs12.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - /** - * 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() }); + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - /** - * 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)); + components.push(versionSalt); + return crypto2.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"); } - /** - * 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); + return token; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __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 core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); - } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); - } - }; - } - 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, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); - } - } - } - request.multipartBody = { parts }; +// 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; } -}); - -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); + 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 _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.addInitializer = function(f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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; - } + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; } - 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"; + } + 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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return ms + " ms"; } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { 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]); + }; } -}); - -// 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 debug4(...args) { - if (!debug4.enabled) { - return; + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) 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: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; } - const self2 = debug4; - 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"); + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - createDebug.formatArgs.call(self2, args); - const logFn = self2.log || createDebug.log; - logFn.apply(self2, args); - } - debug4.namespace = namespace; - debug4.useColors = createDebug.useColors(); - debug4.color = createDebug.selectColor(namespace); - debug4.extend = extend3; - debug4.destroy = createDebug.destroy; - Object.defineProperty(debug4, "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 (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug4); - } - return debug4; - } - function extend3(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); + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; } - } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } - 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(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; - } - 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; + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; } - module2.exports = setup; + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } -}); - -// 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`."); - } +} +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); + }); }; - })(); - 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+)/); + if (f) i[n] = f(i[n]); } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } + } + 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(resolve6, reject) { + v = o[n](v), settle(resolve6, reject, v.done, v.value); }); - args.splice(lastC, 0, c); + }; + } + function settle(resolve6, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve6({ 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]; } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { - } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function load2() { - let r; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + inner.call(this); + } catch (e) { + return Promise.reject(e); } - return r; - } - function localstorage() { + }; + 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 { - return localStorage; - } catch (error4) { + 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); } } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.message; + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path11, preserveJsx) { + if (typeof path11 === "string" && /^\.\.?\//.test(path11)) { + return path11.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path11; +} +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/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports2, module2) { +// 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"; - 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); + 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/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { +// 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"; - var os2 = 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; + 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}`); } - 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); - } + } +}); + +// 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); } - function translateLevel(level) { - if (level === 0) { - return false; + 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); + } } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - if (hasFlag("color=256")) { - return 2; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; + } } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; + } } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - if (process.platform === "win32") { - const osRelease = os2.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; + 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; } - 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; + 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(debug4, { + enabled: enabled(namespace), + destroy, + log: debugObj.log, + namespace, + extend: extend3 + }); + function debug4(...args) { + if (!newDebugger.enabled) { + return; } - return min; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; } - if (env.COLORTERM === "truecolor") { - return 3; + return false; + } + function extend3(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 ("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 (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(", ")}.`); } } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; + function createLogger(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; } - if ("COLORTERM" in env) { - return 1; + function contextGetLogLevel() { + return logLevel; } - return min; + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); - return translateLevel(level); + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - 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 util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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 (error4) { +// 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(); } - 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, (_, k) => { - return k.toUpperCase(); - }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - obj[prop] = val2; - 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]; + 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]); + } + } } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; + /** + * 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() }); } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; + /** + * 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; } - } - function load2() { - return process.env.DEBUG; - } - function init(debug4) { - debug4.inspectOpts = {}; - const keys = Object.keys(exports2.inspectOpts); - for (let i = 0; i < keys.length; i++) { - debug4.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]]; + /** + * 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); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); + } } }); -// 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/@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/agent-base/dist/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(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 json2(stream2) { - const buf = await toBuffer(stream2); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; - } - } - exports2.json = json2; - function req(url2, opts = {}) { - const href = typeof url2 === "string" ? url2 : url2.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); - const promise = new Promise((resolve6, reject) => { - req2.once("response", resolve6).once("error", reject).end(); - }); - req2.then = promise.then.bind(promise); - return req2; + } +}); + +// 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 = randomUUID2; + function randomUUID2() { + return crypto.randomUUID(); } - exports2.req = req; } }); -// node_modules/agent-base/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/agent-base/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); }; + 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.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers3(), exports2); - var INTERNAL = 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; + 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; } - decrementSockets(name, socket) { - if (!this.sockets[name] || socket === null) { - return; + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - const sockets = this.sockets[name]; - const index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - } - // 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); + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - return super.getName(options); + this._policies.push({ + policy, + options + }); + this._orderedPolicies = void 0; } - 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); - } + 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[INTERNAL].currentSocket = socket; - super.createSocket(req, options, cb); - }, (err) => { - this.decrementSockets(name, fakeSocket); - cb(err); }); + this._orderedPolicies = void 0; + return removedPolicies; } - 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); + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + clone() { + return new _HttpPipeline(this._policies); } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; - } + static create() { + return new _HttpPipeline(); } - }; - 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 __importDefault4 = 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 = __importDefault4(require_src()); - var debug4 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve6, 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); + orderPolicies() { + const result = []; + const policyMap = /* @__PURE__ */ new Map(); + function createPhase(name) { + return { + name, + policies: /* @__PURE__ */ new Set(), + hasRun: false, + hasAfterPolicies: false + }; } - function onend() { - cleanup(); - debug4("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + 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; + } } - function onerror(err) { - cleanup(); - debug4("onerror %o", err); - reject(err); + 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); } - 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) { - debug4("have not received end of HTTP headers yet..."); - read(); - return; + 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}`); } - 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")); + if (options.afterPolicies) { + for (const afterPolicyName of options.afterPolicies) { + const afterNode = policyMap.get(afterPolicyName); + if (afterNode) { + node.dependsOn.add(afterNode); + afterNode.dependants.add(node); + } + } } - const firstLineParts = firstLine.split(" "); - const statusCode = +firstLineParts[1]; - const statusText = firstLineParts.slice(2).join(" "); - const headers = {}; - for (const header of headerParts) { - if (!header) + 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; - 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; + 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); } } - debug4("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve6({ - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var parse_proxy_response_1 = require_parse_proxy_response(); - var debug4 = (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 HttpsProxyAgent = 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 ?? {}; - debug4("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 ? omit(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:") { - debug4("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); - } else { - debug4("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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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 -`; + 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); + } + } } - 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) { - debug4("Upgrading socket connection to TLS"); - return tls.connect({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + 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 socket; } - socket.destroy(); - const fakeSocket = new net.Socket({ writable: false }); - fakeSocket.readable = true; - req.once("socket", (s) => { - debug4("Replaying proxy buffer for failed request"); - (0, assert_1.default)(s.listenerCount("data") > 0); - s.push(buffered); - s.push(null); - }); - return fakeSocket; + return result; } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); - } - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + function createEmptyPipeline() { + return HttpPipeline.create(); } } }); -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); - var events_1 = require("events"); - var agent_base_1 = require_dist2(); - var url_1 = require("url"); - var debug4 = (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 ?? {}; - debug4("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 ? omit(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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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; - debug4("Regenerating stored HTTP header string for request"); - req._implicitHeader(); - if (req.outputData && req.outputData.length > 0) { - debug4("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); - debug4("Output buffer: %o", req.outputData[0].data); - } - let socket; - if (this.proxy.protocol === "https:") { - debug4("Creating `tls.Socket`: %o", this.connectOpts); - socket = tls.connect(this.connectOpts); - } else { - debug4("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 omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { +// 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.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_log(); - 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; + 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; } - const httpsProxy = getEnvironmentValue(HTTPS_PROXY); - const allProxy = getEnvironmentValue(ALL_PROXY); - const httpProxy = getEnvironmentValue(HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; + return false; } - function isBypassed(uri, noProxyList, bypassedMap) { - if (noProxyList.length === 0) { - return false; - } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + } +}); + +// 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())); } - 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; - } + /** + * 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 + }; } - } else { - if (host === pattern) { - isBypassedFlag = true; + 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); } - } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 value; + }, 2); } - return []; - } - function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return void 0; + /** + * 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 parsedUrl = new URL(proxyUrl); - const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url2 = new URL(request.url); - const isInsecure = url2.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + const url2 = new URL(value); + if (!url2.search) { + return value; } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + for (const [key] of url2.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url2.searchParams.set(key, RedactedString); + } } - request.agent = cachedAgents.httpsProxyAgent; - } - } - function proxyPolicy(proxySettings, options) { - if (!noProxyListLoaded) { - exports2.globalNoProxyList.push(...loadNoProxy()); + return url2.toString(); } - const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); - const cachedAgents = {}; - return { - name: exports2.proxyPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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 next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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 next(request); } - }; - } + return sanitized; + } + }; + exports2.Sanitizer = Sanitizer; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { +// 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.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); - } - }; + 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/@azure/core-tracing/dist/commonjs/tracingContext.js -var require_tracingContext = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js"(exports2) { +// 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.TracingContextImpl = exports2.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; + 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); } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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) { +// 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.state = void 0; - exports2.state = { - instrumenterImplementation: void 0 - }; + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; - } - exports2.getInstrumenter = getInstrumenter; - } -}); - -// 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 = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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 - }; - } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __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 core_util_1 = require_commonjs2(); - 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 { - 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 }); - Object.setPrototypeOf(this, _RestError.prototype); - } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } - }; - exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - function isRestError(e) { - if (e instanceof RestError) { - return true; - } - return (0, core_util_1.isError)(e) && e.name === "RestError"; - } - } -}); - -// 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_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.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); - } - span.setStatus({ - status: "success" - }); - 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/createPipelineFromOptions.js -var require_createPipelineFromOptions = __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_logPolicy(); - var pipeline_js_1 = require_pipeline(); - var redirectPolicy_js_1 = require_redirectPolicy(); - var userAgentPolicy_js_1 = require_userAgentPolicy(); - var multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { +// 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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib2 = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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((resolve6) => { const handler = () => { resolve6(); @@ -39223,6 +37898,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -39236,25 +37913,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -39263,13 +37937,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -39293,8 +37970,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -39316,7 +37996,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -39334,9 +38014,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -39345,29 +38024,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url2 = new URL(request.url); const isInsecure = url2.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url2.hostname, path: `${url2.pathname}${url2.search}`, port: url2.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve6, reject) => { - const req = isInsecure ? http.request(options, resolve6) : https2.request(options, resolve6); + const req = isInsecure ? node_http_1.default.request(options, resolve6) : node_https_1.default.request(options, resolve6); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -39388,30 +38066,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -39434,11 +38113,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream2, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib2.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream2.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib2.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream2.pipe(inflate); return inflate; } @@ -39458,7 +38137,7 @@ var require_nodeHttpClient = __commonJS({ resolve6(Buffer.concat(buffer).toString("utf8")); }); stream2.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -39489,9 +38168,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -39502,1760 +38181,1368 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; - } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + logger(`Response status code: ${response.status}`); + logger(`Headers: ${sanitizer.sanitize(response.headers)}`); + return response; + } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url2 = new URL(locationHeader, request.url); + request.url = url2.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); + } + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.throttlingRetryPolicyName = void 0; - exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; - function throttlingRetryPolicy(options = {}) { - var _a; - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers2(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; - } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + } +}); + +// 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(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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(); + return next(request); } }; - function refresh(scopes, getTokenOptions) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + } + } +}); + +// 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((resolve6, 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(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve6(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; } - } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + return void 0; } - op = body.call(thisArg, _); - } 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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 }; + 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"; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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"; } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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]; + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); +}); + +// 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]; }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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); + 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]; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(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(); + createDebug.selectColor = selectColor; + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + function debug4(...args) { + if (!debug4.enabled) { + return; + } + const self2 = debug4; + 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 index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; }); - } 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(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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]; + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); } - return t; - }; - return __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 - }; - } -}); - -// 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 { - /** - * 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"); + debug4.namespace = namespace; + debug4.useColors = createDebug.useColors(); + debug4.color = createDebug.selectColor(namespace); + debug4.extend = extend3; + debug4.destroy = createDebug.destroy; + Object.defineProperty(debug4, "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(debug4); } - 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_commonjs2(); - 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + return debug4; } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + function extend3(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; } - /** - * 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"); + 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); + } } - 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"); + 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; + } } - this._name = newName; - this._key = newKey; + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; } - /** - * 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"); + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } } - this._signature = signature; + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + return false; } - /** - * 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"); + function coerce3(val) { + if (val instanceof Error) { + return val.stack || val.message; } - this._signature = newSignature; + return val; } - }; - 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); + 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/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); +// 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+)/); } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); - } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; - } -}); - -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + exports2.log = console.debug || console.log || (() => { }); - } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { + function save(namespaces) { try { - step(generator.next(value)); - } catch (e) { - reject(e); + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { } } - function rejected(value) { + function load2() { + let r; try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + function localstorage() { + try { + return localStorage; + } catch (error3) { + } } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(thisArg, body) { - var _ = { 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]); + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; + } }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; +}); + +// 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 os2 = 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); } - op = body.call(thisArg, _); - } 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 }; + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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 = os2.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; } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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]; + function getSupportLevel(stream2) { + const level = supportsColor(stream2, stream2 && stream2.isTTY); + return translateLevel(level); } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; } - 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) { +}); + +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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 { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); + 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, (_, k) => { + return k.toUpperCase(); }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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]; + 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); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + 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]; + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); + function load2() { + return process.env.DEBUG; + } + function init(debug4) { + debug4.inspectOpts = {}; + const keys = Object.keys(exports2.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug4.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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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 __assign3.apply(this, arguments); + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; - __createBinding3 = Object.create ? (function(o, m, k, k2) { + } +}); + +// 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)) { @@ -41267,7538 +39554,14146 @@ var init_tslib_es63 = __esm({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { + })); + 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; }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 - }; - } -}); - -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __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.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); + exports2.toBuffer = toBuffer; + async function json2(stream2) { + const buf = await toBuffer(stream2); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); + exports2.json = json2; + function req(url2, opts = {}) { + const href = typeof url2 === "string" ? url2 : url2.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); + const promise = new Promise((resolve6, reject) => { + req2.once("response", resolve6).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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 = "_"; + exports2.req = req; } }); -// node_modules/@azure/core-client/dist/commonjs/utils.js -var require_utils5 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { +// node_modules/agent-base/dist/index.js +var require_dist = __commonJS({ + "node_modules/agent-base/dist/index.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; + 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]; + } }; } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); + 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); } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, parsedHeaders), { blobBody: fullResponse.blobBody, readableStreamBody: fullResponse.readableStreamBody }); + __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] = {}; } - const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {}; - const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); - if (expectedBodyTypeName === "Sequence" || isPageableResponse) { - const arrayResponse = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; + /** + * 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:"; } } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } } - 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) - }); - } - exports2.flattenResponse = flattenResponse; - } -}); - -// 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 = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + // 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); } - /** - * @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}.`); + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options) }; - 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); + 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); + } } - 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); - } - } + this[INTERNAL].currentSocket = socket; + super.createSocket(req, options, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); } - /** - * 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, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - } - }; - let payload = {}; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = void 0; + if (!socket) { + throw new Error("No socket was returned in the `connect()` function"); } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; + return socket; + } + get defaultPort() { + return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; } - if (mapper.isConstant) { - object = mapper.defaultValue; + } + get protocol() { + return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); + } + }; + 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 debug4 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); + function parseProxyResponse(socket) { + return new Promise((resolve6, reject) => { + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once("readable", read); } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); + function cleanup() { + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("readable", read); } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + function onend() { + cleanup(); + debug4("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); } - if (object === void 0 || object === null) { - payload = object; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + function onerror(err) { + cleanup(); + debug4("onerror %o", err); + reject(err); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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) { + debug4("have not received end of HTTP headers yet..."); + read(); + return; } - 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]; - } + 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")); } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; + 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}"`)); } - } else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; - } else if (responseBody === "false") { - payload = false; + 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 { - payload = responseBody; + headers[key] = value; } - } 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); } + debug4("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve6({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - } - }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); - } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; - } - return str2.substr(0, len); + socket.on("error", onerror); + socket.on("end", onend); + read(); + }); } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + exports2.parseProxyResponse = parseProxyResponse; + } +}); + +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + var url_1 = require("url"); + var parse_proxy_response_1 = require_parse_proxy_response(); + var debug4 = (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 + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + return options; + }; + var HttpsProxyAgent = 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 ?? {}; + debug4("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 ? omit(opts, "headers") : null, + host, + port + }; } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; - } + /** + * 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'); } - } - 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.`); - } + let socket; + if (proxy.protocol === "https:") { + debug4("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(setServernameFromNonIpHost(this.connectOpts)); + } else { + debug4("Creating `net.Socket`: %o", this.connectOpts); + socket = net.connect(this.connectOpts); } - } - 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(); + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - 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.`); + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - value = base64.encodeByteArray(value); + 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) { + debug4("Upgrading socket connection to TLS"); + return tls.connect({ + ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), + socket + }); + } + return socket; + } + socket.destroy(); + const fakeSocket = new net.Socket({ writable: false }); + fakeSocket.readable = true; + req.once("socket", (s) => { + debug4("Replaying proxy buffer for failed request"); + (0, assert_1.default)(s.listenerCount("data") > 0); + s.push(buffered); + s.push(null); + }); + return fakeSocket; } - return value; + }; + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - function serializeBase64UrlType(objectName, value) { - if (value !== void 0 && value !== null) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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_dist(); + var url_1 = require("url"); + var debug4 = (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 ?? {}; + debug4("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 ? omit(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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - return value; + async connect(req, opts) { + req._header = null; + if (!req.path.includes("://")) { + this.setRequestProps(req, opts); + } + let first; + let endOfHeaders; + debug4("Regenerating stored HTTP header string for request"); + req._implicitHeader(); + if (req.outputData && req.outputData.length > 0) { + debug4("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); + debug4("Output buffer: %o", req.outputData[0].data); + } + let socket; + if (this.proxy.protocol === "https:") { + debug4("Creating `tls.Socket`: %o", this.connectOpts); + socket = tls.connect(this.connectOpts); + } else { + debug4("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 omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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()]; } - 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}.`); + return void 0; + } + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + 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 tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + 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 { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url2 = new URL(request.url); + const isInsecure = url2.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream2) { + if (stream2 instanceof ReadableStream) { + makeAsyncIterable(stream2); + return stream_1.Readable.fromWeb(stream2); + } else { + return stream2; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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 { - 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; - } + total += partLength; } } - 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 total; + } + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); } - return instance; + request.body = await (0, concat_js_1.concat)(sources); } - 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}`); + 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 (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; + if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { + throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); } - return responseBody; } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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]; + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); + } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); + } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + }; + } + } +}); + +// 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); } - return tempArray; + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); - } - } - } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return void 0; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); - } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + } +}); + +// 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); } - } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; - } + exports2.ensureSecureConnection = ensureSecureConnection; + var log_js_1 = require_log2(); + var insecureConnectionWarningEmmitted = false; + function allowInsecureConnection(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url2 = new URL(request.url); + if (url2.hostname === "localhost" || url2.hostname === "127.0.0.1") { + return true; } } - return value; + return false; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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]; + function emitInsecureConnectionWarning() { + const warning9 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning9); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning9); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } else { - break; + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info6 = state_js_1.state.operationRequestMap.get(request); - if (!info6) { - info6 = {}; - state_js_1.state.operationRequestMap.set(request, info6); - } - return info6; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; + } + } +}); + +// 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.deserializationPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } } - return result; + return pipeline; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); } - return result; + return cachedHttpClient; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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]; + } } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if (descriptor.contentType === null) { + return void 0; } - 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 }); - } + if (descriptor.contentType) { + return descriptor.contentType; } - return parsedResponse; + 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 isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escapeDispositionField(value) { + return JSON.stringify(value); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; - } + function getContentDisposition(descriptor) { + const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); + if (contentDispositionHeader) { + return contentDispositionHeader; } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (descriptor.dispositionType === void 0 && descriptor.name === void 0 && descriptor.filename === void 0) { + return void 0; } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + const dispositionType = descriptor.dispositionType ?? "form-data"; + let disposition = dispositionType; + if (descriptor.name) { + disposition += `; name=${escapeDispositionField(descriptor.name)}`; } - return { error: error4, shouldReturnResponse: false }; - } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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; } } - return operationResponse; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; + } + return disposition; } - } -}); - -// 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); } - return result; + 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}`); } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + 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); } - return result; + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } + 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_multipart2(); + async function sendRequest(method, url2, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url2, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + 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, rawHeaders: headers, parsedBody }); } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + return { + request, + 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, rawHeaders }, e); } + throw e; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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; + 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 { - if (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; } } + return "application/json"; } - exports2.serializeRequestBody = serializeRequestBody; - 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 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 prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - 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_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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) }; } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; } - exports2.createClientPipeline = createClientPipeline; - } -}); - -// 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 = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; + 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 + }); } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path11 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path11.startsWith("/")) { - path11 = path11.substring(1); - } - if (isAbsoluteUrl(path11)) { - requestUrl = path11; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path11); - } + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${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 = ","; } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + 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]; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; } - } - return result; - } - function isAbsoluteUrl(url2) { - return url2.includes("://"); + 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 appendPath(url2, pathToAppend) { - if (!pathToAppend) { + function appendQueryParams(url2, options = {}) { + if (!options.queryParameters) { 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 path11 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path11; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } + 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)); } - if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "CSV" || queryParameter.collectionFormat === "Pipes")) { - queryParameterValue = queryParameterValue.join(delimiter); + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); } - result.set(queryParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter), queryParameterValue); + } 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)); } } - return { - queryParams: result, - sequenceParams - }; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return result; + return endpoint; } - function appendQueryParams(url2, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url2; + 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)); } - 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); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - 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}`); + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path11, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path11, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url2, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline, { ...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, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline, { ...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."); } - } else { - searchPieces.push(`${name}=${value}`); } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); + }; } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url: url2 - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, options), { credentialOptions })); + 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 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; + 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/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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)(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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 getLogLevel() { + return context2.getLogLevel(); } - 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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + } +}); + +// 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 + }); } - 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) => Object.assign(Object.assign({}, a), b), {}); + } +}); + +// 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 + }; } - function requestToOptions(request) { + } +}); + +// 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 { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions + 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/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } + 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 + }); } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); + } +}); + +// 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); } - var HttpHeaders = class _HttpHeaders { - 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } + 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"; } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - exports2.toPipelineResponse = toPipelineResponse; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.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) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + 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-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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.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); } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); + 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.requestPolicyFactoryPolicyName, + name: exports2.userAgentPolicyName, async sendRequest(request, 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); + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; + 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); } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + 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/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } +// 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(); } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + 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); } - }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; + } } }); -// node_modules/fast-xml-parser/src/validator.js -var require_validator2 = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { +// 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"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.AbortError = void 0; + var AbortError = class extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); - } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } + 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((resolve6, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - return i; - } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); + if (abortSignal?.aborted) { + return rejectOnAbort(); } - } - return true; - } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; - } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; - } - return i; - } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col + try { + buildPromise((x) => { + removeListeners(); + resolve6(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } - }; - } - function validateAttrName(attrName) { - return util.isName(attrName); + abortSignal?.addEventListener("abort", onAbort); + }); } - function validateTagName(tagname) { - return util.isName(tagname); + } +}); + +// 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)((resolve6) => { + token = setTimeout(resolve6, timeInMs); + }, { + cleanupBeforeAbort: () => clearTimeout(token), + abortSignal, + abortErrorMsg: abortErrorMsg ?? StandardAbortMessage + }); } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; + 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 }; } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; + } +}); + +// 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 { - exp += xmlData[i]; + stringified = String(e); } + } catch (err) { + stringified = "[unable to stringify input]"; } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); - } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); + return `Unknown error ${stringified}`; } - return { entities, i }; } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; + } +}); + +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } } - return [entityName2, val2, i]; + return true; } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; + } +}); + +// 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 = randomUUID2; + 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 isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber2(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; - } - } else { - return str2; - } - } + function isError(e) { + return tspRuntime.isError(e); } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; + function isObject2(input) { + return tspRuntime.isObject(input); } - module2.exports = toNumber2; - } -}); - -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; - } - return () => false; + function randomUUID2() { + 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); } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber2 = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + 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 replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); + 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"); } - return val2; }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; - } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; - } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - function findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); } else { - return closingIndex + str2.length - 1; + return blob; } } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + function createFileFromStream(stream2, name, options = {}) { return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName + ...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 readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } - } - } + 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 parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber2(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } + return source.map((x) => x); } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; + 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } + return tspPolicy.sendRequest(request, next); } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + }; } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator2(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; +// 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/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; +// 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); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; + } +}); + +// 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)(); } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + } +}); + +// 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 replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; - } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; - } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } + }; } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; - } - } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); + } +}); + +// 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); } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; - } + } +}); + +// 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); } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator2(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder + 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; + } + 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-xml/dist/commonjs/xml.common.js -var require_xml_common = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.common.js"(exports2) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + exports2.state = void 0; + exports2.state = { + instrumenterImplementation: void 0 + }; } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false + end: () => { + }, + isRecording: () => false, + recordException: () => { + }, + setAttribute: () => { + }, + setStatus: () => { + }, + addEvent: () => { + } }; } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + 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 getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - 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, ""); + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); + } + return state_js_1.state.instrumenterImplementation; } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); + } +}); + +// 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 + }; } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; + 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(); + } } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; - } + function parseTraceparentHeader(traceparentHeader) { + return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); } - return parsedXml; + function createRequestHeaders(tracingContext) { + return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + } + return { + startSpan, + withSpan, + withContext, + parseTraceparentHeader, + createRequestHeaders + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; + 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; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return xml_common_js_1.XML_CHARKEY; + var tracingClient_js_1 = require_tracingClient(); + Object.defineProperty(exports2, "createTracingClient", { enumerable: true, get: function() { + return tracingClient_js_1.createTracingClient; } }); } }); -// 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_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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(request, next) { + if (!tracingClient) { + return next(request); + } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; + } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); + } + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; + } } - return abortedMap.get(this); + }; + } + 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; } - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - static get none() { - return new _AbortSignal(); + } + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { + request.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; } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - listeners.push(listener); + span.end(); + } catch (e) { + log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + 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)}`); } - /** - * 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."); + } + } +}); + +// 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 }; } - }; - function abortSignal(signal) { - if (signal.aborted) { - return; + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; } - if (signal.onabort) { - signal.onabort.call(signal); + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; + } } - const listeners = listenersMap.get(signal); - if (listeners) { - listeners.slice().forEach((listener) => { - listener.call(signal, { type: "abort" }); - }); + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); } - abortedMap.set(signal, true); + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; } - 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(); - }); + } +}); + +// 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); } } - } - /** - * 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/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - throw error4; - }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return { - code, - message - }; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - 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}`; + } +}); + +// 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(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - 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, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; - } - } - return { response, status }; + } +}); + +// 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); } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); - } + } +}); + +// 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); } - function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; + } +}); + +// 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); } - function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; + } +}); + +// 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); } - function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; + } +}); + +// 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); } - function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; + } +}); + +// 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 + }); } - function findResourceLocation(inputs) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } + } +}); + +// 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; } } - } - 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; + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } + return token; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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; + }; } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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"; + } +}); + +// 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(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - 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; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true + }; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - return void 0; } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error4; + function isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { + const { scopes } = onChallengeOptions; + const accessToken = await onChallengeOptions.getAccessToken(scopes, { + enableCae: true, + claims: caeClaims + }); + if (!accessToken) { + return false; } - return void 0; + onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); + return true; } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return initOperation({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig + 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(request, next) { + if (!request.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, + getAccessToken, + logger }); - 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 - }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } + } + }; } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + } + } + return next(request); } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + }; + } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - case "Body": - default: { - return void 0; + }; + } + } +}); + +// 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); + } +}); + +// 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"); } - case "Body": { - return getProvisioningState(rawResponse); + 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + 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"; } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + } +}); + +// 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; } - return state.config.resourceLocation; - } - function isOperationError(e) { - return e.name === "RestError"; - } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); - } - var createStateProxy$1 = () => ({ /** - * 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. + * 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 */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => state.status = "canceled", - setError: (state, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } }; } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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; + } +}); + +// 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_utils6 = __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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + } + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + 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]; + } } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (parsedHeaders) { + for (const key of Object.keys(parsedHeaders)) { + arrayResponse[key] = parsedHeaders[key]; + } } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + return isNullable && !fullResponse.parsedBody && !parsedHeaders && Object.getOwnPropertyNames(modelProperties).length === 0 ? null : arrayResponse; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + 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_utils6(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } /** - * Serializes the Poller operation. + * @deprecated Removing the constraints validation on client side. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); - } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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); + } + } } - }; - 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); + * Serialize the given object based on its metadata defined in the mapper * - * // You can assign more local properties here. - * } - * } - * ``` + * @param mapper - The mapper which defines the metadata of the serializable object * - * 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. + * @param object - A valid Javascript object to be serialized * - * 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: + * @param objectName - Name of the serialized object * - * ```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 options - additional options to serialization * - * @param operation - Must contain the basic properties of `PollOperation`. + * @returns A valid serialized Javascript object */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve6, reject) => { - this.resolve = resolve6; - 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; + serialize(mapper, object, 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; } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - } - /** - * 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) - }); + if (mapper.isConstant) { + object = mapper.defaultValue; } - this.processUpdatedState(); + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } + } + return payload; } /** - * fireProgress calls the functions passed in via onProgress the method of the poller. + * Deserialize the given object based on its metadata defined in the mapper * - * It loops over all of the callbacks received from onProgress, and executes them, sending them - * the current operation state. + * @param mapper - The mapper which defines the metadata of the serializable object * - * @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. + * @param responseBody - A valid Javascript entity to be deserialized * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @param objectName - Name of the deserialized object * - * @param options - Optional properties passed to the operation's update method. + * @param options - Controls behavior of XML parser and builder. + * + * @returns A valid deserialized Javascript object */ - 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; + 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; } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + 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 (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + if (mapper.isConstant) { + payload = mapper.defaultValue; } + return payload; } - /** - * Returns a promise that will resolve once the underlying operation is completed. - */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; + } + return str2.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 str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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 = ""; + } } - 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); - }; + return classes; + } + function dateToUnixTime(d) { + if (!d) { + return void 0; } - /** - * Returns true if the poller has finished polling. - */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + if (typeof d.valueOf() === "string") { + d = new Date(d); } - /** - * 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")); + 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.`); } } } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + 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.`); } - /** - * 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"); + const isPresent = allowedValues.some((item) => { + if (typeof item.valueOf() === "string") { + return item.toLowerCase() === value.toLowerCase(); } - return this.cancelPromise; + return item === value; + }); + if (!isPresent) { + throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`); } - /** - * 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; + 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); } - /** - * 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; + 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); } - /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. - */ - toString() { - return this.operation.toString(); + 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}".`); + } + } } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + return value; + } + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - /** - * The method used by the poller to wait before attempting to update its operation. - */ - delay() { - return new Promise((resolve6) => setTimeout(() => resolve6(), this.config.intervalInMs)); + 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}.`); } - }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; - } -}); - -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream2 = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs12 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; + } + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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; + } } - n.default = e; - return Object.freeze(n); + return tempArray; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs12); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - /** - * 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); + 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}.`); } - /** - * 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); + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + 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; } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ - "10000", - "10001", - "10002", - "10003", - "10004", - "10100", - "10101", - "10102", - "10103", - "10104", - "11000", - "11001", - "11002", - "11003", - "11004", - "11100", - "11101", - "11102", - "11103", - "11104" - ]; - function escapeURLPath(url3) { - const urlParsed = new URL(url3); - let path11 = urlParsed.pathname; - path11 = path11 || "/"; - path11 = escape(path11); - urlParsed.pathname = path11; - return urlParsed.toString(); + return tempDictionary; } - 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]; - } - } + 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 proxyUri; + return additionalProperties; } - function getValueInConnString(connectionString, argument) { - const elements = connectionString.split(";"); - for (const element of elements) { - if (element.trim().startsWith(argument)) { - return element.trim().match(argument + "=(.*)")[1]; + 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 ""; + return modelProps; } - function extractConnectionStringParts(connectionString) { - let proxyUri = ""; - if (connectionString.startsWith("UseDevelopmentStorage=true")) { - proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); } - 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'"); + if (object !== void 0 && object !== null) { + const payload = {}; + const modelProps = resolveModelProperties(serializer, mapper, objectName); + for (const key of Object.keys(modelProps)) { + const propertyMapper = modelProps[key]; + if (propertyMapper.readOnly) { + continue; } - endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); - if (!endpointSuffix) { - throw new Error("Invalid EndpointSuffix in the provided Connection String"); + 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) && (object[key] !== void 0 && object[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 = object[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; + } + } } - 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 escape(text) { - return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); - } - function appendToURLPath(url3, name) { - const urlParsed = new URL(url3); - let path11 = urlParsed.pathname; - path11 = path11 ? path11.endsWith("/") ? `${path11}${name}` : `${path11}/${name}` : name; - urlParsed.pathname = path11; - return urlParsed.toString(); - } - function setURLParameter(url3, name, value) { - const urlParsed = new URL(url3); - 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); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } } } + return payload; } - if (encodedValue) { - searchPieces.push(`${encodedName}=${encodedValue}`); - } - urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return urlParsed.toString(); - } - function getURLParameter(url3, name) { - var _a; - const urlParsed = new URL(url3); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : void 0; - } - function setURLHost(url3, host) { - const urlParsed = new URL(url3); - urlParsed.hostname = host; - return urlParsed.toString(); - } - function getURLPath(url3) { - try { - const urlParsed = new URL(url3); - return urlParsed.pathname; - } catch (e) { - return void 0; - } - } - function getURLScheme(url3) { - try { - const urlParsed = new URL(url3); - return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; - } catch (e) { - return void 0; - } - } - function getURLPathAndQuery(url3) { - const urlParsed = new URL(url3); - 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}`; + return object; } - function getURLQueries(url3) { - let queryString = new URL(url3).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; + function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; } - return queries; - } - function appendToURLQuery(url3, queryParts) { - const urlParsed = new URL(url3); - let query = urlParsed.search; - if (query) { - query += "&" + queryParts; - } else { - query = queryParts; + 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; + } } - 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"; + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + function isSpecialXmlProperty(propertyName, options) { + return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); } - function generateBlockID(blockIDPrefix, blockIndex) { - const maxSourceStringLength = 48; - const maxBlockIndexLength = 6; - const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength; - if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) { - blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength); + 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 res = blockIDPrefix + padStart2(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, "0"); - return base64encode(res); - } - async function delay2(timeInMs, aborter, abortError) { - return new Promise((resolve6, reject) => { - let timeout; - const abortHandler = () => { - if (timeout !== void 0) { - clearTimeout(timeout); - } - reject(abortError); - }; - const resolveHandler = () => { - if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve6(); - }; - timeout = setTimeout(resolveHandler, timeInMs); - if (aborter !== void 0) { - aborter.addEventListener("abort", abortHandler); + 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; } - }); - } - 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); + 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; + } } - return padString.slice(0, targetLength) + currentString; } - } - function iEqual(str1, str2) { - return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); - } - function getAccountNameFromUrl(url3) { - const parsedUrl = new URL(url3); - 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 = ""; + 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 accountName; - } catch (error4) { - throw new Error("Unable to extract accountName with provided information."); } + return instance; } - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); } + return tempDictionary; } - return tagPairs.join("&"); + return responseBody; } - function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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}`); } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); + 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 res; + return responseBody; } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; + 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); + } + } + } } - const res = {}; - for (const blobTag of tags2.blobTagSet) { - res[blobTag.key] = blobTag.value; + return void 0; + } + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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 res; + return mapper; } - function toQuerySerialization(textConfiguration) { - if (textConfiguration === void 0) { - return void 0; + 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]; } - 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 - } + 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); } - }; - case "arrow": - return { - format: { - type: "arrow", - arrowConfiguration: { - schema: textConfiguration.schema - } + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - }; - case "parquet": - return { - format: { - type: "parquet" + 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 = {}; } - }; - default: - throw Error("Invalid BlobQueryTextConfiguration."); + value[propertyName] = propertyValue; + } + } } + return value; } - 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); + 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 { - orProperties.push({ - policyId: ids[0], - rules: [rule] - }); + break; } } - return orProperties; + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; + } + return result; } - function httpAuthorizationToString(httpAuthorization) { - return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; } - function BlobNameToString(name) { - if (name.encoded) { - return decodeURIComponent(name.content); - } else { - return name.content; + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); } + let info6 = state_js_1.state.operationRequestMap.get(request); + if (!info6) { + info6 = {}; + state_js_1.state.operationRequestMap.set(request, info6); + } + return info6; } - function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); - } - function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; } - 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; + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; } else { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); } } - 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 - }; - } + return result; } - function EscapePath(blobName) { - const split = blobName.split("/"); - for (let i = 0; i < split.length; i++) { - split[i] = encodeURIComponent(split[i]); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const shouldDeserialize = operationInfo?.shouldDeserialize; + let result; + if (shouldDeserialize === void 0) { + result = true; + } else if (typeof shouldDeserialize === "boolean") { + result = shouldDeserialize; + } else { + result = shouldDeserialize(parsedResponse); } - return split.join("/"); + return result; } - function assertResponse(response) { - if (`_response` in response) { - return response; + async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); + if (!shouldDeserializeResponse(parsedResponse)) { + return parsedResponse; } - throw new TypeError(`Unexpected response object ${response}`); - } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { - /** - * Creates an instance of RetryPolicy. - * - * @param nextPolicy - - * @param options - - * @param retryOptions - - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { - super(nextPolicy, options); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); + const operationSpec = operationInfo?.operationSpec; + if (!operationSpec || !operationSpec.responses) { + return parsedResponse; } - /** - * Sends request. - * - * @param request - - */ - async sendRequest(request) { - return this.attemptSendRequest(request, false, 1); + const responseSpec = getOperationResponseMap(parsedResponse); + const { error: error3, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); + if (error3) { + throw error3; + } else if (shouldReturnResponse) { + return parsedResponse; } - /** - * 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); + 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 (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + if (responseSpec.headersMapper) { + parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders", { xml: {}, ignoreUnknownProperties: true }); } - let response; + } + 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 parse(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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await this._nextPolicy.sendRequest(newRequest); - if (!this.shouldRetry(isPrimaryRetry, attempt, response)) { - return response; + 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; } - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (err) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); - if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { - throw 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; } - await this.delay(isPrimaryRetry, attempt, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; + 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)); } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + } + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); } } } - if (response || err) { - const statusCode = response ? response.status : err ? err.statusCode : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; + } + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } 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) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + } + } + 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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path11 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path11.startsWith("/")) { + path11 = path11.substring(1); + } + if (isAbsoluteUrl(path11)) { + requestUrl = path11; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path11); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; + 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); } - } else { - delayTimeInMs = Math.random() * 1e3; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); } - }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; + return result; + } + function isAbsoluteUrl(url2) { + return url2.includes("://"); + } + function appendPath(url2, pathToAppend) { + if (!pathToAppend) { + return url2; } - /** - * Creates a StorageRetryPolicy object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + const parsedUrl = new URL(url2); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; } - }; - var CredentialPolicy = class extends BaseRequestPolicy { - /** - * Sends out request. - * - * @param request - - */ - sendRequest(request) { - return this._nextPolicy.sendRequest(this.signRequest(request)); + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); } - /** - * Child classes must implement this method with request signing. This method - * will be executed in {@link sendRequest}. - * - * @param request - - */ - signRequest(request) { - return request; + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path11 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path11; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + } + } else { + newPath = newPath + pathToAppend; } - }; - 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; + parsedUrl.pathname = newPath; + return parsedUrl.toString(); } - 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; + 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); + } } - 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; + } + return { + queryParams: result, + sequenceParams + }; + } + function simpleParseQueryParams(queryString) { + const result = /* @__PURE__ */ new Map(); + if (!queryString || queryString[0] !== "?") { + return result; + } + queryString = queryString.slice(1); + const pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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 { - return weight1 < weight2; + result.set(name, value); } } - return false; + return result; } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { - /** - * Creates an instance of StorageSharedKeyCredentialPolicy. - * @param nextPolicy - - * @param options - - * @param factory - - */ - constructor(nextPolicy, options, factory) { - super(nextPolicy, options); - this.factory = factory; + function appendQueryParams(url2, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url2; } - /** - * Signs request. - * - * @param request - - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + 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 stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; } - /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key - * - * @param request - - * @param headerName - - */ - getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + 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}`); } - 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); + 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_utils6(); + 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(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url: url2 }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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 request; + } 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") { + request.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)) { + request[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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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_util8(); + 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(request, 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)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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 = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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 path11 = urlParsed.pathname; + path11 = path11 || "/"; + path11 = escape(path11); + urlParsed.pathname = path11; + 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 escape(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 path11 = urlParsed.pathname; + path11 = path11 ? path11.endsWith("/") ? `${path11}${name}` : `${path11}/${name}` : name; + urlParsed.pathname = path11; + 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((resolve6, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve6(); + }; + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path11 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path11}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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((resolve6, 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(resolve6).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve6(); + } + } + }); + }); + } + /** + * 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 path11 = urlParsed.pathname; + path11 = path11 || "/"; + path11 = escape(path11); + urlParsed.pathname = path11; + 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 escape(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 path11 = urlParsed.pathname; + path11 = path11 ? path11.endsWith("/") ? `${path11}${name}` : `${path11}/${name}` : name; + urlParsed.pathname = path11; + 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((resolve6, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve6(); + }; + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path11 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path11}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path11 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path11}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path11 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path11}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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" + } } - 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(request) { - const path11 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path11}`; - const queries = getURLQueries(request.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); + }; + 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" } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } - return canonicalizedResourceString; } }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); + 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" + } + } + } } }; - var StorageSharedKeyCredential = class extends Credential { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + 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" + } + } + } } }; - var AnonymousCredentialPolicy = class extends 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.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" + } + } + } } }; - var AnonymousCredential = class extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + 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" + } + } + } + } + } } }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + 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" + } } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; - } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + 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" } - } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; } } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; + } + }; + 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" + } } } - return false; } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; + }; + 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" + } } - } else { - delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; + }; + 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" + } } } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay2(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); - } - attempt++; - } - if (response) { - return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); - } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; - } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + }; + 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" + } + } } - return value; } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); + }; + 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" + } } } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; } - function getCanonicalizedResourceString(request) { - const path11 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path11}`; - const queries = getURLQueries(request.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); + }; + 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" } } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; - } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; - } - var StorageBrowserPolicy = class extends 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(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); - } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); - } - }; - var StorageBrowserPolicyFactory = class { - /** - * Creates a StorageBrowserPolicyFactory object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - } - return { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); + 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" + } + } } - }; - } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; - } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { - /** - * 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 - }; } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); - } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; - } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; - } - } - return void 0; - } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; - } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + 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" + } + } } - } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + }, + blobItems: { + serializedName: "BlobItems", + required: true, + xmlName: "BlobItems", + xmlElementName: "Blob", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "BlobItemInternal" + } + } } } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); - } - pipeline._corePipeline = corePipeline; } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); - } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; - } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; + }; + exports2.BlobPrefix = { + serializedName: "BlobPrefix", + type: { + name: "Composite", + className: "BlobPrefix", + modelProperties: { + name: { + serializedName: "Name", + xmlName: "Name", + type: { + name: "Composite", + className: "BlobName" + } + } } } - return credential; - } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; - } - return factory.constructor.name === "StorageSharedKeyCredential"; - } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; - } - return factory.constructor.name === "AnonymousCredential"; - } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); - } - function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; - } - return factory.constructor.name === "StorageBrowserPolicyFactory"; - } - function isStorageRetryPolicyFactory(factory) { - if (factory instanceof 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 (request) => { - return { - request, - headers: request.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); - }); - } - var BlobServiceProperties = { - serializedName: "BlobServiceProperties", - xmlName: "StorageServiceProperties", + }; + exports2.BlockLookupList = { + serializedName: "BlockLookupList", + xmlName: "BlockList", type: { name: "Composite", - className: "BlobServiceProperties", + className: "BlockLookupList", modelProperties: { - blobAnalyticsLogging: { - serializedName: "Logging", - xmlName: "Logging", + committed: { + serializedName: "Committed", + xmlName: "Committed", + xmlElementName: "Committed", type: { - name: "Composite", - className: "Logging" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - hourMetrics: { - serializedName: "HourMetrics", - xmlName: "HourMetrics", + uncommitted: { + serializedName: "Uncommitted", + xmlName: "Uncommitted", + xmlElementName: "Uncommitted", type: { - name: "Composite", - className: "Metrics" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - minuteMetrics: { - serializedName: "MinuteMetrics", - xmlName: "MinuteMetrics", + latest: { + serializedName: "Latest", + xmlName: "Latest", + xmlElementName: "Latest", type: { - name: "Composite", - className: "Metrics" + name: "Sequence", + element: { + type: { + name: "String" + } + } } - }, - cors: { - serializedName: "Cors", - xmlName: "Cors", + } + } + } + }; + exports2.BlockList = { + serializedName: "BlockList", + type: { + name: "Composite", + className: "BlockList", + modelProperties: { + committedBlocks: { + serializedName: "CommittedBlocks", + xmlName: "CommittedBlocks", xmlIsWrapped: true, - xmlElementName: "CorsRule", + xmlElementName: "Block", type: { name: "Sequence", element: { type: { name: "Composite", - className: "CorsRule" + className: "Block" } } } }, - defaultServiceVersion: { - serializedName: "DefaultServiceVersion", - xmlName: "DefaultServiceVersion", + uncommittedBlocks: { + serializedName: "UncommittedBlocks", + xmlName: "UncommittedBlocks", + xmlIsWrapped: true, + xmlElementName: "Block", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "Block" + } + } } - }, - deleteRetentionPolicy: { - serializedName: "DeleteRetentionPolicy", - xmlName: "DeleteRetentionPolicy", + } + } + } + }; + exports2.Block = { + serializedName: "Block", + type: { + name: "Composite", + className: "Block", + modelProperties: { + name: { + serializedName: "Name", + required: true, + xmlName: "Name", type: { - name: "Composite", - className: "RetentionPolicy" + name: "String" } }, - staticWebsite: { - serializedName: "StaticWebsite", - xmlName: "StaticWebsite", + size: { + serializedName: "Size", + required: true, + xmlName: "Size", type: { - name: "Composite", - className: "StaticWebsite" + name: "Number" } } } } }; - var Logging = { - serializedName: "Logging", + exports2.PageList = { + serializedName: "PageList", type: { name: "Composite", - className: "Logging", + className: "PageList", modelProperties: { - version: { - serializedName: "Version", - required: true, - xmlName: "Version", + pageRange: { + serializedName: "PageRange", + xmlName: "PageRange", + xmlElementName: "PageRange", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PageRange" + } + } } }, - deleteProperty: { - serializedName: "Delete", - required: true, - xmlName: "Delete", + clearRange: { + serializedName: "ClearRange", + xmlName: "ClearRange", + xmlElementName: "ClearRange", type: { - name: "Boolean" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ClearRange" + } + } } }, - read: { - serializedName: "Read", + 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: "Read", + xmlName: "Start", type: { - name: "Boolean" + name: "Number" } }, - write: { - serializedName: "Write", + end: { + serializedName: "End", required: true, - xmlName: "Write", - type: { - name: "Boolean" - } - }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + xmlName: "End", type: { - name: "Composite", - className: "RetentionPolicy" + name: "Number" } } } } }; - var RetentionPolicy = { - serializedName: "RetentionPolicy", + exports2.ClearRange = { + serializedName: "ClearRange", + xmlName: "ClearRange", type: { name: "Composite", - className: "RetentionPolicy", + className: "ClearRange", modelProperties: { - enabled: { - serializedName: "Enabled", + start: { + serializedName: "Start", required: true, - xmlName: "Enabled", + xmlName: "Start", type: { - name: "Boolean" + name: "Number" } }, - days: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "Days", - xmlName: "Days", + end: { + serializedName: "End", + required: true, + xmlName: "End", type: { name: "Number" } @@ -48806,158 +53701,170 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Metrics = { - serializedName: "Metrics", + exports2.QueryRequest = { + serializedName: "QueryRequest", + xmlName: "QueryRequest", type: { name: "Composite", - className: "Metrics", + className: "QueryRequest", modelProperties: { - version: { - serializedName: "Version", - xmlName: "Version", + queryType: { + serializedName: "QueryType", + required: true, + xmlName: "QueryType", type: { name: "String" } }, - enabled: { - serializedName: "Enabled", + expression: { + serializedName: "Expression", required: true, - xmlName: "Enabled", + xmlName: "Expression", type: { - name: "Boolean" + name: "String" } }, - includeAPIs: { - serializedName: "IncludeAPIs", - xmlName: "IncludeAPIs", + inputSerialization: { + serializedName: "InputSerialization", + xmlName: "InputSerialization", type: { - name: "Boolean" + name: "Composite", + className: "QuerySerialization" } }, - retentionPolicy: { - serializedName: "RetentionPolicy", - xmlName: "RetentionPolicy", + outputSerialization: { + serializedName: "OutputSerialization", + xmlName: "OutputSerialization", type: { name: "Composite", - className: "RetentionPolicy" + className: "QuerySerialization" } } } } }; - var CorsRule = { - serializedName: "CorsRule", + exports2.QuerySerialization = { + serializedName: "QuerySerialization", type: { name: "Composite", - className: "CorsRule", + className: "QuerySerialization", modelProperties: { - allowedOrigins: { - serializedName: "AllowedOrigins", + 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: "AllowedOrigins", + xmlName: "Type", type: { - name: "String" + name: "Enum", + allowedValues: ["delimited", "json", "arrow", "parquet"] } }, - allowedMethods: { - serializedName: "AllowedMethods", - required: true, - xmlName: "AllowedMethods", + delimitedTextConfiguration: { + serializedName: "DelimitedTextConfiguration", + xmlName: "DelimitedTextConfiguration", type: { - name: "String" + name: "Composite", + className: "DelimitedTextConfiguration" } }, - allowedHeaders: { - serializedName: "AllowedHeaders", - required: true, - xmlName: "AllowedHeaders", + jsonTextConfiguration: { + serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", type: { - name: "String" + name: "Composite", + className: "JsonTextConfiguration" } }, - exposedHeaders: { - serializedName: "ExposedHeaders", - required: true, - xmlName: "ExposedHeaders", + arrowConfiguration: { + serializedName: "ArrowConfiguration", + xmlName: "ArrowConfiguration", type: { - name: "String" + name: "Composite", + className: "ArrowConfiguration" } }, - maxAgeInSeconds: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "MaxAgeInSeconds", - required: true, - xmlName: "MaxAgeInSeconds", + parquetTextConfiguration: { + serializedName: "ParquetTextConfiguration", + xmlName: "ParquetTextConfiguration", type: { - name: "Number" + name: "Dictionary", + value: { type: { name: "any" } } } } } } }; - var StaticWebsite = { - serializedName: "StaticWebsite", + exports2.DelimitedTextConfiguration = { + serializedName: "DelimitedTextConfiguration", + xmlName: "DelimitedTextConfiguration", type: { name: "Composite", - className: "StaticWebsite", + className: "DelimitedTextConfiguration", modelProperties: { - enabled: { - serializedName: "Enabled", - required: true, - xmlName: "Enabled", + columnSeparator: { + serializedName: "ColumnSeparator", + xmlName: "ColumnSeparator", type: { - name: "Boolean" + name: "String" } }, - indexDocument: { - serializedName: "IndexDocument", - xmlName: "IndexDocument", + fieldQuote: { + serializedName: "FieldQuote", + xmlName: "FieldQuote", type: { name: "String" } }, - errorDocument404Path: { - serializedName: "ErrorDocument404Path", - xmlName: "ErrorDocument404Path", + recordSeparator: { + serializedName: "RecordSeparator", + xmlName: "RecordSeparator", type: { name: "String" } }, - defaultIndexDocumentPath: { - serializedName: "DefaultIndexDocumentPath", - xmlName: "DefaultIndexDocumentPath", + escapeChar: { + serializedName: "EscapeChar", + xmlName: "EscapeChar", type: { name: "String" } + }, + headersPresent: { + serializedName: "HeadersPresent", + xmlName: "HasHeaders", + type: { + name: "Boolean" + } } } } }; - var StorageError = { - serializedName: "StorageError", + exports2.JsonTextConfiguration = { + serializedName: "JsonTextConfiguration", + xmlName: "JsonTextConfiguration", type: { name: "Composite", - className: "StorageError", + className: "JsonTextConfiguration", modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", - type: { - name: "String" - } - }, - code: { - serializedName: "Code", - xmlName: "Code", - type: { - name: "String" - } - }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", + recordSeparator: { + serializedName: "RecordSeparator", + xmlName: "RecordSeparator", type: { name: "String" } @@ -48965,106 +53872,117 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", + exports2.ArrowConfiguration = { + serializedName: "ArrowConfiguration", + xmlName: "ArrowConfiguration", type: { name: "Composite", - className: "BlobServiceStatistics", + className: "ArrowConfiguration", modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", + schema: { + serializedName: "Schema", + required: true, + xmlName: "Schema", + xmlIsWrapped: true, + xmlElementName: "Field", type: { - name: "Composite", - className: "GeoReplication" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ArrowField" + } + } } } } } }; - var GeoReplication = { - serializedName: "GeoReplication", + exports2.ArrowField = { + serializedName: "ArrowField", + xmlName: "Field", type: { name: "Composite", - className: "GeoReplication", + className: "ArrowField", modelProperties: { - status: { - serializedName: "Status", + type: { + serializedName: "Type", required: true, - xmlName: "Status", + xmlName: "Type", type: { - name: "Enum", - allowedValues: ["live", "bootstrap", "unavailable"] + name: "String" } }, - lastSyncOn: { - serializedName: "LastSyncTime", - required: true, - xmlName: "LastSyncTime", + name: { + serializedName: "Name", + xmlName: "Name", type: { - name: "DateTimeRfc1123" + name: "String" + } + }, + precision: { + serializedName: "Precision", + xmlName: "Precision", + type: { + name: "Number" + } + }, + scale: { + serializedName: "Scale", + xmlName: "Scale", + type: { + name: "Number" } } } } }; - var ListContainersSegmentResponse = { - serializedName: "ListContainersSegmentResponse", - xmlName: "EnumerationResults", + exports2.ServiceSetPropertiesHeaders = { + serializedName: "Service_setPropertiesHeaders", type: { name: "Composite", - className: "ListContainersSegmentResponse", + className: "ServiceSetPropertiesHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", - type: { - name: "Number" - } - }, - containerItems: { - serializedName: "ContainerItems", - required: true, - xmlName: "Containers", - xmlIsWrapped: true, - xmlElementName: "Container", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ContainerItem" - } - } + name: "String" } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + } + } + } + }; + 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" } @@ -49072,184 +53990,165 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { - serializedName: "ContainerItem", - xmlName: "Container", + exports2.ServiceGetPropertiesHeaders = { + serializedName: "Service_getPropertiesHeaders", type: { name: "Composite", - className: "ContainerItem", + className: "ServiceGetPropertiesHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - deleted: { - serializedName: "Deleted", - xmlName: "Deleted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, version: { - serializedName: "Version", - xmlName: "Version", + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", - type: { - name: "Composite", - className: "ContainerProperties" - } - }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } } } } }; - var ContainerProperties = { - serializedName: "ContainerProperties", + exports2.ServiceGetPropertiesExceptionHeaders = { + serializedName: "Service_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "ContainerProperties", + className: "ServiceGetPropertiesExceptionHeaders", modelProperties: { - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", - type: { - name: "DateTimeRfc1123" - } - }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", - type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] - } - }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + } + } + } + }; + 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: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "String" } }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", + } + } + } + }; + 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" } - }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", + } + } + } + }; + 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: "Boolean" + name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var KeyInfo = { - serializedName: "KeyInfo", + exports2.ServiceListContainersSegmentExceptionHeaders = { + serializedName: "Service_listContainersSegmentExceptionHeaders", type: { name: "Composite", - className: "KeyInfo", + className: "ServiceListContainersSegmentExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49257,64 +54156,59 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { - serializedName: "UserDelegationKey", + exports2.ServiceGetUserDelegationKeyHeaders = { + serializedName: "Service_getUserDelegationKeyHeaders", type: { name: "Composite", - className: "UserDelegationKey", + className: "ServiceGetUserDelegationKeyHeaders", modelProperties: { - signedObjectId: { - serializedName: "SignedOid", - required: true, - xmlName: "SignedOid", - type: { - name: "String" - } - }, - signedTenantId: { - serializedName: "SignedTid", - required: true, - xmlName: "SignedTid", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - signedStartsOn: { - serializedName: "SignedStart", - required: true, - xmlName: "SignedStart", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + } + } + } + }; + 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" } @@ -49322,135 +54216,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", + exports2.ServiceGetAccountInfoHeaders = { + serializedName: "Service_getAccountInfoHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "ServiceGetAccountInfoHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - where: { - serializedName: "Where", - required: true, - xmlName: "Where", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - blobs: { - serializedName: "Blobs", - required: true, - xmlName: "Blobs", - xmlIsWrapped: true, - xmlElementName: "Blob", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "FilterBlobItem" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } - } - } - } - }; - var FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", - type: { - name: "Composite", - className: "FilterBlobItem", - modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + }, + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { - name: "String" + name: "Enum", + allowedValues: [ + "Standard_LRS", + "Standard_GRS", + "Standard_RAGRS", + "Standard_ZRS", + "Premium_LRS" + ] } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", + accountKind: { + serializedName: "x-ms-account-kind", + xmlName: "x-ms-account-kind", type: { - name: "String" + name: "Enum", + allowedValues: [ + "Storage", + "BlobStorage", + "StorageV2", + "FileStorage", + "BlockBlobStorage" + ] } }, - tags: { - serializedName: "Tags", - xmlName: "Tags", + isHierarchicalNamespaceEnabled: { + serializedName: "x-ms-is-hns-enabled", + xmlName: "x-ms-is-hns-enabled", type: { - name: "Composite", - className: "BlobTags" + name: "Boolean" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; - var BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", + exports2.ServiceGetAccountInfoExceptionHeaders = { + serializedName: "Service_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "BlobTags", + className: "ServiceGetAccountInfoExceptionHeaders", modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } + name: "String" } } } } }; - var BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", + exports2.ServiceSubmitBatchHeaders = { + serializedName: "Service_submitBatchHeaders", type: { name: "Composite", - className: "BlobTag", + className: "ServiceSubmitBatchHeaders", modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + 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" } @@ -49458,55 +54355,59 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", + exports2.ServiceSubmitBatchExceptionHeaders = { + serializedName: "Service_submitBatchExceptionHeaders", type: { name: "Composite", - className: "SignedIdentifier", + className: "ServiceSubmitBatchExceptionHeaders", modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", - type: { - name: "Composite", - className: "AccessPolicy" - } } } } }; - var AccessPolicy = { - serializedName: "AccessPolicy", + exports2.ServiceFilterBlobsHeaders = { + serializedName: "Service_filterBlobsHeaders", type: { name: "Composite", - className: "AccessPolicy", + className: "ServiceFilterBlobsHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", + 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" } @@ -49514,63 +54415,73 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", + exports2.ServiceFilterBlobsExceptionHeaders = { + serializedName: "Service_filterBlobsExceptionHeaders", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "ServiceFilterBlobsExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + exports2.ContainerCreateHeaders = { + serializedName: "Container_createHeaders", + type: { + name: "Composite", + className: "ContainerCreateHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + 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" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49578,136 +54489,171 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", + exports2.ContainerCreateExceptionHeaders = { + serializedName: "Container_createExceptionHeaders", type: { name: "Composite", - className: "BlobFlatListSegment", + className: "ContainerCreateExceptionHeaders", modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", + exports2.ContainerGetPropertiesHeaders = { + serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", - className: "BlobItemInternal", + className: "ContainerGetPropertiesHeaders", modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + metadata: { + serializedName: "x-ms-meta", + headerCollectionPrefix: "x-ms-meta-", + xmlName: "x-ms-meta", type: { - name: "Composite", - className: "BlobName" + name: "Dictionary", + value: { type: { name: "String" } } } }, - deleted: { - serializedName: "Deleted", - required: true, - xmlName: "Deleted", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Boolean" + name: "String" } }, - snapshot: { - serializedName: "Snapshot", - required: true, - xmlName: "Snapshot", + 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" } }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", + 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: "String" + name: "Enum", + allowedValues: ["container", "blob"] } }, - isCurrentVersion: { - serializedName: "IsCurrentVersion", - xmlName: "IsCurrentVersion", + hasImmutabilityPolicy: { + serializedName: "x-ms-has-immutability-policy", + xmlName: "x-ms-has-immutability-policy", type: { name: "Boolean" } }, - properties: { - serializedName: "Properties", - xmlName: "Properties", + hasLegalHold: { + serializedName: "x-ms-has-legal-hold", + xmlName: "x-ms-has-legal-hold", type: { - name: "Composite", - className: "BlobPropertiesInternal" + name: "Boolean" } }, - metadata: { - serializedName: "Metadata", - xmlName: "Metadata", + defaultEncryptionScope: { + serializedName: "x-ms-default-encryption-scope", + xmlName: "x-ms-default-encryption-scope", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + denyEncryptionScopeOverride: { + serializedName: "x-ms-deny-encryption-scope-override", + xmlName: "x-ms-deny-encryption-scope-override", type: { - name: "Composite", - className: "BlobTags" + name: "Boolean" } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + isImmutableStorageWithVersioningEnabled: { + serializedName: "x-ms-immutable-storage-with-versioning-enabled", + xmlName: "x-ms-immutable-storage-with-versioning-enabled", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Boolean" } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.ContainerGetPropertiesExceptionHeaders = { + serializedName: "Container_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "ContainerGetPropertiesExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -49715,397 +54661,409 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.ContainerDeleteHeaders = { + serializedName: "Container_deleteHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "ContainerDeleteHeaders", modelProperties: { - createdOn: { - serializedName: "Creation-Time", - xmlName: "Creation-Time", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - lastModified: { - serializedName: "Last-Modified", - required: true, - xmlName: "Last-Modified", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - etag: { - serializedName: "Etag", - required: true, - xmlName: "Etag", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentLength: { - serializedName: "Content-Length", - xmlName: "Content-Length", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - contentType: { - serializedName: "Content-Type", - xmlName: "Content-Type", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + } + } + } + }; + 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" } - }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + } + } + } + }; + exports2.ContainerSetMetadataHeaders = { + serializedName: "Container_setMetadataHeaders", + type: { + name: "Composite", + className: "ContainerSetMetadataHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "String" } - }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + } + } + } + }; + exports2.ContainerSetMetadataExceptionHeaders = { + serializedName: "Container_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "String" } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + } + } + } + }; + 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: ["infinite", "fixed"] + allowedValues: ["container", "blob"] } }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "DateTimeRfc1123" } }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", - type: { - name: "DateTimeRfc1123" - } - }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", - type: { - name: "Boolean" - } - }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", - type: { - name: "DateTimeRfc1123" - } - }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + } + } + } + }; + exports2.ContainerGetAccessPolicyExceptionHeaders = { + serializedName: "Container_getAccessPolicyExceptionHeaders", + type: { + name: "Composite", + className: "ContainerGetAccessPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + } + } + } + }; + exports2.ContainerSetAccessPolicyHeaders = { + serializedName: "Container_setAccessPolicyHeaders", + type: { + name: "Composite", + className: "ContainerSetAccessPolicyHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "String" } }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "String" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", + } + } + } + }; + exports2.ContainerSetAccessPolicyExceptionHeaders = { + serializedName: "Container_setAccessPolicyExceptionHeaders", + type: { + name: "Composite", + className: "ContainerSetAccessPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } - }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", + } + } + } + }; + 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: "Boolean" + name: "String" } }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } - }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", + exports2.ContainerRestoreExceptionHeaders = { + serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", - className: "ListBlobsHierarchySegmentResponse", + className: "ContainerRestoreExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + 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" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Number" + name: "DateTimeRfc1123" } }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", - type: { - name: "Composite", - className: "BlobHierarchyListSegment" - } - }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + } + } + } + }; + 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" } @@ -50113,212 +55071,172 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", + exports2.ContainerSubmitBatchHeaders = { + serializedName: "Container_submitBatchHeaders", type: { name: "Composite", - className: "BlobHierarchyListSegment", + className: "ContainerSubmitBatchHeaders", modelProperties: { - blobPrefixes: { - serializedName: "BlobPrefixes", - xmlName: "BlobPrefixes", - xmlElementName: "BlobPrefix", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobPrefix" - } - } + name: "String" } }, - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" } } } } }; - var BlobPrefix = { - serializedName: "BlobPrefix", + exports2.ContainerSubmitBatchExceptionHeaders = { + serializedName: "Container_submitBatchExceptionHeaders", type: { name: "Composite", - className: "BlobPrefix", + className: "ContainerSubmitBatchExceptionHeaders", modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "BlobName" + name: "String" } } } } }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", + exports2.ContainerFilterBlobsHeaders = { + serializedName: "Container_filterBlobsHeaders", type: { name: "Composite", - className: "BlockLookupList", + className: "ContainerFilterBlobsHeaders", modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var BlockList = { - serializedName: "BlockList", + exports2.ContainerFilterBlobsExceptionHeaders = { + serializedName: "Container_filterBlobsExceptionHeaders", type: { name: "Composite", - className: "BlockList", + className: "ContainerFilterBlobsExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } } } } }; - var Block = { - serializedName: "Block", + exports2.ContainerAcquireLeaseHeaders = { + serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", - className: "Block", + className: "ContainerAcquireLeaseHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Number" + 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" } } } } }; - var PageList = { - serializedName: "PageList", + exports2.ContainerAcquireLeaseExceptionHeaders = { + serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "PageList", + className: "ContainerAcquireLeaseExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -50326,300 +55244,308 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", + exports2.ContainerReleaseLeaseHeaders = { + serializedName: "Container_releaseLeaseHeaders", type: { name: "Composite", - className: "PageRange", + className: "ContainerReleaseLeaseHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Number" + name: "String" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Number" + 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" } } } } }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", + exports2.ContainerReleaseLeaseExceptionHeaders = { + serializedName: "Container_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ClearRange", + className: "ContainerReleaseLeaseExceptionHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", + exports2.ContainerRenewLeaseHeaders = { + serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", - className: "QueryRequest", + className: "ContainerRenewLeaseHeaders", modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" + } + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", + type: { + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.ContainerRenewLeaseExceptionHeaders = { + serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "ContainerRenewLeaseExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.ContainerBreakLeaseHeaders = { + serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "ContainerBreakLeaseHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "String" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "Number" } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Dictionary", - value: { type: { name: "any" } } + 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" } } } } }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + exports2.ContainerChangeLeaseHeaders = { + serializedName: "Container_changeLeaseHeaders", type: { name: "Composite", - className: "DelimitedTextConfiguration", + className: "ContainerChangeLeaseHeaders", modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } - } - } - } - }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", - type: { - name: "Composite", - className: "JsonTextConfiguration", - modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + }, + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } } } } }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + exports2.ContainerChangeLeaseExceptionHeaders = { + serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "ArrowConfiguration", + className: "ContainerChangeLeaseExceptionHeaders", modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + name: "String" } } } } }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", + exports2.ContainerListBlobFlatSegmentHeaders = { + serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", - className: "ArrowField", + className: "ContainerListBlobFlatSegmentHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", - type: { - name: "String" - } - }, - name: { - serializedName: "Name", - xmlName: "Name", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", - type: { - name: "Number" - } - }, - scale: { - serializedName: "Scale", - xmlName: "Scale", - type: { - name: "Number" - } - } - } - } - }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", - type: { - name: "Composite", - className: "ServiceSetPropertiesHeaders", - modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -50641,6 +55567,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -50651,11 +55584,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { + serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", + className: "ContainerListBlobFlatSegmentExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50667,12 +55600,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", + exports2.ContainerListBlobHierarchySegmentHeaders = { + serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesHeaders", + 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", @@ -50694,6 +55634,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -50704,11 +55651,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { + serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", + className: "ContainerListBlobHierarchySegmentExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50720,11 +55667,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", + exports2.ContainerGetAccountInfoHeaders = { + serializedName: "Container_getAccountInfoHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsHeaders", + className: "ContainerGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -50754,21 +55701,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { - name: "String" + 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" } } } } }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", + exports2.ContainerGetAccountInfoExceptionHeaders = { + serializedName: "Container_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", + className: "ContainerGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50780,12 +55755,202 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", + exports2.BlobDownloadHeaders = { + serializedName: "Blob_downloadHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentHeaders", + 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", @@ -50807,21 +55972,134 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", + exports2.BlobDownloadExceptionHeaders = { + serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", + className: "BlobDownloadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -50833,167 +56111,153 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", + exports2.BlobGetPropertiesHeaders = { + serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", + className: "BlobGetPropertiesHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + createdOn: { + serializedName: "x-ms-creation-time", + xmlName: "x-ms-creation-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + 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" } }, - date: { - serializedName: "date", - xmlName: "date", + 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" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + copyStatusDescription: { + serializedName: "x-ms-copy-status-description", + xmlName: "x-ms-copy-status-description", type: { name: "String" } - } - } - } - }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } - } - } - } - }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + copyProgress: { + serializedName: "x-ms-copy-progress", + xmlName: "x-ms-copy-progress", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + copySource: { + serializedName: "x-ms-copy-source", + xmlName: "x-ms-copy-source", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "String" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - date: { - serializedName: "date", - xmlName: "date", + isIncrementalCopy: { + serializedName: "x-ms-incremental-copy", + xmlName: "x-ms-incremental-copy", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + 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: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + allowedValues: ["infinite", "fixed"] } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + leaseState: { + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { name: "Enum", allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" + "available", + "leased", + "expired", + "breaking", + "broken" ] } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["locked", "unlocked"] } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "String" + name: "Number" } - } - } - } - }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", - type: { - name: "Composite", - className: "ServiceSubmitBatchHeaders", - modelProperties: { + }, contentType: { serializedName: "content-type", xmlName: "content-type", @@ -51001,59 +56265,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" + } + }, + contentEncoding: { + serializedName: "content-encoding", + xmlName: "content-encoding", type: { name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + contentDisposition: { + serializedName: "content-disposition", + xmlName: "content-disposition", type: { name: "String" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + contentLanguage: { + serializedName: "content-language", + xmlName: "content-language", type: { name: "String" } - } - } - } - }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + cacheControl: { + serializedName: "cache-control", + xmlName: "cache-control", type: { name: "String" } - } - } - } - }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", - type: { - name: "Composite", - className: "ServiceFilterBlobsHeaders", - modelProperties: { + }, + 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", @@ -51082,234 +56342,199 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", - type: { - name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } - } - } - } - }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", - type: { - name: "Composite", - className: "ContainerCreateHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + }, + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "String" + name: "Number" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + isServerEncrypted: { + serializedName: "x-ms-server-encrypted", + xmlName: "x-ms-server-encrypted", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + accessTier: { + serializedName: "x-ms-access-tier", + xmlName: "x-ms-access-tier", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + accessTierInferred: { + serializedName: "x-ms-access-tier-inferred", + xmlName: "x-ms-access-tier-inferred", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", - type: { - name: "Composite", - className: "ContainerCreateExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + archiveStatus: { + serializedName: "x-ms-archive-status", + xmlName: "x-ms-archive-status", type: { name: "String" } - } - } - } - }; - var 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", + accessTierChangedOn: { + serializedName: "x-ms-access-tier-change-time", + xmlName: "x-ms-access-tier-change-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - leaseDuration: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + isCurrentVersion: { + serializedName: "x-ms-is-current-version", + xmlName: "x-ms-is-current-version", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "Boolean" } }, - leaseState: { - serializedName: "x-ms-lease-state", - xmlName: "x-ms-lease-state", + tagCount: { + serializedName: "x-ms-tag-count", + xmlName: "x-ms-tag-count", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "Number" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + expiresOn: { + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "DateTimeRfc1123" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + rehydratePriority: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", type: { - name: "String" + name: "Enum", + allowedValues: ["High", "Standard"] } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + lastAccessed: { + serializedName: "x-ms-last-access-time", + xmlName: "x-ms-last-access-time", type: { - name: "String" + name: "DateTimeRfc1123" } }, - date: { - serializedName: "date", - xmlName: "date", + immutabilityPolicyExpiresOn: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { name: "DateTimeRfc1123" } }, - blobPublicAccess: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { name: "Enum", - allowedValues: ["container", "blob"] + allowedValues: ["Mutable", "Unlocked", "Locked"] } }, - hasImmutabilityPolicy: { - serializedName: "x-ms-has-immutability-policy", - xmlName: "x-ms-has-immutability-policy", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { name: "Boolean" } }, - hasLegalHold: { - serializedName: "x-ms-has-legal-hold", - xmlName: "x-ms-has-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + 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" } }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - denyEncryptionScopeOverride: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" } }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "x-ms-immutable-storage-with-versioning-enabled", - xmlName: "x-ms-immutable-storage-with-versioning-enabled", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, errorCode: { @@ -51322,11 +56547,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "BlobDeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51338,11 +56563,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + className: "BlobUndeleteHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51382,11 +56607,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "BlobUndeleteExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51398,11 +56623,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "BlobSetExpiryHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51445,22 +56670,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51472,20 +56690,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "BlobSetHttpHeadersHeaders", 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", @@ -51500,6 +56710,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51538,11 +56755,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51554,26 +56771,80 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.BlobSetImmutabilityPolicyHeaders = { + serializedName: "Blob_setImmutabilityPolicyHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "BlobSetImmutabilityPolicyHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + 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", @@ -51601,22 +56872,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51628,11 +56892,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.BlobSetLegalHoldHeaders = { + serializedName: "Blob_setLegalHoldHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + className: "BlobSetLegalHoldHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -51662,21 +56926,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "String" + name: "Boolean" } } } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51688,12 +56952,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -51715,6 +56993,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51722,6 +57007,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51732,11 +57038,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "BlobSetMetadataExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51748,15 +57054,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "BlobAcquireLeaseHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + 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" } @@ -51774,15 +57101,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } } } } }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", + className: "BlobAcquireLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51794,12 +57128,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsHeaders", + 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", @@ -51831,11 +57179,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51847,11 +57195,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "BlobRenewLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51905,11 +57253,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51921,11 +57269,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseHeaders", + className: "BlobChangeLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -51955,6 +57303,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51972,11 +57327,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "BlobChangeLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51988,11 +57343,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "BlobBreakLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52008,11 +57363,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { - name: "String" + name: "Number" } }, clientRequestId: { @@ -52046,11 +57401,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52062,12 +57417,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlobCreateSnapshotHeaders", modelProperties: { + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", + type: { + name: "String" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -52082,13 +57444,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52110,21 +57465,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52136,11 +57512,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlobStartCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52156,49 +57532,202 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + 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" + 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" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } } } } }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52206,23 +57735,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerListBlobFlatSegmentHeaders = { - serializedName: "Container_listBlobFlatSegmentHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52261,11 +57797,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52277,19 +57813,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlobSetTierHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", - type: { - name: "String" - } - }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -52311,13 +57840,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52328,11 +57850,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52344,11 +57866,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52416,11 +57938,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52432,11 +57954,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlobQueryHeaders", modelProperties: { lastModified: { serializedName: "last-modified", @@ -52445,13 +57967,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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-", @@ -52461,22 +57976,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52555,7 +58054,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] } }, - copyCompletedOn: { + copyCompletionTime: { serializedName: "x-ms-copy-completion-time", xmlName: "x-ms-copy-completion-time", type: { @@ -52649,20 +58148,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52712,49 +58197,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52772,11 +58214,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadExceptionHeaders = { - serializedName: "Blob_downloadExceptionHeaders", + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadExceptionHeaders", + className: "BlobQueryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52788,209 +58230,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesHeaders = { - serializedName: "Blob_getPropertiesHeaders", + exports2.BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", type: { name: "Composite", - className: "BlobGetPropertiesHeaders", + className: "BlobGetTagsHeaders", 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", @@ -53011,147 +58256,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + }, + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, errorCode: { @@ -53164,11 +58274,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53180,11 +58290,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "BlobDeleteHeaders", + className: "BlobSetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53224,11 +58334,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53240,12 +58350,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + 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", @@ -53267,6 +58398,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -53274,6 +58412,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53284,11 +58443,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53300,11 +58459,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "PageBlobUploadPagesHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53320,6 +58479,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53347,15 +58527,43 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "BlobSetExpiryExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53367,11 +58575,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersHeaders", + className: "PageBlobClearPagesHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53387,6 +58595,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53432,11 +58654,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53448,19 +58670,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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", @@ -53482,29 +58732,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - immutabilityPolicyExpiry: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "DateTimeRfc1123" + name: "Boolean" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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" } } } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53512,16 +58775,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", + 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", @@ -53549,15 +58847,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53569,12 +58874,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldHeaders", + 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", @@ -53603,21 +58929,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53629,11 +58955,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "BlobSetMetadataHeaders", + className: "PageBlobResizeHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53649,6 +58975,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53670,13 +59003,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -53684,27 +59010,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53715,11 +59020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "BlobSetMetadataExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53731,11 +59036,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseHeaders", + className: "PageBlobUpdateSequenceNumberHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53751,11 +59056,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } }, clientRequestId: { @@ -53785,15 +59090,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53805,11 +59117,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseHeaders", + className: "PageBlobCopyIncrementalHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53852,15 +59164,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53872,11 +59206,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "BlobRenewLeaseHeaders", + className: "AppendBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53892,11 +59226,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -53920,21 +59254,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53946,11 +59315,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "BlobChangeLeaseHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53966,6 +59335,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53980,35 +59363,70 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + 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" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } } } } }; - var BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54020,11 +59438,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "BlobBreakLeaseHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54040,18 +59458,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Number" + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, requestId: { @@ -54074,15 +59492,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54090,23 +59550,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotHeaders", + className: "AppendBlobSealHeaders", modelProperties: { - snapshot: { - serializedName: "x-ms-snapshot", - xmlName: "x-ms-snapshot", - type: { - name: "String" - } - }, etag: { serializedName: "etag", xmlName: "etag", @@ -54142,13 +59609,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54156,28 +59616,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", type: { name: "Boolean" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54189,11 +59642,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54209,6 +59662,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54244,19 +59704,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -54269,11 +59735,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54285,11 +59751,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "BlobCopyFromURLHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54305,6 +59771,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54340,35 +59813,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", @@ -54386,11 +59844,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54398,16 +59856,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobAbortCopyFromURLHeaders = { - serializedName: "Blob_abortCopyFromURLHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "BlobAbortCopyFromURLHeaders", + 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", @@ -54436,55 +59915,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var BlobAbortCopyFromURLExceptionHeaders = { - serializedName: "Blob_abortCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobAbortCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var BlobSetTierHeaders = { - serializedName: "Blob_setTierHeaders", - type: { - name: "Composite", - className: "BlobSetTierHeaders", - modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + }, + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } @@ -54499,11 +59953,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierExceptionHeaders = { - serializedName: "Blob_setTierExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "BlobSetTierExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54515,12 +59969,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetAccountInfoHeaders = { - serializedName: "Blob_getAccountInfoHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "BlobGetAccountInfoHeaders", + 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", @@ -54549,50 +60017,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "Boolean" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + name: "String" } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Boolean" + name: "String" } - } - } - } - }; - var BlobGetAccountInfoExceptionHeaders = { - serializedName: "Blob_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "BlobGetAccountInfoExceptionHeaders", - modelProperties: { + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -54603,49 +60048,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQueryHeaders = { - serializedName: "Blob_queryHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobQueryHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } }, - contentType: { - serializedName: "content-type", - xmlName: "content-type", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { name: "String" } }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { - name: "String" + name: "Number" } - }, + } + } + } + }; + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobCommitBlockListHeaders", + modelProperties: { etag: { serializedName: "etag", xmlName: "etag", @@ -54653,127 +60091,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", 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" - ] + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, clientRequestId: { @@ -54797,9 +60133,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } @@ -54811,16 +60147,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -54839,2277 +60168,1249 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "ByteArray" + 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" + } }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "ByteArray" + 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" } } } } }; - var 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.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" } } }; - var 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.comp9 = { + parameterPath: "comp", + mapper: { + defaultValue: "rename", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.sourceContainerName = { + parameterPath: "sourceContainerName", + mapper: { + serializedName: "x-ms-source-container-name", + required: true, + xmlName: "x-ms-source-container-name", + type: { + name: "String" } } }; - var 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.sourceLeaseId = { + parameterPath: ["options", "sourceLeaseId"], + mapper: { + serializedName: "x-ms-source-lease-id", + xmlName: "x-ms-source-lease-id", + type: { + name: "String" } } }; - var 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.comp10 = { + parameterPath: "comp", + mapper: { + defaultValue: "lease", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.action = { + parameterPath: "action", + mapper: { + defaultValue: "acquire", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.duration = { + parameterPath: ["options", "duration"], + mapper: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Number" } } }; - var 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.proposedLeaseId = { + parameterPath: ["options", "proposedLeaseId"], + mapper: { + serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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.action1 = { + parameterPath: "action", + mapper: { + defaultValue: "release", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.proposedLeaseId1 = { + parameterPath: "proposedLeaseId", + mapper: { + serializedName: "x-ms-proposed-lease-id", + required: true, + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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", + exports2.include1 = { + parameterPath: ["options", "include"], + mapper: { + serializedName: "include", + xmlName: "include", + xmlElementName: "ListBlobsIncludeItem", + type: { + name: "Sequence", + element: { type: { - name: "String" + 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" + } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var 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.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], + mapper: { + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", + type: { + name: "Boolean" } } }; - var 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.rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], + mapper: { + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", + type: { + name: "Boolean" } } }; - var 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.encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], + mapper: { + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", + type: { + name: "String" } } }; - var 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.encryptionKeySha256 = { + parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], + mapper: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.blobDeleteType = { + parameterPath: ["options", "blobDeleteType"], + mapper: { + serializedName: "deletetype", + xmlName: "deletetype", + type: { + name: "String" } } }; - var 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.comp11 = { + parameterPath: "comp", + mapper: { + defaultValue: "expiry", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.expiryOptions = { + parameterPath: "expiryOptions", + mapper: { + serializedName: "x-ms-expiry-option", + required: true, + xmlName: "x-ms-expiry-option", + type: { + name: "String" } } }; - var 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.expiresOn = { + parameterPath: ["options", "expiresOn"], + mapper: { + serializedName: "x-ms-expiry-time", + xmlName: "x-ms-expiry-time", + type: { + name: "String" } } }; - var 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.blobCacheControl = { + parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], + mapper: { + serializedName: "x-ms-blob-cache-control", + xmlName: "x-ms-blob-cache-control", + type: { + name: "String" } } }; - var 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.blobContentType = { + parameterPath: ["options", "blobHttpHeaders", "blobContentType"], + mapper: { + serializedName: "x-ms-blob-content-type", + xmlName: "x-ms-blob-content-type", + type: { + name: "String" } } }; - var 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.blobContentMD5 = { + parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], + mapper: { + serializedName: "x-ms-blob-content-md5", + xmlName: "x-ms-blob-content-md5", + type: { + name: "ByteArray" } } }; - var 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.blobContentEncoding = { + parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], + mapper: { + serializedName: "x-ms-blob-content-encoding", + xmlName: "x-ms-blob-content-encoding", + type: { + name: "String" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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"] } } }; - var 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.comp13 = { + parameterPath: "comp", + mapper: { + defaultValue: "legalhold", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.legalHold = { + parameterPath: "legalHold", + mapper: { + serializedName: "x-ms-legal-hold", + required: true, + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var 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.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] } } }; - var 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.sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfMatch = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], + mapper: { + serializedName: "x-ms-source-if-match", + xmlName: "x-ms-source-if-match", + type: { + name: "String" } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var 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.sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], + mapper: { + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", + type: { + name: "String" } } }; - var 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.copySource = { + parameterPath: "copySource", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.blobTagsString = { + parameterPath: ["options", "blobTagsString"], + mapper: { + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", + type: { + name: "String" } } }; - var BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.sealBlob = { + parameterPath: ["options", "sealBlob"], + mapper: { + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", + type: { + name: "Boolean" } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], + exports2.legalHold1 = { + parameterPath: ["options", "legalHold"], mapper: { - defaultValue: "application/xml", + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" + } + } + }; + exports2.xMsRequiresSync = { + parameterPath: "xMsRequiresSync", + mapper: { + defaultValue: "true", isConstant: true, - serializedName: "Content-Type", + serializedName: "x-ms-requires-sync", type: { name: "String" } } }; - var blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + exports2.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], + mapper: { + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", + type: { + name: "ByteArray" + } + } }; - var accept = { - parameterPath: "accept", + exports2.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", type: { name: "String" } } }; - var url2 = { - parameterPath: "url", + exports2.copySourceTags = { + parameterPath: ["options", "copySourceTags"], mapper: { - serializedName: "url", - required: true, - xmlName: "url", + serializedName: "x-ms-copy-source-tag-option", + xmlName: "x-ms-copy-source-tag-option", type: { - name: "String" + name: "Enum", + allowedValues: ["REPLACE", "COPY"] } - }, - skipEncoding: true + } }; - var restype = { - parameterPath: "restype", + exports2.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", type: { name: "String" } } }; - var comp = { + exports2.comp15 = { parameterPath: "comp", mapper: { - defaultValue: "properties", + defaultValue: "copy", isConstant: true, serializedName: "comp", type: { @@ -57117,55 +61418,75 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], + exports2.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", mapper: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "timeout", - xmlName: "timeout", + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", type: { - name: "Number" + name: "String" } } }; - var version = { - parameterPath: "version", + exports2.copyId = { + parameterPath: "copyId", mapper: { - defaultValue: "2024-11-04", - isConstant: true, - serializedName: "x-ms-version", + serializedName: "copyid", + required: true, + xmlName: "copyid", type: { name: "String" } } }; - var requestId = { - parameterPath: ["options", "requestId"], + exports2.comp16 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + defaultValue: "tier", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - var accept1 = { - parameterPath: "accept", + exports2.tier1 = { + parameterPath: "tier", mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", + serializedName: "x-ms-access-tier", + required: true, + xmlName: "x-ms-access-tier", type: { - name: "String" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive", + "Cold" + ] } } }; - var comp1 = { + exports2.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { parameterPath: "comp", mapper: { - defaultValue: "stats", + defaultValue: "query", isConstant: true, serializedName: "comp", type: { @@ -57173,10 +61494,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp2 = { + exports2.comp18 = { parameterPath: "comp", mapper: { - defaultValue: "list", + defaultValue: "tags", isConstant: true, serializedName: "comp", type: { @@ -57184,84 +61505,75 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var prefix = { - parameterPath: ["options", "prefix"], + exports2.tags = { + parameterPath: ["options", "tags"], + mapper: mappers_js_1.BlobTags + }; + exports2.transactionalContentMD5 = { + parameterPath: ["options", "transactionalContentMD5"], mapper: { - serializedName: "prefix", - xmlName: "prefix", + serializedName: "Content-MD5", + xmlName: "Content-MD5", type: { - name: "String" + name: "ByteArray" } } }; - var marker = { - parameterPath: ["options", "marker"], + exports2.transactionalContentCrc64 = { + parameterPath: ["options", "transactionalContentCrc64"], mapper: { - serializedName: "marker", - xmlName: "marker", + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } } }; - var maxPageSize = { - parameterPath: ["options", "maxPageSize"], + exports2.blobType = { + parameterPath: "blobType", mapper: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "maxresults", - xmlName: "maxresults", + defaultValue: "PageBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { - name: "Number" + name: "String" } } }; - var include = { - parameterPath: ["options", "include"], + exports2.blobContentLength = { + parameterPath: "blobContentLength", mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", + serializedName: "x-ms-blob-content-length", + required: true, + xmlName: "x-ms-blob-content-length", type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + name: "Number" } - }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + } }; - var comp3 = { - parameterPath: "comp", + exports2.blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", + defaultValue: 0, + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } } }; - var restype1 = { - parameterPath: "restype", + exports2.contentType1 = { + parameterPath: ["options", "contentType"], mapper: { - defaultValue: "account", + defaultValue: "application/octet-stream", isConstant: true, - serializedName: "restype", + serializedName: "Content-Type", type: { name: "String" } } }; - var body = { + exports2.body1 = { parameterPath: "body", mapper: { serializedName: "body", @@ -57272,10 +61584,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp4 = { + exports2.accept2 = { + parameterPath: "accept", + mapper: { + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" + } + } + }; + exports2.comp19 = { parameterPath: "comp", mapper: { - defaultValue: "batch", + defaultValue: "page", isConstant: true, serializedName: "comp", type: { @@ -57283,32 +61606,117 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var contentLength = { - parameterPath: "contentLength", + exports2.pageWrite = { + parameterPath: "pageWrite", mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", + 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" } } }; - var multipartContentType = { - parameterPath: "multipartContentType", + 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: "Content-Type", + serializedName: "x-ms-range", required: true, - xmlName: "Content-Type", + xmlName: "x-ms-range", type: { name: "String" } } }; - var comp5 = { + exports2.comp20 = { parameterPath: "comp", mapper: { - defaultValue: "blobs", + defaultValue: "pagelist", isConstant: true, serializedName: "comp", type: { @@ -57316,112 +61724,109 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var where = { - parameterPath: ["options", "where"], + exports2.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], mapper: { - serializedName: "where", - xmlName: "where", + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", type: { name: "String" } } }; - var restype2 = { - parameterPath: "restype", + exports2.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", type: { name: "String" } } }; - var metadata = { - parameterPath: ["options", "metadata"], + exports2.sequenceNumberAction = { + parameterPath: "sequenceNumberAction", mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", + serializedName: "x-ms-sequence-number-action", + required: true, + xmlName: "x-ms-sequence-number-action", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Enum", + allowedValues: ["max", "update", "increment"] } } }; - var access = { - parameterPath: ["options", "access"], + exports2.comp21 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "String" } } }; - var defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], + exports2.blobType1 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], + exports2.comp22 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", + defaultValue: "appendblock", + isConstant: true, + serializedName: "comp", type: { - name: "Boolean" + name: "String" } } }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], + exports2.maxSize = { + parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + serializedName: "x-ms-blob-condition-maxsize", + xmlName: "x-ms-blob-condition-maxsize", type: { - name: "String" + name: "Number" } } }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], + exports2.appendPosition = { + parameterPath: [ + "options", + "appendPositionAccessConditions", + "appendPosition" + ], mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", type: { - name: "DateTimeRfc1123" + name: "Number" } } }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], + exports2.sourceRange1 = { + parameterPath: ["options", "sourceRange"], mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - var comp6 = { + exports2.comp23 = { parameterPath: "comp", mapper: { - defaultValue: "metadata", + defaultValue: "seal", isConstant: true, serializedName: "comp", type: { @@ -57429,39 +61834,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var comp7 = { - parameterPath: "comp", + exports2.blobType2 = { + parameterPath: "blobType", mapper: { - defaultValue: "acl", + defaultValue: "BlockBlob", isConstant: true, - serializedName: "comp", + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], + exports2.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } + name: "Boolean" } } }; - var comp8 = { + exports2.comp24 = { parameterPath: "comp", mapper: { - defaultValue: "undelete", + defaultValue: "block", isConstant: true, serializedName: "comp", type: { @@ -57469,30 +61866,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], + exports2.blockId = { + parameterPath: "blockId", mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", + serializedName: "blockid", + required: true, + xmlName: "blockid", type: { name: "String" } } }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } - } + exports2.blocks = { + parameterPath: "blocks", + mapper: mappers_js_1.BlockLookupList }; - var comp9 = { + exports2.comp25 = { parameterPath: "comp", mapper: { - defaultValue: "rename", + defaultValue: "blocklist", isConstant: true, serializedName: "comp", type: { @@ -57500,11168 +61892,13348 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var sourceContainerName = { - parameterPath: "sourceContainerName", + exports2.listType = { + parameterPath: "listType", mapper: { - serializedName: "x-ms-source-container-name", + defaultValue: "committed", + serializedName: "blocklisttype", required: true, - xmlName: "x-ms-source-container-name", + xmlName: "blocklisttype", type: { - name: "String" + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; - var sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" - } + } +}); + +// 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); } }; - var comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" + 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 proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" + 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); } - }; - var action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * [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); } - }; - var action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * [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); } - }; - var breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" - } + /** + * [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); } - }; - var action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" - } + /** + * [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); } - }; - var proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var 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" - ] - } - } + 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 } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" + 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 ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" + 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 ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" + 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 deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] + 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 blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" + 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 comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" + 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 expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" + 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; } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" - } + /** + * 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); } - }; - var immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] - } + /** + * 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); } - }; - var comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } + /** + * [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); } - }; - var comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var 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" - ] - } + /** + * [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); } - }; - var rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] - } + /** + * [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); } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } + /** + * 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); } - }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } + /** + * 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); } - }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" - ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * 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); } }; - var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" + 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 sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" + 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 copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" + 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 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"] + 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 comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" + 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 copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" + 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 comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var setLegalHoldOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.BlobSetLegalHoldHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobSetLegalHoldExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + var acquireLeaseOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.BlobAcquireLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobAcquireLeaseExceptionHeaders } - } - }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags + }, + 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 transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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 transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" + 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 blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + 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 blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + 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 contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + 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 body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + 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 accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + var getAccountInfoOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: Mappers.BlobGetAccountInfoHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobGetAccountInfoExceptionHeaders } - } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" + }, + queryParameters: [ + Parameters.comp, + Parameters.timeoutInSeconds, + Parameters.restype1 ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" - } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" + urlParameters: [Parameters.url], + headerParameters: [ + Parameters.version, + Parameters.requestId, + Parameters.accept1 ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" - } - } + isXML: true, + serializer: xmlSerializer }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" + 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 pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + 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 sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + 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 }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" - } + } +}); + +// 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; } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" - } + /** + * 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); } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" - } + /** + * 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); } - }; - var 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"] - } + /** + * 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); } - }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } + /** + * 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); } - }; - var comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } }; - var maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + 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 } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" + }, + 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 ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + 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 comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + 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 comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + var resizeOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.PageBlobResizeHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobResizeExceptionHeaders } - } - }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList + }, + 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 comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + 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 }; - var ServiceImpl = class { + } +}); + +// 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 Service class. + * Initialize a new instance of the class AppendBlob 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. + * The Create Append Blob operation creates a new append blob. + * @param contentLength The length of the request. * @param options The options parameters. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); + create(contentLength, options) { + return this.client.sendOperationRequest({ contentLength, options }, createOperationSpec); } /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. + * 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. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); + appendBlock(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, appendBlockOperationSpec); } /** - * 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. + * 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. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); + appendBlockFromUrl(sourceUrl, contentLength, options) { + return this.client.sendOperationRequest({ sourceUrl, contentLength, options }, appendBlockFromUrlOperationSpec); } /** - * The List Containers Segment operation returns a list of the containers under the specified account + * 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. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); + 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; } /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * @param keyInfo Key information + * 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. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); + upload(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, uploadOperationSpec); } /** - * Returns the sku name and account kind + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); + putBlobFromUrl(contentLength, copySource, options) { + return this.client.sendOperationRequest({ contentLength, copySource, options }, putBlobFromUrlOperationSpec); } /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * 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 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(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); + stageBlock(blockId, contentLength, body, options) { + return this.client.sendOperationRequest({ blockId, contentLength, body, options }, stageBlockOperationSpec); } /** - * 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. + * 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. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); + 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); } }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( + exports2.BlockBlobImpl = BlockBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var setPropertiesOperationSpec = { - path: "/", + var uploadOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders + 201: { + headersMapper: Mappers.BlockBlobUploadHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobUploadExceptionHeaders } }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url2], + requestBody: Parameters.body1, + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId + 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: "xml", - serializer: xmlSerializer$5 + mediaType: "binary", + serializer: xmlSerializer }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", + var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders + 201: { + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url2], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", + var stageBlockOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockExceptionHeaders } }, + requestBody: Parameters.body1, queryParameters: [ - restype, - timeoutInSeconds, - comp1 + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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, - serializer: xmlSerializer$5 + contentType: "application/xml; charset=utf-8", + mediaType: "binary", + serializer: xmlSerializer }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", + var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", + var commitBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders + 201: { + headersMapper: Mappers.BlockBlobCommitBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobCommitBlockListExceptionHeaders } }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url2], + requestBody: Parameters.blocks, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp25], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId + 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$5 + serializer: xmlSerializer }; - var getAccountInfoOperationSpec$2 = { - path: "/", + var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - headersMapper: ServiceGetAccountInfoHeaders + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } }, queryParameters: [ - comp, - timeoutInSeconds, - restype1 + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.comp25, + Parameters.listType ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" + } +}); + +// 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 defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + 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, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url2); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url2); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + 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"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url2], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (this.move) { + permissions.push("m"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + 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(""); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * Azure Storage account name; readonly. */ - constructor(client) { - this.client = client; - } + accountName; /** - * 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. + * Azure Storage user delegation key; readonly. */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); + 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 { /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * The storage API version. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + version; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + protocol; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); - } + startsOn; /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); - } + expiresOn; /** - * 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. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); - } + permissions; /** - * 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. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); - } + services; /** - * [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. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); - } + resourceTypes; /** - * [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. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); - } + identifier; /** - * [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. + * Optional. Encryption scope to use when sending requests authorized with this SAS URI. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); - } + encryptionScope; /** - * [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. + * 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 */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); - } + resource; /** - * [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. + * The signature for the SAS token. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); - } + signature; /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container - * @param options The options parameters. + * Value for cache-control header in Blob/File Service SAS. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); - } + cacheControl; /** - * [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. + * Value for content-disposition header in Blob/File Service SAS. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); - } + contentDisposition; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Value for content-encoding header in Blob/File Service SAS. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); - } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders + 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 + }; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + 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; + } } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + } + /** + * 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; + } } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + 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; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 + } }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + 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); + } } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url2], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + } + 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); + } } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + } + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + } + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + } + 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(); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var BlobImpl = class { - /** - * 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); + 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * 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); + 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(); + } } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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, + timestamp2, + 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."); } - /** - * 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(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = 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, + timestamp2, + 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}`); } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); + 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'."); } - /** - * 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); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - /** - * 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); + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - /** - * 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(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - /** - * 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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - /** - * [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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + 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."); } - /** - * [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); + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - /** - * 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); + if (version < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + 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; /** - * 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. + * Gets the lease Id. + * + * @readonly */ - copyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + get leaseId() { + return this._leaseId; } /** - * 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. + * Gets the url. + * + * @readonly */ - abortCopyFromURL(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + get url() { + return this._url; } /** - * 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. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + 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; } /** - * Returns the sku name and account kind - * @param options The options parameters. + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + 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 + })); + }); } /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * 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. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); + 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; + }); } /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * 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. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); + 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 + })); + }); } /** - * 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); - } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders + * 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."); } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 + 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)); + }); + } }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders + 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; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + if (!this.push(data)) { + this.source.pause(); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + }; + 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; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + 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}`)); } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 + }; + _destroy(error3, callback) { + this.removeSourceEventHandlers(); + this.source.destroy(); + callback(error3 === null ? void 0 : error3); + } }; - var PageBlobImpl = class { + 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 { /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - constructor(client) { - this.client = client; + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * 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. + * Returns if it was previously specified + * for the file. + * + * @readonly */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * 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. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * 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. + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } /** - * 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. + * 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 */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * 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. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + 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; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - constructor(client) { - this.client = client; + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get leaseState() { + return this.originalResponse.leaseState; } /** - * 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. + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + get leaseStatus() { + return this.originalResponse.leaseStatus; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * A UTC date/time value generated by the service that + * indicates the time at which the response was initiated. + * + * @readonly */ - constructor(client) { - this.client = client; + get date() { + return this.originalResponse.date; } /** - * 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. + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } /** - * 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. + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get etag() { + return this.originalResponse.etag; } /** - * 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. + * The number of tags associated with the blob + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get tagCount() { + return this.originalResponse.tagCount; } /** - * 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. + * The error code. + * + * @readonly */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get errorCode() { + return this.originalResponse.errorCode; } /** - * 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. + * 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 */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * 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. + * 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 */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * 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 */ - constructor(url3, options) { - var _a, _b; - if (url3 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url3; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get lastModified() { + return this.originalResponse.lastModified; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * 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; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * Returns the date and time the blob was created. + * + * @readonly */ - constructor(url3, pipeline) { - this.url = escapeURLPath(url3); - this.accountName = getAccountNameFromUrl(url3); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get createdOn() { + return this.originalResponse.createdOn; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * A name-value pair + * to associate with a file storage object. + * + * @readonly + */ + get metadata() { + return this.originalResponse.metadata; } /** - * 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. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * - * @param permissions - + * @readonly */ - 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; + 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; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * If this blob has been sealed. * - * @param permissionLike - + * @readonly */ - 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; + get isSealed() { + return this.originalResponse.isSealed; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } /** - * 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. + * Indicates if a legal hold is present on the blob. * - * @param permissions - + * @readonly */ - 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; + get legalHold() { + return this.originalResponse.legalHold; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * The response body as a browser Blob. + * Always undefined in node.js. * - * @param permissionLike - + * @readonly */ - 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; + get contentAsBlob() { + return this.originalResponse.blobBody; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * The response body as a node.js Readable stream. + * Always undefined in the browser. * - * The order of the characters should be as specified here to ensure correctness. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * It will automatically retry when internal read stream unexpected ends. * + * @readonly */ - 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(""); + get readableStreamBody() { + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * The HTTP response. */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get _response() { + return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** - * Generates a hash signature for an HTTP request or for a SAS. + * Creates an instance of BlobDownloadResponse. * - * @param stringToSign - + * @param originalResponse - + * @param getter - + * @param offset - + * @param count - + * @param options - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + constructor(originalResponse, getter, offset, count, options = {}) { + this.originalResponse = originalResponse; + this.blobDownloadStream = new RetriableReadableStream_js_1.RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); } }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { + 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 { /** - * Optional. IP range allowed for this SAS. + * Reads a fixed number of bytes from the stream. * - * @readonly + * @param stream - + * @param length - + * @param options - */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } + 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; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * Reads a single byte from the stream. * + * @param stream - + * @param options - */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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; + 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 queries.join("&"); + return zigZagEncoded >> 1 ^ -(zigZagEncoded & 1); } - /** - * 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; + 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."); } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); + } + 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 }); } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); + static async readString(stream2, options = {}) { + const u8arr = await _AvroParser.readBytes(stream2, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); + static async readMapPair(stream2, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream2, options); + const value = await readItemMethod(stream2, options); + return { key, value }; } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); + static async readMap(stream2, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } + return dict; } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); + 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; } - if (version2 >= "2015-04-05") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); + }; + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - throw new RangeError("'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key."); + return _AvroType.fromObjectSchema(schema2); } } - 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."); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); + } } - let resource = "c"; - if (blobSASSignatureValues.blobName) { - resource = "b"; + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { + } + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + // 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"); } } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + // 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]; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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 - }; + }; + } +}); + +// 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; } - 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."); + } +}); + +// 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; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + _objectIndex; + get objectIndex() { + return this._objectIndex; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + _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 schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + 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--; + } } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + 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; } } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + constructor(readable) { + super(); + this._readable = readable; + this._position = 0; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + get position() { + return this._position; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + 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 { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + return new Promise((resolve6, 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(); + resolve6(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); + } + }); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "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'."); + }; + 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 }); } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + _read() { + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + }; + 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; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + /** + * Returns if it was previously specified + * for the file. + * + * @readonly + */ + get cacheControl() { + return this.originalResponse.cacheControl; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + /** + * 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; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + /** + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly + */ + get contentEncoding() { + return this.originalResponse.contentEncoding; } - if (version2 < "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."); + /** + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly + */ + get contentLanguage() { + return this.originalResponse.contentLanguage; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + /** + * 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; } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + /** + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly + */ + get blobType() { + return this.originalResponse.blobType; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + /** + * The number of bytes present in the + * response body. + * + * @readonly + */ + get contentLength() { + return this.originalResponse.contentLength; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; - } - var BlobLeaseClient = class { /** - * Gets the lease Id. + * 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 leaseId() { - return this._leaseId; + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * Gets the url. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. * * @readonly */ - get url() { - return this._url; + get contentRange() { + return this.originalResponse.contentRange; } /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + get contentType() { + return this.originalResponse.contentType; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * 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. * - * @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. + * @readonly */ - async acquireLease(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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 tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); - }); + get copyCompletedOn() { + return void 0; } /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * String identifier for the last attempted Copy + * File operation where this file was the destination file. * - * @param proposedLeaseId - the proposed new lease Id. - * @param options - option to configure lease management operations. - * @returns Response data for change lease operation. + * @readonly */ - async changeLease(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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 tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; - }); + get copyId() { + return this.originalResponse.copyId; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * 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. * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. + * @readonly */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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 tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); + get copyProgress() { + return this.originalResponse.copyProgress; } /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * 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. * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. + * @readonly */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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 tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }); - }); + get copySource() { + return this.originalResponse.copySource; } /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' * - * @param breakPeriod - Break period - * @param options - Optional options to configure lease management operations. - * @returns Response data for break lease operation. + * @readonly */ - async breakLease(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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 tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); + get copyStatus() { + return this.originalResponse.copyStatus; } - }; - var RetriableReadableStream = class extends stream2.Readable { /** - * Creates an instance of RetriableReadableStream. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. * - * @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 - + * @readonly */ - constructor(source, getter, offset, count, options = {}) { - super({ highWaterMark: options.highWaterMark }); - this.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - 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(); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } - _read() { - this.source.resume(); + /** + * 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; } - 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); + /** + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly + */ + get leaseState() { + return this.originalResponse.leaseState; } - 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); + /** + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly + */ + get leaseStatus() { + return this.originalResponse.leaseStatus; } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + /** + * 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; } - }; - var BlobDownloadResponse = class { /** - * Indicates that the service supports - * requests for partial file content. + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. * * @readonly */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } /** - * Returns if it was previously specified - * for the file. + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. * * @readonly */ - get cacheControl() { - return this.originalResponse.cacheControl; + get etag() { + return this.originalResponse.etag; } /** - * Returns the value that was specified - * for the 'x-ms-content-disposition' header and specifies how to process the - * response. + * The error code. * * @readonly */ - get contentDisposition() { - return this.originalResponse.contentDisposition; + get errorCode() { + return this.originalResponse.errorCode; } /** - * Returns the value that was specified - * for the Content-Encoding request header. + * 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 contentEncoding() { - return this.originalResponse.contentEncoding; + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * Returns the value that was specified - * for the Content-Language request header. + * 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 contentLanguage() { - return this.originalResponse.contentLanguage; + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. + * 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 blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; + get lastModified() { + return this.originalResponse.lastModified; } /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * A name-value pair + * to associate with a file storage object. * * @readonly */ - get blobType() { - return this.originalResponse.blobType; + get metadata() { + return this.originalResponse.metadata; } /** - * The number of bytes present in the - * response body. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * * @readonly */ - get contentLength() { - return this.originalResponse.contentLength; + get requestId() { + return this.originalResponse.requestId; } /** - * 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. + * 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 contentMD5() { - return this.originalResponse.contentMD5; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * Indicates the range of bytes returned if - * the client requested a subset of the file by setting the Range request - * header. + * Indicates the version of the File service used + * to execute the request. * * @readonly */ - get contentRange() { - return this.originalResponse.contentRange; + get version() { + return this.originalResponse.version; } /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * 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 contentType() { - return this.originalResponse.contentType; + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } /** - * 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 + * 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 copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + get contentCrc64() { + return this.originalResponse.contentCrc64; } /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * The response body as a browser Blob. + * Always undefined in node.js. * * @readonly */ - get copyId() { - return this.originalResponse.copyId; + get blobBody() { + return void 0; } /** - * 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. + * 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 copyProgress() { - return this.originalResponse.copyProgress; + get readableStreamBody() { + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** - * 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 + * The HTTP response. */ - get copySource() { - return this.originalResponse.copySource; + get _response() { + return this.originalResponse._response; } + originalResponse; + blobDownloadStream; /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' + * Creates an instance of BlobQueryResponse. * - * @readonly + * @param originalResponse - + * @param options - */ - get copyStatus() { - return this.originalResponse.copyStatus; + 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, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return void 0; + } + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : 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 _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return void 0; + } } - /** - * 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; + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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}`); } - /** - * 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; + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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 = () => ({ /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly + * 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. */ - get leaseState() { - return this.originalResponse.leaseState; + 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, 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, + 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; } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly - */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * 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; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. - * - * @readonly + * Serializes the Poller operation. */ - get etag() { - return this.originalResponse.etag; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; + }; + 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); } - /** - * The error code. - * - * @readonly - */ - get errorCode() { - return this.originalResponse.errorCode; + }; + 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 { /** - * 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). + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @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. + * 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. * - * @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. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @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. + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @readonly - */ - get lastAccessed() { - return this.originalResponse.lastAccessed; - } - /** - * Returns the date and time the blob was created. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @readonly - */ - get createdOn() { - return this.originalResponse.createdOn; - } - /** - * A name-value pair - * to associate with a file storage object. + * // You can assign more local properties here. + * } + * } + * ``` * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * 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. * - * @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. + * 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: * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the Blob service used - * to execute the request. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get version() { - return this.originalResponse.version; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve6, reject) => { + this.resolve = resolve6; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * Indicates the versionId of the downloaded blob version. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get versionId() { - return this.originalResponse.versionId; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * Indicates whether version of this blob is a current version. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly + * 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. */ - get isCurrentVersion() { - return this.originalResponse.isCurrentVersion; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * 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. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @readonly + * 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. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * 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) + * Invokes the underlying operation's cancel method. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Object Replication Policy Id of the destination blob. + * 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. * - * @readonly - */ - get objectReplicationDestinationPolicyId() { - return this.originalResponse.objectReplicationDestinationPolicyId; - } - /** - * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get objectReplicationSourceProperties() { - return this.originalResponse.objectReplicationSourceProperties; + 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()); + } } /** - * If this blob has been sealed. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get isSealed() { - return this.originalResponse.isSealed; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get immutabilityPolicyExpiresOn() { - return this.originalResponse.immutabilityPolicyExpiresOn; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * Indicates immutability policy mode. - * - * @readonly + * Returns true if the poller has finished polling. */ - get immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * Indicates if a legal hold is present on the blob. - * - * @readonly + * Stops the poller from continuing to poll. */ - get legalHold() { - return this.originalResponse.legalHold; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * The response body as a browser Blob. - * Always undefined in node.js. - * - * @readonly + * Returns true if the poller is stopped. */ - get contentAsBlob() { - return this.originalResponse.blobBody; + isStopped() { + return this.stopped; } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * Attempts to cancel the underlying operation. * - * It will automatically retry when internal read stream unexpected ends. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly - */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - /** - * Creates an instance of BlobDownloadResponse. + * If it's called again before it finishes, it will throw an error. * - * @param originalResponse - - * @param getter - - * @param offset - - * @param count - - * @param options - + * @param options - Optional properties passed to the operation's update method. */ - constructor(originalResponse, getter, offset, count, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + 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; } - }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - var AvroParser = class _AvroParser { /** - * Reads a fixed number of bytes from the stream. + * Returns the state of the operation. * - * @param stream - - * @param length - - * @param options - + * 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. */ - static async readFixedBytes(stream3, length, options = {}) { - const bytes = await stream3.read(length, { abortSignal: options.abortSignal }); - if (bytes.length !== length) { - throw new Error("Hit stream end."); - } - return bytes; + getOperationState() { + return this.operation.state; } /** - * Reads a single byte from the stream. - * - * @param stream - - * @param options - + * 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. */ - static async readByte(stream3, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream3, 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(stream3, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await _AvroParser.readByte(stream3, 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(stream3, 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(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readInt(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readNull() { - return null; - } - static async readBoolean(stream3, options = {}) { - const b = await _AvroParser.readByte(stream3, options); - if (b === 1) { - return true; - } else if (b === 0) { - return false; - } else { - throw new Error("Byte was not a boolean."); - } - } - static async readFloat(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); - } - static async readDouble(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); - } - static async readBytes(stream3, options = {}) { - const size = await _AvroParser.readLong(stream3, options); - if (size < 0) { - throw new Error("Bytes size was negative."); - } - return stream3.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream3, options = {}) { - const u8arr = await _AvroParser.readBytes(stream3, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); - } - static async readMapPair(stream3, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream3, options); - const value = await readItemMethod(stream3, options); - return { key, value }; - } - static async readMap(stream3, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream3, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; - } - return dict; - } - static async readArray(stream3, readItemMethod, options = {}) { - const items = []; - for (let count = await _AvroParser.readLong(stream3, options); count !== 0; count = await _AvroParser.readLong(stream3, options)) { - if (count < 0) { - await _AvroParser.readLong(stream3, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream3, options); - items.push(item); - } - } - return items; + getResult() { + const state = this.operation.state; + return state.result; } - }; - 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. + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - static fromSchema(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); - } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); - } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { - } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); - } - } - }; - var AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream3, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream3, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream3, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream3, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream3, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream3, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream3, options); - default: - throw new Error("Unknown Avro Primitive"); - } - } - }; - var AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, options = {}) { - const value = await AvroParser.readInt(stream3, options); - return this._symbols[value]; - } - }; - var AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; - } - async read(stream3, options = {}) { - const typeIndex = await AvroParser.readInt(stream3, options); - return this._types[typeIndex].read(stream3, options); - } - }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - const readItemMethod = (s, opts) => { - return this._itemType.read(s, opts); - }; - return AvroParser.readMap(stream3, readItemMethod, options); - } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, 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(stream3, options); - } - } - return record; + toString() { + return this.operation.toString(); } }; - 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; - } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; - } - get objectIndex() { - return this._objectIndex; + 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); } - 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; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve6) => setTimeout(() => resolve6(), this.config.intervalInMs)); } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); - } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; + }; + 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; } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, + blobClient, + copySource, + startCopyFromURLOptions }); - await 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--; - } + super(operation); + if (typeof onProgress === "function") { + this.onProgress(onProgress); } + this.intervalInMs = intervalInMs; } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; - } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); - } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } - } - yield yield tslib.__await(result); - } - }); + delay() { + return (0, core_util_1.delay)(this.intervalInMs); } }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); - } - return data; - } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; + var cancel = async function cancel2(options = {}) { + const state = this.state; + const { copyId } = state; + if (state.isCompleted) { + return makeBlobBeginCopyFromURLPollOperation(state); } - get position() { - return this._position; + if (!copyId) { + state.isCancelled = true; + return makeBlobBeginCopyFromURLPollOperation(state); } - async read(size, options = {}) { - var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.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."); + 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; } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve6, 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(); - resolve6(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); - } - }); + } 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 BlobQuickQueryStream = class extends stream2.Readable { - /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - - */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); - } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); + var toString3 = function toString4() { + return JSON.stringify({ state: this.state }, (key, value) => { + if (key === "blobClient") { + return void 0; } + return value; + }); + }; + function makeBlobBeginCopyFromURLPollOperation(state) { + return { + state: { ...state }, + cancel, + toString: toString3, + 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.`); } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); + 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.`); } - }; - var BlobQueryResponse = class { + 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 { /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly + * Concurrency. Must be lager than 0. */ - get acceptRanges() { - return this.originalResponse.acceptRanges; - } + concurrency; /** - * Returns if it was previously specified - * for the file. - * - * @readonly + * Number of active operations under execution. */ - get cacheControl() { - return this.originalResponse.cacheControl; - } + actives = 0; /** - * Returns the value that was specified - * for the 'x-ms-content-disposition' header and specifies how to process the - * response. - * - * @readonly + * Number of completed operations under execution. */ - get contentDisposition() { - return this.originalResponse.contentDisposition; + 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(); } /** - * Returns the value that was specified - * for the Content-Encoding request header. + * Add a operation into queue. * - * @readonly + * @param operation - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; + addOperation(operation) { + this.operations.push(async () => { + try { + this.actives++; + await operation(); + this.actives--; + this.completed++; + this.parallelExecute(); + } catch (error3) { + this.emitter.emit("error", error3); + } + }); } /** - * Returns the value that was specified - * for the Content-Language request header. + * Start execute operations in the queue. * - * @readonly */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + async do() { + if (this.operations.length === 0) { + return Promise.resolve(); + } + this.parallelExecute(); + return new Promise((resolve6, reject) => { + this.emitter.on("finish", resolve6); + this.emitter.on("error", (error3) => { + this.state = BatchStates.Error; + reject(error3); + }); + }); } /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. + * Get next operation to be executed. Return null when reaching ends. * - * @readonly */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; + nextOperation() { + if (this.offset < this.operations.length) { + return this.operations[this.offset++]; + } + return null; } /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * Start execute operations. One one the most important difference between + * this method with do() is that do() wraps as an sync method. * - * @readonly */ - get blobType() { - return this.originalResponse.blobType; + 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_utils7 = __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((resolve6, 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); + resolve6(); + 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}`)); + } + resolve6(); + }); + stream2.on("error", (msg) => { + clearTimeout(timeout); + reject(msg); + }); + }); + } + async function streamToBuffer2(stream2, buffer, encoding) { + let pos = 0; + const bufferSize = buffer.length; + return new Promise((resolve6, 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", () => { + resolve6(pos); + }); + stream2.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve6, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve6(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); + }); + } + async function readStreamToLocalFile(rs, file) { + return new Promise((resolve6, reject) => { + const ws = node_fs_1.default.createWriteStream(file); + rs.on("error", (err) => { + reject(err); + }); + ws.on("error", (err) => { + reject(err); + }); + ws.on("close", resolve6); + 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_utils7(); + 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 number of bytes present in the - * response body. - * - * @readonly + * The name of the blob. */ - get contentLength() { - return this.originalResponse.contentLength; + get name() { + return this._name; } /** - * 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 + * The name of the storage container the blob is associated with. */ - get contentMD5() { - return this.originalResponse.contentMD5; + get containerName() { + return this._containerName; } - /** - * 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; + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + options = options || {}; + let pipeline; + let url2; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; + } + pipeline = (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); + } + pipeline = (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; + pipeline = (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, pipeline); + ({ 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); } /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * 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. * - * @readonly + * @param snapshot - The snapshot timestamp. + * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - get contentType() { - return this.originalResponse.contentType; + 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); } /** - * 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. + * 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. * - * @readonly + * @param versionId - The versionId. + * @returns A new BlobClient object pointing to the version of this blob. */ - get copyCompletedOn() { - return void 0; + 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); } /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * Creates a AppendBlobClient object. * - * @readonly */ - get copyId() { - return this.originalResponse.copyId; + getAppendBlobClient() { + return new AppendBlobClient(this.url, this.pipeline); } /** - * 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. + * Creates a BlockBlobClient object. * - * @readonly */ - get copyProgress() { - return this.originalResponse.copyProgress; + getBlockBlobClient() { + return new BlockBlobClient(this.url, this.pipeline); } /** - * 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. + * Creates a PageBlobClient object. * - * @readonly */ - get copySource() { - return this.originalResponse.copySource; + getPageBlobClient() { + return new PageBlobClient(this.url, this.pipeline); } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' + * Reads or downloads a blob from the system, including its metadata and properties. + * You can also call Get Blob to read a snapshot. * - * @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. + * * In Node.js, data returns in a Readable stream readableStreamBody + * * In browsers, data returns in a promise blobBody * - * @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'. + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob * - * @readonly - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; - } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * @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. * - * @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. + * Example usage (Node.js): * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * ```ts snippet:ReadmeSampleDownloadBlob_Node + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The error code. + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * @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). + * // 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}`); + * } * - * @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. + * 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(); + * } + * ``` * - * @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. + * Example usage (browser): * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * A name-value pair - * to associate with a file storage object. + * ```ts snippet:ReadmeSampleDownloadBlob_Browser + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * @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. + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * @readonly + * // 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}`); + * } + * ``` */ - get clientRequestId() { - return this.originalResponse.clientRequestId; + 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 + }); + }); } /** - * Indicates the version of the File service used - * to execute the request. + * Returns true if the Azure blob resource represented by this client exists; false otherwise. * - * @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. + * 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. * - * @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) + * @param options - options to Exists operation. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + 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; + } + }); } /** - * The response body as a browser Blob. - * Always undefined in node.js. + * 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 * - * @readonly + * 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. */ - get blobBody() { - return void 0; + 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) + }; + }); } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. - * - * It will parse avor data returned by blob query. + * 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 * - * @readonly + * @param options - Optional options to Blob Delete operation. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + 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 + })); + }); } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + 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; + } + }); } /** - * Creates an instance of BlobQueryResponse. + * 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 originalResponse - - * @param options - + * @param options - Optional options to Blob Undelete operation. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; - } - return tier2; - } - 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 = EncryptionAlgorithmAES25; - } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { - constructor(options) { - const { blobClient, copySource: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; - let state; - if (resumeFrom) { - state = JSON.parse(resumeFrom).state; - } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { - blobClient, - copySource: copySource2, - startCopyFromURLOptions - })); - super(operation); - if (typeof onProgress === "function") { - this.onProgress(onProgress); - } - this.intervalInMs = intervalInMs; - } - delay() { - return coreUtil.delay(this.intervalInMs); - } - }; - var cancel = async function cancel2(options = {}) { - const state = this.state; - const { copyId: copyId2 } = state; - if (state.isCompleted) { - return makeBlobBeginCopyFromURLPollOperation(state); - } - if (!copyId2) { - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - } - await state.blobClient.abortCopyFromURL(copyId2, { - abortSignal: options.abortSignal - }); - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - }; - var update = async function update2(options = {}) { - const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; - if (!state.isStarted) { - state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, 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; - } + 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 + })); + }); } - return makeBlobBeginCopyFromURLPollOperation(state); - }; - var toString3 = function toString4() { - return JSON.stringify({ state: this.state }, (key, value) => { - if (key === "blobClient") { - return void 0; - } - return value; - }); - }; - function makeBlobBeginCopyFromURLPollOperation(state) { - return { - state: Object.assign({}, state), - cancel, - toString: toString3, - update - }; - } - function rangeToString(iRange) { - if (iRange.offset < 0) { - throw new RangeError(`Range.offset cannot be smaller than 0.`); + /** + * 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 + })); + }); } - 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.`); + /** + * 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 + })); + }); } - return iRange.count ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}` : `bytes=${iRange.offset}-`; - } - var BatchStates; - (function(BatchStates2) { - BatchStates2[BatchStates2["Good"] = 0] = "Good"; - BatchStates2[BatchStates2["Error"] = 1] = "Error"; - })(BatchStates || (BatchStates = {})); - var Batch = class { /** - * Creates an instance of Batch. - * @param concurrency - + * 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 - */ - constructor(concurrency = 5) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; - if (concurrency < 1) { - throw new RangeError("concurrency must be larger than 0"); - } - this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + 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) + })); + }); } /** - * Add a operation into queue. + * Gets the tags associated with the underlying blob. * - * @param operation - + * @param options - */ - addOperation(operation) { - this.operations.push(async () => { - try { - this.actives++; - await operation(); - this.actives--; - this.completed++; - this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); - } + 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; }); } /** - * Start execute operations in the queue. + * 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. */ - async do() { - if (this.operations.length === 0) { - return Promise.resolve(); - } - this.parallelExecute(); - return new Promise((resolve6, reject) => { - this.emitter.on("finish", resolve6); - this.emitter.on("error", (error4) => { - this.state = BatchStates.Error; - reject(error4); - }); + 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 + })); }); } /** - * Get next operation to be executed. Return null when reaching ends. + * 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. */ - nextOperation() { - if (this.offset < this.operations.length) { - return this.operations[this.offset++]; - } - return null; + 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; } /** - * Start execute operations. One one the most important difference between - * this method with do() is that do() wraps as an sync method. + * 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. */ - 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; - } - } + 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 + })); + }); } - }; - var BuffersStream = class extends stream2.Readable { /** - * Creates an instance of BuffersStream that will emit the data - * contained in the array of buffers. + * 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 buffers - Array of buffers containing the data - * @param byteLength - The total length of data contained in the buffers + * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication + * @param options - */ - 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."); - } + 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 + })); + }); } /** - * Internal _read() that will be called when the stream wants to pull more data in. + * 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 size - Optional. The size of data to be read + * @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. */ - _read(size) { - if (this.pushedBytesLength >= this.byteLength) { - this.push(null); + 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 || {}; } - if (!size) { - size = this.readableHighWaterMark; + let blockSize = options.blockSize ?? 0; + if (blockSize < 0) { + throw new RangeError("blockSize option must be >= 0"); } - 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 (blockSize === 0) { + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } - if (outBuffers.length > 1) { - this.push(Buffer.concat(outBuffers)); - } else if (outBuffers.length === 1) { - this.push(outBuffers[0]); + 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; + }); } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { /** - * The size of the data contained in the pooled buffers. + * 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. */ - get size() { - return this._size; + 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; + }); } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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; + 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]; } - this.buffers.push(Buffer.allocUnsafe(len)); - } - if (buffers) { - this.fill(buffers, totalLength); + 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."); } } /** - * 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. + * 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 buffers - Input buffers containing the data to be filled in the pooled buffer - * @param totalLength - Total length of the data to be filled in. + * @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. */ - 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; + generateSasUrl(options) { + return new Promise((resolve6) => { + 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(); + resolve6((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"); } - buffers.splice(0, i); - if (buffers.length > 0) { - buffers[0] = buffers[0].slice(sourceOffset); - } + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).stringToSign; } /** - * Get the readable stream assembled from all the data in the internal buffers. * + * 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. */ - getReadableStream() { - return new BuffersStream(this.buffers, this.size); + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve6) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); } - }; - var BufferScheduler = class { /** - * Creates an instance of BufferScheduler. + * Only available for BlobClient constructed with a shared key credential. * - * @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 + * 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. */ - constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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; + 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; } /** - * Start the scheduler, will return error when stream of any of the outgoingHandlers - * returns error. + * Delete the immutablility policy on the blob. * + * @param options - Optional options to delete immutability policy on the blob. */ - async do() { - return new Promise((resolve6, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve6).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve6(); - } - } - }); + 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 + })); }); } /** - * Insert a new data into unresolved array. + * Set immutability policy on the blob. * - * @param data - + * @param options - Optional options to set immutability policy on the blob. */ - appendUnresolvedData(data) { - this.unresolvedDataArray.push(data); - this.unresolvedLength += data.length; + 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 + })); + }); } /** - * 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. + * Set legal hold on the blob. * + * @param options - Optional options to set legal hold on the blob. */ - shiftBufferFromUnresolvedDataArray(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; + 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 + })); + }); } /** - * 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. + * 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 * - * @returns Return false when buffers in incoming are not enough, else true. + * @param options - Options to the Service Get Account Info operation. + * @returns Response data for the Service Get Account Info operation. */ - resolveData() { - while (this.unresolvedLength >= this.bufferSize) { - let buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; + 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 pipeline; + let url2; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + pipeline = (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); + } + pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); } else { - return false; + 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; + pipeline = (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"); } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); + } else { + throw new Error("Expecting non-empty strings for containerName and blobName parameters"); } - return true; + super(url2, pipeline); + this.appendBlobContext = this.storageClientContext.appendBlob; } /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. + * 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. */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); + 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); } /** - * Trigger a outgoing handler for a buffer shifted from outgoing. + * 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 buffer - + * @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 triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); + 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 + })); + }); } /** - * Return buffer used by outgoing handler into incoming. + * 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 buffer - + * @param options - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream3, buffer2, offset, end, encoding) { - let pos = 0; - const count = end - offset; - return new Promise((resolve6, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream3.on("readable", () => { - if (pos >= count) { - clearTimeout(timeout); - resolve6(); - return; - } - let chunk = stream3.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); - } - const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); - pos += chunkLength; - }); - stream3.on("end", () => { - clearTimeout(timeout); - if (pos < count) { - reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); - } - resolve6(); - }); - stream3.on("error", (msg) => { - clearTimeout(timeout); - reject(msg); - }); - }); - } - async function streamToBuffer2(stream3, buffer2, encoding) { - let pos = 0; - const bufferSize = buffer2.length; - return new Promise((resolve6, reject) => { - stream3.on("readable", () => { - let chunk = stream3.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; + 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; } - buffer2.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - stream3.on("end", () => { - resolve6(pos); - }); - stream3.on("error", reject); - }); - } - async function readStreamToLocalFile(rs, file) { - return new Promise((resolve6, reject) => { - const ws = fs__namespace.createWriteStream(file); - rs.on("error", (err) => { - reject(err); }); - ws.on("error", (err) => { - reject(err); + } + /** + * 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 + })); }); - ws.on("close", resolve6); - rs.pipe(ws); - }); - } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + } /** - * The name of the blob. + * 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); + * ``` */ - get name() { - return this._name; + 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 name of the storage container the blob is associated with. + * 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 - */ - get containerName() { - return this._containerName; + 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) { - options = options || {}; let pipeline; - let url3; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + let url2; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; + url2 = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); - ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); - this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + super(url2, pipeline); + this.blockBlobContext = this.storageClientContext.blockBlob; + this._blobContext = this.storageClientContext.blob; } /** - * 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. + * 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 BlobClient object identical to the source but with the specified snapshot timestamp + * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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); } /** - * 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. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @param versionId - The versionId. - * @returns A new BlobClient object pointing to the version of this blob. - */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); - } - /** - * Creates a AppendBlobClient object. + * 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 - */ - getAppendBlobClient() { - return new AppendBlobClient(this.url, this.pipeline); + 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 BlockBlobClient object. + * 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); + * ``` */ - getBlockBlobClient() { - return new BlockBlobClient(this.url, this.pipeline); + 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 PageBlobClient object. + * 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. */ - getPageBlobClient() { - return new PageBlobClient(this.url, this.pipeline); + 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 + })); + }); } /** - * 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://docs.microsoft.com/en-us/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): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` - * - * Example usage (browser): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded - * ); + * 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 * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); - * } - * ``` + * @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 download(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + 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, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress - // for Node.js, progress is reported by RetriableReadableStream + onUploadProgress: options.onProgress }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), - rangeGetContentMD5: options.rangeGetContentMD5, - rangeGetContentCRC64: options.rangeGetContentCrc64, - snapshot: options.snapshot, + transactionalContentMD5: options.transactionalContentMD5, + transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, + encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); - const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { - return wrappedRes; - } - if (options.maxRetryRequests === void 0 || options.maxRetryRequests < 0) { - options.maxRetryRequests = 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(wrappedRes, async (start) => { - var _a2; - 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: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions - }, - range: 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(Object.assign({ 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. + * 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 options - options to Exists operation. + * @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 exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { - try { - 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 === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { - return true; - } - throw e; - } + 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 + })); }); } /** - * 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://docs.microsoft.com/en-us/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. + * 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 options - Optional options to Get Properties operation. + * @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 getProperties(options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * 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 options - Optional options to Blob Delete operation. + * @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 delete(options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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, - deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob. * - * @param options - Optional options to Blob Delete operation. + * 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 deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + 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); } - throw e; + 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); } }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * ONLY AVAILABLE IN BROWSERS. * - * @param options - Optional options to Blob Undelete operation. + * 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 undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); + 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); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * 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. * - * @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. + * 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 setHTTPHeaders(blobHTTPHeaders, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ - abortSignal: options.abortSignal, - blobHttpHeaders: blobHTTPHeaders, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger. - tracingOptions: updatedOptions.tracingOptions - })); + 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); }); } /** - * Sets user-defined metadata for the specified blob as one or more name-value pairs. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * If no option provided, or no metadata defined in the parameter, the blob - * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * Uploads a local file in blocks to a block blob. * - * @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. + * 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 setMetadata(metadata2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, + 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 - })); + }); }); } /** - * 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 ('_'). + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @param tags - - * @param options - + * 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 setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + 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 { /** - * Gets the tags associated with the underlying blob. - * - * @param options - + * pageBlobsContext provided by protocol layer. */ - async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); - return wrappedResponse; - }); + pageBlobContext; + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + let pipeline; + let url2; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + pipeline = (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); + } + pipeline = (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; + pipeline = (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, pipeline); + this.pageBlobContext = this.storageClientContext.pageBlob; } /** - * Get a {@link BlobLeaseClient} that manages leases on the blob. + * 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 proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the blob. + * @param snapshot - The snapshot timestamp. + * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + 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 read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob + * 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 options - Optional options to the Blob Create Snapshot operation. + * @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 createSnapshot(options = {}) { + async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob - * - * Example using automatic polling: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using manual polling: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` - * - * Example using progress updates: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * onProgress(state) { - * console.log(`Progress: ${state.copyProgress}`); - * } - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * // cancel operation after starting it. - * try { - * await copyPoller.cancelOperation(); - * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); - * } - * } - * ``` + * 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 copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. - */ - async beginCopyFromURL(copySource2, options = {}) { - const client = { - abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), - getProperties: (...args) => this.getProperties(...args), - startCopyFromURL: (...args) => this.startCopyFromURL(...args) - }; - const poller = new BlobBeginCopyFromUrlPoller({ - blobClient: client, - copySource: copySource2, - intervalInMs: options.intervalInMs, - onProgress: options.onProgress, - resumeFrom: options.resumeFrom, - startCopyFromURLOptions: options + * @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; + } }); - 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * 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 copyId - Id of the Copy From URL operation. - * @param options - Optional options to the Blob Abort Copy From URL operation. + * @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 abortCopyFromURL(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * 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 copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication + * @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 syncCopyFromURL(copySource2, options = {}) { + async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + (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, - metadata: options.metadata, + sourceContentMD5: options.sourceContentMD5, + sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + sequenceNumberAccessConditions: options.conditions, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, - legalHold: options.legalHold, + cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceTags: options.copySourceTags, + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * Frees the specified pages from the page blob. + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * - * @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. + * @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 setAccessTier(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - rehydratePriority: options.rehydratePriority, + 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 })); }); } - async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; - let offset = 0; - let count = 0; - let options = param4; - if (param1 instanceof Buffer) { - buffer2 = 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 = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0) { - throw new RangeError("blockSize option must be >= 0"); - } - if (blockSize === 0) { - blockSize = 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 tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { - if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, 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 (!buffer2) { - try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); - } - } - if (buffer2.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(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 stream3 = response.readableStreamBody; - await streamToBuffer(stream3, buffer2, off - offset, chunkEnd - offset); - transferProgress += chunkEnd - off; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }); - } - await batch.do(); - return buffer2; - }); - } /** - * 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. + * 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 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. + * @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 downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); - if (response.readableStreamBody) { - await readStreamToLocalFile(response.readableStreamBody, filePath); - } - response.blobDownloadStream = void 0; - return response; + 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); }); } - 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 (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 (error4) { - 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * 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 copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. + * @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 startCopyFromURL(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + 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, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - sourceIfTags: options.sourceConditions.tagConditions + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - sealBlob: options.sealBlob, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, + maxPageSize: options.maxPageSize, 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel} * - * @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. + * @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. */ - generateSasUrl(options) { - return new Promise((resolve6) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve6(appendToURLQuery(this.url, sas)); - }); + 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); + } } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects * - * @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. + * @param offset - Starting byte position of the page ranges. + * @param count - Number of bytes to get. + * @param options - Options to List Page Ranges operation. */ - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - generateSasStringToSign(options) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + 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); } - return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; } /** - * Delete the immutablility policy on the blob. + * 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 * - * @param options - Optional options to delete immutability policy on the blob. + * .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. */ - async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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 + }); + } + }; } /** - * Set immutability policy on the blob. + * 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 options - Optional options to set immutability policy on the blob. + * @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 setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ - immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, - immutabilityPolicyMode: immutabilityPolicy.policyMode, + 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); }); } /** - * Set legal hold on the blob. + * 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 options - Optional options to set legal hold on the blob. + * @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 setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. + * + * @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 getAccountInfo(options = {}) { - return tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - }; - var AppendBlobClient = class _AppendBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline; - let url3; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new 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"); + 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); } - super(url3, pipeline); - 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. + * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects * - * @param snapshot - The snapshot timestamp. - * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. + * @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. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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); + } } /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 * - * @param options - Options to the Append Block Create operation. + * .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"; * - * Example usage: + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); - * await appendBlobClient.create(); + * 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. */ - async create(options = {}) { + listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); + 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 + }); + } + }; } /** - * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 options - + * @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 createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } + 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); }); } /** - * Seals the append blob, making it read only. + * 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 options - + * @param size - Target size + * @param options - Options to the Page Blob Resize operation. + * @returns Response data for the Page Blob Resize operation. */ - async seal(options = {}) { + async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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, - appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); }); } /** - * Commits a new block of data to the end of the existing append blob. - * @see https://docs.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: - * - * ```js - * const content = "Hello World!"; - * - * // Create a new append blob and append data to the blob. - * const newAppendBlobClient = containerClient.getAppendBlobClient(""); - * await newAppendBlobClient.create(); - * await newAppendBlobClient.appendBlock(content, content.length); + * Sets a page blob's sequence number. + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * - * // Append data to an existing append blob. - * const existingAppendBlobClient = containerClient.getAppendBlobClient(""); - * await existingAppendBlobClient.appendBlock(content, content.length); - * ``` + * @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 appendBlock(body2, contentLength2, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + 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, - appendPositionAccessConditions: options.conditions, + blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onUploadProgress: options.onProgress + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions }, - 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-url + * 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 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 - + * @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 appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + 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, - sourceRange: rangeToString({ offset: sourceOffset, count }), - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - leaseAccessConditions: options.conditions, - appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); }); } }; - var BlockBlobClient = class _BlockBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline; - let url3; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + 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_utils7(); + 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(str2) { + return Buffer.byteLength(str2); + } + } +}); + +// 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 index = 0; index < subResponseCount; index++) { + const subResponse = subResponses[index]; + 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; } - pipeline = newPipeline(sharedKeyCredential, options); } else { - throw new Error("Account connection string is only supported in Node.js environment"); + if (!deserializedSubResponse.bodyAsText) { + deserializedSubResponse.bodyAsText = ""; + } + deserializedSubResponse.bodyAsText += responseLine; } - } else if (extractedCreds.kind === "SASConnString") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + } + 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 { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + } + if (subRespFailed) { + subResponsesFailedCount++; + } else { + subResponsesSucceededCount++; } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); } - super(url3, pipeline); - this.blockBlobContext = this.storageClientContext.blockBlob; - this._blobContext = this.storageClientContext.blob; + 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 { /** - * 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. + * Lock for a specific key. If the lock has been acquired by another customer, then + * will wait until getting the lock. * - * @param snapshot - The snapshot timestamp. - * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. + * @param key - lock key */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + static async lock(key) { + return new Promise((resolve6) => { + if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { + this.keys[key] = MutexLockStatus.LOCKED; + resolve6(); + } else { + this.onUnlockEvent(key, () => { + this.keys[key] = MutexLockStatus.LOCKED; + resolve6(); + }); + } + }); } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Quick query for a JSON or CSV formatted blob. - * - * Example usage (Node.js): - * - * ```js - * // Query and convert a blob to a string - * const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` + * Unlock a key. * - * @param query - - * @param options - + * @param key - */ - async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { - throw new Error("This operation currently is only supported in Node.js."); + static async unlock(key) { + return new Promise((resolve6) => { + if (this.keys[key] === MutexLockStatus.LOCKED) { + this.emitUnlockEvent(key); + } + delete this.keys[key]; + resolve6(); + }); + } + static keys = {}; + static listeners = {}; + static onUnlockEvent(key, handler) { + if (this.listeners[key] === void 0) { + this.listeners[key] = [handler]; + } else { + this.listeners[key].push(handler); } - return tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ - abortSignal: options.abortSignal, - queryRequest: { - queryType: "SQL", - expression: query, - inputSerialization: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) - }, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - tracingOptions: updatedOptions.tracingOptions - })); - return new BlobQueryResponse(response, { - abortSignal: options.abortSignal, - onProgress: options.onProgress, - onError: options.onError + } + static emitUnlockEvent(key) { + if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { + const handler = this.listeners[key].shift(); + setImmediate(() => { + handler.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(); } /** - * 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://docs.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: - * - * ```js - * const content = "Hello world!"; - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` + * 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 */ - async upload(body2, contentLength2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onUploadProgress: options.onProgress - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); - }); + getMultiPartContentType() { + return this.batchRequest.getMultipartContentType(); } /** - * 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. + * Get assembled HTTP request body for sub requests. */ - async syncUploadFromURL(sourceURL, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); - }); + getHttpRequestBody() { + return this.batchRequest.getHttpRequestBody(); } /** - * Uploads the specified block to the block blob's "staging area" to be later - * committed by a call to commitBlockList. - * @see https://docs.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. + * Get sub requests that are added into the batch request. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { - 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 - })); + 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(); + } /** - * 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://docs.microsoft.com/en-us/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. + * 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. */ - async stageBlockFromURL(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - sourceRange: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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 pipeline = new Pipeline_js_1.Pipeline([]); + pipeline._credential = credential; + pipeline._corePipeline = corePipeline; + return pipeline; + } + appendSubRequestToBody(request) { + 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 + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.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 request.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 path11 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path11 || path11 === "") { + 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}`; } - /** - * 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://docs.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(blocks2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); - }); + getMultipartContentType() { + return this.multipartContentType; } - /** - * Returns the list of blocks that have been uploaded as part of a block blob - * using the specified block list filter. - * @see https://docs.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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - if (!res.committedBlocks) { - res.committedBlocks = []; + getSubRequests() { + return this.subRequests; + } + }; + function batchRequestAssemblePolicy(batchRequest) { + return { + name: "batchRequestAssemblePolicy", + async sendRequest(request) { + batchRequest.appendSubRequestToBody(request); + return { + request, + status: 200, + headers: (0, core_rest_pipeline_1.createHttpHeaders)() + }; + } + }; + } + function batchHeaderFilterPolicy() { + return { + name: "batchHeaderFilterPolicy", + async sendRequest(request, next) { + let xMsHeaderName = ""; + for (const [name] of request.headers) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { + xMsHeaderName = name; + } } - if (!res.uncommittedBlocks) { - res.uncommittedBlocks = []; + if (xMsHeaderName !== "") { + request.headers.delete(xMsHeaderName); } - return res; - }); + return next(request); + } + }; + } + } +}); + +// 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 pipeline; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { + pipeline = credentialOrPipeline; + } else if (!credentialOrPipeline) { + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } else { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); + } + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path11 = (0, utils_common_js_1.getURLPath)(url2); + if (path11 && path11 !== "/") { + this.serviceOrContainerContext = storageClientContext.container; + } else { + this.serviceOrContainerContext = storageClientContext.service; + } } - // 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 - + * Creates a {@link BlobBatch}. + * A BlobBatch represents an aggregated set of operations on blobs. */ - async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; - if (data instanceof Buffer) { - buffer2 = data; - } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); - } else { - data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); - } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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 { - const browserBlob = new Blob([data]); - return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); + 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); } /** - * ONLY AVAILABLE IN BROWSERS. - * - * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob. + * Submit batch request which consists of multiple subrequests. * - * 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. + * Get `blobBatchClient` and other details before running the snippets. + * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` * - * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is - * `blobContentType`, enabling the browser to provide - * functionality based on file type. + * Example usage: * - * @deprecated Use {@link uploadData} instead. + * ```ts snippet:BlobBatchClientSubmitBatch + * import { DefaultAzureCredential } from "@azure/identity"; + * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; * - * @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 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); - }); - } - /** + * const account = ""; + * const credential = new DefaultAzureCredential(); + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * credential, + * ); * - * 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. + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobBatchClient = containerClient.getBlobBatchClient(); * - * 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. + * const batchRequest = new BlobBatch(); + * await batchRequest.deleteBlob("", credential); + * await batchRequest.deleteBlob("", credential, { + * deleteSnapshots: "include", + * }); + * const batchResp = await blobBatchClient.submitBatch(batchRequest); + * console.log(batchResp.subResponsesSucceededCount); + * ``` * - * @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 = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); - } - const maxSingleShotSize = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); - } - if (blockSize === 0) { - if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`${size} is too larger to upload to a block blob.`); - } - if (size > maxSingleShotSize) { - blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - } - } - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } - if (!options.conditions) { - options.conditions = {}; - } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { - if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); - } - const numBlocks = Math.floor((size - 1) / blockSize) + 1; - if (numBlocks > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); - } - const blockList = []; - const blockIDPrefix = coreUtil.randomUUID(); - let transferProgress = 0; - const batch = new Batch(options.concurrency); - for (let i = 0; i < numBlocks; i++) { - batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); - const start = blockSize * i; - const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; - blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { - abortSignal: options.abortSignal, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += contentLength2; - if (options.onProgress) { - options.onProgress({ - loadedBytes: transferProgress - }); - } - }); - } - await batch.do(); - return this.commitBlockList(blockList, updatedOptions); - }); - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. + * Example using a lease: * - * Uploads a local file in blocks to a block blob. + * ```ts snippet:BlobBatchClientSubmitBatchWithLease + * import { DefaultAzureCredential } from "@azure/identity"; + * import { BlobServiceClient, BlobBatch } from "@azure/storage-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. + * const account = ""; + * const credential = new DefaultAzureCredential(); + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * credential, + * ); * - * @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 tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; - return this.uploadSeekableInternal((offset, count) => { - return () => fsCreateReadStream(filePath, { - autoClose: true, - end: count ? offset + count - 1 : Infinity, - start: offset - }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); - }); - } - /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobBatchClient = containerClient.getBlobBatchClient(); + * const blobClient = containerClient.getBlobClient(""); * - * Uploads a Node.js Readable stream into block blob. + * 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); + * ``` * - * PERFORMANCE IMPROVEMENT TIPS: - * * Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * - * @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. + * @param batchRequest - A set of Delete or SetTier operations. + * @param options - */ - async uploadStream(stream3, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } - if (!options.conditions) { - options.conditions = {}; + async submitBatch(batchRequest, options = {}) { + if (!batchRequest || batchRequest.getSubRequests().size === 0) { + throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { - let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); - let transferProgress = 0; - const blockList = []; - const scheduler = new BufferScheduler( - stream3, - bufferSize, - maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); - blockList.push(blockID); - blockNum++; - await this.stageBlock(blockID, body2, 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 assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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; }); } }; - var PageBlobClient = class _PageBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + 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 pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { + url2 = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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"); + throw new Error("Expecting non-empty strings for containerName parameter"); } - super(url3, pipeline); - this.pageBlobContext = this.storageClientContext.pageBlob; + super(url2, pipeline); + this._containerName = this.getContainerNameFromUrl(); + this.containerContext = this.storageClientContext.container; } /** - * 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. + * 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 snapshot - The snapshot timestamp. - * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); - } - /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @param options - Options to Container Create operation. * - * @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. + * + * 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(size, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - blobSequenceNumber: options.blobSequenceNumber, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); + 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 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://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 size - size of the page blob. * @param options - */ - async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + async createIfNotExists(options = {}) { + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + const res = await this.create(updatedOptions); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; + } else { + throw e; } - throw e; } }); } /** - * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.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(body2, offset, count, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onUploadProgress: options.onProgress - }, - range: 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://docs.microsoft.com/en-us/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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { - abortSignal: options.abortSignal, - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - leaseAccessConditions: options.conditions, - sequenceNumberAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Frees the specified pages from the page blob. - * @see https://docs.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 tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: 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://docs.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 tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - tracingOptions: updatedOptions.tracingOptions - })); - return 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://docs.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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel} + * Returns true if the Azure container resource represented by this client exists; false otherwise. * - * @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. - */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); - } - /** - * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects + * 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 offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. - * @param options - Options to List Page Ranges operation. + * @param options - */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; + async exists(options = {}) { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; + await this.getProperties({ + abortSignal: options.abortSignal, + tracingOptions: updatedOptions.tracingOptions + }); + return true; + } catch (e) { + if (e.statusCode === 404) { + return false; } + throw e; } }); } /** - * Returns an async iterable iterator to list of page ranges for a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges - * - * .byPage() returns an async iterable iterator to list of page ranges for a page blob. - * - * Example using `for await` syntax: - * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRanges()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); - * } - * ``` + * Creates a {@link BlobClient} * - * Example using `byPage()`: + * @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} * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * ``` + * @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} * - * Example using paging with a marker: + * @param blobName - A block blob name * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } + * Example usage: * - * // Gets next marker - * let marker = response.continuationToken; + * ```ts snippet:ClientsUpload + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * // Passing next marker as continuationToken + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blockBlobClient = containerClient.getBlockBlobClient(blobName); * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } + * const content = "Hello world!"; + * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); * ``` - * @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, Object.assign({ maxPageSize: settings.maxPageSize }, options)); - } - }; + 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); } /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * Creates a {@link PageBlobClient} * - * @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. + * @param blobName - A page blob name */ - async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), - tracingOptions: updatedOptions.tracingOptions - })); - return rangeResponseFromModel(result); - }); + 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); } /** - * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * 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 * - * @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. + * 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 listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevsnapshot: prevSnapshotOrUrl, - range: rangeToString({ - offset, - count - }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + 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 })); }); } /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} - * + * 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 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. + * @param options - Options to Container Delete operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } + 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 + })); }); } /** - * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects + * 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 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. + * @param options - Options to Container Delete operation. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; + async deleteIfExists(options = {}) { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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; } }); } /** - * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.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. - * - * Example using `for await` syntax: - * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; - * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * - * // Gets next marker - * let marker = response.continuationToken; - * - * // Passing next marker as continuationToken + * Sets one or more user-defined name-value pairs for the specified container. * - * iterator = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; + * If no option provided, or no metadata defined in the parameter, the container + * metadata will be removed. * - * // Prints 10 page ranges - * for (const blob of response) { - * 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, Object.assign({}, 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, Object.assign({ 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @see https://learn.microsoft.com/rest/api/storageservices/set-container-metadata * - * @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. + * @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 getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl2, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + metadata, + modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); }); } /** - * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * Gets the permissions for the specified container. The permissions indicate + * whether container data may be accessed publicly. * - * @param size - Target size - * @param options - Options to the Page Blob Resize operation. - * @returns Response data for the Page Blob Resize operation. + * 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 resize(size, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - encryptionScope: options.encryptionScope, 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 a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * Sets the permissions for the specified container. The permissions indicate + * whether blobs in a container may be accessed publicly. * - * @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. + * 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 updateSequenceNumber(sequenceNumberAction2, sequenceNumber, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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, - blobSequenceNumber: sequenceNumber, + access, + containerAcl: acl, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: options.conditions, 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * Get a {@link BlobLeaseClient} that manages leases on the container. * - * @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. + * @param proposeLeaseId - Initial proposed lease Id. + * @returns A new BlobLeaseClient object for managing leases on the container. */ - async startCopyIncremental(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - }; - async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); - } - function utf8ByteLength(str2) { - return Buffer.byteLength(str2); - } - var HTTP_HEADER_DELIMITER = ": "; - var SPACE_DELIMITER = " "; - var NOT_FOUND = -1; - var BatchResponseParser = class { - 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}${HTTP_LINE_ENDING}`; - this.batchResponseEnding = `--${this.responseBatchBoundary}--`; + getBlobLeaseClient(proposeLeaseId) { + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response - async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { - throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`); - } - const responseBodyAsText = await 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 index = 0; index < subResponseCount; index++) { - const subResponse = subResponses[index]; - const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${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(HeaderConstants.CONTENT_ID)) { - contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); - } - if (responseLine.startsWith(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] === 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 { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); - } - if (subRespFailed) { - subResponsesFailedCount++; - } else { - subResponsesSucceededCount++; - } - } - return { - subResponses: deserializedSubResponses, - subResponsesSucceededCount, - subResponsesFailedCount - }; + /** + * 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 + }; + }); } - }; - 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. + * 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 key - lock key + * @param blobName - + * @param options - Options to Blob Delete operation. + * @returns Block blob deletion response data. */ - static async lock(key) { - return new Promise((resolve6) => { - if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { - this.keys[key] = MutexLockStatus.LOCKED; - resolve6(); - } else { - this.onUnlockEvent(key, () => { - this.keys[key] = MutexLockStatus.LOCKED; - resolve6(); - }); + 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); }); } /** - * Unlock a key. + * 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 key - + * @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. */ - static async unlock(key) { - return new Promise((resolve6) => { - if (this.keys[key] === MutexLockStatus.LOCKED) { - this.emitUnlockEvent(key); - } - delete this.keys[key]; - resolve6(); + 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; }); } - static onUnlockEvent(key, handler) { - if (this.listeners[key] === void 0) { - this.listeners[key] = [handler]; - } else { - this.listeners[key].push(handler); - } - } - static emitUnlockEvent(key) { - if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { - const handler = this.listeners[key].shift(); - setImmediate(() => { - handler.call(this); - }); - } - } - }; - Mutex.keys = {}; - Mutex.listeners = {}; - var BlobBatch = class { - constructor() { - this.batch = "batch"; - 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 + * 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. */ - getMultiPartContentType() { - return this.batchRequest.getMultipartContentType(); + 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; + }); } /** - * Get assembled HTTP request body for sub requests. + * 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. */ - getHttpRequestBody() { - return this.batchRequest.getHttpRequestBody(); + 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); + } } /** - * Get sub requests that are added into the batch request. + * Returns an AsyncIterableIterator of {@link BlobItem} objects + * + * @param options - Options to list blobs operation. */ - getSubRequests() { - return this.batchRequest.getSubRequests(); - } - async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); - try { - this.batchRequest.preAddSubRequest(subRequest); - await assembleSubRequestFunc(); - this.batchRequest.postAddSubRequest(subRequest); - } finally { - await Mutex.unlock(this.batch); + async *listItems(options = {}) { + let marker; + for await (const listBlobsFlatSegmentResponse of this.listSegments(marker, options)) { + yield* listBlobsFlatSegmentResponse.segment.blobItems; } } - setBatchType(batchType) { - if (!this.batchType) { - this.batchType = batchType; + /** + * 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 (this.batchType !== batchType) { - throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`); + if (options.includeDeleted) { + include.push("deleted"); } - } - async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url3; - let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url3 = urlOrBlobClient; - credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url3 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - options = credentialOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + if (options.includeMetadata) { + include.push("metadata"); } - if (!options) { - options = {}; + if (options.includeSnapshots) { + include.push("snapshots"); } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { - this.setBatchType("delete"); - await this.addSubRequestInternal({ - url: url3, - credential - }, async () => { - await new BlobClient(url3, this.batchRequest.createPipeline(credential)).delete(updatedOptions); - }); - }); - } - async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url3; - let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url3 = urlOrBlobClient; - credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url3 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; - options = tierOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + if (options.includeVersions) { + include.push("versions"); } - if (!options) { - options = {}; + if (options.includeUncommitedBlobs) { + include.push("uncommittedblobs"); } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { - this.setBatchType("setAccessTier"); - await this.addSubRequestInternal({ - url: url3, - credential - }, async () => { - await new BlobClient(url3, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); - }); - }); + 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 + }); + } + }; } - }; - var InnerBatchRequest = class { - constructor() { - this.operationCount = 0; - this.body = ""; - const tempGuid = coreUtil.randomUUID(); - this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; - this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`; - this.batchRequestEnding = `--${this.boundary}--`; - this.subRequests = /* @__PURE__ */ new Map(); + /** + * 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); + } } /** - * 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. + * 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. */ - createPipeline(credential) { - const corePipeline = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - xmlCharKey: "#" + 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 + }; } } - }), { phase: "Serialize" }); - corePipeline.addPolicy(batchHeaderFilterPolicy()); - corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); + for (const blob of segment.blobItems) { + yield { kind: "blob", ...blob }; + } } - const pipeline = new Pipeline([]); - pipeline._credential = credential; - pipeline._corePipeline = corePipeline; - return pipeline; } - appendSubRequestToBody(request) { - this.body += [ - this.subRequestPrefix, - // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, - // sub request's content ID - "", - // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` - // sub request start line with method - ].join(HTTP_LINE_ENDING); - for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + /** + * 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"); } - this.body += HTTP_LINE_ENDING; - } - preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + const include = []; + if (options.includeCopy) { + include.push("copy"); } - const path11 = getURLPath(subRequest.url); - if (!path11 || path11 === "") { - throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); + if (options.includeDeleted) { + include.push("deleted"); } - } - 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}${HTTP_LINE_ENDING}`; - } - getMultipartContentType() { - return this.multipartContentType; - } - getSubRequests() { - return this.subRequests; - } - }; - function batchRequestAssemblePolicy(batchRequest) { - return { - name: "batchRequestAssemblePolicy", - async sendRequest(request) { - batchRequest.appendSubRequestToBody(request); - return { - request, - status: 200, - headers: coreRestPipeline.createHttpHeaders() - }; + if (options.includeMetadata) { + include.push("metadata"); } - }; - } - function batchHeaderFilterPolicy() { - return { - name: "batchHeaderFilterPolicy", - async sendRequest(request, next) { - let xMsHeaderName = ""; - for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { - xMsHeaderName = name; - } - } - if (xMsHeaderName !== "") { - request.headers.delete(xMsHeaderName); - } - return next(request); + if (options.includeSnapshots) { + include.push("snapshots"); } - }; - } - var BlobBatchClient = class { - constructor(url3, credentialOrPipeline, options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - pipeline = newPipeline(credentialOrPipeline, options); + if (options.includeVersions) { + include.push("versions"); } - const storageClientContext = new StorageContextClient(url3, getCoreClientOptions(pipeline)); - const path11 = getURLPath(url3); - if (path11 && path11 !== "/") { - this.serviceOrContainerContext = storageClientContext.container; - } else { - this.serviceOrContainerContext = storageClientContext.service; + 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 + }); + } + }; } /** - * Creates a {@link BlobBatch}. - * A BlobBatch represents an aggregated set of operations on blobs. + * 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. */ - createBatch() { - return new BlobBatch(); - } - async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new 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 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; + }); } - async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); - for (const urlOrBlobClient of urlsOrBlobClients) { - if (typeof urlOrBlobClient === "string") { - await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); - } else { - await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions); - } + /** + * 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); } - return this.submitBatch(batch); } /** - * Submit batch request which consists of multiple subrequests. + * Returns an AsyncIterableIterator for blobs. * - * Get `blobBatchClient` and other details before running the snippets. - * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` + * @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. * - * Example usage: + * .byPage() returns an async iterable iterator to list the blobs in pages. * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` + * Example using `for await` syntax: * - * Example using a lease: + * ```ts snippet:ReadmeSampleFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * @param batchRequest - A set of Delete or SetTier operations. - * @param options - + * // 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. */ - async submitBatch(batchRequest, options = {}) { - if (!batchRequest || batchRequest.getSubRequests().size === 0) { - throw new RangeError("Batch request should contain one or more sub requests."); - } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { - const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new 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; - }); + 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 + }); + } + }; } - }; - var ContainerClient = class extends StorageClient { /** - * The name of the container. + * 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. */ - get containerName() { - return this._containerName; + 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 + })); + }); } - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { - let pipeline; - let url3; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { - const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url3 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + 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 { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + containerName = parsedUrl.pathname.split("/")[1]; } - } else { - throw new Error("Expecting non-empty strings for containerName parameter"); + 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."); } - super(url3, pipeline); - 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://docs.microsoft.com/en-us/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. + * 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. * - * Example usage: + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * const createContainerResponse = await containerClient.create(); - * console.log("Container was created successfully", createContainerResponse.requestId); - * ``` + * @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. */ - async create(options = {}) { - return tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + generateSasUrl(options) { + return new Promise((resolve6) => { + 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(); + resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** - * Creates a new container under the specified account. If the container with - * the same name already exists, it is not changed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata + * Only available for ContainerClient constructed with a shared key credential. * - * @param options - + * 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. */ - async createIfNotExists(options = {}) { - return tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } else { - throw e; - } - } - }); + /* 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; } /** - * Returns true if the Azure container resource represented by this client exists; false otherwise. + * 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. * - * 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. + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas * - * @param options - + * @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. */ - async exists(options = {}) { - return 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; - } + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve6) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** - * Creates a {@link BlobClient} + * 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. * - * @param blobName - A blob name - * @returns A new BlobClient object for the given blob name. - */ - getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } - /** - * Creates an {@link AppendBlobClient} + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas * - * @param blobName - An append blob name + * @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. */ - getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + generateUserDelegationSasStringToSign(options, userDelegationKey) { + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).stringToSign; } /** - * Creates a {@link BlockBlobClient} - * - * @param blobName - A block blob name - * - * - * Example usage: + * Creates a BlobBatchClient object to conduct batch operations. * - * ```js - * const content = "Hello world!"; + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * - * const blockBlobClient = containerClient.getBlockBlobClient(""); - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` + * @returns A new BlobBatchClient object for this container. */ - getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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 { /** - * Creates a {@link PageBlobClient} + * Parse initializes the AccountSASPermissions fields from a string. * - * @param blobName - A page blob name + * @param permissions - */ - getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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; } /** - * 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://docs.microsoft.com/en-us/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. + * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it + * and boolean values for them. * - * @param options - Options to Container Get Properties operation. + * @param permissionLike - */ - async getProperties(options = {}) { - if (!options.conditions) { - options.conditions = {}; + static from(permissionLike) { + const accountSASPermissions = new _AccountSASPermissions(); + if (permissionLike.read) { + accountSASPermissions.read = true; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); - }); + 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; } /** - * Marks the specified container for deletion. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container - * - * @param options - Options to Container Delete operation. + * Permission to read resources and list queues and tables granted. */ - async delete(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } + read = false; /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container - * - * @param options - Options to Container Delete operation. + * Permission to write resources granted. */ - async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } - }); - } + write = false; /** - * 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://docs.microsoft.com/en-us/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. + * Permission to delete blobs and files granted. */ - async setMetadata(metadata2, 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: metadata2, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } + delete = false; /** - * Gets the permissions for the specified container. The permissions indicate - * whether container data may be accessed publicly. + * 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. * - * 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". + * Using this method will guarantee the resource types are in + * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * - * @param options - Options to Container Get Access Policy operation. */ - async getAccessPolicy(options = {}) { - if (!options.conditions) { - options.conditions = {}; + toString() { + const permissions = []; + if (this.read) { + permissions.push("r"); } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = 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; - }); + 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 { /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * 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 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. + * @param resourceTypes - */ - async setAccessPolicy(access2, containerAcl2, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { - const acl = []; - for (const identifier of containerAcl2 || []) { - acl.push({ - accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", - permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" - }, - id: identifier.id - }); + 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 assertResponse(await this.containerContext.setAccessPolicy({ - abortSignal: options.abortSignal, - access: access2, - containerAcl: acl, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); + } + return accountSASResourceTypes; } /** - * 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. + * Permission to access service level APIs granted. */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); - } + service = false; /** - * 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. + * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * - * @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, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { - const blockBlobClient = this.getBlockBlobClient(blobName); - const response = await blockBlobClient.upload(body2, contentLength2, updatedOptions); - return { - blockBlobClient, - response - }; - }); + 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 { /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * 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 blobName - - * @param options - Options to Blob Delete operation. - * @returns Block blob deletion response data. + * @param services - */ - async deleteBlob(blobName, options = {}) { - return tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { - let blobClient = this.getBlobClient(blobName); - if (options.versionId) { - blobClient = blobClient.withVersion(options.versionId); + 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 blobClient.delete(updatedOptions); - }); + } + return accountSASServices; } /** - * 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://docs.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. + * Permission to access blob resources granted. */ - async listBlobFlatSegment(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); - return wrappedResponse; - }); - } + blob = false; /** - * 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://docs.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. + * Permission to access file resources granted. */ - async listBlobHierarchySegment(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); - return wrappedResponse; - }); - } + file = false; /** - * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse + * Permission to access queue resources granted. + */ + queue = false; + /** + * Permission to access table resources granted. + */ + table = false; + /** + * Converts the given services to a string. * - * @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. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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; /** - * Returns an AsyncIterableIterator of {@link BlobItem} objects * - * @param options - Options to list blobs operation. + * 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; + 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 pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); + return new _BlobServiceClient(extractedCreds.url, pipeline); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); } - }); + } else if (extractedCreds.kind === "SASConnString") { + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); + } else { + throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + } + } + constructor(url2, credentialOrPipeline, options) { + let pipeline; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { + pipeline = 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)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); + } else { + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } + super(url2, pipeline); + this.serviceContext = this.storageClientContext.service; } /** - * 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. - * - * Example using `for await` syntax: - * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); - * let response = (await iterator.next()).value; + * Creates a {@link ContainerClient} object * - * // Prints 2 blob names - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * @param containerName - A container name + * @returns A new ContainerClient object for the given container name. * - * // Gets next marker - * let marker = response.continuationToken; + * Example usage: * - * // Passing next marker as continuationToken + * ```ts snippet:BlobServiceClientGetContainerClient + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); - * response = (await iterator.next()).value; + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * // Prints 10 blob names - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * const containerClient = blobServiceClient.getContainerClient(""); * ``` - * - * @param options - Options to list blobs. - * @returns An asyncIterableIterator that supports paging. */ - listBlobsFlat(options = {}) { - const include2 = []; - if (options.includeCopy) { - include2.push("copy"); - } - if (options.includeDeleted) { - include2.push("deleted"); - } - if (options.includeMetadata) { - include2.push("metadata"); - } - if (options.includeSnapshots) { - include2.push("snapshots"); - } - if (options.includeVersions) { - include2.push("versions"); - } - if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); - } - if (options.includeTags) { - include2.push("tags"); - } - if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include2.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; - } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - 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, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); - } - }; + getContainerClient(containerName) { + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse + * Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container * - * @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. + * @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. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } + 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 + }; }); } /** - * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects. + * Deletes a Blob container. * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. + * @param containerName - Name of the container to delete. + * @param options - Options to configure Container Delete operation. + * @returns Container deletion response. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } + async deleteContainer(containerName, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + const containerClient = this.getContainerClient(containerName); + return containerClient.delete(updatedOptions); }); } /** - * 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. - * - * Example using `for await` syntax: - * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * entity = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` + * 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. * - * Example using paging with a max page size: + * @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 * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); + * @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 * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; + * @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 * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } + * @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 * - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` + * @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 delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. + * @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. */ - listBlobsByHierarchy(delimiter2, options = {}) { - if (delimiter2 === "") { - throw new RangeError("delimiter should contain one or more characters"); - } - const include2 = []; - if (options.includeCopy) { - include2.push("copy"); - } - if (options.includeDeleted) { - include2.push("deleted"); - } - if (options.includeMetadata) { - include2.push("metadata"); - } - if (options.includeSnapshots) { - include2.push("snapshots"); - } - if (options.includeVersions) { - include2.push("versions"); - } - if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); - } - if (options.includeTags) { - include2.push("tags"); - } - if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include2.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; - } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, 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(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); - } - }; + 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 in the container whose tags - * match a given search expression. + * 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. @@ -68676,28 +75248,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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. + * 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. @@ -68712,18 +75288,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -68734,87 +75308,69 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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. + * under the specified account. * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * ```js - * let i = 1; - * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `iter.next()`: + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * ```js + * // Use for await to iterate the blobs * let i = 1; - * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; - * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); + * // 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 = containerClient + * iterator = blobServiceClient * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; @@ -68822,7 +75378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -68834,7 +75390,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -68853,6183 +75411,6803 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. + * @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 getAccountInfo(options = {}) { - return tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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; }); } - getContainerNameFromUrl() { - let containerName; - try { - const parsedUrl = new URL(this.url); - if (parsedUrl.hostname.split(".")[1] === "blob") { - containerName = parsedUrl.pathname.split("/")[1]; - } else if (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 (error4) { - throw new Error("Unable to extract containerName with provided information."); + /** + * 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.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"); + }; + } +}); + +// 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(resolve6) { + resolve6(value); + }); } - /** - * 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://docs.microsoft.com/en-us/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((resolve6) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve6(appendToURLQuery(this.url, sas)); - }); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve6(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 core12 = __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(); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * Sets the number of bytes sent * - * @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. + * @param sentBytes the number of bytes sent */ - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - generateSasStringToSign(options) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + setSentBytes(sentBytes) { + this.sentBytes = sentBytes; } /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this container. + * Returns the total number of bytes transferred. */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); - } - }; - var AccountSASPermissions = class _AccountSASPermissions { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + getTransferredBytes() { + return this.sentBytes; } /** - * Parse initializes the AccountSASPermissions fields from a string. - * - * @param permissions - + * Returns true if the upload is complete. */ - 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; + isDone() { + return this.getTransferredBytes() === this.contentLength; } /** - * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. - * - * @param permissionLike - + * Prints the current upload stats. Once the upload completes, this will print one + * last line and then stop. */ - 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; + display() { + if (this.displayedComplete) { + return; } - if (permissionLike.permanentDelete) { - accountSASPermissions.permanentDelete = true; + 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); + core12.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); + if (this.isDone()) { + this.displayedComplete = true; } - return accountSASPermissions; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas - * + * Returns a function used to handle TransferProgressEvents. */ - 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(""); - } - }; - var AccountSASResourceTypes = class _AccountSASResourceTypes { - constructor() { - this.service = false; - this.container = false; - this.object = false; + onProgress() { + return (progress) => { + this.setSentBytes(progress.loadedBytes); + }; } /** - * 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. + * Starts the timer that displays the stats. * - * @param resourceTypes - + * @param delayInMs the delay between each write */ - 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}`); + startDisplayTimer(delayInMs = 1e3) { + const displayCallback = () => { + this.display(); + if (!this.isDone()) { + this.timeoutHandle = setTimeout(displayCallback, delayInMs); } - } - return accountSASResourceTypes; + }; + this.timeoutHandle = setTimeout(displayCallback, delayInMs); } /** - * Converts the given resource types to a string. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas - * + * 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. */ - toString() { - const resourceTypes = []; - if (this.service) { - resourceTypes.push("s"); - } - if (this.container) { - resourceTypes.push("c"); - } - if (this.object) { - resourceTypes.push("o"); + stopDisplayTimer() { + if (this.timeoutHandle) { + clearTimeout(this.timeoutHandle); + this.timeoutHandle = void 0; } - return resourceTypes.join(""); + this.display(); } }; - var AccountSASServices = class _AccountSASServices { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } - /** - * 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}`); + exports2.UploadProgress = UploadProgress; + function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const blobClient = new storage_blob_1.BlobClient(signedUploadURL); + const blockBlobClient = blobClient.getBlockBlobClient(); + const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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(); + core12.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) { + core12.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; + } finally { + uploadProgress.stopDisplayTimer(); } - return accountSASServices; + }); + } + } +}); + +// 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]; + } }; } - /** - * Converts the given services to a string. - * - */ - toString() { - const services = []; - if (this.blob) { - services.push("b"); + 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]); } - if (this.table) { - services.push("t"); + __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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (this.queue) { - services.push("q"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (this.file) { - services.push("f"); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } - return services.join(""); - } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { - return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential).sasQueryParameters; - } - function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) { - const version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core12 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var constants_1 = require_constants7(); + function isSuccessStatusCode(statusCode) { + if (!statusCode) { + return false; } - if (accountSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + return statusCode >= 200 && statusCode < 300; + } + function isServerErrorStatusCode(statusCode) { + if (!statusCode) { + return true; } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); - let stringToSign; - if (version2 >= "2020-12-06") { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version2, - accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", - "" - // Account SAS requires an additional newline character - ].join("\n"); - } else { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version2, - "" - // Account SAS requires an additional newline character - ].join("\n"); + return statusCode >= 500; + } + function isRetryableStatusCode(statusCode) { + if (!statusCode) { + return false; } - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters(version2, 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 - }; + const retryableStatusCodes = [ + http_client_1.HttpCodes.BadGateway, + http_client_1.HttpCodes.ServiceUnavailable, + http_client_1.HttpCodes.GatewayTimeout + ]; + return retryableStatusCodes.includes(statusCode); } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { - /** - * - * 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 = extractConnectionStringParts(connectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + function sleep(milliseconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => setTimeout(resolve6, milliseconds)); + }); + } + function retry3(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); } - const pipeline = newPipeline(sharedKeyCredential, options); - return new _BlobServiceClient(extractedCreds.url, pipeline); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); + isRetryable = true; + errorMessage = error3.message; } - } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); - return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); - } - } - constructor(url3, credentialOrPipeline, options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); - } else { - pipeline = newPipeline(new AnonymousCredential(), options); + if (response) { + statusCode = getStatusCode(response); + if (!isServerErrorStatusCode(statusCode)) { + return response; + } + } + if (statusCode) { + isRetryable = isRetryableStatusCode(statusCode); + errorMessage = `Cache service responded with ${statusCode}`; + } + core12.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + if (!isRetryable) { + core12.debug(`${name} - Error is not retryable`); + break; + } + yield sleep(delay2); + attempt++; } - super(url3, pipeline); - this.serviceContext = this.storageClientContext.service; + 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 retry3( + 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 retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); + }); + } + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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); } /** - * Creates a {@link ContainerClient} object - * - * @param containerName - A container name - * @returns A new ContainerClient object for the given container name. - * - * Example usage: + * Status of whether aborted or not. * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * ``` + * @readonly */ - getContainerClient(containerName) { - return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + get aborted() { + if (!abortedMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); + } + return abortedMap.get(this); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * Creates a new AbortSignal instance that will never be aborted. * - * @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. + * @readonly */ - async createContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(containerName); - const containerCreateResponse = await containerClient.create(updatedOptions); - return { - containerClient, - containerCreateResponse - }; - }); + static get none() { + return new _AbortSignal(); } /** - * Deletes a Blob container. + * Added new "abort" event listener, only support "abort" event. * - * @param containerName - Name of the container to delete. - * @param options - Options to configure Container Delete operation. - * @returns Container deletion response. + * @param _type - Only support "abort" event + * @param listener - The listener to be added */ - async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(containerName); - return containerClient.delete(updatedOptions); - }); + 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); } /** - * 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. + * Remove "abort" event listener, only support "abort" event. * - * @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. + * @param _type - Only support "abort" event + * @param listener - The listener to be removed */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); - const containerContext = containerClient["storageClientContext"].container; - const containerUndeleteResponse = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, - tracingOptions: updatedOptions.tracingOptions - })); - return { containerClient, containerUndeleteResponse }; - }); + removeEventListener(_type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); + } + const listeners = listenersMap.get(this); + const index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 1); + } } /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. + * Dispatches a synthetic event to the AbortSignal. */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); + dispatchEvent(_event) { + throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); } - /** - * Gets the properties of a storage account’s Blob service, including properties - * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); + }; + 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(); + }); + } + } + } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * The AbortSignal associated with this controller that will signal aborted + * when the abort method is called on this controller. * - * @param properties - - * @param options - Options to the Service Set Properties operation. - * @returns Response data for the Service Set Properties operation. + * @readonly */ - async setProperties(properties, options = {}) { - return tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + get signal() { + return this._signal; } /** - * 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://docs.microsoft.com/en-us/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. + * Signal that any operations passed this controller's associated abort signal + * to cancel any remaining work and throw an `AbortError`. */ - async getStatistics(options = {}) { - return tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + abort() { + abortSignal(this._signal); } /** - * 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://docs.microsoft.com/en-us/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. + * Creates a new AbortSignal instance that will abort after the provided ms. + * @param ms - Elapsed time in milliseconds to trigger an abort. */ - async getAccountInfo(options = {}) { - return tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); + 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(resolve6) { + resolve6(value); }); } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 core12 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs12 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); + var constants_1 = require_constants7(); + var requestUtils_1 = require_requestUtils(); + var abort_controller_1 = require_dist4(); + function pipeResponseToStream(response, output) { + return __awaiter2(this, void 0, void 0, function* () { + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(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(); + } /** - * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * Progress to the next segment. Only call this method when the previous segment + * is complete. * - * @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. + * @param segmentSize the length of the next segment */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); - }); + nextSegment(segmentSize) { + this.segmentOffset = this.segmentOffset + this.segmentSize; + this.segmentIndex = this.segmentIndex + 1; + this.segmentSize = segmentSize; + this.receivedBytes = 0; + core12.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** - * 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. + * Sets the number of bytes received for the current segment. * - * @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. + * @param receivedBytes the number of bytes received */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ - abortSignal: options.abortSignal, - where: tagFilterSqlExpression, - marker: marker2, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); - return wrappedResponse; - }); + setReceivedBytes(receivedBytes) { + this.receivedBytes = receivedBytes; } /** - * 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. + * Returns the total number of bytes transferred. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + getTransferredBytes() { + return this.segmentOffset + this.receivedBytes; } /** - * 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. + * Returns true if the download is complete. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + isDone() { + return this.getTransferredBytes() === this.contentLength; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let 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. + * Prints the current download stats. Once the download completes, this will print one + * last line and then stop. */ - findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, 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, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); - } + 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); + core12.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); }; } /** - * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses + * Starts the timer that displays the stats. * - * @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. + * @param delayInMs the delay between each write */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); + startDisplayTimer(delayInMs = 1e3) { + const displayCallback = () => { + this.display(); + if (!this.isDone()) { + this.timeoutHandle = setTimeout(displayCallback, delayInMs); } - }); + }; + this.timeoutHandle = setTimeout(displayCallback, delayInMs); } /** - * Returns an AsyncIterableIterator for Container Items - * - * @param options - Options to list containers operation. + * 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; + 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 = fs12.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(); + core12.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 { + core12.debug("Unable to validate download, no Content-Length header"); + } + }); + } + function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const archiveDescriptor = yield fs12.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 >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 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 { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); + 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"); } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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 _a; + 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 = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; + if (contentLength < 0) { + core12.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 = fs12.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)) { + fs12.writeFileSync(fd, result); + } } + } finally { + downloadProgress.stopDisplayTimer(); + fs12.closeSync(fd); } + } + }); + } + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { + let timeoutHandle; + const timeoutPromise = new Promise((resolve6) => { + timeoutHandle = setTimeout(() => resolve6("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 core12 = __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; + core12.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core12.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core12.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; + } + core12.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core12.debug(`Download concurrency: ${result.downloadConcurrency}`); + core12.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core12.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core12.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core12.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.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"; + } + 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_package2 = __commonJS({ + "node_modules/@actions/cache/package.json"(exports2, module2) { + module2.exports = { + name: "@actions/cache", + version: "5.0.1", + 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.0", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "@actions/http-client": "^3.0.0", + "@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_package2(); + 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(resolve6) { + resolve6(value); }); } - /** - * 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. - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const container of blobServiceClient.listContainers()) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let 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; + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 = saveCache3; + var core12 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs12 = __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 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}`; + core12.debug(`Resource Url: ${url2}`); + return url2; + } + function createAcceptHeader(type2, apiVersion) { + return `${type2};api-version=${apiVersion}`; + } + function getRequestOptions() { + const requestOptions = { + headers: { + Accept: createAcceptHeader("application/json", "6.0-preview.1") } - const include2 = []; - if (options.includeDeleted) { - include2.push("deleted"); + }; + 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* () { + 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 (core12.isDebug()) { + yield printCachesListForDiagnostics(keys[0], httpClient, version); + } + return null; } - if (options.includeMetadata) { - include2.push("metadata"); + if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { + throw new Error(`Cache service responded with ${response.statusCode}`); } - if (options.includeSystem) { - include2.push("system"); + const cacheResult = response.result; + const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation; + if (!cacheDownloadUrl) { + throw new Error("Cache not found."); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - 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, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + core12.setSecret(cacheDownloadUrl); + core12.debug(`Cache Result:`); + core12.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) { + core12.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) || []) { + core12.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}`); + } } - }; - } - /** - * 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://docs.microsoft.com/en-us/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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, 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 = Object.assign({ _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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this service. - */ - getBlobBatchClient() { - return new 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://docs.microsoft.com/en-us/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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); } - if (expiresOn2 === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + }); + } + 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); } - const sas = generateAccountSASQueryParameters(Object.assign({ - permissions, - expiresOn: expiresOn2, - resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return 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://docs.microsoft.com/en-us/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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); + }); + } + 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* () { + core12.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.`); } - if (expiresOn2 === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + }); + } + 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 = fs12.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()]; + core12.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, () => fs12.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 { + fs12.closeSync(fd); } - return generateAccountSASQueryParametersInternal(Object.assign({ - permissions, - expiresOn: expiresOn2, - resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; - } - }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; + 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 saveCache3(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(); + core12.debug("Upload cache"); + yield uploadFile(httpClient, cacheId, archivePath, options); + core12.debug("Commiting cache"); + const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); + core12.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.`); + } + core12.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"; } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; - exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + return t; + } + exports2.typeofJsonValue = typeofJsonValue; + function isJsonObject(value) { + return value !== null && typeof value == "object" && !Array.isArray(value); + } + exports2.isJsonObject = isJsonObject; } }); -// node_modules/@actions/cache/lib/internal/shared/errors.js -var require_errors2 = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/errors.js"(exports2) { +// 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.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(", ")}`; + 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; } - 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"; + 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; + } } - }; - 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"; + if (groupPos) { + base64 += encTable[p]; + base64 += "="; + if (groupPos == 1) + base64 += "="; } - }; - exports2.UsageError = UsageError; - UsageError.isUsageErrorMessage = (msg) => { - if (!msg) - return false; - return msg.includes("insufficient usage"); - }; + return base64; + } + exports2.base64encode = base64encode; } }); -// node_modules/@actions/cache/lib/internal/uploadUtils.js -var require_uploadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; + } } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + if (parts.length) { + if (i) + parts.push(fromCharCodes(chunk.slice(0, i))); + return parts.join(""); } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + 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; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; + 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.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core12 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); - 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; + 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]; + } } - /** - * Returns the total number of bytes transferred. - */ - getTransferredBytes() { - return this.sentBytes; + let middleByte = this.buf[this.pos++]; + lowBits |= (middleByte & 15) << 28; + highBits = (middleByte & 112) >> 4; + if ((middleByte & 128) == 0) { + this.assertBounds(); + return [lowBits, highBits]; } - /** - * Returns true if the upload is complete. - */ - isDone() { - return this.getTransferredBytes() === this.contentLength; + 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]; + } } - /** - * Prints the current upload stats. Once the upload completes, this will print one - * last line and then stop. - */ - display() { - if (this.displayedComplete) { + 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 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); - core12.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); + const splitBits = lo >>> 28 & 15 | (hi & 7) << 4; + const hasMoreBits = !(hi >> 3 == 0); + bytes.push((hasMoreBits ? splitBits | 128 : splitBits) & 255); + if (!hasMoreBits) { + return; } - /** - * 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; + 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; } - this.display(); } - }; - exports2.UploadProgress = UploadProgress; - function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const blobClient = new storage_blob_1.BlobClient(signedUploadURL); - const blockBlobClient = blobClient.getBlockBlobClient(); - const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 0); - const uploadOptions = { - blockSize: options === null || options === void 0 ? void 0 : options.uploadChunkSize, - concurrency: options === null || options === void 0 ? void 0 : options.uploadConcurrency, - maxSingleShotSize: 128 * 1024 * 1024, - onProgress: uploadProgress.onProgress() - }; - try { - uploadProgress.startDisplayTimer(); - core12.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 (error4) { - core12.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; - } finally { - uploadProgress.stopDisplayTimer(); + 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.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - } -}); - -// node_modules/@actions/cache/lib/internal/requestUtils.js -var require_requestUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + exports2.int64fromString = int64fromString; + function int64toString(bitsLow, bitsHigh) { + if (bitsHigh >>> 0 <= 2097151) { + return "" + (TWO_PWR_32_DBL2 * bitsHigh + (bitsLow >>> 0)); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + if (digitB >= base) { + digitC += Math.floor(digitB / base); + digitB %= base; } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + function decimalFrom1e7(digit1e7, needLeadingZeros) { + let partial = digit1e7 ? String(digit1e7) : ""; + if (needLeadingZeros) { + return "0000000".slice(partial.length) + partial; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + 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; } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + bytes.push(value); + } else { + for (let i = 0; i < 9; i++) { + bytes.push(value & 127 | 128); + value = value >> 7; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core12 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var constants_1 = require_constants7(); - function isSuccessStatusCode(statusCode) { - if (!statusCode) { - return false; + bytes.push(1); } - return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; - function isServerErrorStatusCode(statusCode) { - if (!statusCode) { - return true; + exports2.varint32write = varint32write; + function varint32read() { + let b = this.buf[this.pos++]; + let result = b & 127; + if ((b & 128) == 0) { + this.assertBounds(); + return result; } - return statusCode >= 500; - } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; - function isRetryableStatusCode(statusCode) { - if (!statusCode) { - return false; + b = this.buf[this.pos++]; + result |= (b & 127) << 7; + if ((b & 128) == 0) { + this.assertBounds(); + return result; } - const retryableStatusCodes = [ - http_client_1.HttpCodes.BadGateway, - http_client_1.HttpCodes.ServiceUnavailable, - http_client_1.HttpCodes.GatewayTimeout - ]; - return retryableStatusCodes.includes(statusCode); - } - exports2.isRetryableStatusCode = isRetryableStatusCode; - function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, milliseconds)); - }); - } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { - let errorMessage = ""; - let attempt = 1; - while (attempt <= maxAttempts) { - let response = void 0; - let statusCode = void 0; - let isRetryable = false; - try { - response = yield method(); - } catch (error4) { - if (onError) { - response = onError(error4); - } - isRetryable = true; - errorMessage = error4.message; - } - if (response) { - statusCode = getStatusCode(response); - if (!isServerErrorStatusCode(statusCode)) { - return response; - } - } - if (statusCode) { - isRetryable = isRetryableStatusCode(statusCode); - errorMessage = `Cache service responded with ${statusCode}`; - } - core12.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); - if (!isRetryable) { - core12.debug(`${name} - Error is not retryable`); - break; - } - yield sleep(delay2); - attempt++; - } - throw Error(`${name} failed: ${errorMessage}`); - }); - } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3( - 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. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { - return { - statusCode: error4.statusCode, - result: null, - headers: {}, - error: error4 - }; - } else { - return void 0; - } - } - ); - }); - } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); - }); + 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.retryHttpClientResponse = retryHttpClientResponse; + exports2.varint32read = varint32read; } }); -// node_modules/@actions/cache/lib/internal/downloadUtils.js -var require_downloadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core12 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs12 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); - function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { - const pipeline = util.promisify(stream2.pipeline); - yield pipeline(response.message, output); - }); + 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; } - 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; - core12.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); - } + 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 { /** - * Sets the number of bytes received for the current segment. - * - * @param receivedBytes the number of bytes received + * Create a new instance with the given bits. */ - setReceivedBytes(receivedBytes) { - this.receivedBytes = receivedBytes; + constructor(lo, hi) { + this.lo = lo | 0; + this.hi = hi | 0; } /** - * Returns the total number of bytes transferred. + * Is this instance equal to 0? */ - getTransferredBytes() { - return this.segmentOffset + this.receivedBytes; + isZero() { + return this.lo == 0 && this.hi == 0; } /** - * Returns true if the download is complete. + * Convert to a native number. */ - isDone() { - return this.getTransferredBytes() === this.contentLength; + 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 { /** - * Prints the current download stats. Once the download completes, this will print one - * last line and then stop. + * Create instance from a `string`, `number` or `bigint`. */ - 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); - core12.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); - if (this.isDone()) { - this.displayedComplete = true; - } + 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); } /** - * Returns a function used to handle TransferProgressEvents. + * Convert to decimal string. */ - onProgress() { - return (progress) => { - this.setReceivedBytes(progress.loadedBytes); - }; + toString() { + return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); } /** - * Starts the timer that displays the stats. - * - * @param delayInMs the delay between each write + * Convert to native bigint. */ - startDisplayTimer(delayInMs = 1e3) { - const displayCallback = () => { - this.display(); - if (!this.isDone()) { - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - }; - this.timeoutHandle = setTimeout(displayCallback, delayInMs); + 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 { /** - * 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. + * Create instance from a `string`, `number` or `bigint`. */ - stopDisplayTimer() { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - this.timeoutHandle = void 0; - } - this.display(); - } - }; - exports2.DownloadProgress = DownloadProgress; - function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { - const writeStream = fs12.createWriteStream(archivePath); - const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.get(archiveLocation); - })); - downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { - downloadResponse.message.destroy(); - core12.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 { - core12.debug("Unable to validate download, no Content-Length header"); - } - }); - } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; - function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs12.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", () => __awaiter4(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: () => __awaiter4(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 = () => __awaiter4(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 >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 10)) { - yield waitAndWrite(); - } - } - while (actives > 0) { - yield waitAndWrite(); - } - } finally { - httpClient.dispose(); - yield archiveDescriptor.close(); - } - }); - } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; - function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(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) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - 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 = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; - if (contentLength < 0) { - core12.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 = fs12.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)) { - fs12.writeFileSync(fd, result); - } - } - } finally { - downloadProgress.stopDisplayTimer(); - fs12.closeSync(fd); + 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)); } - } - }); - } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { - let timeoutHandle; - const timeoutPromise = new Promise((resolve6) => { - timeoutHandle = setTimeout(() => resolve6("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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getDownloadOptions = exports2.getUploadOptions = void 0; - var core12 = __importStar4(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; - } + 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); } - 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; - core12.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core12.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core12.debug(`Upload chunk size: ${result.uploadChunkSize}`); - return result; - } - exports2.getUploadOptions = getUploadOptions; - 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; - } + /** + * Do we have a minus sign? + */ + isNegative() { + return (this.hi & HALF_2_PWR_32) !== 0; } - const segmentDownloadTimeoutMins = process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]; - if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { - result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; + /** + * 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); } - core12.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core12.debug(`Download concurrency: ${result.downloadConcurrency}`); - core12.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core12.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core12.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core12.debug(`Lookup only: ${result.lookupOnly}`); - return result; - } - exports2.getDownloadOptions = getDownloadOptions; - } -}); - -// 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.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; - 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 getCacheServiceVersion() { - if (isGhes()) - return "v1"; - return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; - } - exports2.getCacheServiceVersion = getCacheServiceVersion; - 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}`); + /** + * 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); } - } - exports2.getCacheServiceURL = getCacheServiceURL; - } -}); - -// node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ - "node_modules/@actions/cache/package.json"(exports2, module2) { - module2.exports = { - name: "@actions/cache", - version: "4.1.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": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", - "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", - "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", - semver: "^6.3.1" - }, - devDependencies: { - "@types/node": "^22.13.9", - "@types/semver": "^6.0.0", - "@protobuf-ts/plugin": "^2.9.4", - typescript: "^5.2.2" + /** + * 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/@actions/cache/lib/internal/shared/user-agent.js -var require_user_agent = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/user-agent.js"(exports2) { +// 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.getUserAgentString = void 0; - var packageJson = require_package2(); - function getUserAgentString() { - return `@actions/cache-${packageJson.version}`; - } - exports2.getUserAgentString = getUserAgentString; - } -}); - -// node_modules/@actions/cache/lib/internal/cacheHttpClient.js -var require_cacheHttpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; + 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) }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + 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 }); } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core12 = __importStar4(require_core()); - var http_client_1 = require_lib4(); - var auth_1 = require_auth2(); - var fs12 = __importStar4(require("fs")); - var url_1 = require("url"); - var utils = __importStar4(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 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."); + /** + * 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]; } - const url2 = `${baseUrl}_apis/artifactcache/${resource}`; - core12.debug(`Resource Url: ${url2}`); - return url2; - } - function createAcceptHeader(type2, apiVersion) { - return `${type2};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 __awaiter4(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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.getJson(getCacheApiUrl(resource)); - })); - if (response.statusCode === 204) { - if (core12.isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version); - } - return null; - } - if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { - 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."); - } - core12.setSecret(cacheDownloadUrl); - core12.debug(`Cache Result:`); - core12.debug(JSON.stringify(cacheResult)); - return cacheResult; - }); - } - exports2.getCacheEntry = getCacheEntry; - function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { - const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(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) { - core12.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) || []) { - core12.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}`); + /** + * 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) { } - } - } - }); - } - function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(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); - } - }); - } - exports2.downloadCache = downloadCache; - function reserveCache(key, paths, options) { - return __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); - })); - return response; - }); - } - exports2.reserveCache = reserveCache; - function getContentRange(start, end) { - return `bytes ${start}-${end}/*`; - } - function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { - core12.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})`, () => __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - const fileSize = utils.getArchiveFileSizeInBytes(archivePath); - const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs12.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()]; - core12.debug("Awaiting all uploads"); - let offset = 0; - try { - yield Promise.all(parallelUploads.map(() => __awaiter4(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, () => fs12.createReadStream(archivePath, { - fd, - start, - end, - autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); - }), start, end); + 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); } - }))); - } finally { - fs12.closeSync(fd); - } - return; - }); - } - function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { - const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); - })); - }); - } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(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(); - core12.debug("Upload cache"); - yield uploadFile(httpClient, cacheId, archivePath, options); - core12.debug("Commiting cache"); - const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.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.`); - } - core12.info("Cache saved successfully"); + break; + default: + throw new Error("cant skip wire type " + wireType); } - }); - } - exports2.saveCache = saveCache3; + 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/json-typings.js -var require_json_typings = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/json-typings.js"(exports2) { +// 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.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"; + exports2.assertFloat32 = exports2.assertUInt32 = exports2.assertInt32 = exports2.assertNever = exports2.assert = void 0; + function assert(condition, msg) { + if (!condition) { + throw new Error(msg); } - return t; } - exports2.typeofJsonValue = typeofJsonValue; - function isJsonObject(value) { - return value !== null && typeof value == "object" && !Array.isArray(value); + exports2.assert = assert; + function assertNever2(value, msg) { + throw new Error(msg !== null && msg !== void 0 ? msg : "Unexpected object: " + value); } - exports2.isJsonObject = isJsonObject; + 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/base64.js -var require_base642 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/base64.js"(exports2) { +// 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.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.`); - } + 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; } - 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; + 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, type2) { + return this.uint32((fieldNo << 3 | type2) >>> 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; } - 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; + /** + * 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; } - if (groupPos) { - base64 += encTable[p]; - base64 += "="; - if (groupPos == 1) - base64 += "="; + /** + * Write a `int32` value, a signed 32 bit varint. + */ + int32(value) { + assert_1.assertInt32(value); + goog_varint_1.varint32write(value, this.buf); + return this; } - return base64; + /** + * 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.base64encode = base64encode; + exports2.jsonReadOptions = jsonReadOptions; + function jsonWriteOptions(options) { + return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; + } + exports2.jsonWriteOptions = jsonWriteOptions; + function mergeJsonOptions(a, b) { + var _a, _b; + let c = Object.assign(Object.assign({}, a), b); + c.typeRegistry = [...(_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : [], ...(_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/protobufjs-utf8.js -var require_protobufjs_utf8 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/protobufjs-utf8.js"(exports2) { +// 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.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(""); + 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 fromCharCodes(chunk.slice(0, i)); + return sb.join(""); } - exports2.utf8read = utf8read; + exports2.lowerCamelCase = lowerCamelCase; } }); -// 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) { +// 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.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; - var UnknownFieldHandler; - (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = 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.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 _a, _b, _c, _d; + field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : 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.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 = {})); + exports2.normalizeFieldInfo = normalizeFieldInfo; + function readFieldOptions(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; + } + exports2.readFieldOptions = readFieldOptions; + function readFieldOption(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.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/goog-varint.js -var require_goog_varint = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/goog-varint.js"(exports2) { +// 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.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]; - } + 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; } - let middleByte = this.buf[this.pos++]; - lowBits |= (middleByte & 15) << 28; - highBits = (middleByte & 112) >> 4; - if ((middleByte & 128) == 0) { - this.assertBounds(); - return [lowBits, highBits]; + 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; } - 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]; - } + } + 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; } - 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; - } + exports2.setOneofValue = setOneofValue; + function setUnknownOneofValue(oneof, kind, value) { + if (oneof.oneofKind !== void 0) { + delete oneof[oneof.oneofKind]; } - const splitBits = lo >>> 28 & 15 | (hi & 7) << 4; - const hasMoreBits = !(hi >> 3 == 0); - bytes.push((hasMoreBits ? splitBits | 128 : splitBits) & 255); - if (!hasMoreBits) { - return; + oneof.oneofKind = kind; + if (value !== void 0 && kind !== void 0) { + oneof[kind] = value; } - 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; - } + } + exports2.setUnknownOneofValue = setUnknownOneofValue; + function clearOneofValue(oneof) { + if (oneof.oneofKind !== void 0) { + delete oneof[oneof.oneofKind]; } - bytes.push(hi >>> 31 & 1); + oneof.oneofKind = void 0; } - 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; - } + exports2.clearOneofValue = clearOneofValue; + function getSelectedOneofValue(oneof) { + if (oneof.oneofKind === void 0) { + return void 0; } - add1e6digit(-24, -18); - add1e6digit(-18, -12); - add1e6digit(-12, -6); - add1e6digit(-6); - return [minus, lowBits, highBits]; + return oneof[oneof.oneofKind]; } - exports2.int64fromString = int64fromString; - function int64toString(bitsLow, bitsHigh) { - if (bitsHigh >>> 0 <= 2097151) { - return "" + (TWO_PWR_32_DBL2 * bitsHigh + (bitsLow >>> 0)); + 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(info6) { + var _a; + this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; } - 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; + 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) }; } - if (digitB >= base) { - digitC += Math.floor(digitB / base); - digitB %= base; + /** + * 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; } - function decimalFrom1e7(digit1e7, needLeadingZeros) { - let partial = digit1e7 ? String(digit1e7) : ""; - if (needLeadingZeros) { - return "0000000".slice(partial.length) + partial; + 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 partial; + return true; } - 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; + message(arg, type2, allowExcessProperties, depth) { + if (allowExcessProperties) { + return type2.isAssignable(arg, depth); } - bytes.push(value); - } else { - for (let i = 0; i < 9; i++) { - bytes.push(value & 127 | 128); - value = value >> 7; + return type2.is(arg, depth); + } + messages(arg, type2, 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 (!type2.isAssignable(arg[i], depth - 1)) + return false; + } else { + for (let i = 0; i < arg.length && i < depth; i++) + if (!type2.is(arg[i], depth - 1)) + return false; } - bytes.push(1); + return true; } - } - exports2.varint32write = varint32write; - function varint32read() { - let b = this.buf[this.pos++]; - let result = b & 127; - if ((b & 128) == 0) { - this.assertBounds(); - return result; + scalar(arg, type2, longType) { + let argType = typeof arg; + switch (type2) { + 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); + } } - b = this.buf[this.pos++]; - result |= (b & 127) << 7; - if ((b & 128) == 0) { - this.assertBounds(); - return result; + scalars(arg, type2, 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], type2, longType)) + return false; + } + return true; } - b = this.buf[this.pos++]; - result |= (b & 127) << 14; - if ((b & 128) == 0) { - this.assertBounds(); - return result; + mapKeys(map2, type2, depth) { + let keys = Object.keys(map2); + switch (type2) { + 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)), type2, depth); + case reflection_info_1.ScalarType.BOOL: + return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type2, depth); + default: + return this.scalars(keys, type2, depth, reflection_info_1.LongType.STRING); + } } - b = this.buf[this.pos++]; - result |= (b & 127) << 21; - if ((b & 128) == 0) { - this.assertBounds(); - return result; + }; + 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, type2) { + switch (type2) { + case reflection_info_1.LongType.BIGINT: + return long.toBigInt(); + case reflection_info_1.LongType.NUMBER: + return long.toNumber(); + default: + return long.toString(); } - 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; + exports2.reflectionLongConvert = reflectionLongConvert; } }); -// 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) { +// 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.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; + 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(info6) { + this.info = info6; } - /** - * Is this instance equal to 0? - */ - isZero() { - return this.lo == 0 && this.hi == 0; + prepare() { + var _a; + if (this.fMap === void 0) { + this.fMap = {}; + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + for (const field of fieldsInput) { + this.fMap[field.name] = field; + this.fMap[field.jsonName] = field; + this.fMap[field.localName] = field; + } + } } - /** - * 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; + // 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}`); + } } - }; - var PbULong = class _PbULong extends SharedPbLong { /** - * Create instance from a `string`, `number` or `bigint`. + * 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. */ - 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)); + 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; } - 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); + 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; } - throw new Error("unknown value " + typeof value); + 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; + } + } + } } /** - * Convert to decimal string. + * Returns `false` for unrecognized string representations. + * + * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). */ - toString() { - return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); + enum(type2, json2, fieldName, ignoreUnknownFields) { + if (type2[0] == "google.protobuf.NullValue") + assert_1.assert(json2 === null || json2 === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); + if (json2 === null) + return 0; + switch (typeof json2) { + case "number": + assert_1.assert(Number.isInteger(json2), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json2}.`); + return json2; + case "string": + let localEnumName = json2; + if (type2[2] && json2.substring(0, type2[2].length) === type2[2]) + localEnumName = json2.substring(type2[2].length); + let enumNumber = type2[1][localEnumName]; + if (typeof enumNumber === "undefined" && ignoreUnknownFields) { + return false; + } + assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json2}".`); + return enumNumber; + } + assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json2}".`); } - /** - * 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); + scalar(json2, type2, longType, fieldName) { + let e; + try { + switch (type2) { + // 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 (json2 === null) + return 0; + if (json2 === "NaN") + return Number.NaN; + if (json2 === "Infinity") + return Number.POSITIVE_INFINITY; + if (json2 === "-Infinity") + return Number.NEGATIVE_INFINITY; + if (json2 === "") { + e = "empty string"; + break; + } + if (typeof json2 == "string" && json2.trim().length !== json2.length) { + e = "extra whitespace"; + break; + } + if (typeof json2 != "string" && typeof json2 != "number") { + break; + } + let float2 = Number(json2); + if (Number.isNaN(float2)) { + e = "not a number"; + break; + } + if (!Number.isFinite(float2)) { + e = "too large or small"; + break; + } + if (type2 == reflection_info_1.ScalarType.FLOAT) + assert_1.assertFloat32(float2); + return float2; + // 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 (json2 === null) + return 0; + let int32; + if (typeof json2 == "number") + int32 = json2; + else if (json2 === "") + e = "empty string"; + else if (typeof json2 == "string") { + if (json2.trim().length !== json2.length) + e = "extra whitespace"; + else + int32 = Number(json2); + } + if (int32 === void 0) + break; + if (type2 == 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 (json2 === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); + if (typeof json2 != "number" && typeof json2 != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json2), longType); + case reflection_info_1.ScalarType.FIXED64: + case reflection_info_1.ScalarType.UINT64: + if (json2 === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); + if (typeof json2 != "number" && typeof json2 != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json2), longType); + // bool: + case reflection_info_1.ScalarType.BOOL: + if (json2 === null) + return false; + if (typeof json2 !== "boolean") + break; + return json2; + // string: + case reflection_info_1.ScalarType.STRING: + if (json2 === null) + return ""; + if (typeof json2 !== "string") { + e = "extra whitespace"; + break; + } + try { + encodeURIComponent(json2); + } catch (e2) { + e2 = "invalid UTF8"; + break; + } + return json2; + // 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 (json2 === null || json2 === "") + return new Uint8Array(0); + if (typeof json2 !== "string") + break; + return base64_1.base64decode(json2); + } + } catch (error3) { + e = error3.message; + } + this.assert(false, fieldName + (e ? " - " + e : ""), json2); } }; - exports2.PbULong = PbULong; - PbULong.ZERO = new PbULong(0, 0); - var PbLong = class _PbLong extends SharedPbLong { + 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(info6) { + var _a; + this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; + } /** - * Create instance from a `string`, `number` or `bigint`. + * Converts the message to a JSON object, based on the field descriptors. */ - 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)); + write(message, options) { + const json2 = {}, source = message; + for (const field of this.fields) { + if (!field.oneof) { + let jsonValue2 = this.field(field, source[field.localName], options); + if (jsonValue2 !== void 0) + json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue2; + continue; } - 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(); + 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); + json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; + } + return json2; + } + 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; } - throw new Error("unknown value " + typeof value); + 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; } /** - * Do we have a minus sign? + * Returns `null` as the default for google.protobuf.NullValue. */ - isNegative() { - return (this.hi & HALF_2_PWR_32) !== 0; + enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { + if (type2[0] == "google.protobuf.NullValue") + return !emitDefaultValues && !optional ? void 0 : null; + if (value === void 0) { + assert_1.assert(optional); + return void 0; + } + if (value === 0 && !emitDefaultValues && !optional) + return void 0; + assert_1.assert(typeof value == "number"); + assert_1.assert(Number.isInteger(value)); + if (enumAsInteger || !type2[1].hasOwnProperty(value)) + return value; + if (type2[2]) + return type2[2] + type2[1][value]; + return type2[1][value]; } - /** - * 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); + message(type2, value, fieldName, options) { + if (value === void 0) + return options.emitDefaultValues ? null : void 0; + return type2.internalJsonWrite(value, options); } - /** - * 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); + scalar(type2, value, fieldName, optional, emitDefaultValues) { + if (value === void 0) { + assert_1.assert(optional); + return void 0; + } + const ed = emitDefaultValues || optional; + switch (type2) { + // 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); } - 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); + exports2.ReflectionJsonWriter = ReflectionJsonWriter; } }); -// 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) { +// 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.BinaryReader = exports2.binaryReadOptions = void 0; - var binary_format_contract_1 = require_binary_format_contract(); + 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(); - 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 - }); + function reflectionScalarDefault(type2, longType = reflection_info_1.LongType.STRING) { + switch (type2) { + 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; } - /** - * 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]; + } + 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(info6) { + this.info = info6; } - /** - * 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); + prepare() { + var _a; + if (!this.fieldNoToField) { + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); } - 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. + * 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. */ - bytes() { - let len = this.uint32(); - let start = this.pos; - this.pos += len; - this.assertBounds(); - return this.buf.subarray(start, start + len); + 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 `string` field, length-delimited data converted to UTF-8 text. + * Read a map field, expecting key field = 1, value field = 2 */ - string() { - return this.textDecoder.decode(this.bytes()); + 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]; } - }; - 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); + scalar(reader, type2, longType) { + switch (type2) { + 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.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; + }; + exports2.ReflectionBinaryReader = ReflectionBinaryReader; } }); -// 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) { +// 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.BinaryWriter = exports2.binaryWriteOptions = void 0; - var pb_long_1 = require_pb_long(); - var goog_varint_1 = require_goog_varint(); + 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 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 = []; + var pb_long_1 = require_pb_long(); + var ReflectionBinaryWriter = class { + constructor(info6) { + this.info = info6; } - /** - * 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; + prepare() { + if (!this.fields) { + const fieldsInput = this.info.fields ? this.info.fields.concat() : []; + this.fields = fieldsInput.sort((a, b) => a.no - b.no); } - 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, type2) { - return this.uint32((fieldNo << 3 | type2) >>> 0); } /** - * Write a chunk of raw bytes. + * Writes the message to binary format. */ - raw(chunk) { - if (this.buf.length) { - this.chunks.push(new Uint8Array(this.buf)); - this.buf = []; + 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; + } } - this.chunks.push(chunk); - return this; + let u = options.writeUnknownFields; + if (u !== false) + (u === true ? binary_format_contract_1.UnknownFieldHandler.onWrite : u)(this.info.typeName, message, writer); } - /** - * 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; + 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.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); + 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(); } - /** - * 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); + message(writer, options, handler, fieldNo, value) { + if (value === void 0) + return; + handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); + writer.join(); } /** - * Write a `int64` value, a signed 64-bit varint. + * Write a single scalar value. */ - int64(value) { - let long = pb_long_1.PbLong.from(value); - goog_varint_1.varint64write(long.lo, long.hi, this.buf); - return this; + scalar(writer, type2, fieldNo, value, emitDefault) { + let [wireType, method, isDefault] = this.scalarInfo(type2, value); + if (!isDefault || emitDefault) { + writer.tag(fieldNo, wireType); + writer[method](value); + } } /** - * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + * Write an array of scalar values in packed format. */ - 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; + packed(writer, type2, fieldNo, value) { + if (!value.length) + return; + assert_1.assert(type2 !== reflection_info_1.ScalarType.BYTES && type2 !== reflection_info_1.ScalarType.STRING); + writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); + writer.fork(); + let [, method] = this.scalarInfo(type2); + for (let i = 0; i < value.length; i++) + writer[method](value[i]); + writer.join(); } /** - * Write a `uint64` value, an unsigned 64-bit varint. + * 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. */ - uint64(value) { - let long = pb_long_1.PbULong.from(value); - goog_varint_1.varint64write(long.lo, long.hi, this.buf); - return this; + scalarInfo(type2, value) { + let t = binary_format_contract_1.WireType.Varint; + let m; + let i = value === void 0; + let d = value === 0; + switch (type2) { + 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.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 _a, _b; - let c = Object.assign(Object.assign({}, a), b); - c.typeRegistry = [...(_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : [], ...(_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 = Symbol.for("protobuf-ts/message-type"); + exports2.ReflectionBinaryWriter = ReflectionBinaryWriter; } }); -// 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) { +// 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.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); - } + exports2.reflectionCreate = void 0; + var reflection_scalar_default_1 = require_reflection_scalar_default(); + var message_type_contract_1 = require_message_type_contract(); + function reflectionCreate(type2) { + const msg = type2.messagePrototype ? Object.create(type2.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type2 }); + for (let field of type2.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 sb.join(""); + return msg; } - exports2.lowerCamelCase = lowerCamelCase; + exports2.reflectionCreate = reflectionCreate; } }); -// 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) { +// 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.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 _a, _b, _c, _d; - field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : 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 _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readFieldOptions = readFieldOptions; - function readFieldOption(messageType, fieldName, extensionName, extensionType) { - var _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.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; + exports2.reflectionMergePartial = void 0; + function reflectionMergePartial(info6, target, source) { + let fieldValue, input = source, output; + for (let field of info6.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; + } } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; } - exports2.readMessageOption = readMessageOption; + exports2.reflectionMergePartial = reflectionMergePartial; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js -var require_oneof = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js"(exports2) { +// 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.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")) { + exports2.reflectionEquals = void 0; + var reflection_info_1 = require_reflection_info(); + function reflectionEquals(info6, a, b) { + if (a === b) + return true; + if (!a || !b) return false; + for (let field of info6.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; + } } - 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; - } + return true; } - 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.reflectionEquals = reflectionEquals; + var objectValues = Object.values; + function primitiveEq(type2, a, b) { + if (a === b) + return true; + if (type2 !== 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; } - exports2.setUnknownOneofValue = setUnknownOneofValue; - function clearOneofValue(oneof) { - if (oneof.oneofKind !== void 0) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = void 0; + function repeatedPrimitiveEq(type2, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!primitiveEq(type2, a[i], b[i])) + return false; + return true; } - exports2.clearOneofValue = clearOneofValue; - function getSelectedOneofValue(oneof) { - if (oneof.oneofKind === void 0) { - return void 0; - } - return oneof[oneof.oneofKind]; + function repeatedMsgEq(type2, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!type2.equals(a[i], b[i])) + return false; + return true; } - 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) { +// 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.ReflectionTypeCheck = void 0; + exports2.MessageType = void 0; + var message_type_contract_1 = require_message_type_contract(); var reflection_info_1 = require_reflection_info(); - var oneof_1 = require_oneof(); - var ReflectionTypeCheck = class { - constructor(info6) { - var _a; - this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; + 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); } - 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; - } - } + create(value) { + let message = reflection_create_1.reflectionCreate(this); + if (value !== void 0) { + reflection_merge_partial_1.reflectionMergePartial(this, message, value); } - this.data = { req, known, oneofs: Object.values(oneofs) }; + return message; } /** - * 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. + * Clone the message. * - * The number of map entries / repeated values being checked - * is < depth. + * Unknown fields are discarded. */ - 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; + clone(message) { + let copy = this.create(); + reflection_merge_partial_1.reflectionMergePartial(this, copy, message); + return copy; } - 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; + /** + * 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); } - message(arg, type2, allowExcessProperties, depth) { - if (allowExcessProperties) { - return type2.isAssignable(arg, depth); - } - return type2.is(arg, depth); + /** + * 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); } - messages(arg, type2, 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 (!type2.isAssignable(arg[i], depth - 1)) - return false; - } else { - for (let i = 0; i < arg.length && i < depth; i++) - if (!type2.is(arg[i], depth - 1)) - return false; - } - return true; + /** + * 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(json2, options) { + return this.internalJsonRead(json2, json_format_contract_1.jsonReadOptions(options)); + } + /** + * Read a new message from a JSON string. + * This is equivalent to `T.fromJson(JSON.parse(json))`. + */ + fromJsonString(json2, options) { + let value = JSON.parse(json2); + 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 _a; + let value = this.toJson(message, options); + return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); } - scalar(arg, type2, longType) { - let argType = typeof arg; - switch (type2) { - 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); - } + /** + * Write the message to binary format. + */ + toBinary(message, options) { + let opt = binary_writer_1.binaryWriteOptions(options); + return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish(); } - scalars(arg, type2, 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], type2, longType)) - return false; + /** + * 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(json2, options, target) { + if (json2 !== null && typeof json2 == "object" && !Array.isArray(json2)) { + let message = target !== null && target !== void 0 ? target : this.create(); + this.refJsonReader.read(json2, message, options); + return message; } - return true; + throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json2)}.`); } - mapKeys(map2, type2, depth) { - let keys = Object.keys(map2); - switch (type2) { - 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)), type2, depth); - case reflection_info_1.ScalarType.BOOL: - return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type2, depth); - default: - return this.scalars(keys, type2, depth, reflection_info_1.LongType.STRING); - } + /** + * 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.ReflectionTypeCheck = ReflectionTypeCheck; + exports2.MessageType = MessageType; } }); -// 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) { +// 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.reflectionLongConvert = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionLongConvert(long, type2) { - switch (type2) { - case reflection_info_1.LongType.BIGINT: - return long.toBigInt(); - case reflection_info_1.LongType.NUMBER: - return long.toNumber(); - default: - return long.toString(); + 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.reflectionLongConvert = reflectionLongConvert; + exports2.isEnumObject = isEnumObject; + function listEnumValues(enumObject) { + if (!isEnumObject(enumObject)) + throw new Error("not a typescript enum object"); + let values = []; + for (let [name, number] of Object.entries(enumObject)) + if (typeof number == "number") + values.push({ name, number }); + 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, index, arr) => arr.indexOf(num) == index); + } + exports2.listEnumNumbers = listEnumNumbers; } }); -// 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) { +// 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 }); - exports2.ReflectionJsonReader = void 0; 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(); - var reflection_info_1 = require_reflection_info(); + 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(); - var reflection_long_convert_1 = require_reflection_long_convert(); - var ReflectionJsonReader = class { - constructor(info6) { - this.info = info6; - } - prepare() { - var _a; - if (this.fMap === void 0) { - this.fMap = {}; - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - 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 val2; - switch (field.V.kind) { - case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); - break; - case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - break; - case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); - break; - } - this.assert(val2 !== 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] = val2; - } - } 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 val2; - switch (field.kind) { - case "message": - val2 = field.T().internalJsonRead(jsonItem, options); - break; - case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - break; - case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); - break; - } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); - } - } 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 val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - target[localName] = val2; - break; - case "scalar": - if (jsonValue === null) - continue; - target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); - break; - } - } - } + 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 _a, _b, _c; + let m = method; + m.service = service; + m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : 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 _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; + } + exports2.readMethodOptions = readMethodOptions; + function readMethodOption(service, methodName, extensionName, extensionType) { + var _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + if (!options) { + return void 0; } - /** - * Returns `false` for unrecognized string representations. - * - * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). - */ - enum(type2, json2, fieldName, ignoreUnknownFields) { - if (type2[0] == "google.protobuf.NullValue") - assert_1.assert(json2 === null || json2 === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); - if (json2 === null) - return 0; - switch (typeof json2) { - case "number": - assert_1.assert(Number.isInteger(json2), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json2}.`); - return json2; - case "string": - let localEnumName = json2; - if (type2[2] && json2.substring(0, type2[2].length) === type2[2]) - localEnumName = json2.substring(type2[2].length); - let enumNumber = type2[1][localEnumName]; - if (typeof enumNumber === "undefined" && ignoreUnknownFields) { - return false; - } - assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json2}".`); - return enumNumber; - } - assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json2}".`); + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; } - scalar(json2, type2, longType, fieldName) { - let e; - try { - switch (type2) { - // 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 (json2 === null) - return 0; - if (json2 === "NaN") - return Number.NaN; - if (json2 === "Infinity") - return Number.POSITIVE_INFINITY; - if (json2 === "-Infinity") - return Number.NEGATIVE_INFINITY; - if (json2 === "") { - e = "empty string"; - break; - } - if (typeof json2 == "string" && json2.trim().length !== json2.length) { - e = "extra whitespace"; - break; - } - if (typeof json2 != "string" && typeof json2 != "number") { - break; - } - let float2 = Number(json2); - if (Number.isNaN(float2)) { - e = "not a number"; - break; - } - if (!Number.isFinite(float2)) { - e = "too large or small"; - break; - } - if (type2 == reflection_info_1.ScalarType.FLOAT) - assert_1.assertFloat32(float2); - return float2; - // 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 (json2 === null) - return 0; - let int32; - if (typeof json2 == "number") - int32 = json2; - else if (json2 === "") - e = "empty string"; - else if (typeof json2 == "string") { - if (json2.trim().length !== json2.length) - e = "extra whitespace"; - else - int32 = Number(json2); - } - if (int32 === void 0) - break; - if (type2 == 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 (json2 === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); - if (typeof json2 != "number" && typeof json2 != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json2), longType); - case reflection_info_1.ScalarType.FIXED64: - case reflection_info_1.ScalarType.UINT64: - if (json2 === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); - if (typeof json2 != "number" && typeof json2 != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json2), longType); - // bool: - case reflection_info_1.ScalarType.BOOL: - if (json2 === null) - return false; - if (typeof json2 !== "boolean") - break; - return json2; - // string: - case reflection_info_1.ScalarType.STRING: - if (json2 === null) - return ""; - if (typeof json2 !== "string") { - e = "extra whitespace"; - break; - } - try { - encodeURIComponent(json2); - } catch (e2) { - e2 = "invalid UTF8"; - break; - } - return json2; - // 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 (json2 === null || json2 === "") - return new Uint8Array(0); - if (typeof json2 !== "string") - break; - return base64_1.base64decode(json2); - } - } catch (error4) { - e = error4.message; - } - this.assert(false, fieldName + (e ? " - " + e : ""), json2); + return extensionType ? extensionType.fromJson(optionVal) : optionVal; + } + exports2.readMethodOption = readMethodOption; + function readServiceOption(service, extensionName, extensionType) { + const options = service.options; + if (!options) { + return void 0; } - }; - exports2.ReflectionJsonReader = ReflectionJsonReader; + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; + } + return extensionType ? extensionType.fromJson(optionVal) : optionVal; + } + exports2.readServiceOption = readServiceOption; } }); -// 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) { +// 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.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(info6) { - var _a; - this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; - } - /** - * Converts the message to a JSON object, based on the field descriptors. - */ - write(message, options) { - const json2 = {}, source = message; - for (const field of this.fields) { - if (!field.oneof) { - let jsonValue2 = this.field(field, source[field.localName], options); - if (jsonValue2 !== void 0) - json2[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); - json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; - } - return json2; + 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 : {}; } - 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 val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - break; - case "message": - const messageType = field.V.T(); - for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - 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 val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - break; - case "message": - const messageType = field.T(); - for (let i = 0; i < value.length; i++) { - const val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - 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; + }; + 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 : {}; } - /** - * Returns `null` as the default for google.protobuf.NullValue. - */ - enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { - if (type2[0] == "google.protobuf.NullValue") - return !emitDefaultValues && !optional ? void 0 : null; - if (value === void 0) { - assert_1.assert(optional); - return void 0; + toString() { + const l = [this.name + ": " + this.message]; + if (this.code) { + l.push(""); + l.push("Code: " + this.code); } - if (value === 0 && !emitDefaultValues && !optional) - return void 0; - assert_1.assert(typeof value == "number"); - assert_1.assert(Number.isInteger(value)); - if (enumAsInteger || !type2[1].hasOwnProperty(value)) - return value; - if (type2[2]) - return type2[2] + type2[1][value]; - return type2[1][value]; - } - message(type2, value, fieldName, options) { - if (value === void 0) - return options.emitDefaultValues ? null : void 0; - return type2.internalJsonWrite(value, options); - } - scalar(type2, value, fieldName, optional, emitDefaultValues) { - if (value === void 0) { - assert_1.assert(optional); - return void 0; + if (this.serviceName && this.methodName) { + l.push("Method: " + this.serviceName + "/" + this.methodName); } - const ed = emitDefaultValues || optional; - switch (type2) { - // 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); + 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.ReflectionJsonWriter = ReflectionJsonWriter; + exports2.RpcError = RpcError; } }); -// 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) { +// 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.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(type2, longType = reflection_info_1.LongType.STRING) { - switch (type2) { - 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.mergeRpcOptions = void 0; + var runtime_1 = require_commonjs16(); + function mergeRpcOptions(defaults, options) { + if (!options) + return defaults; + let o = {}; + copy(defaults, o); + copy(options, o); + for (let key of Object.keys(options)) { + let val = options[key]; + switch (key) { + case "jsonOptions": + o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); + break; + case "binaryOptions": + o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); + break; + case "meta": + o.meta = {}; + copy(defaults.meta, o.meta); + copy(options.meta, o.meta); + break; + case "interceptors": + o.interceptors = defaults.interceptors ? defaults.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; } } - 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) { +// 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.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(info6) { - this.info = info6; - } - prepare() { - var _a; - if (!this.fieldNoToField) { - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); + 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((resolve6, reject) => { + this._resolve = resolve6; + this._reject = reject; + }); + if (preventUnhandledRejectionWarning) { + this._promise.catch((_) => { + }); } } /** - * 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. + * Get the current state of the promise. */ - 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; - } - } + get state() { + return this._state; } /** - * Read a map field, expecting key field = 1, value field = 2 + * Get the deferred promise. */ - mapEntry(field, reader, options) { - let length = reader.uint32(); - let end = reader.pos + length; - let key = void 0; - let val2 = 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": - val2 = this.scalar(reader, field.V.T, field.V.L); - break; - case "enum": - val2 = reader.int32(); - break; - case "message": - val2 = 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 (val2 === void 0) - switch (field.V.kind) { - case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); - break; - case "enum": - val2 = 0; - break; - case "message": - val2 = field.V.T().create(); - break; - } - return [key, val2]; + get promise() { + return this._promise; } - scalar(reader, type2, longType) { - switch (type2) { - 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); - } + /** + * 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.ReflectionBinaryReader = ReflectionBinaryReader; + exports2.Deferred = Deferred; } }); -// 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) { +// 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.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(info6) { - this.info = info6; + 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: [] }; } - prepare() { - if (!this.fields) { - const fieldsInput = this.info.fields ? this.info.fields.concat() : []; - this.fields = fieldsInput.sort((a, b) => a.no - b.no); - } + // --- 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 /** - * Writes the message to binary format. + * Is this stream already closed by a completion or error? */ - 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, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); - 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(); + get closed() { + return this._closed !== false; } - message(writer, options, handler, fieldNo, value) { - if (value === void 0) - return; - handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); - writer.join(); + /** + * 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(); } /** - * Write a single scalar value. + * Emits a new message. Throws if stream is closed. + * + * Triggers onNext and onMessage callbacks. */ - scalar(writer, type2, fieldNo, value, emitDefault) { - let [wireType, method, isDefault] = this.scalarInfo(type2, value); - if (!isDefault || emitDefault) { - writer.tag(fieldNo, wireType); - writer[method](value); - } + 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)); } /** - * Write an array of scalar values in packed format. + * Closes the stream with an error. Throws if stream is closed. + * + * Triggers onNext and onError callbacks. */ - packed(writer, type2, fieldNo, value) { - if (!value.length) - return; - assert_1.assert(type2 !== reflection_info_1.ScalarType.BYTES && type2 !== reflection_info_1.ScalarType.STRING); - writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); - writer.fork(); - let [, method] = this.scalarInfo(type2); - for (let i = 0; i < value.length; i++) - writer[method](value[i]); - writer.join(); + 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(); } /** - * Get information for writing a scalar value. + * Closes the stream successfully. Throws if stream is closed. * - * Returns tuple: - * [0]: appropriate WireType - * [1]: name of the appropriate method of IBinaryWriter - * [2]: whether the given value is a default value + * 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. * - * If argument `value` is omitted, [2] is always false. + * 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. */ - scalarInfo(type2, value) { - let t = binary_format_contract_1.WireType.Varint; - let m; - let i = value === void 0; - let d = value === 0; - switch (type2) { - 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; + [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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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); + } } - return [t, m, i || d]; + function step(result) { + result.done ? resolve6(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + 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.ReflectionBinaryWriter = ReflectionBinaryWriter; + exports2.UnaryCall = UnaryCall; } }); -// 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) { +// 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"; - 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(type2) { - const msg = type2.messagePrototype ? Object.create(type2.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type2 }); - for (let field of type2.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - return msg; - } - exports2.reflectionCreate = reflectionCreate; + /** + * 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/build/commonjs/reflection-merge-partial.js -var require_reflection_merge_partial = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-merge-partial.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionMergePartial = void 0; - function reflectionMergePartial(info6, target, source) { - let fieldValue, input = source, output; - for (let field of info6.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } else { - fieldValue = input[name]; - output = target; - if (fieldValue == void 0) { - continue; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - 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; + function step(result) { + result.done ? resolve6(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.response = response; + this.status = status; + this.trailers = trailers; } - } - exports2.reflectionMergePartial = reflectionMergePartial; + /** + * 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/build/commonjs/reflection-equals.js -var require_reflection_equals = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-equals.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionEquals = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionEquals(info6, a, b) { - if (a === b) - return true; - if (!a || !b) - return false; - for (let field of info6.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - return true; - } - exports2.reflectionEquals = reflectionEquals; - var objectValues = Object.values; - function primitiveEq(type2, a, b) { - if (a === b) - return true; - if (type2 !== 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(type2, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!primitiveEq(type2, a[i], b[i])) - return false; - return true; - } - function repeatedMsgEq(type2, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!type2.equals(a[i], b[i])) - return false; - return true; - } + /** + * 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/build/commonjs/message-type.js -var require_message_type = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js"(exports2) { +// 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"; - 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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - create(value) { - let message = reflection_create_1.reflectionCreate(this); - if (value !== void 0) { - reflection_merge_partial_1.reflectionMergePartial(this, message, value); + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - return message; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve6(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 : {}; } /** - * Clone the message. - * - * Unknown fields are discarded. + * Sent message(s) during the last operation. */ - clone(message) { - let copy = this.create(); - reflection_merge_partial_1.reflectionMergePartial(this, copy, message); - return copy; + get sentMessages() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.sent; + } else if (typeof this.lastInput == "object") { + return [this.lastInput.single]; + } + return []; } /** - * 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`. + * Sending message(s) completed? */ - equals(a, b) { - return reflection_equals_1.reflectionEquals(this, a, b); + 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 _a; + const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _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); } /** - * 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)? + * 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. */ - is(arg, depth = this.defaultCheckDepth) { - return this.refTypeCheck.is(arg, depth, false); + 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(); + }); } - /** - * 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); + // Creates a promise for response status from the mock data. + promiseStatus() { + var _a; + const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; + return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); } - /** - * Copy partial data into the target message. - */ - mergePartial(target, source) { - reflection_merge_partial_1.reflectionMergePartial(this, target, source); + // Creates a promise for response trailers from the mock data. + promiseTrailers() { + var _a; + const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; + return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); } - /** - * 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); + maybeSuppressUncaught(...promise) { + if (this.suppressUncaughtRejections) { + for (let p of promise) { + p.catch(() => { + }); + } + } } - /** - * Read a new message from a JSON value. - */ - fromJson(json2, options) { - return this.internalJsonRead(json2, json_format_contract_1.jsonReadOptions(options)); + mergeOptions(options) { + return rpc_options_1.mergeRpcOptions({}, options); } - /** - * Read a new message from a JSON string. - * This is equivalent to `T.fromJson(JSON.parse(json))`. - */ - fromJsonString(json2, options) { - let value = JSON.parse(json2); - return this.fromJson(value, options); + unary(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseTrailers()); + this.maybeSuppressUncaught(statusPromise, trailersPromise); + this.lastInput = { single: input }; + return new unary_call_1.UnaryCall(method, requestHeaders, input, headersPromise, responsePromise, statusPromise, trailersPromise); } - /** - * Write the message to canonical JSON value. - */ - toJson(message, options) { - return this.internalJsonWrite(message, json_format_contract_1.jsonWriteOptions(options)); + serverStreaming(method, input, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); } - /** - * Convert the message to canonical JSON string. - * This is equivalent to `JSON.stringify(T.toJson(t))` - */ - toJsonString(message, options) { + clientStreaming(method, options) { var _a; - let value = this.toJson(message, options); - return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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); } - /** - * Write the message to binary format. - */ - toBinary(message, options) { - let opt = binary_writer_1.binaryWriteOptions(options); - return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish(); + duplex(method, options) { + var _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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); } - /** - * 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(json2, options, target) { - if (json2 !== null && typeof json2 == "object" && !Array.isArray(json2)) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refJsonReader.read(json2, message, options); - return message; + }; + 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((resolve6, reject) => { + if (abort === null || abort === void 0 ? void 0 : abort.aborted) { + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + } else { + const id = setTimeout(() => resolve6(v), ms); + if (abort) { + abort.addEventListener("abort", (ev) => { + clearTimeout(id); + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + }); + } } - throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json2)}.`); + }); + } + var TestInputStream = class { + constructor(data, abort) { + this._completed = false; + this._sent = []; + this.data = data; + this.abort = abort; } - /** - * 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); + get sent() { + return this._sent; } - /** - * 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; + get completed() { + return this._completed; } - /** - * 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; + 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)); } }; - 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) { +// 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.listEnumNumbers = exports2.listEnumNames = exports2.listEnumValues = exports2.isEnumObject = void 0; - function isEnumObject(arg) { - if (typeof arg != "object" || arg === null) { - return false; + 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 _a, _b, _c, _d; + if (kind == "unary") { + let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); + for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { + const next = tail; + tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); + } + return tail(method, input, options); } - if (!arg.hasOwnProperty(0)) { - return false; + 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); } - 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; + 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); } - return true; + 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.isEnumObject = isEnumObject; - function listEnumValues(enumObject) { - if (!isEnumObject(enumObject)) - throw new Error("not a typescript enum object"); - let values = []; - for (let [name, number] of Object.entries(enumObject)) - if (typeof number == "number") - values.push({ name, number }); - return values; + exports2.stackIntercept = stackIntercept; + function stackUnaryInterceptors(transport, method, input, options) { + return stackIntercept("unary", transport, method, options, input); } - exports2.listEnumValues = listEnumValues; - function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + exports2.stackUnaryInterceptors = stackUnaryInterceptors; + function stackServerStreamingInterceptors(transport, method, input, options) { + return stackIntercept("serverStreaming", transport, method, options, input); } - exports2.listEnumNames = listEnumNames; - function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + exports2.stackServerStreamingInterceptors = stackServerStreamingInterceptors; + function stackClientStreamingInterceptors(transport, method, options) { + return stackIntercept("clientStreaming", transport, method, options); } - exports2.listEnumNumbers = listEnumNumbers; + exports2.stackClientStreamingInterceptors = stackClientStreamingInterceptors; + function stackDuplexStreamingInterceptors(transport, method, options) { + return stackIntercept("duplex", transport, method, options); + } + exports2.stackDuplexStreamingInterceptors = stackDuplexStreamingInterceptors; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { +// 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 }); - 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; + 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_binary_writer_1 = require_reflection_binary_writer(); - Object.defineProperty(exports2, "ReflectionBinaryWriter", { enumerable: true, get: function() { - return reflection_binary_writer_1.ReflectionBinaryWriter; + var reflection_info_1 = require_reflection_info2(); + Object.defineProperty(exports2, "readMethodOptions", { enumerable: true, get: function() { + return reflection_info_1.readMethodOptions; } }); - var reflection_json_reader_1 = require_reflection_json_reader(); - Object.defineProperty(exports2, "ReflectionJsonReader", { enumerable: true, get: function() { - return reflection_json_reader_1.ReflectionJsonReader; + Object.defineProperty(exports2, "readMethodOption", { enumerable: true, get: function() { + return reflection_info_1.readMethodOption; } }); - var reflection_json_writer_1 = require_reflection_json_writer(); - Object.defineProperty(exports2, "ReflectionJsonWriter", { enumerable: true, get: function() { - return reflection_json_writer_1.ReflectionJsonWriter; + Object.defineProperty(exports2, "readServiceOption", { enumerable: true, get: function() { + return reflection_info_1.readServiceOption; } }); - 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 rpc_error_1 = require_rpc_error(); + Object.defineProperty(exports2, "RpcError", { enumerable: true, get: function() { + return rpc_error_1.RpcError; } }); - var oneof_1 = require_oneof(); - Object.defineProperty(exports2, "isOneofGroup", { enumerable: true, get: function() { - return oneof_1.isOneofGroup; + var rpc_options_1 = require_rpc_options(); + Object.defineProperty(exports2, "mergeRpcOptions", { enumerable: true, get: function() { + return rpc_options_1.mergeRpcOptions; } }); - Object.defineProperty(exports2, "setOneofValue", { enumerable: true, get: function() { - return oneof_1.setOneofValue; + var rpc_output_stream_1 = require_rpc_output_stream(); + Object.defineProperty(exports2, "RpcOutputStreamController", { enumerable: true, get: function() { + return rpc_output_stream_1.RpcOutputStreamController; } }); - Object.defineProperty(exports2, "getOneofValue", { enumerable: true, get: function() { - return oneof_1.getOneofValue; + var test_transport_1 = require_test_transport(); + Object.defineProperty(exports2, "TestTransport", { enumerable: true, get: function() { + return test_transport_1.TestTransport; } }); - Object.defineProperty(exports2, "clearOneofValue", { enumerable: true, get: function() { - return oneof_1.clearOneofValue; + var deferred_1 = require_deferred(); + Object.defineProperty(exports2, "Deferred", { enumerable: true, get: function() { + return deferred_1.Deferred; } }); - Object.defineProperty(exports2, "getSelectedOneofValue", { enumerable: true, get: function() { - return oneof_1.getSelectedOneofValue; + Object.defineProperty(exports2, "DeferredState", { enumerable: true, get: function() { + return deferred_1.DeferredState; } }); - var enum_object_1 = require_enum_object(); - Object.defineProperty(exports2, "listEnumValues", { enumerable: true, get: function() { - return enum_object_1.listEnumValues; + var duplex_streaming_call_1 = require_duplex_streaming_call(); + Object.defineProperty(exports2, "DuplexStreamingCall", { enumerable: true, get: function() { + return duplex_streaming_call_1.DuplexStreamingCall; } }); - Object.defineProperty(exports2, "listEnumNames", { enumerable: true, get: function() { - return enum_object_1.listEnumNames; + var client_streaming_call_1 = require_client_streaming_call(); + Object.defineProperty(exports2, "ClientStreamingCall", { enumerable: true, get: function() { + return client_streaming_call_1.ClientStreamingCall; } }); - Object.defineProperty(exports2, "listEnumNumbers", { enumerable: true, get: function() { - return enum_object_1.listEnumNumbers; + var server_streaming_call_1 = require_server_streaming_call(); + Object.defineProperty(exports2, "ServerStreamingCall", { enumerable: true, get: function() { + return server_streaming_call_1.ServerStreamingCall; } }); - Object.defineProperty(exports2, "isEnumObject", { enumerable: true, get: function() { - return enum_object_1.isEnumObject; + var unary_call_1 = require_unary_call(); + Object.defineProperty(exports2, "UnaryCall", { enumerable: true, get: function() { + return unary_call_1.UnaryCall; } }); - var lower_camel_case_1 = require_lower_camel_case(); - Object.defineProperty(exports2, "lowerCamelCase", { enumerable: true, get: function() { - return lower_camel_case_1.lowerCamelCase; + var rpc_interceptor_1 = require_rpc_interceptor(); + Object.defineProperty(exports2, "stackIntercept", { enumerable: true, get: function() { + return rpc_interceptor_1.stackIntercept; } }); - var assert_1 = require_assert(); - Object.defineProperty(exports2, "assert", { enumerable: true, get: function() { - return assert_1.assert; + Object.defineProperty(exports2, "stackDuplexStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackDuplexStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertNever", { enumerable: true, get: function() { - return assert_1.assertNever; + Object.defineProperty(exports2, "stackClientStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackClientStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertInt32", { enumerable: true, get: function() { - return assert_1.assertInt32; + Object.defineProperty(exports2, "stackServerStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackServerStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertUInt32", { enumerable: true, get: function() { - return assert_1.assertUInt32; + Object.defineProperty(exports2, "stackUnaryInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackUnaryInterceptors; } }); - Object.defineProperty(exports2, "assertFloat32", { enumerable: true, get: function() { - return assert_1.assertFloat32; + 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/@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) { +// 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.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); - function normalizeMethodInfo(method, service) { - var _a, _b, _c; - let m = method; - m.service = service; - m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : 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 _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readMethodOptions = readMethodOptions; - function readMethodOption(service, methodName, extensionName, extensionType) { - var _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; - if (!options) { - return void 0; - } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; + 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*/ + } + ]); } - return extensionType ? extensionType.fromJson(optionVal) : optionVal; - } - exports2.readMethodOption = readMethodOption; - function readServiceOption(service, extensionName, extensionType) { - const options = service.options; - if (!options) { - return void 0; + 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; } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; + 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; } - 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 : {}; + 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.ServiceType = ServiceType; + exports2.CacheScope = new CacheScope$Type(); } }); -// 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) { +// 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.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 : {}; + 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 } + ]); } - 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}`); + 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 l.join("\n"); + 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.RpcError = RpcError; + exports2.CacheMetadata = new CacheMetadata$Type(); } }); -// 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) { +// 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.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs11(); - function mergeRpcOptions(defaults, options) { - if (!options) - return defaults; - let o = {}; - copy(defaults, o); - copy(options, o); - for (let key of Object.keys(options)) { - let val2 = options[key]; - switch (key) { - case "jsonOptions": - o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); - break; - case "binaryOptions": - o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); - break; - case "meta": - o.meta = {}; - copy(defaults.meta, o.meta); - copy(options.meta, o.meta); - break; - case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); - break; - } + 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*/ + } + ]); } - 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; + 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; } - } - } -}); - -// 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((resolve6, reject) => { - this._resolve = resolve6; - this._reject = reject; - }); - if (preventUnhandledRejectionWarning) { - this._promise.catch((_) => { - }); + 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; } - /** - * Get the current state of the promise. - */ - get state() { - return this._state; - } - /** - * Get the deferred promise. - */ - get promise() { - return this._promise; + 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; } - /** - * 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; + }; + 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*/ + } + ]); } - /** - * 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; + 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; } - /** - * Resolve the promise. Ignore if not pending. - */ - resolvePending(val2) { - if (this._state === DeferredState.PENDING) - this.resolve(val2); + 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; } - /** - * Reject the promise. Ignore if not pending. - */ - rejectPending(reason) { - if (this._state === DeferredState.PENDING) - this.reject(reason); + 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.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_commonjs11(); - var RpcOutputStreamController = class { + exports2.CreateCacheEntryResponse = new CreateCacheEntryResponse$Type(); + var FinalizeCacheEntryUploadRequest$Type = class extends runtime_5.MessageType { 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); + 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*/ + } + ]); } - onError(callback) { - return this.addLis(callback, this._lis.err); + 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; } - onComplete(callback) { - return this.addLis(callback, this._lis.cmp); + 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; } - addLis(callback, list) { - list.push(callback); - return () => { - let i = list.indexOf(callback); - if (i >= 0) - list.splice(i, 1); - }; + 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; } - // remove all listeners - clearLis() { - for (let l of Object.values(this._lis)) - l.splice(0, l.length); + }; + 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*/ + } + ]); } - // --- Controller API - /** - * Is this stream already closed by a completion or error? - */ - get closed() { - return this._closed !== false; + 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; } - /** - * 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, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); - if (message) - this.notifyMessage(message); - if (error4) - this.notifyError(error4); - if (complete) - this.notifyComplete(); + 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; } - /** - * 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)); + 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; } - /** - * Closes the stream with an error. Throws if stream is closed. - * - * Triggers onNext and onError callbacks. - */ - notifyError(error4) { - runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); - this.clearLis(); + }; + 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*/ + } + ]); } - /** - * 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(); + 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; } - /** - * 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; + 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); } - }; - } - // "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); } + return message; } - }; - 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + 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; } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + 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*/ + } + ]); } - /** - * 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)); + 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; } - promiseFinished() { - return __awaiter4(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 - }; - }); + 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.UnaryCall = UnaryCall; + 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/@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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; + 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); } - /** - * 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)); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toJson(request, { + 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 + })); } - promiseFinished() { - return __awaiter4(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 - }; + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { + 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 + })); } - }; - 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { + 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 + })); } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + exports2.CacheServiceClientJSON = CacheServiceClientJSON; + var CacheServiceClientProtobuf = class { + constructor(rpc) { + this.rpc = rpc; + this.CreateCacheEntry.bind(this); + this.FinalizeCacheEntryUpload.bind(this); + this.GetCacheEntryDownloadURL.bind(this); } - /** - * 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)); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); + return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); } - promiseFinished() { - return __awaiter4(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 - }; - }); + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); + 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(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); + 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.ClientStreamingCall = ClientStreamingCall; + exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; } }); -// 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) { +// node_modules/@actions/cache/lib/internal/shared/util.js +var require_util9 = __commonJS({ + "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; + 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)}`); } - /** - * 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)); + } + function maskSecretUrls(body) { + if (typeof body !== "object" || body === null) { + (0, core_1.debug)("body is not an object or is null"); + return; } - promiseFinished() { - return __awaiter4(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 - }; - }); + if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { + maskSigUrl(body.signed_upload_url); } - }; - exports2.DuplexStreamingCall = DuplexStreamingCall; + if ("signed_download_url" in body && typeof body.signed_download_url === "string") { + maskSigUrl(body.signed_download_url); + } + } } }); -// 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) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -75057,1199 +82235,1137 @@ var require_test_transport = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TestTransport = void 0; - var rpc_error_1 = require_rpc_error(); - var runtime_1 = require_commonjs11(); - 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; + 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_util9(); + var CacheServiceClient = class { + constructor(userAgent, 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; } - return false; - } - // Creates a promise for response headers from the mock data. - promiseHeaders() { - var _a; - const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _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); + if (baseRetryIntervalMilliseconds) { + this.baseRetryIntervalMilliseconds = baseRetryIntervalMilliseconds; } - 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(); + if (retryMultiplier) { + this.retryMultiplier = retryMultiplier; } - runtime_1.assert(method.O.is(r)); - return Promise.resolve(r); + this.httpClient = new http_client_1.HttpClient(userAgent, [ + new auth_1.BearerCredentialHandler(token) + ]); } - /** - * 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 __awaiter4(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); - } + // 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 { - yield delay2(this.responseDelay, abort)(void 0); - } catch (error4) { - stream2.notifyError(error4); - 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 (error4) { - stream2.notifyError(error4); - 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 _a; - const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _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 _a; - const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _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(() => { - }); + 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}`); } - } - } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); - } - unary(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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((resolve6, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - } else { - const id = setTimeout(() => resolve6(v), ms); - if (abort) { - abort.addEventListener("abort", (ev) => { - clearTimeout(id); - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); - }); + 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++; } - } - }); - } - var TestInputStream = class { - constructor(data, abort) { - this._completed = false; - this._sent = []; - this.data = data; - this.abort = abort; + throw new Error(`Request failed`); + }); } - get sent() { - return this._sent; + isSuccessStatusCode(statusCode) { + if (!statusCode) + return false; + return statusCode >= 200 && statusCode < 300; } - get completed() { - return this._completed; + 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); } - 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)); + sleep(milliseconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => setTimeout(resolve6, milliseconds)); + }); } - complete() { - if (this.data.inputComplete instanceof rpc_error_1.RpcError) { - return Promise.reject(this.data.inputComplete); + getExponentialRetryTimeMilliseconds(attempt) { + if (attempt < 0) { + throw new Error("attempt should be a positive integer"); } - 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)); + 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/@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) { +// node_modules/@actions/cache/lib/internal/tar.js +var require_tar = __commonJS({ + "node_modules/@actions/cache/lib/internal/tar.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_commonjs11(); - function stackIntercept(kind, transport, method, options, input) { - var _a, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); - } - return tail(method, input, options); + 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]; + } }; } - 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); + 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]); } - return tail(method, input, options); + __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(resolve6) { + resolve6(value); + }); } - 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 new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - return tail(method, options); - } - runtime_1.assertNever(kind); + function step(result) { + result.done ? resolve6(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 = extractTar2; + exports2.createTar = createTar; + var exec_1 = require_exec(); + var io6 = __importStar2(require_io()); + var fs_1 = require("fs"); + var path11 = __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 io6.which("gtar", false); + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else { + return { + path: yield io6.which("tar", true), + type: constants_1.ArchiveToolType.BSD + }; + } + } + default: + break; + } + return { + path: yield io6.which("tar", true), + type: constants_1.ArchiveToolType.GNU + }; + }); } - exports2.stackIntercept = stackIntercept; - function stackUnaryInterceptors(transport, method, input, options) { - return stackIntercept("unary", transport, method, options, input); + function getTarArgs(tarPath_1, compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (tarPath, compressionMethod, type2, 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 (type2) { + case "create": + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + break; + case "extract": + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path11.sep}`, "g"), "/")); + break; + case "list": + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path11.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; + }); } - exports2.stackUnaryInterceptors = stackUnaryInterceptors; - function stackServerStreamingInterceptors(transport, method, input, options) { - return stackIntercept("serverStreaming", transport, method, options, input); + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { + let args; + const tarPath = yield getTarPath(); + const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); + const compressionArgs = type2 !== "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 && type2 !== "create") { + args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + } else { + args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + } + if (BSD_TAR_ZSTD) { + return args; + } + return [args.join(" ")]; + }); } - exports2.stackServerStreamingInterceptors = stackServerStreamingInterceptors; - function stackClientStreamingInterceptors(transport, method, options) { - return stackIntercept("clientStreaming", transport, method, options); + function getWorkingDirectory() { + var _a; + return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); } - exports2.stackClientStreamingInterceptors = stackClientStreamingInterceptors; - function stackDuplexStreamingInterceptors(transport, method, options) { - return stackIntercept("duplex", transport, method, options); + 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(`\\${path11.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(`\\${path11.sep}`, "g"), "/") + ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; + default: + return ["-z"]; + } + }); } - 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(); - } + 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(`\\${path11.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(`\\${path11.sep}`, "g"), "/"), + constants_1.TarFilename + ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; + default: + return ["-z"]; } - } - /** - * 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_commonjs12 = __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; - } }); + }); + } + 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 extractTar2(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const workingDirectory = getWorkingDirectory(); + yield io6.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)(path11.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + const commands = yield getCommands(compressionMethod, "create"); + yield execCommands(commands, archiveFolder); + }); + } } }); -// 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) { +// node_modules/@actions/cache/lib/cache.js +var require_cache4 = __commonJS({ + "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheScope = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ - } - ]); + 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]; + } }; } - 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; + 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(resolve6) { + resolve6(value); + }); } - 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 new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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; - } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - 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_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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; + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache3; + exports2.saveCache = saveCache3; + var core12 = __importStar2(require_core()); + var path11 = __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 ValidationError = class _ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + Object.setPrototypeOf(this, _ValidationError.prototype); } - 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; + }; + exports2.ValidationError = ValidationError; + var ReserveCacheError = class _ReserveCacheError extends Error { + constructor(message) { + super(message); + this.name = "ReserveCacheError"; + Object.setPrototypeOf(this, _ReserveCacheError.prototype); } - 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.ReserveCacheError = ReserveCacheError; + var FinalizeCacheError = class _FinalizeCacheError extends Error { + constructor(message) { + super(message); + this.name = "FinalizeCacheError"; + Object.setPrototypeOf(this, _FinalizeCacheError.prototype); } }; - exports2.CacheMetadata = new CacheMetadata$Type(); - } -}); - -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ - } - ]); + 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`); } - 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; + } + function checkKey(key) { + if (key.length > 512) { + throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); } - 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; + const regex = /^[^,]*$/; + if (!regex.test(key)) { + throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); } - 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; + } + 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"]; } - }; - 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*/ + } + function restoreCache3(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)(); + core12.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + 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) { + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core12.debug("Resolved Keys:"); + core12.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 { + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + return void 0; } - ]); - } - 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); + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core12.info("Lookup only - skipping download"); + return cacheEntry.cacheKey; + } + archivePath = path11.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core12.debug(`Archive Path: ${archivePath}`); + yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); + if (core12.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core12.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core12.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) { + core12.error(`Failed to restore: ${error3.message}`); + } else { + core12.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core12.debug(`Failed to delete archive: ${error3}`); } } - 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*/ + 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) { + options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core12.debug("Resolved Keys:"); + core12.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 request = { + key: primaryKey, + restoreKeys, + version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) + }; + const response = yield twirpClient.GetCacheEntryDownloadURL(request); + if (!response.ok) { + core12.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); + return void 0; + } + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core12.info(`Cache hit for restore-key: ${response.matchedKey}`); + } else { + core12.info(`Cache hit for: ${response.matchedKey}`); + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core12.info("Lookup only - skipping download"); + return response.matchedKey; + } + archivePath = path11.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core12.debug(`Archive path: ${archivePath}`); + core12.debug(`Starting download of archive to: ${archivePath}`); + yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core12.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core12.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - ]); - } - 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); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core12.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) { + core12.error(`Failed to restore: ${error3.message}`); + } else { + core12.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + if (archivePath) { + yield utils.unlinkFile(archivePath); + } + } catch (error3) { + core12.debug(`Failed to delete archive: ${error3}`); } } - 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*/ + return void 0; + }); + } + function saveCache3(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + core12.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + checkKey(key); + 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 _a, _b, _c, _d, _e; + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core12.debug("Cache Paths:"); + core12.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 = path11.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core12.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core12.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - ]); - } - 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); + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core12.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.`); + } + core12.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + } + core12.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 === ReserveCacheError.name) { + core12.info(`Failed to save: ${typedError.message}`); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core12.error(`Failed to save: ${typedError.message}`); + } else { + core12.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core12.debug(`Failed to delete archive: ${error3}`); } } - 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*/ + return cacheId; + }); + } + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + 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); + core12.debug("Cache Paths:"); + core12.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 = path11.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core12.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core12.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - ]); - } - 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); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core12.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core12.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core12.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); + } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core12.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + } + core12.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); + core12.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 === ReserveCacheError.name) { + core12.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core12.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core12.error(`Failed to save: ${typedError.message}`); + } else { + core12.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core12.debug(`Failed to delete archive: ${error3}`); } } - return message; + return cacheId; + }); + } + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/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; } - 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; + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - }; - 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*/ - } - ]); + 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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - 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; + 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); } - 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); - } + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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"; } - return message; + this.command = command; + this.properties = properties; + this.message = 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; + 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; } }; - 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 } - ]); + 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/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) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); - var CacheServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); - } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toJson(request, { - 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(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { - 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 - })); + 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]; + } }; } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { - 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 - })); + 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; }; - exports2.CacheServiceClientJSON = CacheServiceClientJSON; - var CacheServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs12 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); + if (!fs12.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); + fs12.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" + }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/protobuf", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromBinary(data2)); + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - }; - exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/cache/lib/internal/shared/util.js -var require_util10 = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; - 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)); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url2} ${error4 instanceof Error ? error4.message : String(error4)}`); + } else { + return void 0; } } - 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; + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { - maskSigUrl(body.signed_upload_url); + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - if ("signed_download_url" in body && typeof body.signed_download_url === "string") { - maskSigUrl(body.signed_download_url); + 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.maskSecretUrls = maskSecretUrls; + 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/cache/lib/internal/shared/cacheTwirpClient.js -var require_cacheTwirpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -76277,426 +83393,571 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; - 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_auth2(); - var http_client_1 = require_lib4(); - var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util10(); - var CacheServiceClient = class { - constructor(userAgent, 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(userAgent, [ - new auth_1.BearerCredentialHandler(token) - ]); + exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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); } - // This function satisfies the Rpc interface. It is compatible with the JSON - // JSON generated client. - request(service, method, contentType, data) { - return __awaiter4(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(() => __awaiter4(this, void 0, void 0, function* () { - return this.httpClient.post(url2, JSON.stringify(data), headers); - })); - return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + }; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __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", () => { + resolve6(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve6(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(userAgent, 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 = userAgent; + 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 || {}); }); } - retryableRequest(operation) { - return __awaiter4(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(); + 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; } - errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, data); + } else { + return response; } - if (error4 instanceof errors_1.UsageError) { - throw error4; + } + 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; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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."); } - isRetryable = true; - errorMessage = error4.message; + yield response.readBody(); + if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { + for (const header in headers) { + if (header.toLowerCase() === "authorization") { + delete headers[header]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, data); + redirectsRemaining--; } - if (!isRetryable) { - throw new Error(`Received non-retryable error: ${errorMessage}`); + if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { + return response; } - if (attempt + 1 === this.maxAttempts) { - throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); + numTries += 1; + if (numTries < maxTries) { + yield response.readBody(); + yield this._performExponentialBackoff(numTries); } - 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`); + } while (numTries < maxTries); + return response; }); } - 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); + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; } - sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, milliseconds)); + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve6(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); }); } - getExponentialRetryTimeMilliseconds(attempt) { - if (attempt < 0) { - throw new Error("attempt should be a positive integer"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - if (attempt === 0) { - return this.baseRetryIntervalMilliseconds; + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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(); } - 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); - } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; - } -}); - -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + /** + * 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); } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + 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); } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + return info6; + } + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; - var exec_1 = require_exec(); - var io6 = __importStar4(require_io3()); - var fs_1 = require("fs"); - var path11 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { - return __awaiter4(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 io6.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io6.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; - } - } - default: - break; + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - return { - path: yield io6.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); - } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - 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 (type2) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path11.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path11.sep}`, "g"), "/"), "-P"); - break; + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - 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; + 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; } - return args; - }); - } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); - const compressionArgs = type2 !== "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 && type2 !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; - } else { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); + this._agent = agent; } - if (BSD_TAR_ZSTD) { - return args; + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); } - return [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a; - return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(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(`\\${path11.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(`\\${path11.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; + return agent; + } + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; } - }); - } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(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(`\\${path11.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(`\\${path11.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; + if (proxyAgent) { + return proxyAgent; } - }); - } - function execCommands(commands, cwd) { - return __awaiter4(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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); - } + 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 + }); } - }); - } - function listTar(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - exports2.listTar = listTar; - function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io6.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - exports2.extractTar = extractTar2; - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path11.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - exports2.createTar = createTar; + 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((resolve6) => setTimeout(() => resolve6(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve6(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 { + resolve6(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -76724,380 +83985,524 @@ var require_cache3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core12 = __importStar4(require_core()); - var path11 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); - var config_1 = require_config(); - var tar_1 = require_tar(); - var http_client_1 = require_lib4(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); + exports2.PersonalAccessTokenCredentialHandler = exports2.BearerCredentialHandler = exports2.BasicCredentialHandler = void 0; + var BasicCredentialHandler = class { + constructor(username, password) { + this.username = username; + this.password = password; } - }; - exports2.ValidationError = ValidationError; - var ReserveCacheError = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - }; - exports2.ReserveCacheError = ReserveCacheError; - var FinalizeCacheError = class _FinalizeCacheError extends Error { - constructor(message) { - super(message); - this.name = "FinalizeCacheError"; - Object.setPrototypeOf(this, _FinalizeCacheError.prototype); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } }; - 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`); + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - } - function checkKey(key) { - if (key.length > 512) { - throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`); + // 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}`; } - const regex = /^[^,]*$/; - if (!regex.test(key)) { - throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - } - 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"]; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core12.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - switch (cacheServiceVersion) { - case "v2": - return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - case "v1": - default: - return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - } - }); - } - exports2.restoreCache = restoreCache3; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core12.debug("Resolved Keys:"); - core12.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); + }; + 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"); } - const compressionMethod = yield utils.getCompressionMethod(); - let archivePath = ""; - try { - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core12.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path11.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core12.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core12.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core12.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to restore: ${error4.message}`); - } else { - core12.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + 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/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core12.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core12.debug("Resolved Keys:"); - core12.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 request = { - key: primaryKey, - restoreKeys, - version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) - }; - const response = yield twirpClient.GetCacheEntryDownloadURL(request); - if (!response.ok) { - core12.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); - return void 0; - } - const isRestoreKeyMatch = request.key !== response.matchedKey; - if (isRestoreKeyMatch) { - core12.info(`Cache hit for restore-key: ${response.matchedKey}`); - } else { - core12.info(`Cache hit for: ${response.matchedKey}`); - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core12.info("Lookup only - skipping download"); - return response.matchedKey; - } - archivePath = path11.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core12.debug(`Archive path: ${archivePath}`); - core12.debug(`Starting download of archive to: ${archivePath}`); - yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core12.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core12.info("Cache restored successfully"); - return response.matchedKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to restore: ${error4.message}`); - } else { - core12.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { + function rejected(value) { try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error4) { - core12.debug(`Failed to delete archive: ${error4}`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return void 0; - }); - } - function saveCache3(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core12.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - exports2.saveCache = saveCache3; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core12.debug("Cache Paths:"); - core12.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.`); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OidcClient = void 0; + var http_client_1 = require_lib5(); + var auth_1 = require_auth3(); + 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"); } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path11.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core12.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core12.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.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.`); - } - core12.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize + 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 _a; + 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}`); }); - if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - core12.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core12.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to save: ${typedError.message}`); - } else { - core12.warning(`Failed to save: ${typedError.message}`); + 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}`); } - } finally { + }); + } + }; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core12.debug(`Failed to delete archive: ${error4}`); + step(generator.next(value)); + } catch (e) { + reject(e); } } - return cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core12.debug("Cache Paths:"); - core12.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 = path11.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core12.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core12.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core12.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core12.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; + function rejected(value) { try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core12.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core12.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + step(generator["throw"](value)); + } catch (e) { + reject(e); } - core12.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); - core12.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.`); + } + function step(result) { + result.done ? resolve6(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; } - cacheId = parseInt(finalizeResponse.entryId); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core12.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core12.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core12.error(`Failed to save: ${typedError.message}`); - } else { - core12.warning(`Failed to save: ${typedError.message}`); - } + 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.`); } - } finally { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core12.debug(`Failed to delete archive: ${error4}`); + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + 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 cacheId; - }); + 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/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/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 path11 = __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, path11.sep); } + exports2.toPlatformPath = toPlatformPath; } }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ +var require_io_util3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77106,21 +84511,21 @@ var require_io_util4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -77150,14 +84555,14 @@ var require_io_util4 = __commonJS({ var _a; 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 fs12 = __importStar4(require("fs")); - var path11 = __importStar4(require("path")); + var fs12 = __importStar2(require("fs")); + var path11 = __importStar2(require("path")); _a = fs12.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs12.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -77171,7 +84576,7 @@ var require_io_util4 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -77189,7 +84594,7 @@ var require_io_util4 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -77267,10 +84672,10 @@ var require_io_util4 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ +var require_io3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77279,21 +84684,21 @@ var require_io4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -77323,10 +84728,10 @@ var require_io4 = __commonJS({ 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 path11 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); + var path11 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -77353,7 +84758,7 @@ var require_io4 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -77374,7 +84779,7 @@ var require_io4 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -77394,14 +84799,14 @@ var require_io4 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77425,7 +84830,7 @@ var require_io4 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77458,315 +84863,90 @@ var require_io4 = __commonJS({ const matches = []; for (const directory of directories) { const filePath = yield ioUtil.tryGetExecutablePath(path11.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os2 = require("os"); - var cp = require("child_process"); - var fs12 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os2.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os2.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; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs12.existsSync(lsbReleaseFile)) { - contents = fs12.readFileSync(lsbReleaseFile).toString(); - } else if (fs12.existsSync(osReleaseFile)) { - contents = fs12.readFileSync(osReleaseFile).toString(); - } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/tool-cache/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 (_a) { - 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; + if (filePath) { + matches.push(filePath); + } } - } - return false; + return matches; + }); } - 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]"); + 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 copyFile(srcFile, destFile, force); + } + } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + function copyFile(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); + } + }); } - 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/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -77794,598 +84974,463 @@ var require_lib5 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(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", () => { - resolve6(output.toString()); - }); - })); - }); + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path11 = __importStar2(require("path")); + var io6 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve6(Buffer.concat(chunks)); - }); - })); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + _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)}`; + } } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; } } + return cmd; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - /** - * 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 __awaiter4(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); - }); + _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; } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + _endsWith(str2, end) { + return str2.endsWith(end); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + _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(""); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + _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; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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; - }); + } + 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; } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); + _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}"`; } - this._disposed = true; + return result; } /** - * Raw request. - * @param info - * @param data + * 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 */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); + exec() { + return __awaiter2(this, void 0, void 0, function* () { + if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { + this.toolPath = path11.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve6, 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) + os2.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 { - resolve6(res); + resolve6(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); } + cp.stdin.end(this.options.input); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); + })); }); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } + }; + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } - const req = info6.httpModule.request(info6.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(); + 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); } - handleResult(new Error(`Request timeout: ${info6.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(); + continue; } - } - /** - * 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; + if (c === "\\" && escaped) { + append(c); + continue; } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; + if (c === "\\" && inQuotes) { + escaped = true; + continue; } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; } + continue; } - return info6; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + append(c); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + if (arg.length > 0) { + args.push(arg.trim()); } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + 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"); } - if (!useProxy) { - agent = this._agent; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - if (agent) { - return agent; + } + CheckComplete() { + if (this.done) { + return; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } - 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; + } + _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`); } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; } - return agent; + this.done = true; + this.emit("done", error3, this.processExitCode); } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; - } - if (proxyAgent) { - return proxyAgent; + static HandleTimeout(state) { + if (state.done) { + return; } - 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 - }); + 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); } - return proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve6(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 { - resolve6(response); - } - })); - }); + state._setResult(); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -78413,58 +85458,63 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core12 = __importStar4(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"); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + function exec(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.`); } - } - execute(action, isRetryable) { - return __awaiter4(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; - } - core12.info(err.message); - } - const seconds = this.getSleepAmount(); - core12.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + }; + 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 exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78477,21 +85527,21 @@ var require_tool_cache = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -78518,613 +85568,301 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core12 = __importStar4(require_core()); - var io6 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs12 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os2 = __importStar4(require("os")); - var path11 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver8 = __importStar4(require_semver2()); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(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); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url2, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path11.join(_getTempDirectory(), crypto.randomUUID()); - yield io6.mkdirP(path11.dirname(dest)); - core12.debug(`Downloading ${url2}`); - core12.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url2, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url2, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs12.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core12.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url2, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core12.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream2.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs12.createWriteStream(dest)); - core12.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core12.debug("download failed"); - try { - yield io6.rmRF(dest); - } catch (err) { - core12.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core12.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path11.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 io6.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core12.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() - } - }); - core12.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core12.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core12.isDebug()) { - args.push("-v"); - } - const xarPath = yield io6.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io6.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 - ]; - core12.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 io6.which("powershell", true); - core12.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io6.which("unzip", true); - const args = [file]; - if (!core12.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os2.arch(); - core12.debug(`Caching tool ${tool} ${version} ${arch2}`); - core12.debug(`source dir: ${sourceDir}`); - if (!fs12.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs12.readdirSync(sourceDir)) { - const s = path11.join(sourceDir, itemName); - yield io6.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch2); - return destPath; - }); - } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os2.arch(); - core12.debug(`Caching tool ${tool} ${version} ${arch2}`); - core12.debug(`source file: ${sourceFile}`); - if (!fs12.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path11.join(destFolder, targetFile); - core12.debug(`destination file ${destPath}`); - yield io6.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); - return destFolder; - }); - } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch2) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch2 = arch2 || os2.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path11.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core12.debug(`checking cache: ${cachePath}`); - if (fs12.existsSync(cachePath) && fs12.existsSync(`${cachePath}.complete`)) { - core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); - toolPath = cachePath; - } else { - core12.debug("not found"); - } - } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch2) { - const versions = []; - arch2 = arch2 || os2.arch(); - const toolPath = path11.join(_getCacheDirectory(), toolName); - if (fs12.existsSync(toolPath)) { - const children = fs12.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path11.join(toolPath, child, arch2 || ""); - if (fs12.existsSync(fullPath) && fs12.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } - } - return versions; - } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core12.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core12.debug("Invalid json"); - } - } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; + 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 exec = __importStar2(require_exec3()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path11.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io6.mkdirP(dest); - return dest; + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true }); - } - function _createToolPath(tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path11.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - core12.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io6.rmRF(folderPath); - yield io6.rmRF(markerPath); - yield io6.mkdirP(folderPath); - return folderPath; + return { + name: name.trim(), + version: version.trim() + }; + }); + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true }); - } - function _completeToolPath(tool, version, arch2) { - const folderPath = path11.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - const markerPath = `${folderPath}.complete`; - fs12.writeFileSync(markerPath, ""); - core12.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core12.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core12.debug(`explicit? ${valid3}`); - return valid3; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core12.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; - } - return -1; + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.getExecOutput("lsb_release", ["-i", "-r", "-s"], { + silent: true }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core12.debug(`matched: ${version}`); - } else { - core12.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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; - }; + 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/http-client/lib/proxy.js -var require_proxy5 = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.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; + 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]; + } }; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + 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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } else { - return void 0; + function step(result) { + result.done ? resolve6(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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os2 = __importStar2(require("os")); + var path11 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable5(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 checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + exports2.exportVariable = exportVariable5; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + process.env["PATH"] = `${inputPath}${path11.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + if (options && options.trimWhitespace === false) { + return val; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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; } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - 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; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning9(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning9; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } + return result; + }); + } + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return false; + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - 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]"); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - 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; - } - }; + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -79137,31 +85875,21 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -79189,628 +85917,780 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os2 = require("os"); + var cp = require("child_process"); + var fs12 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os2.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } + } + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); } - 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._findMatch = _findMatch; + function _getOsVersion() { + const plat = os2.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; + } + } + } } - }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs12.existsSync(lsbReleaseFile)) { + contents = fs12.readFileSync(lsbReleaseFile).toString(); + } else if (fs12.existsSync(osReleaseFile)) { + contents = fs12.readFileSync(osReleaseFile).toString(); } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(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", () => { - resolve6(output.toString()); - }); - })); - }); + return contents; + } + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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]; + } }; } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve6(Buffer.concat(chunks)); - }); - })); - }); + 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; }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } + function step(result) { + result.done ? resolve6(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 core12 = __importStar2(require_core3()); + 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"); + } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); + 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; + } + core12.info(err.message); + } + const seconds = this.getSleepAmount(); + core12.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); }); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + getSleepAmount() { + return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); + sleep(seconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => setTimeout(resolve6, seconds * 1e3)); }); } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + 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]; + } }; } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + 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); } - /** - * 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 __awaiter4(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); + __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(resolve6) { + resolve6(value); }); } - postJson(requestUrl_1, obj_1) { - return __awaiter4(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); - }); + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core12 = __importStar2(require_core3()); + var io6 = __importStar2(require_io3()); + var crypto2 = __importStar2(require("crypto")); + var fs12 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os2 = __importStar2(require("os")); + var path11 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver9 = __importStar2(require_semver2()); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + 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); } - putJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }; + exports2.HTTPError = HTTPError2; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url2, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path11.join(_getTempDirectory(), crypto2.randomUUID()); + yield io6.mkdirP(path11.dirname(dest)); + core12.debug(`Downloading ${url2}`); + core12.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 || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; }); - } - patchJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }); + } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url2, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs12.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false }); - } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + if (auth) { + core12.debug("set auth"); + if (headers === void 0) { + headers = {}; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + headers.authorization = auth; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve6(res); - } + const response = yield http.get(url2, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core12.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream2.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs12.createWriteStream(dest)); + core12.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core12.debug("download failed"); + try { + yield io6.rmRF(dest); + } catch (err) { + core12.debug(`Failed to delete '${dest}'. ${err.message}`); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + }); + } + 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 = core12.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } + } else { + const escapedScript = path11.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 io6.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - const req = info6.httpModule.request(info6.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(); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core12.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() } - handleResult(new Error(`Request timeout: ${info6.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + core12.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); + if (core12.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 { - req.end(); + args = [flags]; + } + args.push("-x", "-C", dest, "-f", file); + if (core12.isDebug()) { + args.push("-v"); + } + const xarPath = yield io6.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io6.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 + ]; + core12.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 io6.which("powershell", true); + core12.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 io6.which("unzip", true); + const args = [file]; + if (!core12.isDebug()) { + args.unshift("-q"); } - } - /** - * 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; + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os2.arch(); + core12.debug(`Caching tool ${tool} ${version} ${arch2}`); + core12.debug(`source dir: ${sourceDir}`); + if (!fs12.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; + const destPath = yield _createToolPath(tool, version, arch2); + for (const itemName of fs12.readdirSync(sourceDir)) { + const s = path11.join(sourceDir, itemName); + yield io6.cp(s, destPath, { recursive: true }); } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } + _completeToolPath(tool, version, arch2); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os2.arch(); + core12.debug(`Caching tool ${tool} ${version} ${arch2}`); + core12.debug(`source file: ${sourceFile}`); + if (!fs12.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); } - return info6; + const destFolder = yield _createToolPath(tool, version, arch2); + const destPath = path11.join(destFolder, targetFile); + core12.debug(`destination file ${destPath}`); + yield io6.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch2); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch2) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + arch2 = arch2 || os2.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch2); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path11.join(_getCacheDirectory(), toolName, versionSpec, arch2); + core12.debug(`checking cache: ${cachePath}`); + if (fs12.existsSync(cachePath) && fs12.existsSync(`${cachePath}.complete`)) { + core12.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + toolPath = cachePath; + } else { + core12.debug("not found"); } - return _default2; } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch2) { + const versions = []; + arch2 = arch2 || os2.arch(); + const toolPath = path11.join(_getCacheDirectory(), toolName); + if (fs12.existsSync(toolPath)) { + const children = fs12.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path11.join(toolPath, child, arch2 || ""); + if (fs12.existsSync(fullPath) && fs12.existsSync(`${fullPath}.complete`)) { + versions.push(child); } } } - 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 _default2; } - _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; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core12.debug("set auth"); + headers.authorization = auth; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; } - 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; + let manifestUrl = ""; + for (const item of response.result.tree) { + if (item.path === "versions-manifest.json") { + manifestUrl = item.url; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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 (_a) { + core12.debug("Invalid json"); + } } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path11.join(_getTempDirectory(), crypto2.randomUUID()); } - if (proxyAgent) { - return proxyAgent; + yield io6.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path11.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + core12.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io6.rmRF(folderPath); + yield io6.rmRF(markerPath); + yield io6.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch2) { + const folderPath = path11.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const markerPath = `${folderPath}.complete`; + fs12.writeFileSync(markerPath, ""); + core12.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core12.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core12.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core12.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); - }); + if (version) { + core12.debug(`matched: ${version}`); + } else { + core12.debug("match not found"); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve6(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 { - resolve6(response); - } - })); - }); + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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; }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ +var require_debug3 = __commonJS({ "node_modules/follow-redirects/debug.js"(exports2, module2) { var debug4; module2.exports = function() { if (!debug4) { try { debug4 = require_src()("follow-redirects"); - } catch (error4) { + } catch (error3) { } if (typeof debug4 !== "function") { debug4 = function() { @@ -79831,7 +86711,7 @@ var require_follow_redirects = __commonJS({ var https2 = require("https"); var Writable = require("stream").Writable; var assert = require("assert"); - var debug4 = require_debug2(); + var debug4 = require_debug3(); (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; @@ -79843,8 +86723,8 @@ var require_follow_redirects = __commonJS({ var useNativeURL = false; try { assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; } var preservedUrlFields = [ "auth", @@ -79918,9 +86798,9 @@ var require_follow_redirects = __commonJS({ this._currentRequest.abort(); this.emit("abort"); }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); + RedirectableRequest.prototype.destroy = function(error3) { + destroyRequest(this._currentRequest, error3); + destroy.call(this, error3); return this; }; RedirectableRequest.prototype.write = function(data, encoding, callback) { @@ -80087,10 +86967,10 @@ var require_follow_redirects = __commonJS({ var i = 0; var self2 = this; var buffers = this._requestBodyBuffers; - (function writeNext(error4) { + (function writeNext(error3) { if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); + if (error3) { + self2.emit("error", error3); } else if (i < buffers.length) { var buffer = buffers[i++]; if (!request.finished) { @@ -80289,12 +87169,12 @@ var require_follow_redirects = __commonJS({ }); return CustomError; } - function destroyRequest(request, error4) { + function destroyRequest(request, error3) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); - request.destroy(error4); + request.destroy(error3); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); @@ -83221,7 +90101,6 @@ __export(upload_lib_exports, { buildPayload: () => buildPayload, findSarifFilesInDir: () => findSarifFilesInDir, getGroupedSarifFilePaths: () => getGroupedSarifFilePaths, - getSarifFilePaths: () => getSarifFilePaths, populateRunAutomationDetails: () => populateRunAutomationDetails, postProcessSarifFiles: () => postProcessSarifFiles, readSarifFile: () => readSarifFile, @@ -83251,14 +90130,13 @@ var path2 = __toESM(require("path")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var fs = __toESM(require("fs")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -83275,14 +90153,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs12.lstat(itemPath, { bigint: true }) : await fs12.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs12.lstat(itemPath, { bigint: true }) : await fs12.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 fs12.readdir(itemPath) : await fs12.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs12.readdir(itemPath) : await fs12.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -83293,13 +90171,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -84179,6 +91057,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -84298,7 +91188,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -84338,16 +91228,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -85912,9 +92793,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -86050,11 +92931,11 @@ function parseMatrixInput(matrixInput) { } return JSON.parse(matrixInput); } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } function satisfiesGHESVersion(ghesVersion, range, defaultIfInvalid) { const semverVersion = semver.coerce(ghesVersion); @@ -86347,17 +93228,17 @@ function getAuthorizationHeaderFor(logger, apiDetails, url2) { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -86488,19 +93369,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -86516,9 +93397,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -86715,30 +93596,45 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); +// src/logging.ts +var core7 = __toESM(require_core()); +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/diff-informed-analysis-utils.ts var fs4 = __toESM(require("fs")); var path4 = __toESM(require("path")); // src/feature-flags.ts -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.23.3"; -var cliVersion = "2.23.3"; +var bundleVersion = "codeql-bundle-v2.23.8"; +var cliVersion = "2.23.8"; // src/overlay-database-utils.ts var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); // src/git-utils.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core7.debug(`Running git command: git ${args.join(" ")}`); + core8.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -86753,13 +93649,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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."; } - core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); - throw error4; + core8.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -86903,7 +93799,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core7.debug( + core8.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -86928,22 +93824,8 @@ async function isAnalyzingDefaultBranch() { return currentRef === defaultBranch; } -// src/logging.ts -var core8 = __toESM(require_core()); -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/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -87004,7 +93886,7 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { } // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); function isSupportedToolsFeature(versionInfo, feature) { return !!versionInfo.features && versionInfo.features[feature]; } @@ -87017,11 +93899,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -87033,6 +93910,16 @@ var featureConfig = { 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", @@ -87061,12 +93948,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -87167,6 +94048,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -87178,21 +94064,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -87220,9 +94107,12 @@ ${jsonContents}` } // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -87295,7 +94185,7 @@ var fs8 = __toESM(require("fs")); var path7 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // node_modules/uuid/dist-node/stringify.js var byteToHex = []; @@ -87356,9 +94246,9 @@ var import_child_process = require("child_process"); var fs6 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; async function getTarVersion() { @@ -87400,9 +94290,9 @@ async function isZstdAvailable(logger) { case "gnu": return { available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver5.gte( - semver5.coerce(version), - semver5.coerce(MIN_REQUIRED_GNU_TAR_VERSION) + semver6.gte( + semver6.coerce(version), + semver6.coerce(MIN_REQUIRED_GNU_TAR_VERSION) ), foundZstdBinary, version: tarVersion @@ -87411,7 +94301,7 @@ async function isZstdAvailable(logger) { return { available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain // a patch version number. - semver5.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), + semver6.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), foundZstdBinary, version: tarVersion }; @@ -87515,10 +94405,10 @@ var os = __toESM(require("os")); var path6 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; var TOOLCACHE_TOOL_NAME = "CodeQL"; function makeDownloadFirstToolsDownloadDurations(downloadDurationMs, extractionDurationMs) { @@ -87648,7 +94538,7 @@ function getToolcacheDirectory(version) { return path6.join( getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, - semver6.clean(version) || version, + semver7.clean(version) || version, os.arch() || "" ); } @@ -87773,13 +94663,13 @@ function tryGetTagNameFromUrl(url2, logger) { return match[1]; } function convertToSemVer(version, logger) { - if (!semver7.valid(version)) { + if (!semver8.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 = semver7.clean(version); + const s = semver8.clean(version); if (!s) { throw new Error(`Bundle version ${version} is not in SemVer format.`); } @@ -87887,7 +94777,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian url2 = toolsInput; if (tagName) { const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver7.valid(bundleVersion3)) { + if (bundleVersion3 && semver8.valid(bundleVersion3)) { cliVersion2 = convertToSemVer(bundleVersion3, logger); } } @@ -87970,7 +94860,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: cliVersion2 ?? humanReadableVersion }; } - if (variant !== 0 /* DOTCOM */ && !forceShippedTools && !toolsInput) { + if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { const result = await findOverridingToolsInCache( humanReadableVersion, logger @@ -88158,7 +95048,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau async function useZstdBundle(cliVersion2, tarSupportsZstd) { return ( // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver7.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) + process.platform !== "win32" && tarSupportsZstd && semver8.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) ); } function getTempExtractionDir(tempDir) { @@ -88190,7 +95080,7 @@ async function getNightlyToolsUrl(logger) { } } function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver7.compare(b, a)); + const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver8.compare(b, a)); logger.debug( `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( allVersions @@ -88679,6 +95569,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -89239,13 +96146,13 @@ function fromString(str2, unsigned, radix) { return result; } Long.fromString = fromString; -function fromValue(val2, unsigned) { - if (typeof val2 === "number") return fromNumber(val2, unsigned); - if (typeof val2 === "string") return fromString(val2, unsigned); +function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); return fromBits( - val2.low, - val2.high, - typeof unsigned === "boolean" ? unsigned : val2.unsigned + val.low, + val.high, + typeof unsigned === "boolean" ? unsigned : val.unsigned ); } Long.fromValue = fromValue; @@ -89317,8 +96224,8 @@ LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { LongPrototype.getNumBitsAbs = function getNumBitsAbs() { if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val2 = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) if ((val2 & 1 << bit) != 0) break; + 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() { @@ -89938,7 +96845,7 @@ async function addFingerprints(sarif, sourceRoot, logger) { // src/init.ts var toolrunner4 = __toESM(require_toolrunner()); -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); const { @@ -90024,7 +96931,7 @@ function areAllRunsUnique(sarifObjects) { return true; } async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) { - if (githubVersion.type === 1 /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { + if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { return false; } return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; @@ -90039,7 +96946,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { ); } async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) { - if (githubVersion.type === 1 /* GHES */) { + if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) { if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) { return false; } @@ -90054,7 +96961,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo const sarifObjects = sarifFiles.map((sarifFile) => { return JSON.parse(fs11.readFileSync(sarifFile, "utf8")); }); - const deprecationWarningMessage = gitHubVersion.type === 1 /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025"; + 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); @@ -90303,15 +97210,15 @@ function validateSarifFileSchema(sarif, sarifFilePath, logger) { const warnings = (result.errors ?? []).filter( (err) => err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument) ); - for (const warning8 of warnings) { + for (const warning9 of warnings) { logger.info( - `Warning: '${warning8.instance}' is not a valid URI in '${warning8.property}'.` + `Warning: '${warning9.instance}' is not a valid URI in '${warning9.property}'.` ); } if (errors.length > 0) { - for (const error4 of errors) { - logger.startGroup(`Error details: ${error4.stack}`); - logger.info(JSON.stringify(error4, null, 2)); + 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}`); @@ -90564,10 +97471,10 @@ function shouldConsiderConfigurationError(processingErrors) { } function shouldConsiderInvalidRequest(processingErrors) { return processingErrors.every( - (error4) => error4.startsWith("rejecting SARIF") || error4.startsWith("an invalid URI was provided as a SARIF location") || error4.startsWith("locationFromSarifResult: expected artifact location") || error4.startsWith( + (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( - error4 + error3 ) ); } @@ -90650,7 +97557,6 @@ function filterAlertsByDiffRange(logger, sarif) { buildPayload, findSarifFilesInDir, getGroupedSarifFilePaths, - getSarifFilePaths, populateRunAutomationDetails, postProcessSarifFiles, readSarifFile, @@ -90675,7 +97581,7 @@ undici/lib/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) long/index.js: (** diff --git a/lib/upload-sarif-action-post.js b/lib/upload-sarif-action-post.js index dd361efcd3..494b4a7680 100644 --- a/lib/upload-sarif-action-post.js +++ b/lib/upload-sarif-action-post.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os2 = __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() + os.EOL); + process.stdout.write(cmd.toString() + os2.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,41 +176,51 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs2 = __importStar4(require("fs")); - var os = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs3 = __importStar2(require("fs")); + var os2 = __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 (!fs2.existsSync(filePath)) { + if (!fs3.existsSync(filePath)) { throw new Error(`Missing file at path: ${filePath}`); } - fs2.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os.EOL}`, { + fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -210,18 +228,18 @@ var require_file_command = __commonJS({ if (convertedValue.includes(delimiter)) { throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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) { debug4("got illegal response body from proxy"); socket.destroy(); - var error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -999,14 +1015,14 @@ var require_util = __commonJS({ } const port = url.port != null ? url.port : url.protocol === "https:" ? 443 : 80; let origin = url.origin != null ? url.origin : `${url.protocol}//${url.hostname}:${port}`; - let path2 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; + let path3 = url.path != null ? url.path : `${url.pathname || ""}${url.search || ""}`; if (origin.endsWith("/")) { origin = origin.substring(0, origin.length - 1); } - if (path2 && !path2.startsWith("/")) { - path2 = `/${path2}`; + if (path3 && !path3.startsWith("/")) { + path3 = `/${path3}`; } - url = new URL(origin + path2); + url = new URL(origin + path3); } return url; } @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -2620,20 +2636,20 @@ var require_parseParams = __commonJS({ var require_basename = __commonJS({ "node_modules/@fastify/busboy/lib/utils/basename.js"(exports2, module2) { "use strict"; - module2.exports = function basename(path2) { - if (typeof path2 !== "string") { + module2.exports = function basename2(path3) { + if (typeof path3 !== "string") { return ""; } - for (var i = path2.length - 1; i >= 0; --i) { - switch (path2.charCodeAt(i)) { + for (var i = path3.length - 1; i >= 0; --i) { + switch (path3.charCodeAt(i)) { case 47: // '/' case 92: - path2 = path2.slice(i + 1); - return path2 === ".." || path2 === "." ? "" : path2; + path3 = path3.slice(i + 1); + return path3 === ".." || path3 === "." ? "" : path3; } } - return path2 === ".." || path2 === "." ? "" : path2; + return path3 === ".." || path3 === "." ? "" : path3; }; } }); @@ -2647,7 +2663,7 @@ var require_multipart = __commonJS({ var Dicer = require_Dicer(); var parseParams = require_parseParams(); var decodeText = require_decodeText(); - var basename = require_basename(); + var basename2 = require_basename(); var getLimit = require_getLimit(); var RE_BOUNDARY = /^boundary$/i; var RE_FIELD = /^form-data$/i; @@ -2764,7 +2780,7 @@ var require_multipart = __commonJS({ } else if (RE_FILENAME.test(parsed[i][0])) { filename = parsed[i][1]; if (!preservePath) { - filename = basename(filename); + filename = basename2(filename); } } } @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); + supportedHashes = crypto2.getHashes().filter((hash) => possibleRelevantHashes.includes(hash)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5663,7 +5679,7 @@ var require_request = __commonJS({ } var Request = class _Request { constructor(origin, { - path: path2, + path: path3, method, body, headers, @@ -5677,11 +5693,11 @@ var require_request = __commonJS({ throwOnError, expectContinue }, handler) { - if (typeof path2 !== "string") { + if (typeof path3 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path2[0] !== "/" && !(path2.startsWith("http://") || path2.startsWith("https://")) && method !== "CONNECT") { + } else if (path3[0] !== "/" && !(path3.startsWith("http://") || path3.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.exec(path2) !== null) { + } else if (invalidPathRegex.exec(path3) !== null) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -5744,7 +5760,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? util.buildURL(path2, query) : path2; + this.path = query ? util.buildURL(path3, query) : path3; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6752,9 +6768,9 @@ var require_RedirectHandler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path2 = search ? `${pathname}${search}` : pathname; + const path3 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path2; + this.opts.path = path3; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -7994,7 +8010,7 @@ var require_client = __commonJS({ writeH2(client, client[kHTTP2Session], request); return; } - const { body, method, path: path2, host, upgrade, headers, blocking, reset } = request; + const { body, method, path: path3, host, upgrade, headers, blocking, reset } = request; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { body.read(0); @@ -8044,7 +8060,7 @@ var require_client = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path2} HTTP/1.1\r + let header = `${method} ${path3} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -8107,7 +8123,7 @@ upgrade: ${upgrade}\r return true; } function writeH2(client, session, request) { - const { body, method, path: path2, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + const { body, method, path: path3, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; let headers; if (typeof reqHeaders === "string") headers = Request[kHTTP2CopyHeaders](reqHeaders.trim()); else headers = reqHeaders; @@ -8150,7 +8166,7 @@ upgrade: ${upgrade}\r }); return true; } - headers[HTTP2_HEADER_PATH] = path2; + headers[HTTP2_HEADER_PATH] = path3; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body && typeof body.read === "function") { @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10390,20 +10406,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path2) { - if (typeof path2 !== "string") { - return path2; + function safeUrl(path3) { + if (typeof path3 !== "string") { + return path3; } - const pathSegments = path2.split("?"); + const pathSegments = path3.split("?"); if (pathSegments.length !== 2) { - return path2; + return path3; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path2, method, body, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path2); + function matchKey(mockDispatch2, { path: path3, method, body, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path3); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10421,7 +10437,7 @@ var require_mock_utils = __commonJS({ 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: path2 }) => matchValue(safeUrl(path2), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path3 }) => matchValue(safeUrl(path3), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10458,9 +10474,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path2, method, body, headers, query } = opts; + const { path: path3, method, body, headers, query } = opts; return { - path: path2, + path: path3, method, body, headers, @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay, persist } = mockDispatch2; + const { data: { statusCode, data, headers, trailers, error: error3 }, delay, persist } = mockDispatch2; const { timesInvoked, times } = mockDispatch2; mockDispatch2.consumed = !persist && timesInvoked >= times; mockDispatch2.pending = timesInvoked < times; - if (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay === "number" && delay > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -10909,10 +10925,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path2, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path3, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path2, + Path: path3, "Status code": statusCode, Persistent: persist ? "\u2705" : "\u274C", Invocations: timesInvoked, @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve2({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15532,8 +15548,8 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path2) { - for (const char of path2) { + function validateCookiePath(path3) { + for (const char of path3) { const code = char.charCodeAt(0); if (code < 33 || char === ";") { throw new Error("Invalid cookie path"); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17213,11 +17229,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path2 = opts.path; + let path3 = opts.path; if (!opts.path.startsWith("/")) { - path2 = `/${path2}`; + path3 = `/${path3}`; } - url = new URL(util.parseOrigin(url).origin + path2); + url = new URL(util.parseOrigin(url).origin + path3); } else { if (!opts) { opts = typeof url === "object" ? url : {}; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path2 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path3 = __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, path2.sep); + return pth.replace(/[/\\]/g, path3.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs3 = __importStar2(require("fs")); + var path3 = __importStar2(require("path")); + _a = fs3.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs3.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs2.constants.O_RDONLY; + exports2.READONLY = fs3.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18563,7 +18677,7 @@ var require_io_util = __commonJS({ } if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { - const upperExt = path2.extname(filePath).toUpperCase(); + const upperExt = path3.extname(filePath).toUpperCase(); if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { return filePath; } @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18587,11 +18701,11 @@ var require_io_util = __commonJS({ if (stats && stats.isFile()) { if (exports2.IS_WINDOWS) { try { - const directory = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + const directory = path3.dirname(filePath); + const upperName = path3.basename(filePath).toUpperCase(); + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { - filePath = path2.join(directory, actualName); + filePath = path3.join(directory, actualName); break; } } @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18684,18 +18810,23 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which6; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path3 = __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 ? path2.join(dest, path2.basename(source)) : dest; + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path3.join(dest, path3.basename(source)) : dest; if (!(yield ioUtil.exists(source))) { throw new Error(`no such file or directory: ${source}`); } @@ -18707,20 +18838,19 @@ var require_io = __commonJS({ yield cpDirRecursive(source, newDest, 0, force); } } else { - if (path2.relative(source, newDest) === "") { + if (path3.relative(source, newDest) === "") { throw new Error(`'${newDest}' and '${source}' are the same file`); } yield copyFile(source, newDest, force); } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = path2.join(dest, path2.basename(source)); + dest = path3.join(dest, path3.basename(source)); destExists = yield ioUtil.exists(dest); } if (destExists) { @@ -18731,13 +18861,12 @@ var require_io = __commonJS({ } } } - yield mkdirP(path2.dirname(dest)); + yield mkdirP(path3.dirname(dest)); yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,15 +18913,14 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + 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(path2.delimiter)) { + for (const extension of process.env["PATHEXT"].split(path3.delimiter)) { if (extension) { extensions.push(extension); } @@ -18807,12 +18933,12 @@ var require_io = __commonJS({ } return []; } - if (tool.includes(path2.sep)) { + if (tool.includes(path3.sep)) { return []; } const directories = []; if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { + for (const p of process.env.PATH.split(path3.delimiter)) { if (p) { directories.push(p); } @@ -18820,7 +18946,7 @@ var require_io = __commonJS({ } const matches = []; for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); + const filePath = yield ioUtil.tryGetExecutablePath(path3.join(directory, tool), extensions); if (filePath) { matches.push(filePath); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path2 = __importStar4(require("path")); - var io6 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path3 = __importStar2(require("path")); + var io6 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner5 = class extends events.EventEmitter { @@ -18988,12 +19128,12 @@ var require_toolrunner = __commonJS({ _processLineBuffer(data, strBuffer, onLine) { try { let s = strBuffer + data.toString(); - let n = s.indexOf(os.EOL); + let n = s.indexOf(os2.EOL); while (n > -1) { const line = s.substring(0, n); onLine(line); - s = s.substring(n + os.EOL.length); - n = s.indexOf(os.EOL); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); } return s; } catch (err) { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { - this.toolPath = path2.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + this.toolPath = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io6.which(this.toolPath, true); - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19162,7 +19302,7 @@ var require_toolrunner = __commonJS({ } const optionsNonNull = this._cloneExecOptions(this.options); if (!optionsNonNull.silent && optionsNonNull.outStream) { - optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL); + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os2.EOL); } const state = new ExecState(optionsNonNull, this.toolPath); state.on("debug", (message) => { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve2(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + 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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = exportVariable6; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug4; + exports2.error = error3; + exports2.warning = warning10; + exports2.notice = notice; + exports2.info = info7; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os = __importStar4(require("os")); - var path2 = __importStar4(require("path")); + var os2 = __importStar2(require("os")); + var path3 = __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 exportVariable5(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable6(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable5; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19679,20 +19870,18 @@ var require_core = __commonJS({ } else { (0, command_1.issueCommand)("add-path", {}, inputPath); } - process.env["PATH"] = `${inputPath}${path2.delimiter}${process.env["PATH"]}`; + process.env["PATH"] = `${inputPath}${path3.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,71 +19889,58 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput(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(os.EOL); + process.stdout.write(os2.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug4(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug4; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning9(message, properties = {}) { + function warning10(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning9; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info7(message) { - process.stdout.write(message + os.EOL); + process.stdout.write(message + os2.EOL); } - exports2.info = info7; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19835,8 +20007,8 @@ var require_context = __commonJS({ 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 path2 = process.env.GITHUB_EVENT_PATH; - process.stdout.write(`GITHUB_EVENT_PATH ${path2} does not exist${os_1.EOL}`); + const path3 = process.env.GITHUB_EVENT_PATH; + process.stdout.write(`GITHUB_EVENT_PATH ${path3} does not exist${os_1.EOL}`); } } this.eventName = process.env.GITHUB_EVENT_NAME; @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url, opts) => __awaiter4(this, void 0, void 0, function* () { + const proxyFetch = (url, opts) => __awaiter2(this, void 0, void 0, function* () { return (0, undici_1.fetch)(url, Object.assign(Object.assign({}, opts), { dispatcher: httpDispatcher })); }); return proxyFetch; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,501 +25406,43 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs2.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs2.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path2.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 = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path2.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 = which6; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path2.join(dest, path2.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 (path2.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.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(path2.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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 __awaiter4(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(path2.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(path2.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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 debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { + var debug4 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => { }; module2.exports = debug4; } @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare2 = require_compare(); - var gte5 = (a, b, loose) => compare2(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare2(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises2)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } } doExpire(clearGlobalState, run, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve2, returned, task; + var args, cb, error3, reject, resolve2, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve2, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve2(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info7) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info7) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info7.retryCount + 1; if (maxRetries > info7.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29255,7 +28969,7 @@ var require_dist_node15 = __commonJS({ var require_config = __commonJS({ "node_modules/@actions/artifact/lib/internal/shared/config.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -29267,7 +28981,7 @@ var require_config = __commonJS({ exports2.getConcurrency = getConcurrency; exports2.getUploadChunkTimeout = getUploadChunkTimeout; exports2.getMaxArtifactListCount = getMaxArtifactListCount; - var os_1 = __importDefault4(require("os")); + var os_1 = __importDefault2(require("os")); var core_1 = require_core(); function getUploadChunkSize() { return 8 * 1024 * 1024; @@ -29513,7 +29227,7 @@ var require_binary_format_contract = __commonJS({ exports2.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; var UnknownFieldHandler; (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = Symbol.for("protobuf-ts/unknown"); + 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 }); @@ -30438,7 +30152,7 @@ var require_message_type_contract = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.MESSAGE_TYPE = void 0; - exports2.MESSAGE_TYPE = Symbol.for("protobuf-ts/message-type"); + exports2.MESSAGE_TYPE = /* @__PURE__ */ Symbol.for("protobuf-ts/message-type"); } }); @@ -30936,26 +30650,26 @@ var require_reflection_json_reader = __commonJS({ const fieldObj = target[localName]; for (const [jsonObjKey, jsonObjValue] of Object.entries(jsonValue)) { this.assert(jsonObjValue !== null, field.name + " map value", null); - let val2; + let val; switch (field.V.kind) { case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); + val = field.V.T().internalJsonRead(jsonObjValue, options); break; case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); + val = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); break; } - this.assert(val2 !== void 0, field.name + " map value", jsonObjValue); + 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] = val2; + fieldObj[key] = val; } } else if (field.repeat) { if (jsonValue === null) @@ -30964,22 +30678,22 @@ var require_reflection_json_reader = __commonJS({ const fieldArr = target[localName]; for (const jsonItem of jsonValue) { this.assert(jsonItem !== null, field.name, null); - let val2; + let val; switch (field.kind) { case "message": - val2 = field.T().internalJsonRead(jsonItem, options); + val = field.T().internalJsonRead(jsonItem, options); break; case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) + val = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); + if (val === false) continue; break; case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); + val = this.scalar(jsonItem, field.T, field.L, field.name); break; } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); + this.assert(val !== void 0, field.name, jsonValue); + fieldArr.push(val); } } else { switch (field.kind) { @@ -30993,10 +30707,10 @@ var require_reflection_json_reader = __commonJS({ case "enum": if (jsonValue === null) continue; - let val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) + let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); + if (val === false) continue; - target[localName] = val2; + target[localName] = val; break; case "scalar": if (jsonValue === null) @@ -31146,8 +30860,8 @@ var require_reflection_json_reader = __commonJS({ break; return base64_1.base64decode(json2); } - } catch (error4) { - e = error4.message; + } catch (error3) { + e = error3.message; } this.assert(false, fieldName + (e ? " - " + e : ""), json2); } @@ -31201,26 +30915,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.V.kind) { case "scalar": for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; + const val = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); + assert_1.assert(val !== void 0); + jsonObj[entryKey.toString()] = val; } break; } @@ -31232,26 +30946,26 @@ var require_reflection_json_writer = __commonJS({ switch (field.kind) { case "scalar": for (let i = 0; i < value.length; i++) { - const val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + 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 val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); + const val = this.message(messageType, value[i], field.name, options); + assert_1.assert(val !== void 0); + jsonArr.push(val); } break; } @@ -31501,7 +31215,7 @@ var require_reflection_binary_reader = __commonJS({ let length = reader.uint32(); let end = reader.pos + length; let key = void 0; - let val2 = void 0; + let val = void 0; while (reader.pos < end) { let [fieldNo, wireType] = reader.tag(); switch (fieldNo) { @@ -31514,13 +31228,13 @@ var require_reflection_binary_reader = __commonJS({ case 2: switch (field.V.kind) { case "scalar": - val2 = this.scalar(reader, field.V.T, field.V.L); + val = this.scalar(reader, field.V.T, field.V.L); break; case "enum": - val2 = reader.int32(); + val = reader.int32(); break; case "message": - val2 = field.V.T().internalBinaryRead(reader, reader.uint32(), options); + val = field.V.T().internalBinaryRead(reader, reader.uint32(), options); break; } break; @@ -31532,19 +31246,19 @@ var require_reflection_binary_reader = __commonJS({ let keyRaw = reflection_scalar_default_1.reflectionScalarDefault(field.K); key = field.K == reflection_info_1.ScalarType.BOOL ? keyRaw.toString() : keyRaw; } - if (val2 === void 0) + if (val === void 0) switch (field.V.kind) { case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); + val = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); break; case "enum": - val2 = 0; + val = 0; break; case "message": - val2 = field.V.T().create(); + val = field.V.T().create(); break; } - return [key, val2]; + return [key, val]; } scalar(reader, type2, longType) { switch (type2) { @@ -31649,8 +31363,8 @@ var require_reflection_binary_writer = __commonJS({ break; case "map": assert_1.assert(typeof value == "object" && value !== null); - for (const [key, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); + for (const [key, val] of Object.entries(value)) + this.mapEntry(writer, options, field, key, val); break; } } @@ -32220,11 +31934,11 @@ var require_enum_object = __commonJS({ } exports2.listEnumValues = listEnumValues; function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); + return listEnumValues(enumObject).map((val) => val.name); } exports2.listEnumNames = listEnumNames; function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } exports2.listEnumNumbers = listEnumNumbers; } @@ -33280,7 +32994,7 @@ var require_rpc_options = __commonJS({ copy(defaults, o); copy(options, o); for (let key of Object.keys(options)) { - let val2 = options[key]; + let val = options[key]; switch (key) { case "jsonOptions": o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); @@ -33294,7 +33008,7 @@ var require_rpc_options = __commonJS({ copy(options.meta, o.meta); break; case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); break; } } @@ -33386,9 +33100,9 @@ var require_deferred = __commonJS({ /** * Resolve the promise. Ignore if not pending. */ - resolvePending(val2) { + resolvePending(val) { if (this._state === DeferredState.PENDING) - this.resolve(val2); + this.resolve(val); } /** * Reject the promise. Ignore if not pending. @@ -33459,12 +33173,12 @@ var require_rpc_output_stream = __commonJS({ * at a time. * Can be used to wrap a stream by using the other stream's `onNext`. */ - notifyNext(message, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); + 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 (error4) - this.notifyError(error4); + if (error3) + this.notifyError(error3); if (complete) this.notifyComplete(); } @@ -33484,12 +33198,12 @@ var require_rpc_output_stream = __commonJS({ * * Triggers onNext and onError callbacks. */ - notifyError(error4) { + notifyError(error3) { runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); + 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(); } /** @@ -33558,7 +33272,7 @@ var require_rpc_output_stream = __commonJS({ var require_unary_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/unary-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -33605,7 +33319,7 @@ var require_unary_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -33627,7 +33341,7 @@ var require_unary_call = __commonJS({ var require_server_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/server-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -33676,7 +33390,7 @@ var require_server_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -33697,7 +33411,7 @@ var require_server_streaming_call = __commonJS({ var require_client_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/client-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -33745,7 +33459,7 @@ var require_client_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -33766,7 +33480,7 @@ var require_client_streaming_call = __commonJS({ var require_duplex_streaming_call = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/duplex-streaming-call.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -33814,7 +33528,7 @@ var require_duplex_streaming_call = __commonJS({ return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } promiseFinished() { - return __awaiter4(this, void 0, void 0, function* () { + 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, @@ -33834,7 +33548,7 @@ var require_duplex_streaming_call = __commonJS({ var require_test_transport = __commonJS({ "node_modules/@protobuf-ts/runtime-rpc/build/commonjs/test-transport.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -33938,7 +33652,7 @@ var require_test_transport = __commonJS({ * not reject. If it does, code is broken. */ streamResponses(method, stream, abort) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const messages = []; if (this.data.response === void 0) { messages.push(method.O.create()); @@ -33953,8 +33667,8 @@ var require_test_transport = __commonJS({ } try { yield delay(this.responseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); + } catch (error3) { + stream.notifyError(error3); return; } if (this.data.response instanceof rpc_error_1.RpcError) { @@ -33965,8 +33679,8 @@ var require_test_transport = __commonJS({ stream.notifyMessage(msg); try { yield delay(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream.notifyError(error4); + } catch (error3) { + stream.notifyError(error3); return; } } @@ -35525,7 +35239,7 @@ var require_artifact_twirp_client = __commonJS({ var require_generated = __commonJS({ "node_modules/@actions/artifact/lib/generated/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -35538,14 +35252,14 @@ var require_generated = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); + 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 }); - __exportStar4(require_timestamp(), exports2); - __exportStar4(require_wrappers(), exports2); - __exportStar4(require_artifact(), exports2); - __exportStar4(require_artifact_twirp_client(), exports2); + __exportStar2(require_timestamp(), exports2); + __exportStar2(require_wrappers(), exports2); + __exportStar2(require_artifact(), exports2); + __exportStar2(require_artifact_twirp_client(), exports2); } }); @@ -35553,7 +35267,7 @@ var require_generated = __commonJS({ var require_retention = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/retention.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -35566,34 +35280,34 @@ var require_retention = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getExpiration = getExpiration; var generated_1 = require_generated(); - var core14 = __importStar4(require_core()); + var core14 = __importStar2(require_core()); function getExpiration(retentionDays) { if (!retentionDays) { return void 0; @@ -35660,13 +35374,13 @@ These characters are not allowed in the artifact name due to limitations with ce } (0, core_1.info)(`Artifact name is valid!`); } - function validateFilePath(path2) { - if (!path2) { + function validateFilePath(path3) { + if (!path3) { throw new Error(`Provided file path input during validation is empty`); } for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path2.includes(invalidCharacterKey)) { - throw new Error(`The path for one of the files in artifact is not valid: ${path2}. Contains the following character: ${errorMessageForCharacter} + if (path3.includes(invalidCharacterKey)) { + throw new Error(`The path for one of the files in artifact is not valid: ${path3}. Contains the following character: ${errorMessageForCharacter} Invalid characters include: ${Array.from(invalidArtifactFilePathCharacters.values()).toString()} @@ -35678,93 +35392,232 @@ The following characters are not allowed in files that are uploaded due to limit } }); -// node_modules/@actions/artifact/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// 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.1", + 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.0", + "@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_agent = __commonJS({ + "node_modules/@actions/artifact/lib/internal/shared/user-agent.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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); - } - } else { - return void 0; - } + exports2.getUserAgentString = getUserAgentString; + var packageJson = require_package2(); + function getUserAgentString() { + return `@actions/artifact-${packageJson.version}`; } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + } +}); + +// node_modules/@actions/artifact/lib/internal/shared/errors.js +var require_errors2 = __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"; } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + }; + exports2.FilesNotFoundError = FilesNotFoundError; + var InvalidResponseError = class extends Error { + constructor(message) { + super(message); + this.name = "InvalidResponseError"; } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + }; + exports2.InvalidResponseError = InvalidResponseError; + var ArtifactNotFoundError = class extends Error { + constructor(message = "Artifact not found") { + super(message); + this.name = "ArtifactNotFoundError"; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + }; + 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"; } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + }; + 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"; } - 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; - } + }; + 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"; } - 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]"); + }; + 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; } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + 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!"; } - get username() { - return this._decodedUsername; + 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); } - get password() { - return this._decodedPassword; + } + 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/node_modules/@actions/http-client/lib/index.js -var require_lib3 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/artifact/lib/internal/shared/util.js +var require_util8 = __commonJS({ + "node_modules/@actions/artifact/lib/internal/shared/util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -35777,939 +35630,279 @@ var require_lib3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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); - } + 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]); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + __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.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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; + exports2.getBackendIdsFromToken = getBackendIdsFromToken; + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; + var core14 = __importStar2(require_core()); + var config_1 = require_config(); + 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; } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); + const scpParts = decoded.scp.split(" "); + if (scpParts.length === 0) { + throw InvalidJwtError; } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); + 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] + }; + core14.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`); + core14.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`); + return ids; } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + throw InvalidJwtError; } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; - } + function maskSigUrl(url) { + if (!url) + return; + try { + const parsedUrl = new URL(url); + 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: ${url} ${error3 instanceof Error ? error3.message : String(error3)}`); } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + } + function maskSecretUrls(body) { + if (typeof body !== "object" || body === null) { + (0, core_1.debug)("body is not an object or is null"); + return; } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { + maskSigUrl(body.signed_upload_url); } - /** - * 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 __awaiter4(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); - }); + if ("signed_url" in body && typeof body.signed_url === "string") { + maskSigUrl(body.signed_url); } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); + } + } +}); + +// 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(resolve2) { + resolve2(value); }); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.internalArtifactTwirpClient = internalArtifactTwirpClient; + 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_config(); + var user_agent_1 = require_user_agent(); + var errors_1 = require_errors2(); + var util_1 = require_util8(); + var ArtifactHttpClient = class { + constructor(userAgent, 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(userAgent, [ + new auth_1.BearerCredentialHandler(token) + ]); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); + // 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 url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; + (0, core_1.debug)(`[Request] ${method} ${url}`); + const headers = { + "Content-Type": contentType + }; + try { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { + return this.httpClient.post(url, JSON.stringify(data), headers); + })); + return body; + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); + } }); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } + 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 }; } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, data); - } else { - return response; + 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}`; } - } - 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; + } catch (error3) { + if (error3 instanceof SyntaxError) { + (0, core_1.debug)(`Raw Body: ${rawBody}`); } - 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."); + if (error3 instanceof errors_1.UsageError) { + throw error3; } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + 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); } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, data); - redirectsRemaining--; + isRetryable = true; + errorMessage = error3.message; } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + if (!isRetryable) { + throw new Error(`Received non-retryable error: ${errorMessage}`); } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + if (attempt + 1 === this.maxAttempts) { + throw new Error(`Failed to make request after ${this.maxAttempts} attempts: ${errorMessage}`); } - } while (numTries < maxTries); - return response; + 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`); }); } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; + isSuccessStatusCode(statusCode) { + if (!statusCode) + return false; + return statusCode >= 200 && statusCode < 300; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + 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); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info7.httpModule.request(info7.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: ${info7.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); + sleep(milliseconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + } + getExponentialRetryTimeMilliseconds(attempt) { + if (attempt < 0) { + throw new Error("attempt should be a positive integer"); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + 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); } - /** - * 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 info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } - } - return info7; - } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); - } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; - } - _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 https2.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 __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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 { - resolve2(response); - } - })); - }); - } - }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); - } -}); - -// node_modules/@actions/artifact/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/artifact/node_modules/@actions/http-client/lib/auth.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 __awaiter4(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 __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; - } -}); - -// node_modules/@actions/artifact/package.json -var require_package2 = __commonJS({ - "node_modules/@actions/artifact/package.json"(exports2, module2) { - module2.exports = { - name: "@actions/artifact", - version: "4.0.0", - 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": "^1.10.0", - "@actions/github": "^6.0.1", - "@actions/http-client": "^2.1.0", - "@azure/core-http": "^3.0.5", - "@azure/storage-blob": "^12.15.0", - "@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_agent = __commonJS({ - "node_modules/@actions/artifact/lib/internal/shared/user-agent.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUserAgentString = getUserAgentString; - var packageJson = require_package2(); - function getUserAgentString() { - return `@actions/artifact-${packageJson.version}`; - } - } -}); - -// node_modules/@actions/artifact/lib/internal/shared/errors.js -var require_errors2 = __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); - } + 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); } - 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_util8 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/shared/util.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -36722,327 +35915,42 @@ var require_util8 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getBackendIdsFromToken = getBackendIdsFromToken; - exports2.maskSigUrl = maskSigUrl; - exports2.maskSecretUrls = maskSecretUrls; - var core14 = __importStar4(require_core()); - var config_1 = require_config(); - var jwt_decode_1 = __importDefault4(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] - }; - core14.debug(`Workflow Run Backend ID: ${ids.workflowRunBackendId}`); - core14.debug(`Workflow Job Run Backend ID: ${ids.workflowJobRunBackendId}`); - return ids; - } - throw InvalidJwtError; - } - function maskSigUrl(url) { - if (!url) - return; - try { - const parsedUrl = new URL(url); - const signature = parsedUrl.searchParams.get("sig"); - if (signature) { - (0, core_1.setSecret)(signature); - (0, core_1.setSecret)(encodeURIComponent(signature)); - } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); - } - } - 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); - } - } - } -}); - -// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalArtifactTwirpClient = internalArtifactTwirpClient; - var http_client_1 = require_lib3(); - var auth_1 = require_auth2(); - var core_1 = require_core(); - var generated_1 = require_generated(); - var config_1 = require_config(); - var user_agent_1 = require_user_agent(); - var errors_1 = require_errors2(); - var util_1 = require_util8(); - var ArtifactHttpClient = class { - constructor(userAgent, 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(userAgent, [ - 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 __awaiter4(this, void 0, void 0, function* () { - const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; - (0, core_1.debug)(`[Request] ${method} ${url}`); - const headers = { - "Content-Type": contentType - }; - try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { - return this.httpClient.post(url, JSON.stringify(data), headers); - })); - return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); - } - }); - } - retryableRequest(operation) { - return __awaiter4(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 (error4) { - if (error4 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); - } - if (error4 instanceof errors_1.UsageError) { - throw error4; - } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); - } - isRetryable = true; - errorMessage = error4.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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => setTimeout(resolve2, 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); - } - } -}); - -// 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); Object.defineProperty(exports2, "__esModule", { value: true }); exports2.validateRootDirectory = validateRootDirectory; exports2.getUploadZipSpecification = getUploadZipSpecification; - var fs2 = __importStar4(require("fs")); + var fs3 = __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 (!fs2.existsSync(rootDirectory)) { + if (!fs3.existsSync(rootDirectory)) { throw new Error(`The provided rootDirectory ${rootDirectory} does not exist`); } - if (!fs2.statSync(rootDirectory).isDirectory()) { + if (!fs3.statSync(rootDirectory).isDirectory()) { throw new Error(`The provided rootDirectory ${rootDirectory} is not a valid directory`); } (0, core_1.info)(`Root directory input is valid!`); @@ -37052,7 +35960,7 @@ var require_upload_zip_specification = __commonJS({ rootDirectory = (0, path_1.normalize)(rootDirectory); rootDirectory = (0, path_1.resolve)(rootDirectory); for (let file of filesToZip) { - const stats = fs2.lstatSync(file, { throwIfNoEntry: false }); + const stats = fs3.lstatSync(file, { throwIfNoEntry: false }); if (!stats) { throw new Error(`File ${file} does not exist`); } @@ -37084,208 +35992,569 @@ var require_upload_zip_specification = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; +// 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 context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.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], context2); + 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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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; + } + function step(result) { + result.done ? resolve2(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; } - }); - this._orderedPolicies = void 0; - return removedPolicies; - } - sendRequest(httpClient, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - getOrderedPolicies() { - if (!this._orderedPolicies) { - this._orderedPolicies = this.orderPolicies(); - } - return this._orderedPolicies; - } - clone() { - return new _HttpPipeline(this._policies); - } - static create() { - return new _HttpPipeline(); + 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; } - 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; + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); + }); + }; + } + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ 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); } }; - function createEmptyPipeline() { - return HttpPipeline.create(); + 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(path3, preserveJsx) { + if (typeof path3 === "string" && /^\.\.?\//.test(path3)) { + return path3.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path3; +} +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/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { +// 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 }); - var os = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); + 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) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os.EOL}`); + 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 = []; @@ -37300,19 +36569,18 @@ var require_dist = __commonJS({ enable, enabled, disable, - log + log: log_js_1.log }); function enable(namespaces) { enabledString = namespaces; enabledNamespaces = []; skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); + const namespaceList = namespaces.split(",").map((ns) => ns.trim()); for (const ns of namespaceList) { if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); + skippedNamespaces.push(ns.substring(1)); } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); + enabledNamespaces.push(ns); } } for (const instance of debuggers) { @@ -37324,31 +36592,100 @@ var require_dist = __commonJS({ return true; } for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { + if (namespaceMatches(namespace, skipped)) { return false; } } for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { + 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(debug5, { + const newDebugger = Object.assign(debug4, { enabled: enabled(namespace), destroy, log: debugObj.log, namespace, extend: extend3 }); - function debug5(...args) { + function debug4(...args) { if (!newDebugger.enabled) { return; } @@ -37373,236 +36710,482 @@ var require_dist = __commonJS({ newDebugger.log = this.log; return newDebugger; } - var debug4 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug4("azure"); - AzureLogger.log = (...args) => { - debug4.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } - } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); - } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); - } - } - debug4.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; - } + 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 createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } function patchLogMethod(parent, child) { child.log = (...args) => { parent.log(...args); }; } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug4.disable(); - debug4.enable(enabledNamespaces2 + "," + logger.namespace); + 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(",")); } - registeredLoggers.add(logger); - return logger; + 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 createLogger(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: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; + } + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); + function getLogLevel() { + return context2.getLogLevel(); } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __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.createHttpHeaders = createHttpHeaders; + function normalizeName(name) { + return name.toLowerCase(); + } + function* headerIterator(map2) { + for (const entry of map2.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); } }; - exports2.AbortError = AbortError; + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); + } } }); -// 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) { +// 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 }); - exports2.AbortError = void 0; - var AbortError_js_1 = require_AbortError(); - 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) { +// 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 }); - exports2.createAbortablePromise = createAbortablePromise; - var abort_controller_1 = require_commonjs3(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve2, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); - } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); - } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); - } - try { - buildPromise((x) => { - removeListeners(); - resolve2(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); - } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); - } } }); -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/random.js"(exports2) { +// 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.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; + exports2.randomUUID = randomUUID; + function randomUUID() { + return crypto.randomUUID(); } } }); -// node_modules/@azure/core-util/dist/commonjs/delay.js -var require_delay = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/delay.js"(exports2) { +// 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.delay = delay; - exports2.calculateRetryDelay = calculateRetryDelay; - var createAbortablePromise_js_1 = require_createAbortablePromise(); - var random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve2) => { - token = setTimeout(resolve2, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? 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, random_js_1.getRandomIntegerInclusive)(0, clampedDelay / 2); - return { retryAfterInMs }; + 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/@azure/core-util/dist/commonjs/aborterUtils.js -var require_aborterUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/aborterUtils.js"(exports2) { +// 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.cancelablePromiseRace = cancelablePromiseRace; - async function cancelablePromiseRace(abortablePromiseBuilders, options) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); + 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; } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); + 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, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); + } + 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/@azure/core-util/dist/commonjs/object.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/object.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/object.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isObject = isObject2; @@ -37612,13 +37195,12 @@ var require_object = __commonJS({ } }); -// node_modules/@azure/core-util/dist/commonjs/error.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/error.js var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/error.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; var object_js_1 = require_object(); function isError(e) { if ((0, object_js_1.isObject)(e)) { @@ -37628,314 +37210,134 @@ var require_error = __commonJS({ } return false; } - function getErrorMessage2(e) { - if (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/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { +// 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.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); - } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); - } + exports2.custom = void 0; + var node_util_1 = require("node:util"); + exports2.custom = node_util_1.inspect.custom; } }); -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { +// 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.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; - } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; + 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())); } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; + /** + * 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 url = new URL(value); + if (!url.search) { + return value; + } + for (const [key] of url.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url.searchParams.set(key, RedactedString); + } } - } - return true; - } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID() { - return uuidFunction(); - } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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/@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.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs4(); - 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 { - 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())); - } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); - } - sanitizeUrl(value) { - if (typeof value !== "string" || value === null || value === "") { - return value; - } - const url = new URL(value); - if (!url.search) { - return value; - } - for (const [key] of url.searchParams) { - if (!this.allowedQueryParameters.has(key.toLowerCase())) { - url.searchParams.set(key, RedactedString); - } - } - return url.toString(); + return url.toString(); } sanitizeHeaders(obj) { const sanitized = {}; @@ -37967,1168 +37369,826 @@ var require_sanitizer = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js"(exports2) { +// 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.logPolicyName = void 0; - exports2.logPolicy = logPolicy; - var log_js_1 = require_log(); + 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(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; - } - }; + 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/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js"(exports2) { +// 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.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(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); - } - }; + exports2.uint8ArrayToString = uint8ArrayToString; + exports2.stringToUint8Array = stringToUint8Array; + function uint8ArrayToString(bytes, format) { + return Buffer.from(bytes).toString(format); } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url = new URL(locationHeader, request.url); - request.url = url.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; - } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); - } - return response; + function stringToUint8Array(value, format) { + return Buffer.from(value, format); } } }); -// node_modules/@azure/core-rest-pipeline/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, - __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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - 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(resolve2) { - resolve2(value); - }); +// 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"); } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } +}); + +// 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 rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + function isStreamComplete(stream) { + if (stream.readable === false) { + return Promise.resolve(); } + return new Promise((resolve2) => { + const handler = () => { + resolve2(); + stream.removeListener("close", handler); + stream.removeListener("end", handler); + stream.removeListener("error", handler); + }; + stream.on("close", handler); + stream.on("end", handler); + stream.on("error", handler); + }); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + function isArrayBuffer(body) { + return body && typeof body.byteLength === "number"; } - 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; + 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(request) { + const abortController = new AbortController(); + let abortListener; + if (request.abortSignal) { + if (request.abortSignal.aborted) { + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _2.label = op[1]; - break; + abortListener = (event) => { + if (event.type === "abort") { + abortController.abort(); + } + }; + request.abortSignal.addEventListener("abort", abortListener); + } + let timeoutId; + if (request.timeout > 0) { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); + abortController.abort(); + }, request.timeout); + } + const acceptEncoding = request.headers.get("Accept-Encoding"); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); + let body = typeof request.body === "function" ? request.body() : request.body; + if (body && !request.headers.has("Content-Length")) { + const bodyLength = getBodyLength(body); + if (bodyLength !== null) { + request.headers.set("Content-Length", bodyLength); } - if (op[0] === 6 && _2.label < t[1]) { - _2.label = t[1]; - t = op; - break; + } + let responseStream; + try { + if (body && request.onUploadProgress) { + const onUploadProgress = request.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; } - if (t && _2.label < t[2]) { - _2.label = t[2]; - _2.ops.push(op); - break; + const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); } - if (t[2]) _2.ops.pop(); - _2.trys.pop(); - continue; + const headers = getResponseHeaders(res); + const status = res.statusCode ?? 0; + const response = { + status, + headers, + request + }; + if (request.method === "HEAD") { + res.resume(); + return response; + } + responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res; + const onDownloadProgress = request.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 + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) + ) { + response.readableStreamBody = responseStream; + } else { + response.bodyAsText = await streamToText(responseStream); + } + return response; + } finally { + if (request.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) { + request.abortSignal?.removeEventListener("abort", abortListener); + } + }).catch((e) => { + log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); + }); + } + } } - op = body.call(thisArg, _2); - } catch (e) { - op = [6, e]; - y = 0; - } finally { - f = t = 0; + makeRequest(request, abortController, body) { + const url = new URL(request.url); + const isInsecure = url.protocol !== "https:"; + if (isInsecure && !request.allowInsecureConnection) { + throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); + } + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); + const options = { + agent, + hostname: url.hostname, + path: `${url.pathname}${url.search}`, + port: url.port, + method: request.method, + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides + }; + return new Promise((resolve2, reject) => { + const req = isInsecure ? node_http_1.default.request(options, resolve2) : node_https_1.default.request(options, resolve2); + req.once("error", (err) => { + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + }); + 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(request, isInsecure) { + const disableKeepAlive = request.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 && !request.tlsSettings) { + return node_https_1.default.globalAgent; + } + const tlsSettings = request.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; } - 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 }; + function getDecodedResponseStream(stream, headers) { + const contentEncoding = headers.get("Content-Encoding"); + if (contentEncoding === "gzip") { + const unzip = node_zlib_1.default.createGunzip(); + stream.pipe(unzip); + return unzip; + } else if (contentEncoding === "deflate") { + const inflate = node_zlib_1.default.createInflate(); + stream.pipe(inflate); + return inflate; + } + return stream; } - }; - 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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + function streamToText(stream) { + return new Promise((resolve2, reject) => { + const buffer = []; + stream.on("data", (chunk) => { + if (Buffer.isBuffer(chunk)) { + buffer.push(chunk); + } else { + buffer.push(Buffer.from(chunk)); + } + }); + stream.on("end", () => { + resolve2(Buffer.concat(buffer).toString("utf8")); + }); + stream.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 + })); + } + }); + }); } - } - 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]; + 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(); } } - 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); - }; +}); + +// 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)(); + } } - 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); - }); +}); + +// 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + logger(`Response status code: ${response.status}`); + logger(`Headers: ${sanitizer.sanitize(response.headers)}`); + return response; + } }; - if (f) i[n] = f(i[n]); } } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); +}); + +// 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url = new URL(locationHeader, request.url); + request.url = url.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); + } + return response; } } - 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); +}); + +// 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } + } } - function reject(value) { - resume("throw", value); +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/constants.js +var require_constants7 = __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; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); +}); + +// 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_constants7(); + 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; + } } -} -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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; +}); + +// 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } + }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js"(exports2) { +// 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.getHeaderName = getHeaderName; - exports2.setPlatformSpecificData = setPlatformSpecificData; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var os = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; - } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); + exports2.decompressResponsePolicyName = void 0; + exports2.decompressResponsePolicy = decompressResponsePolicy; + exports2.decompressResponsePolicyName = "decompressResponsePolicy"; + function decompressResponsePolicy() { + return { + name: exports2.decompressResponsePolicyName, + async sendRequest(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); + } + return next(request); } - } - map2.set("OS", `(${os.arch()}-${os.type()}-${os.release()})`); + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants7 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js"(exports2) { +// 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.DEFAULT_RETRY_POLICY_COUNT = exports2.SDK_VERSION = void 0; - exports2.SDK_VERSION = "1.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; + 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/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js"(exports2) { +// 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.getUserAgentHeaderName = getUserAgentHeaderName; - exports2.getUserAgentValue = getUserAgentValue; - var userAgentPlatform_js_1 = require_userAgentPlatform(); - var constants_js_1 = require_constants7(); - 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; + 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/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js"(exports2) { +// node_modules/@typespec/ts-http-runtime/dist/commonjs/util/helpers.js +var require_helpers = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/util/helpers.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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); + exports2.delay = delay; + exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; + var AbortError_js_1 = require_AbortError(); + var StandardAbortMessage = "The operation was aborted."; + function delay(delayInMs, value, options) { + return new Promise((resolve2, 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); } - return next(request); + }; + onAborted = () => { + if (timer) { + clearTimeout(timer); + } + removeListeners(); + return rejectOnAbort(); + }; + if (options?.abortSignal && options.abortSignal.aborted) { + return rejectOnAbort(); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - 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 isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + timer = setTimeout(() => { + removeListeners(); + resolve2(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); + } + }); } - function isBlob(x) { - return typeof x.stream === "function"; + 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/@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) { +// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs4(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); + exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; + exports2.throttlingRetryStrategy = throttlingRetryStrategy; + var helpers_js_1 = require_helpers(); + 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; } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); - } + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function createFileFromStream(stream, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + function throttlingRetryStrategy() { + return { + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; + } + return { + retryAfterInMs + }; } - return s; - }, [rawContent]: stream }); - } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); - } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { +// 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.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); - } - yield yield tslib_1.__await(value); + 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 }; } - } finally { - reader.releaseLock(); + if (responseError && !matchedSystemError && !isExponential) { + return { errorToThrow: responseError }; + } + return (0, delay_js_1.calculateRetryDelay)(retryCount, { + retryDelayInMs: retryInterval, + maxRetryDelayInMs: maxRetryInterval + }); } - }); - } - function makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } + }; } - function ensureNodeStream(stream) { - if (stream instanceof ReadableStream) { - makeAsyncIterable(stream); - return node_stream_1.Readable.fromWeb(stream); - } else { - return stream; - } + function isExponentialRetryResponse(response) { + return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); - } else { - return ensureNodeStream(source); + function isSystemError(err) { + if (!err) { + return false; } - } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } - } - }); - })()); - }; + return err.code === "ETIMEDOUT" || err.code === "ESOCKETTIMEDOUT" || err.code === "ECONNREFUSED" || err.code === "ECONNRESET" || err.code === "ENOENT" || err.code === "ENOTFOUND"; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs4(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_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(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); - } - request.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(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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 !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); - } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __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; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs5 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs5(); - var StandardAbortMessage = "The operation was aborted."; - function delay(delayInMs, value, options) { - return new Promise((resolve2, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); - }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); - } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); - } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); - } - timer = setTimeout(() => { - removeListeners(); - resolve2(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : 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/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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_helpers(); - 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 (_a) { - 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/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs4(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; - } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; - } - }; - } - 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/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js"(exports2) { +// 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_helpers(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs5(); + var AbortError_js_1 = require_AbortError(); + var logger_js_1 = require_logger(); var constants_js_1 = require_constants7(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline retryPolicy"); + 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(request, next) { - var _a, _b; let response; let responseError; let retryCount = -1; @@ -39148,12 +38208,12 @@ var require_retryPolicy = __commonJS({ } response = responseError.response; } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { + if (request.abortSignal?.aborted) { logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); + const abortError = new AbortError_js_1.AbortError(); throw abortError; } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : constants_js_1.DEFAULT_RETRY_POLICY_COUNT)) { + 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; @@ -39165,7 +38225,7 @@ var require_retryPolicy = __commonJS({ } logger.info(`Retry ${retryCount}: Processing ${strategies.length} retry strategies.`); strategiesLoop: for (const strategy of strategies) { - const strategyLogger = strategy.logger || retryPolicyLogger; + const strategyLogger = strategy.logger || logger; strategyLogger.info(`Retry ${retryCount}: Processing retry strategy ${strategy.name}.`); const modifiers = strategy.retry({ retryCount, @@ -39207,9 +38267,9 @@ var require_retryPolicy = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/defaultRetryPolicy.js var require_defaultRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/defaultRetryPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.defaultRetryPolicyName = void 0; @@ -39220,122 +38280,47 @@ var require_defaultRetryPolicy = __commonJS({ var constants_js_1 = require_constants7(); exports2.defaultRetryPolicyName = "defaultRetryPolicy"; function defaultRetryPolicy(options = {}) { - var _a; return { name: exports2.defaultRetryPolicyName, sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT + maxRetries: options.maxRetries ?? constants_js_1.DEFAULT_RETRY_POLICY_COUNT }).sendRequest }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { +// 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.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); - } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } - } - var HttpHeadersImpl = class { - 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.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); - } + 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/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/formDataPolicy.js var require_formDataPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js"(exports2) { + "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 core_util_1 = require_commonjs4(); + var bytesEncoding_js_1 = require_bytesEncoding(); + var checkEnvironment_js_1 = require_checkEnvironment(); var httpHeaders_js_1 = require_httpHeaders(); exports2.formDataPolicyName = "formDataPolicy"; function formDataToFormDataMap(formData) { - var _a; const formDataMap = {}; for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; + formDataMap[key] ??= []; formDataMap[key].push(value); } return formDataMap; @@ -39344,7 +38329,7 @@ var require_formDataPolicy = __commonJS({ return { name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { request.formData = formDataToFormDataMap(request.body); request.body = void 0; } @@ -39379,7 +38364,7 @@ var require_formDataPolicy = __commonJS({ if (contentType && !contentType.startsWith("multipart/form-data")) { return; } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? contentType : "multipart/form-data"); + request.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]) { @@ -39388,7 +38373,7 @@ var require_formDataPolicy = __commonJS({ headers: (0, httpHeaders_js_1.createHttpHeaders)({ "Content-Disposition": `form-data; name="${fieldName}"` }), - body: (0, core_util_1.stringToUint8Array)(value, "utf-8") + 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.`); @@ -39418,16 +38403,16 @@ var require_ms = __commonJS({ var d = h * 24; var w = d * 7; var y = d * 365.25; - module2.exports = function(val2, options) { + module2.exports = function(val, options) { options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); + var type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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(val2) + "val is not a non-empty string or a valid number. val=" + JSON.stringify(val) ); }; function parse(str2) { @@ -39580,8 +38565,8 @@ var require_common = __commonJS({ index++; const formatter = createDebug.formatters[format]; if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); + const val = args[index]; + match = formatter.call(self2, val); args.splice(index, 1); index--; } @@ -39686,11 +38671,11 @@ var require_common = __commonJS({ } return false; } - function coerce3(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; + function coerce3(val) { + if (val instanceof Error) { + return val.stack || val.message; } - return val2; + 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`."); @@ -39840,14 +38825,14 @@ var require_browser = __commonJS({ } else { exports2.storage.removeItem("debug"); } - } catch (error4) { + } catch (error3) { } } function load2() { let r; try { r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { + } catch (error3) { } if (!r && typeof process !== "undefined" && "env" in process) { r = process.env.DEBUG; @@ -39857,7 +38842,7 @@ var require_browser = __commonJS({ function localstorage() { try { return localStorage; - } catch (error4) { + } catch (error3) { } } module2.exports = require_common()(exports2); @@ -39865,8 +38850,8 @@ var require_browser = __commonJS({ formatters.j = function(v) { try { return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.message; + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; } }; } @@ -39889,7 +38874,7 @@ var require_has_flag = __commonJS({ var require_supports_color = __commonJS({ "node_modules/supports-color/index.js"(exports2, module2) { "use strict"; - var os = require("os"); + var os2 = require("os"); var tty = require("tty"); var hasFlag = require_has_flag(); var { env } = process; @@ -39937,7 +38922,7 @@ var require_supports_color = __commonJS({ return min; } if (process.platform === "win32") { - const osRelease = os.release().split("."); + const osRelease = os2.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } @@ -40086,7 +39071,7 @@ var require_node = __commonJS({ 221 ]; } - } catch (error4) { + } catch (error3) { } exports2.inspectOpts = Object.keys(process.env).filter((key) => { return /^debug_/i.test(key); @@ -40094,17 +39079,17 @@ var require_node = __commonJS({ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_2, k) => { return k.toUpperCase(); }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; + 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 { - val2 = Number(val2); + val = Number(val); } - obj[prop] = val2; + obj[prop] = val; return obj; }, {}); function useColors() { @@ -40176,7 +39161,7 @@ var require_src = __commonJS({ var require_helpers2 = __commonJS({ "node_modules/agent-base/dist/helpers.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -40189,24 +39174,24 @@ var require_helpers2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); async function toBuffer(stream) { let length = 0; const chunks = []; @@ -40243,10 +39228,10 @@ var require_helpers2 = __commonJS({ }); // node_modules/agent-base/dist/index.js -var require_dist2 = __commonJS({ +var require_dist = __commonJS({ "node_modules/agent-base/dist/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -40259,30 +39244,30 @@ var require_dist2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); + 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 = __importStar4(require("net")); - var http = __importStar4(require("http")); + var net = __importStar2(require("net")); + var http = __importStar2(require("http")); var https_1 = require("https"); - __exportStar4(require_helpers2(), exports2); - var INTERNAL = Symbol("AgentBaseInternalState"); + __exportStar2(require_helpers2(), exports2); + var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState"); var Agent = class extends http.Agent { constructor(opts) { super(opts); @@ -40402,12 +39387,12 @@ var require_dist2 = __commonJS({ var require_parse_proxy_response = __commonJS({ "node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + 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 = __importDefault4(require_src()); + var debug_1 = __importDefault2(require_src()); var debug4 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); function parseProxyResponse(socket) { return new Promise((resolve2, reject) => { @@ -40495,10 +39480,10 @@ var require_parse_proxy_response = __commonJS({ }); // node_modules/https-proxy-agent/dist/index.js -var require_dist3 = __commonJS({ +var require_dist2 = __commonJS({ "node_modules/https-proxy-agent/dist/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -40511,30 +39496,30 @@ var require_dist3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + 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 = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(require_src()); - var agent_base_1 = require_dist2(); + 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_dist(); var url_1 = require("url"); var parse_proxy_response_1 = require_parse_proxy_response(); var debug4 = (0, debug_1.default)("https-proxy-agent"); @@ -40645,10 +39630,10 @@ var require_dist3 = __commonJS({ }); // node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ +var require_dist3 = __commonJS({ "node_modules/http-proxy-agent/dist/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -40661,30 +39646,30 @@ var require_dist4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + 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 = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(require_src()); + 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 agent_base_1 = require_dist(); var url_1 = require("url"); var debug4 = (0, debug_1.default)("http-proxy-agent"); var HttpProxyAgent = class extends agent_base_1.Agent { @@ -40774,18 +39759,18 @@ var require_dist4 = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/proxyPolicy.js var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { + "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_log(); + var https_proxy_agent_1 = require_dist2(); + var http_proxy_agent_1 = require_dist3(); + var log_js_1 = require_log2(); var HTTPS_PROXY = "HTTPS_PROXY"; var HTTP_PROXY = "HTTP_PROXY"; var ALL_PROXY = "ALL_PROXY"; @@ -40816,7 +39801,7 @@ var require_proxyPolicy = __commonJS({ return false; } const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { + if (bypassedMap?.has(host)) { return bypassedMap.get(host); } let isBypassedFlag = false; @@ -40835,7 +39820,7 @@ var require_proxyPolicy = __commonJS({ } } } - bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.set(host, isBypassedFlag); + bypassedMap?.set(host, isBypassedFlag); return isBypassedFlag; } function loadNoProxy() { @@ -40870,7 +39855,7 @@ var require_proxyPolicy = __commonJS({ let parsedProxyUrl; try { parsedProxyUrl = new URL(settings.host); - } catch (_a) { + } catch { throw new Error(`Expecting a valid host string in proxy settings, but found "${settings.host}".`); } parsedProxyUrl.port = String(settings.port); @@ -40913,8 +39898,7 @@ var require_proxyPolicy = __commonJS({ return { name: exports2.proxyPolicyName, async sendRequest(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { setProxyAgentOnRequest(request, cachedAgents, defaultProxy); } else if (request.proxySettings) { setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); @@ -40926,31 +39910,31 @@ var require_proxyPolicy = __commonJS({ } }); -// 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) { +// 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.setClientRequestIdPolicyName = void 0; - exports2.setClientRequestIdPolicy = setClientRequestIdPolicy; - exports2.setClientRequestIdPolicyName = "setClientRequestIdPolicy"; - function setClientRequestIdPolicy(requestIdHeaderName = "x-ms-client-request-id") { + exports2.agentPolicyName = void 0; + exports2.agentPolicy = agentPolicy; + exports2.agentPolicyName = "agentPolicy"; + function agentPolicy(agent) { return { - name: exports2.setClientRequestIdPolicyName, - async sendRequest(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + name: exports2.agentPolicyName, + sendRequest: async (req, next) => { + if (!req.agent) { + req.agent = agent; } - return next(request); + return next(req); } }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/tlsPolicy.js var require_tlsPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/policies/tlsPolicy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.tlsPolicyName = void 0; @@ -40970,367 +39954,208 @@ var require_tlsPolicy = __commonJS({ } }); -// node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js -var require_tracingContext = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js"(exports2) { +// 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.TracingContextImpl = exports2.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; + 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"); } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; + function isWebReadableStream(x) { + return Boolean(x && typeof x.getReader === "function" && typeof x.tee === "function"); } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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 isBinaryBody(body) { + return body !== void 0 && (body instanceof Uint8Array || isReadableStream(body) || typeof body === "function" || body instanceof Blob); } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; + function isReadableStream(x) { + return isNodeReadableStream(x) || isWebReadableStream(x); } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; + function isBlob(x) { + return typeof x.stream === "function"; } - exports2.getInstrumenter = getInstrumenter; } }); -// node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js -var require_tracingClient = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingClient.js"(exports2) { +// 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.createTracingClient = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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); + 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; } - span.setAttribute("az.namespace", tracingContext.getValue(tracingContext_js_1.knownContextKeys.namespace)); - const updatedOptions = Object.assign({}, operationOptions, { - tracingOptions: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions), { tracingContext }) - }); - return { - span, - updatedOptions - }; + } finally { + reader.releaseLock(); } - 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 makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - function withContext(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - function parseTraceparentHeader(traceparentHeader) { - return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); + } + function ensureNodeStream(stream) { + if (stream instanceof ReadableStream) { + makeAsyncIterable(stream); + return stream_1.Readable.fromWeb(stream); + } else { + return stream; } - function createRequestHeaders(tracingContext) { - return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + } + 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); } - return { - startSpan, - withSpan, - withContext, - parseTraceparentHeader, - createRequestHeaders + } + 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 stream of streams) { + for await (const chunk of stream) { + yield chunk; + } + } + })()); }; } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs6 = __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/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/restError.js"(exports2) { +// 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.RestError = void 0; - exports2.isRestError = isRestError; - var core_util_1 = require_commonjs4(); - 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 { - 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 }); - Object.setPrototypeOf(this, _RestError.prototype); + 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 +`; } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; + 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; } - }; - exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - function isRestError(e) { - if (e instanceof RestError) { - return true; + } + 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 (0, core_util_1.isError)(e) && e.name === "RestError"; + return total; } - } -}); - -// 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_commonjs6(); - var constants_js_1 = require_constants7(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs4(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); + } + request.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.tracingPolicyName, + name: exports2.multipartPolicyName, async sendRequest(request, next) { - var _a; - if (!tracingClient) { + if (!request.multipartBody) { return next(request); } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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}`); } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - tryProcessResponse(span, response); - return response; - } catch (err) { - tryProcessError(span, err); - throw err; + 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(); } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } }; } - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.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); - } - span.setStatus({ - status: "success" - }); - 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/createPipelineFromOptions.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.js var require_createPipelineFromOptions = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/createPipelineFromOptions.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/createPipelineFromOptions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createPipelineFromOptions = createPipelineFromOptions; @@ -41338,19 +40163,20 @@ var require_createPipelineFromOptions = __commonJS({ var pipeline_js_1 = require_pipeline(); var redirectPolicy_js_1 = require_redirectPolicy(); var userAgentPolicy_js_1 = require_userAgentPolicy(); - var multipartPolicy_js_1 = require_multipartPolicy(); var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs4(); + var checkEnvironment_js_1 = require_checkEnvironment(); var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); + var agentPolicy_js_1 = require_agentPolicy(); var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); + var multipartPolicy_js_1 = require_multipartPolicy(); function createPipelineFromOptions(options) { - var _a; const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); + } if (options.tlsOptions) { pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); } @@ -41359,13 +40185,9 @@ var require_createPipelineFromOptions = __commonJS({ } pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { + if (checkEnvironment_js_1.isNodeLike) { pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); @@ -41374,749 +40196,803 @@ var require_createPipelineFromOptions = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { +// 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.getBodyLength = getBodyLength; - exports2.createNodeHttpClient = createNodeHttpClient; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib = tslib_1.__importStar(require("node:zlib")); - var node_stream_1 = require("node:stream"); - var abort_controller_1 = require_commonjs5(); - var httpHeaders_js_1 = require_httpHeaders(); - var restError_js_1 = require_restError(); - var log_js_1 = require_log(); - var DEFAULT_TLS_SETTINGS = {}; - function isReadableStream(body) { - return body && typeof body.pipe === "function"; + exports2.apiVersionPolicyName = void 0; + exports2.apiVersionPolicy = apiVersionPolicy; + exports2.apiVersionPolicyName = "ApiVersionPolicy"; + function apiVersionPolicy(options) { + return { + name: exports2.apiVersionPolicyName, + sendRequest: (req, next) => { + const url = new URL(req.url); + if (!url.searchParams.get("api-version") && options.apiVersion) { + req.url = `${req.url}${Array.from(url.searchParams.keys()).length > 0 ? "&" : "?"}api-version=${options.apiVersion}`; + } + return next(req); + } + }; } - function isStreamComplete(stream) { - return new Promise((resolve2) => { - const handler = () => { - resolve2(); - stream.removeListener("close", handler); - stream.removeListener("end", handler); - stream.removeListener("error", handler); - }; - stream.on("close", handler); - stream.on("end", handler); - stream.on("error", handler); - }); + } +}); + +// 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 isArrayBuffer(body) { - return body && typeof body.byteLength === "number"; + function isBearerTokenCredential(credential) { + return "getBearerToken" in credential; } - var ReportTransform = class extends node_stream_1.Transform { - // 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.loadedBytes = 0; - this.progressCallback = progressCallback; - } - }; - var NodeHttpClient = class { - constructor() { - this.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(request) { - var _a, _b, _c; - const abortController = new AbortController(); - let abortListener; - if (request.abortSignal) { - if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); - } - abortListener = (event) => { - if (event.type === "abort") { - abortController.abort(); - } - }; - request.abortSignal.addEventListener("abort", abortListener); - } - if (request.timeout > 0) { - setTimeout(() => { - abortController.abort(); - }, request.timeout); - } - const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); - let body = typeof request.body === "function" ? request.body() : request.body; - if (body && !request.headers.has("Content-Length")) { - const bodyLength = getBodyLength(body); - if (bodyLength !== null) { - request.headers.set("Content-Length", bodyLength); - } - } - let responseStream; - try { - if (body && request.onUploadProgress) { - const onUploadProgress = request.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(request, abortController, body); - const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; - const response = { - status, - headers, - request - }; - if (request.method === "HEAD") { - res.resume(); - return response; - } - responseStream = shouldDecompress ? getDecodedResponseStream(res, headers) : res; - const onDownloadProgress = request.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 - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) - ) { - response.readableStreamBody = responseStream; - } else { - response.bodyAsText = await streamToText(responseStream); - } - return response; - } finally { - if (request.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(() => { - var _a2; - if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); - } - }).catch((e) => { - log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); - }); - } - } - } - makeRequest(request, abortController, body) { - var _a; + 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(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { const url = new URL(request.url); - const isInsecure = url.protocol !== "https:"; - if (isInsecure && !request.allowInsecureConnection) { - throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); - } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); - const options = { - agent, - hostname: url.hostname, - path: `${url.pathname}${url.search}`, - port: url.port, - method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) - }; - return new Promise((resolve2, reject) => { - const req = isInsecure ? http.request(options, resolve2) : https2.request(options, resolve2); - req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); - }); - abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); - 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(request, isInsecure) { - var _a; - const disableKeepAlive = request.disableKeepAlive; - if (isInsecure) { - if (disableKeepAlive) { - return http.globalAgent; - } - if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); - } - return this.cachedHttpAgent; - } else { - if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; - } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : 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 https2.Agent(Object.assign({ - // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, 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); + if (url.hostname === "localhost" || url.hostname === "127.0.0.1") { + return true; } } - return headers; + return false; } - function getDecodedResponseStream(stream, headers) { - const contentEncoding = headers.get("Content-Encoding"); - if (contentEncoding === "gzip") { - const unzip = zlib.createGunzip(); - stream.pipe(unzip); - return unzip; - } else if (contentEncoding === "deflate") { - const inflate = zlib.createInflate(); - stream.pipe(inflate); - return inflate; + function emitInsecureConnectionWarning() { + const warning10 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning10); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning10); } - return stream; - } - function streamToText(stream) { - return new Promise((resolve2, reject) => { - const buffer = []; - stream.on("data", (chunk) => { - if (Buffer.isBuffer(chunk)) { - buffer.push(chunk); - } else { - buffer.push(Buffer.from(chunk)); - } - }); - stream.on("end", () => { - resolve2(Buffer.concat(buffer).toString("utf8")); - }); - stream.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : 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 ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); + } else { + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); + } } } - function createNodeHttpClient() { - return new NodeHttpClient(); - } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js -var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { +// 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.createDefaultHttpClient = createDefaultHttpClient; - var nodeHttpClient_js_1 = require_nodeHttpClient(); - function createDefaultHttpClient() { - return (0, nodeHttpClient_js_1.createNodeHttpClient)(); + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs4(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; - } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.exponentialRetryPolicyName = void 0; - exports2.exponentialRetryPolicy = exponentialRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants7(); - exports2.exponentialRetryPolicyName = "exponentialRetryPolicy"; - function exponentialRetryPolicy(options = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); + } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.systemErrorRetryPolicyName = void 0; - exports2.systemErrorRetryPolicy = systemErrorRetryPolicy; - var exponentialRetryStrategy_js_1 = require_exponentialRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants7(); - exports2.systemErrorRetryPolicyName = "systemErrorRetryPolicy"; - function systemErrorRetryPolicy(options = {}) { - var _a; + exports2.oauth2AuthenticationPolicyName = void 0; + exports2.oauth2AuthenticationPolicy = oauth2AuthenticationPolicy; + var checkInsecureConnection_js_1 = require_checkInsecureConnection(); + exports2.oauth2AuthenticationPolicyName = "oauth2AuthenticationPolicy"; + function oauth2AuthenticationPolicy(options) { return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest + name: exports2.oauth2AuthenticationPolicyName, + async sendRequest(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); + } }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.throttlingRetryPolicyName = void 0; - exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); - var constants_js_1 = require_constants7(); - exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; - function throttlingRetryPolicy(options = {}) { - var _a; - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } + } + return pipeline; + } + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); + } + return cachedHttpClient; } } }); -// 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) { +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); - } - return finalToken; + 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]; } } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - return token; + 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 createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; - } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; - } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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; + function escapeDispositionField(value) { + return JSON.stringify(value); + } + function getContentDisposition(descriptor) { + const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); + if (contentDispositionHeader) { + return contentDispositionHeader; } - 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); + 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; } - return token; + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + 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_multipart2(); + async function sendRequest(method, url, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + const headers = response.headers.toJSON(); + const stream = response.readableStreamBody ?? response.browserStreamBody; + const parsedBody = options.responseAsStream || stream !== void 0 ? void 0 : getResponseBody(response); + const body = stream ?? parsedBody; + if (options?.onResponse) { + options.onResponse({ ...response, request, rawHeaders: headers, parsedBody }); + } + return { + request, + 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, rawHeaders }, e); + } + throw e; } } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; + function getRequestContentType(options = {}) { + return options.contentType ?? options.headers?.["content-type"] ?? getContentType(options.body); + } + function getContentType(body) { + if (ArrayBuffer.isView(body)) { + return "application/octet-stream"; } - return; + if (typeof body === "string") { + try { + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; + } + } + return "application/json"; } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, 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(request, next) { - if (!request.url.toLowerCase().startsWith("https://")) { - throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); + function buildPipelineRequest(method, url, 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, + 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) }; } - await callbacks.authorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + return { body: JSON.stringify(body) }; + case "text/plain": + return { body: String(body) }; + default: + if (typeof body === "string") { + return { body }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${routePath}`, options); + const url = new URL(requestUrl); + return url.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(url, options = {}) { + if (!options.queryParameters) { + return url; + } + const parsedUrl = new URL(url); + 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)); } - } - if (error4) { - throw error4; } else { - return response; + 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(endpoint, options) { + if (!options.pathParameters) { + return endpoint; + } + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; + } + return endpoint; + } + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); + } + } + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path3, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path3, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; return { - name: exports2.ndJsonPolicyName, - async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); - } + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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, url, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url, pipeline, { ...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."); } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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 { - name: exports2.auxiliaryAuthenticationHeaderPolicyName, - async sendRequest(request, next) { - if (!request.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(request); - } - 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, - 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(request); - } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); - return next(request); - } + 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/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js"(exports2) { +// node_modules/@typespec/ts-http-runtime/dist/commonjs/index.js +var require_commonjs3 = __commonJS({ + "node_modules/@typespec/ts-http-runtime/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createFileFromStream = exports2.createFile = 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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; + 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 createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; + var logger_js_1 = require_logger(); + Object.defineProperty(exports2, "createClientLogger", { enumerable: true, get: function() { + return logger_js_1.createClientLogger; } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; + 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; @@ -42124,6 +41000,182 @@ var require_commonjs7 = __commonJS({ 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_commonjs3(); + 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_commonjs4 = __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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.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_commonjs4(); + 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_constants7(); + 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_constants7(); + 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_constants7(); + 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; @@ -42131,6 +41183,13 @@ var require_commonjs7 = __commonJS({ 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; @@ -42138,12 +41197,30 @@ var require_commonjs7 = __commonJS({ 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; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "setClientRequestIdPolicyName", { enumerable: true, get: function() { - return setClientRequestIdPolicy_js_1.setClientRequestIdPolicyName; + 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() { @@ -42176,42 +41253,6 @@ var require_commonjs7 = __commonJS({ Object.defineProperty(exports2, "redirectPolicyName", { enumerable: true, get: function() { return redirectPolicy_js_1.redirectPolicyName; } }); - 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); var tlsPolicy_js_1 = require_tlsPolicy(); Object.defineProperty(exports2, "tlsPolicy", { enumerable: true, get: function() { return tlsPolicy_js_1.tlsPolicy; @@ -42219,6818 +41260,5637 @@ var require_commonjs7 = __commonJS({ Object.defineProperty(exports2, "tlsPolicyName", { enumerable: true, get: function() { return tlsPolicy_js_1.tlsPolicyName; } }); - 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 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 file_js_1 = require_file2(); - Object.defineProperty(exports2, "createFile", { enumerable: true, get: function() { - return file_js_1.createFile; + var userAgentPolicy_js_1 = require_userAgentPolicy(); + Object.defineProperty(exports2, "userAgentPolicy", { enumerable: true, get: function() { + return userAgentPolicy_js_1.userAgentPolicy; } }); - Object.defineProperty(exports2, "createFileFromStream", { enumerable: true, get: function() { - return file_js_1.createFileFromStream; + Object.defineProperty(exports2, "userAgentPolicyName", { enumerable: true, get: function() { + return userAgentPolicy_js_1.userAgentPolicyName; } }); } }); -// node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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]]; +// 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 + }); } - return t; -} -function __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - 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; +}); + +// 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); } } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } +}); + +// 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"; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(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 }; +}); + +// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js +var require_constants8 = __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; } -} -function __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 }; +}); + +// 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_constants8(); + function getUserAgentString(telemetryInfo) { + const parts = []; + for (const [key, value] of telemetryInfo) { + const token = value ? `${key}/${value}` : key; + parts.push(token); + } + return parts.join(" "); } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + function getUserAgentHeaderName() { + return (0, userAgentPlatform_js_1.getHeaderName)(); } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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]; + 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; } } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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); - }); +}); + +// 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); + } + return next(request); + } }; - 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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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]; +}); + +// 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); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + async function computeSha256Hash(content, encoding) { + return (0, node_crypto_1.createHash)("sha256").update(content).digest(encoding); } - 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 __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(e, env.error, "An error was suppressed during disposal.") : e; - env.hasError = true; +}); + +// 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; + } }); } - var r, s = 0; - function next() { - while (r = env.stack.pop()) { +}); + +// 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 { - 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); + return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); + } finally { + aborter.abort(); + options?.abortSignal?.removeEventListener("abort", abortHandler); } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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 __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 - }; } }); -// node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js -var require_azureKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureKeyCredential.js"(exports2) { +// 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.AzureKeyCredential = void 0; - var AzureKeyCredential = class { - /** - * 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.AbortError = void 0; + var AbortError = class extends Error { + constructor(message) { + super(message); + this.name = "AbortError"; } }; - exports2.AzureKeyCredential = AzureKeyCredential; + exports2.AbortError = AbortError; } }); -// node_modules/@azure/core-auth/dist/commonjs/keyCredential.js -var require_keyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/keyCredential.js"(exports2) { +// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js +var require_commonjs5 = __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.isKeyCredential = isKeyCredential; - var core_util_1 = require_commonjs4(); - function isKeyCredential(credential) { - return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; - } + 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-auth/dist/commonjs/azureNamedKeyCredential.js -var require_azureNamedKeyCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureNamedKeyCredential.js"(exports2) { +// 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.AzureNamedKeyCredential = void 0; - exports2.isNamedKeyCredential = isNamedKeyCredential; - var core_util_1 = require_commonjs4(); - var AzureNamedKeyCredential = class { - /** - * 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"); + exports2.createAbortablePromise = createAbortablePromise; + var abort_controller_1 = require_commonjs5(); + function createAbortablePromise(buildPromise, options) { + const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options ?? {}; + return new Promise((resolve2, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - 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"); + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - 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"; + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); + } + if (abortSignal?.aborted) { + return rejectOnAbort(); + } + try { + buildPromise((x) => { + removeListeners(); + resolve2(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); + } + abortSignal?.addEventListener("abort", onAbort); + }); } } }); -// node_modules/@azure/core-auth/dist/commonjs/azureSASCredential.js -var require_azureSASCredential = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/azureSASCredential.js"(exports2) { +// 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.AzureSASCredential = void 0; - exports2.isSASCredential = isSASCredential; - var core_util_1 = require_commonjs4(); - var AzureSASCredential = class { - /** - * 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"); + exports2.delay = delay; + exports2.calculateRetryDelay = calculateRetryDelay; + var createAbortablePromise_js_1 = require_createAbortablePromise(); + var util_1 = require_internal3(); + var StandardAbortMessage = "The delay was aborted."; + function delay(timeInMs, options) { + let token; + const { abortSignal, abortErrorMsg } = options ?? {}; + return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve2) => { + token = setTimeout(resolve2, 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]"; } - this._signature = newSignature; + return `Unknown error ${stringified}`; } - }; - 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) { +// 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); + exports2.isDefined = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; + } + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; + } + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; + } + } + return true; + } + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } } }); -// node_modules/@azure/core-auth/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-auth/dist/commonjs/index.js"(exports2) { +// node_modules/@azure/core-util/dist/commonjs/index.js +var require_commonjs6 = __commonJS({ + "node_modules/@azure/core-util/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; + 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 keyCredential_js_1 = require_keyCredential(); - Object.defineProperty(exports2, "isKeyCredential", { enumerable: true, get: function() { - return keyCredential_js_1.isKeyCredential; + var createAbortablePromise_js_1 = require_createAbortablePromise(); + Object.defineProperty(exports2, "createAbortablePromise", { enumerable: true, get: function() { + return createAbortablePromise_js_1.createAbortablePromise; } }); - var azureNamedKeyCredential_js_1 = require_azureNamedKeyCredential(); - Object.defineProperty(exports2, "AzureNamedKeyCredential", { enumerable: true, get: function() { - return azureNamedKeyCredential_js_1.AzureNamedKeyCredential; + var delay_js_1 = require_delay2(); + Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { + return delay_js_1.delay; } }); - Object.defineProperty(exports2, "isNamedKeyCredential", { enumerable: true, get: function() { - return azureNamedKeyCredential_js_1.isNamedKeyCredential; + var error_js_1 = require_error2(); + Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { + return error_js_1.getErrorMessage; } }); - var azureSASCredential_js_1 = require_azureSASCredential(); - Object.defineProperty(exports2, "AzureSASCredential", { enumerable: true, get: function() { - return azureSASCredential_js_1.AzureSASCredential; + var typeGuards_js_1 = require_typeGuards2(); + Object.defineProperty(exports2, "isDefined", { enumerable: true, get: function() { + return typeGuards_js_1.isDefined; } }); - Object.defineProperty(exports2, "isSASCredential", { enumerable: true, get: function() { - return azureSASCredential_js_1.isSASCredential; + Object.defineProperty(exports2, "isObjectWithProperties", { enumerable: true, get: function() { + return typeGuards_js_1.isObjectWithProperties; } }); - var tokenCredential_js_1 = require_tokenCredential(); - Object.defineProperty(exports2, "isTokenCredential", { enumerable: true, get: function() { - return tokenCredential_js_1.isTokenCredential; + 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-http-compat/dist/commonjs/policies/disableKeepAlivePolicy.js -var require_disableKeepAlivePolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/disableKeepAlivePolicy.js"(exports2) { +// 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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { + exports2.hasRawContent = hasRawContent; + exports2.getRawContent = getRawContent; + exports2.createFileFromStream = createFileFromStream; + exports2.createFile = createFile; + var core_util_1 = require_commonjs6(); + 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(stream, name, options = {}) { return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); - } + ...unimplementedMethods, + type: options.type ?? "", + lastModified: options.lastModified ?? (/* @__PURE__ */ new Date()).getTime(), + webkitRelativePath: options.webkitRelativePath ?? "", + size: options.size ?? -1, + name, + stream: () => { + const s = stream(); + if (isNodeReadableStream(s)) { + throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + } + return s; + }, + [rawContent]: stream }; } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); + 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); } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; } }); -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; +// 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } + } + } + return tspPolicy.sendRequest(request, next); + } + }; + } } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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]]; +}); + +// 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)(); } - return t; -} -function __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - 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; +}); + +// 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); } } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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); +}); + +// 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)(); + } } - return useValue ? value : void 0; -} -function __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); +}); + +// 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); + } } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } +}); + +// 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); + } + return next(request); + } + }; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + } +}); + +// 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); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } +}); + +// 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); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(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; +}); + +// 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); } - 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; - } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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]; + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; } + 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; } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); +}); + +// 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 }; } - 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); - }); +}); + +// 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: () => { + } }; - 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 __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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]; + 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); + } + }; } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - 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 __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); } + return state_js_1.state.instrumenterImplementation; } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); - }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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 __assign3.apply(this, arguments); - }; - __createBinding3 = 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]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 - }; } }); -// node_modules/@azure/core-client/dist/commonjs/base64.js -var require_base642 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/base64.js"(exports2) { +// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); - } - exports2.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); - } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); + 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(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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 + }; } - exports2.decodeStringToString = decodeStringToString; } }); -// node_modules/@azure/core-client/dist/commonjs/interfaces.js -var require_interfaces = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/interfaces.js"(exports2) { +// node_modules/@azure/core-tracing/dist/commonjs/index.js +var require_commonjs7 = __commonJS({ + "node_modules/@azure/core-tracing/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + 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-client/dist/commonjs/utils.js -var require_utils5 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { +// 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.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; - } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); - } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, 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 = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[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) - }); + exports2.RestError = void 0; + exports2.isRestError = isRestError; + var ts_http_runtime_1 = require_commonjs3(); + exports2.RestError = ts_http_runtime_1.RestError; + function isRestError(e) { + return (0, ts_http_runtime_1.isRestError)(e); } - exports2.flattenResponse = flattenResponse; } }); -// node_modules/@azure/core-client/dist/commonjs/serializer.js -var require_serializer = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializer.js"(exports2) { +// 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.MapperTypeNames = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base642()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - 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, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : 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) { - object = mapper.defaultValue; - } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); - } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); - } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); - } - if (object === void 0 || object === null) { - payload = object; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : false - }; - if (responseBody === void 0 || responseBody === null) { - if (this.isXML && mapper.type.name === "Sequence" && !mapper.xmlIsWrapped) { - responseBody = []; + exports2.tracingPolicyName = void 0; + exports2.tracingPolicy = tracingPolicy; + var core_tracing_1 = require_commonjs7(); + var constants_js_1 = require_constants8(); + var userAgent_js_1 = require_userAgent2(); + var log_js_1 = require_log3(); + var core_util_1 = require_commonjs6(); + 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(request, next) { + if (!tracingClient) { + return next(request); } - if (mapper.defaultValue !== void 0) { - responseBody = mapper.defaultValue; + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; } - 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]; - } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); } - 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); + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; } } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - } - }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); - } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; - } - return str2.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 str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + }; } - function base64UrlToByteArray(str2) { - if (!str2) { + 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; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); - } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); } - 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 = ""; - } + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.tracingOptions }, { + spanKind: "client", + spanAttributes + }); + if (!span.isRecording()) { + span.end(); + return void 0; } - } - return classes; - } - function dateToUnixTime(d) { - if (!d) { + const headers = tracingClient.createRequestHeaders(updatedOptions.tracingOptions.tracingContext); + for (const [key, value] of Object.entries(headers)) { + request.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; } - if (typeof d.valueOf() === "string") { - d = new Date(d); - } - return Math.floor(d.getTime() / 1e3); } - function unixTimeToDate(n) { - if (!n) { - 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)}`); } - 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.`); - } + 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)}`); } - 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.`); + } +}); + +// 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 }; } - 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)}.`); + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; } - 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.`); + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; } - 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); + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); } - return value; + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; } - 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.`); + } +}); + +// 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 (request, next) => { + if (!request.abortSignal) { + return next(request); } - 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}".`); + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); } } - } - return value; + }; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - 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 = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; - } - const tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, 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; + } +}); + +// 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_commonjs6(); + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - return tempArray; - } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "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(object)) { - const serializedValue = serializer.serialize(valueType, object[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; + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return tempDictionary; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - function resolveAdditionalProperties(serializer, mapper, objectName) { - const additionalProperties = mapper.type.additionalProperties; - if (!additionalProperties && mapper.type.className) { - const modelMapper = resolveReferencedMapper(serializer, mapper, objectName); - return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; - } - return additionalProperties; + } +}); + +// 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_commonjs3(); + var wrapAbortSignal_js_1 = require_wrapAbortSignal(); + function createDefaultHttpClient() { + const client = (0, ts_http_runtime_1.createDefaultHttpClient)(); + return { + async sendRequest(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); + } + } + }; } - 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]; + } +}); + +// 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_commonjs3(); + function createHttpHeaders(rawHeaders) { + return (0, ts_http_runtime_1.createHttpHeaders)(rawHeaders); } - 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 === null || modelMapper === void 0 ? void 0 : 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; + } +}); + +// 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_commonjs3(); + function createPipelineRequest(options) { + return (0, ts_http_runtime_1.createPipelineRequest)(options); } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); - } - if (object !== void 0 && object !== 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) && (object[key] !== void 0 && object[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] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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 object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } - } - } - return payload; - } - return object; + } +}); + +// 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); } - 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 = Object.assign({}, 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; + } +}); + +// 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); } - function isSpecialXmlProperty(propertyName, options) { - return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); + } +}); + +// 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); } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); - } + } +}); + +// 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_commonjs4(); + var constants_js_1 = require_constants8(); + 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_commonjs6(); + 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 { - 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 finalToken = await getAccessToken(); + if (finalToken === null) { + throw new Error("Failed to refresh access token."); } + return finalToken; } } - 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); + 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; } - } - } 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]; + 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(); } - } - 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); + }; + 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 tempDictionary; - } - return responseBody; - } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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}`); + return refreshWorker; } - if (responseBody) { - if (!Array.isArray(responseBody)) { - responseBody = [responseBody]; + return async (scopes, tokenOptions) => { + const hasClaimChallenge = Boolean(tokenOptions.claims); + const tenantIdChanged = tenantId !== tokenOptions.tenantId; + if (hasClaimChallenge) { + token = null; } - if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + const mustRefresh = tenantIdChanged || hasClaimChallenge || cycler.mustRefresh; + if (mustRefresh) { + return refresh(scopes, tokenOptions); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + if (cycler.shouldRefresh) { + refresh(scopes, tokenOptions); } - return tempArray; - } - return responseBody; + return token; + }; } - 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]; + } +}); + +// 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(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; } 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); - } - } + throw e; } } - return void 0; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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(request, next) { + if (!request.url.toLowerCase().startsWith("https://")) { + throw new Error("Bearer token authentication is not permitted for non-TLS protected (non-https) URLs."); } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; + await callbacks.authorizeRequest({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + getAccessToken, + logger + }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } } } + if (error3) { + throw error3; + } else { + return response; + } } - } - 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; + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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; } - 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) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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 = {}; + exports2.ndJsonPolicyName = void 0; + exports2.ndJsonPolicy = ndJsonPolicy; + exports2.ndJsonPolicyName = "ndJsonPolicy"; + function ndJsonPolicy() { + return { + name: exports2.ndJsonPolicyName, + async sendRequest(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); } - value[propertyName] = propertyValue; } + return next(request); } - } - return value; - } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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 = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; - } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info7 = state_js_1.state.operationRequestMap.get(request); - if (!info7) { - info7 = {}; - state_js_1.state.operationRequestMap.set(request, info7); - } - return info7; + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs7(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY - } + 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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.deserializationPolicyName, + name: exports2.auxiliaryAuthenticationHeaderPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); - } - }; - } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); - } - } - return result; - } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : 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 parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; - } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; - } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } 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; + if (!request.url.toLowerCase().startsWith("https://")) { + throw new Error("Bearer token authentication for auxiliary header is not permitted for non-TLS protected (non-https) URLs."); } - } 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) { - var _a; - 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 }; + if (!credentials || credentials.length === 0) { + logger.info(`${exports2.auxiliaryAuthenticationHeaderPolicyName} header will not be set due to empty credentials.`); + return next(request); } - } else { - return { error: null, shouldReturnResponse: false }; - } - } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; - } - 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]; - } + 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); } - deserializedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, "error.response.parsedBody", options); - } - const internalError = parsedBody.error || deserializedError || parsedBody; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; + tokenPromises.push(sendAuthorizeRequest({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + getAccessToken, + logger + })); } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; - } - return { error: error4, shouldReturnResponse: false }; - } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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(request); } - } 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; + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - } - 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) { +// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js +var require_commonjs8 = __commonJS({ + "node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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; - } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; - } - exports2.getPathStringFromParameter = getPathStringFromParameter; + 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-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } - } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); - } + exports2.AzureKeyCredential = void 0; + var AzureKeyCredential = class { + _key; + /** + * The value of the key to be used in authentication + */ + get key() { + return this._key; } - } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + /** + * 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; } - } - exports2.serializeRequestBody = serializeRequestBody; - 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 }; + /** + * 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; } - const result = { [elementName]: obj }; - result[interfaces_js_1.XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace }; - return result; - } + }; + exports2.AzureKeyCredential = AzureKeyCredential; } }); -// node_modules/@azure/core-client/dist/commonjs/pipeline.js -var require_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { +// 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.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs7(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); - } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; + exports2.isKeyCredential = isKeyCredential; + var core_util_1 = require_commonjs6(); + function isKeyCredential(credential) { + return (0, core_util_1.isObjectWithProperties)(credential, ["key"]) && typeof credential.key === "string"; } - exports2.createClientPipeline = createClientPipeline; } }); -// node_modules/@azure/core-client/dist/commonjs/httpClientCache.js -var require_httpClientCache = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/httpClientCache.js"(exports2) { +// 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.getCachedDefaultHttpClient = void 0; - var core_rest_pipeline_1 = require_commonjs7(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + exports2.AzureNamedKeyCredential = void 0; + exports2.isNamedKeyCredential = isNamedKeyCredential; + var core_util_1 = require_commonjs6(); + var AzureNamedKeyCredential = class { + _key; + _name; + /** + * The value of the key to be used in authentication. + */ + get key() { + return this._key; } - return cachedHttpClient; + /** + * 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"; } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js -var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { +// 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.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path2 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path2.startsWith("/")) { - path2 = path2.substring(1); - } - if (isAbsoluteUrl(path2)) { - requestUrl = path2; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path2); - } - } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + exports2.AzureSASCredential = void 0; + exports2.isSASCredential = isSASCredential; + var core_util_1 = require_commonjs6(); + var AzureSASCredential = class { + _signature; + /** + * The value of the shared access signature to be used in authentication + */ + get signature() { + return this._signature; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + /** + * 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; } - return result; - } - function isAbsoluteUrl(url) { - return url.includes("://"); - } - function appendPath(url, pathToAppend) { - if (!pathToAppend) { - return url; - } - const parsedUrl = new URL(url); - let newPath = parsedUrl.pathname; - if (!newPath.endsWith("/")) { - newPath = `${newPath}/`; - } - if (pathToAppend.startsWith("/")) { - pathToAppend = pathToAppend.substring(1); - } - const searchStart = pathToAppend.indexOf("?"); - if (searchStart !== -1) { - const path2 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path2; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + /** + * 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"); } - } else { - newPath = newPath + pathToAppend; + this._signature = newSignature; } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); + }; + exports2.AzureSASCredential = AzureSASCredential; + function isSASCredential(credential) { + return (0, core_util_1.isObjectWithProperties)(credential, ["signature"]) && typeof credential.signature === "string"; } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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 - }; + } +}); + +// 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 simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; - } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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 isPopToken(accessToken) { + return accessToken.tokenType === "pop"; } - function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url; - } - const parsedUrl = new URL(url); - 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(); + function isTokenCredential(credential) { + const castCredential = credential; + return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// node_modules/@azure/core-auth/dist/commonjs/index.js +var require_commonjs9 = __commonJS({ + "node_modules/@azure/core-auth/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs7(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.length) { - for (const { policy, position } of options.additionalPolicies) { - const afterPhase = position === "perRetry" ? "Sign" : void 0; - this.pipeline.addPolicy(policy, { - afterPhase - }); - } + exports2.disableKeepAlivePolicyName = void 0; + exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; + exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; + exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; + function createDisableKeepAlivePolicy() { + return { + name: exports2.disableKeepAlivePolicyName, + async sendRequest(request, next) { + request.disableKeepAlive = true; + return next(request); } - } - /** - * Send the provided httpRequest. - */ - async sendRequest(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, 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; + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); } } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// node_modules/@azure/core-client/dist/commonjs/base64.js +var require_base642 = __commonJS({ + "node_modules/@azure/core-client/dist/commonjs/base64.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - var base64_js_1 = require_base642(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); + exports2.encodeString = encodeString; + exports2.encodeByteArray = encodeByteArray; + exports2.decodeString = decodeString; + exports2.decodeStringToString = decodeStringToString; + function encodeString(value) { + return Buffer.from(value).toString("base64"); } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return true; + 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(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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; + 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; } - return void 0; } - function buildScopes(challengeOptions, challengeInfo) { - if (!challengeInfo.resource_id) { - return challengeOptions.scopes; + function flattenResponse(fullResponse, responseSpec) { + const parsedHeaders = fullResponse.parsedHeaders; + if (fullResponse.request.method === "HEAD") { + return { + ...parsedHeaders, + body: fullResponse.parsedBody + }; } - 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"; + 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 + }; } - return [scope]; - } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; + 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; - } - 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) => Object.assign(Object.assign({}, a), b), {}); - } - function requestToOptions(request) { - return { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions - }; + return handleNullableResponseAndWrappableBody({ + body: fullResponse.parsedBody, + headers: parsedHeaders, + hasNullableType: isNullable, + shouldWrapBody: isPrimitiveBody(fullResponse.parsedBody, expectedBodyTypeName) + }); } } }); -// node_modules/@azure/core-client/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; - } }); + exports2.MapperTypeNames = void 0; + exports2.createSerializer = createSerializer; + var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); + var base64 = tslib_1.__importStar(require_base642()); 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 = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs7(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; + var utils_js_1 = require_utils5(); + var SerializerImpl = class { + modelMappers; + isXML; + constructor(modelMappers = {}, isXML = false) { + this.modelMappers = modelMappers; + this.isXML = isXML; } - } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; + /** + * @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); } - return Reflect.set(target, prop, value, receiver); } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); - } - var HttpHeaders = class _HttpHeaders { - constructor(rawHeaders) { - this._headersMap = {}; - if (rawHeaders) { - for (const headerName in rawHeaders) { - this.set(headerName, rawHeaders[headerName]); + if (UniqueItems && value.some((item, i, ar) => ar.indexOf(item) !== i)) { + failValidation("UniqueItems", UniqueItems); } } } /** - * 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. + * 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 */ - 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]); + serialize(mapper, object, 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; } - 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); + if (mapperType.match(/^Sequence$/i) !== null) { + payload = []; } - 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); + if (mapper.isConstant) { + object = mapper.defaultValue; } - 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; - } + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); } - 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; + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); } - 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs7(); - var util_js_1 = require_util9(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } - } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); - } - } - exports2.toPipelineResponse = toPipelineResponse; - } -}); - -// 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_commonjs7(); - var core_client_1 = require_commonjs9(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.handleRedirects) === false) { - this.pipeline.removePolicy({ - name: core_rest_pipeline_1.redirectPolicyName - }); + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } } + return payload; } /** - * Compatible send operation request function. + * Deserialize the given object based on its metadata defined in the mapper * - * @param operationArguments - Operation arguments - * @param operationSpec - Operation Spec - * @returns + * @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 */ - async sendOperationRequest(operationArguments, operationSpec) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); + 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 = []; } - } - operationArguments.options = Object.assign(Object.assign({}, 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - 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(request, 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); + if (mapper.defaultValue !== void 0) { + responseBody = mapper.defaultValue; } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); - } - }; - } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; - } -}); - -// 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 = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util9(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); + return responseBody; } - }; - } - exports2.convertHttpClient = convertHttpClient; - } -}); - -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs10 = __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/src/util.js -var require_util10 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } + let payload; + const mapperType = mapper.type.name; + if (!objectName) { + objectName = mapper.serializedName; } - } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; - } - }; - exports2.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; - } -}); - -// node_modules/fast-xml-parser/src/validator.js -var require_validator = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { - "use strict"; - var util = require_util10(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; + 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]; } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; + } + if (mapperType.match(/^Number$/i) !== null) { + payload = parseFloat(responseBody); + if (isNaN(payload)) { + payload = responseBody; } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } + } else if (mapperType.match(/^Boolean$/i) !== null) { + if (responseBody === "true") { + payload = true; + } else if (responseBody === "false") { + payload = false; } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; + 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); } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); } + if (mapper.isConstant) { + payload = mapper.defaultValue; + } + return payload; } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } - } + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); + } + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; } - return i; + return str2.substr(0, len); } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } - } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } - } + 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.`); } - return i; + const str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { - } else { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; - } - } - attrStr += xmlData[i]; + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; } - if (startChar !== "") { - return false; + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); } - return { - value: attrStr, - index: i, - tagClosed - }; + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); + 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 true; + return classes; } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; + function dateToUnixTime(d) { + if (!d) { + return void 0; } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; + if (typeof d.valueOf() === "string") { + d = new Date(d); } - return -1; + return Math.floor(d.getTime() / 1e3); } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; + function unixTimeToDate(n) { + if (!n) { + return void 0; } - return i; + return new Date(n * 1e3); } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col + 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 validateAttrName(attrName) { - return util.isName(attrName); + 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 validateTagName(tagname) { - return util.isName(tagname); + 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 getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; + 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 getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util10(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; + 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}".`); } } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); - } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); } - return { entities, i }; + return value; } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; + function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + throw new Error(`${objectName} must be of type Array.`); } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; + 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}.`); } - return [entityName2, val2, i]; - } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; - } - function isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; - } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; - } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; - } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; - } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; + if (elementType.type.name === "Composite" && elementType.type.className) { + elementType = serializer.modelMappers[elementType.type.className] ?? elementType; + } + const tempArray = []; + for (let i = 0; i < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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 { - return str2; + tempArray[i] = serializedValue; } } + return tempArray; } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; + function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { + if (typeof object !== "object") { + throw new Error(`${objectName} must be of type object.`); } - return numStr; - } - module2.exports = toNumber; - } -}); - -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; + 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}.`); } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; + const tempDictionary = {}; + for (const key of Object.keys(object)) { + const serializedValue = serializer.serialize(valueType, object[key], objectName, options); + tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); } - return () => false; + 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; } - module2.exports = getIgnoreAttributesFn; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { - "use strict"; - var util = require_util10(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_2, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_2, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; + 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 parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } + 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 resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; + 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}".`); } - if (tags.length === 2) { - tagname = prefix + tags[1]; + 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 tagname; + return modelProps; } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { + function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + } + if (object !== void 0 && object !== 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 oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); + let propName; + let parentObject = payload; + if (serializer.isXML) { + if (propertyMapper.xmlIsWrapped) { + propName = propertyMapper.xmlName; + } else { + propName = propertyMapper.xmlElementName || propertyMapper.xmlName; } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); + } else { + const paths = splitSerializeName(propertyMapper.serializedName); + propName = paths.pop(); + for (const pathName of paths) { + const childObject = parentObject[pathName]; + if ((childObject === void 0 || childObject === null) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { + parentObject[pathName] = {}; } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; + parentObject = parentObject[pathName]; } } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); + 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 + }; } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } + const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; + let toSerialize = object[key]; + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator && polymorphicDiscriminator.clientName === key && (toSerialize === void 0 || toSerialize === null)) { + toSerialize = mapper.serializedName; } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); + 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 { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; + parentObject[propName] = value; } - textData = ""; - i = closeIndex; } } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } - } - var replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); + const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); + if (additionalPropertiesMapper) { + const propNames = Object.keys(modelProps); + for (const clientPropName in object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } } } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); - } - return val2; - }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; + return payload; } - return textData; + return object; } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; + function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { + if (!isXml || !propertyMapper.xmlNamespace) { + return serializedValue; } - return false; - } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; + 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; } - tagExp += ch; } + const result = {}; + result[options.xml.xmlCharKey] = serializedValue; + result[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; + return result; } - function findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); - } else { - return closingIndex + str2.length - 1; - } + function isSpecialXmlProperty(propertyName, options) { + return [interfaces_js_1.XML_ATTRKEY, options.xml.xmlCharKey].includes(propertyName); } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); + 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 rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); + 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; } - } - return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName - }; - } - function readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } + 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; } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; + 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); } } - } - } - } - function parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber(val2, options); - } else { - if (util.isExist(val2)) { - return val2; } else { - return ""; + 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; + } } } - } - module2.exports = OrderedObjParser; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { - "use strict"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; + 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); + } } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; + } 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 isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; + 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 (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; + if (responseBody) { + const tempDictionary = {}; + for (const key of Object.keys(responseBody)) { + tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); + } + return tempDictionary; } - return false; + return responseBody; } - exports2.prettify = prettify; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); + 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}`); } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); + if (responseBody) { + if (!Array.isArray(responseBody)) { + responseBody = [responseBody]; } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } + if (element.type.name === "Composite" && element.type.className) { + element = serializer.modelMappers[element.type.className] ?? element; } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; + const tempArray = []; + for (let i = 0; i < responseBody.length; i++) { + tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); } + return tempArray; } - }; - module2.exports = XMLParser; - } -}); - -// node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); + return responseBody; } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); + 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); + } } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; } - isPreviousElementTag = true; } - return xmlStr; + return void 0; } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; + function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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 attrStr; + return mapper; } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + function getPolymorphicDiscriminatorRecursively(serializer, mapper) { + return mapper.type.polymorphicDiscriminator || getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) || getPolymorphicDiscriminatorSafely(serializer, mapper.type.className); } - function replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; + function getPolymorphicDiscriminatorSafely(serializer, typeName) { + return typeName && serializer.modelMappers[typeName] && serializer.modelMappers[typeName].type.polymorphicDiscriminator; } - module2.exports = toXml; + 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/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; - } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; - } + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.state = void 0; + exports2.state = { + operationRequestMap: /* @__PURE__ */ new WeakMap() }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; + } +}); + +// 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 { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } + let propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath); + if (!propertySearchResult.propertyFound && fallbackObject) { + propertySearchResult = getPropertyFromParameterPath(fallbackObject, parameterPath); } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); + let useDefaultValue = false; + if (!propertySearchResult.propertyFound) { + useDefaultValue = parameterMapper.required || parameterPath[0] === "options" && parameterPath.length === 2; } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue; } } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } - } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; + if (parameterMapper.required) { + value = {}; } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; + 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; + } } } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; + 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 { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } + if (i === parameterPath.length) { + result.propertyValue = parent; + result.propertyFound = true; } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); + return result; } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; + var originalRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function hasOriginalRequest(request) { + return originalRequestSymbol in request; + } + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); + } + let info7 = state_js_1.state.operationRequestMap.get(request); + if (!info7) { + info7 = {}; + state_js_1.state.operationRequestMap.set(request, info7); } + return info7; } - module2.exports = Builder; - } -}); - -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { - "use strict"; - var validator = require_validator(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder - }; - } -}); - -// 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) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + exports2.deserializationPolicyName = void 0; + exports2.deserializationPolicy = deserializationPolicy; + var interfaces_js_1 = require_interfaces(); + var core_rest_pipeline_1 = require_commonjs8(); + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false + name: exports2.deserializationPolicyName, + async sendRequest(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } }; } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + if (operationSpec) { + if (!operationInfo?.operationResponseGetter) { + result = operationSpec.responses[parsedResponse.status]; + } else { + result = operationInfo?.operationResponseGetter(operationSpec, parsedResponse); + } + } + return result; } - function getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function shouldDeserializeResponse(parsedResponse) { + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + 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; } - 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 deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { + const parsedResponse = await parse(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; } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); + 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 validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; + 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 parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; + 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.`; } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; + return { error: error3, shouldReturnResponse: false }; + } + async function parse(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 parsedXml; + return operationResponse; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs11 = __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/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) { +// 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.AbortError = void 0; - var AbortError = class extends Error { - constructor(message) { - super(message); - this.name = "AbortError"; + 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)); + } } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs12 = __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; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); } - 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."); + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); + } + } } - 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 index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + const customHeaders = operationArguments.options?.requestOptions?.customHeaders; + if (customHeaders) { + for (const customHeaderName of Object.keys(customHeaders)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); } } - /** - * 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; + function serializeRequestBody(request, 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 } - if (!Array.isArray(parentSignals)) { - parentSignals = arguments; + }; + const xmlCharKey = updatedOptions.xml.xmlCharKey; + if (operationSpec.requestBody && operationSpec.requestBody.mapper) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.body); + } + } + } catch (error3) { + throw new Error(`Error "${error3.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); } - for (const parentSignal of parentSignals) { - if (parentSignal.aborted) { - this.abort(); - } else { - parentSignal.addEventListener("abort", () => { - this.abort(); - }); + } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { + request.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); + request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); } } } - /** - * 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; + } + 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; } - /** - * Signal that any operations passed this controller's associated abort signal - * to cancel any remaining work and throw an `AbortError`. - */ - abort() { - abortSignal(this._signal); + return serializedValue; + } + function prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { + if (!Array.isArray(obj)) { + obj = [obj]; } - /** - * 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; + if (!xmlNamespaceKey || !xmlNamespace) { + return { [elementName]: obj }; } - }; - exports2.AbortController = AbortController2; - exports2.AbortError = AbortError; - exports2.AbortSignal = AbortSignal2; + const result = { [elementName]: obj }; + result[interfaces_js_1.XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace }; + return result; + } } }); -// node_modules/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs4(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); + exports2.createClientPipeline = createClientPipeline; + var deserializationPolicy_js_1 = require_deserializationPolicy(); + var core_rest_pipeline_1 = require_commonjs8(); + var serializationPolicy_js_1 = require_serializationPolicy(); + function createClientPipeline(options = {}) { + const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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_commonjs8(); + var cachedHttpClient; + function getCachedDefaultHttpClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); } + return cachedHttpClient; } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); + } +}); + +// 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 path3 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path3.startsWith("/")) { + path3 = path3.substring(1); + } + if (isAbsoluteUrl(path3)) { + requestUrl = path3; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path3); } - throw error4; - }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; } - return message + " " + innerMessage; + const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); + requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); + return requestUrl; } - 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); + function replaceAll(input, replacements) { + let result = input; + for (const [searchValue, replaceValue] of replacements) { + result = result.split(searchValue).join(replaceValue); } - return { - code, - message - }; + return result; } - 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}`; + 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); } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - logger.warning(errStr); - break; - } - case "canceled": { - stateProxy.setCanceled(state); - break; + result.set(`{${urlParameter.mapper.serializedName || parameterPathString}}`, urlParameterValue); } } - 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; + return result; } - async function initOperation(inputs) { - const { init, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation - }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; + function isAbsoluteUrl(url) { + return url.includes("://"); } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; - } + function appendPath(url, pathToAppend) { + if (!pathToAppend) { + return url; } - return { response, status }; - } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); + const parsedUrl = new URL(url); + let newPath = parsedUrl.pathname; + if (!newPath.endsWith("/")) { + newPath = `${newPath}/`; + } + if (pathToAppend.startsWith("/")) { + pathToAppend = pathToAppend.substring(1); + } + const searchStart = pathToAppend.indexOf("?"); + if (searchStart !== -1) { + const path3 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path3; + if (search) { + parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; } - updateState === null || updateState === void 0 ? void 0 : updateState(state, response); + } else { + newPath = newPath + pathToAppend; } + parsedUrl.pathname = newPath; + return parsedUrl.toString(); } - 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) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; + 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); } - case "original-uri": { - return requestPath; + if (!queryParameter.skipEncoding) { + if (Array.isArray(queryParameterValue)) { + queryParameterValue = queryParameterValue.map((item) => { + return encodeURIComponent(item); + }); + } else { + queryParameterValue = encodeURIComponent(queryParameterValue); + } } - case "location": - default: { - return location; + 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 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; + function simpleParseQueryParams(queryString) { + const result = /* @__PURE__ */ new Map(); + if (!queryString || queryString[0] !== "?") { + return result; + } + queryString = queryString.slice(1); + const pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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 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.`); + function appendQueryParams(url, queryParams, sequenceParams, noOverwrite = false) { + if (queryParams.size === 0) { + return url; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + const parsedUrl = new URL(url); + 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); } } - } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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"; + 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(); } - 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; + } +}); + +// 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_commonjs4(); + 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_commonjs8(); + 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 + }); + } + } } - return void 0; - } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; + /** + * Send the provided httpRequest. + */ + async sendRequest(request) { + return this.pipeline.sendRequest(this._httpClient, request); } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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 url = (0, urlHelpers_js_1.getRequestUrl)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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; + } } - return error4; + }; + 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 calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + 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; } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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; + } +}); + +// 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_base642(); + 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 initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return 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 + 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; } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); - } - case "ResourceLocation": { - return getLocationHeader(rawResponse); - } - case "Body": - default: { - return void 0; - } + } +}); + +// 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); } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); + 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; } - case "Body": { - return getProvisioningState(rawResponse); + const accessToken = await challengeOptions.getAccessToken(challengeScopes, { + ...requestOptions, + tenantId + }); + if (!accessToken) { + return false; } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + 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 getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; - } + function buildScopes(challengeOptions, challengeInfo) { + if (!challengeInfo.resource_id) { + return challengeOptions.scopes; } - return state.config.resourceLocation; + 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 isOperationError(e) { - return e.name === "RestError"; + function getChallenge(response) { + const challenge = response.headers.get("WWW-Authenticate"); + if (response.status === 401 && challenge) { + return challenge; + } + return; } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); + 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 }), {}); } - var createStateProxy$1 = () => ({ - /** - * 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, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); - }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } - } - 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 pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; - }; - } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); + function requestToOptions(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + tracingOptions: request.tracingOptions + }; } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - 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 _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + } +}); + +// node_modules/@azure/core-client/dist/commonjs/index.js +var require_commonjs10 = __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_commonjs8(); + var originalRequestSymbol = /* @__PURE__ */ Symbol("Original PipelineRequest"); + var originalClientRequestSymbol = /* @__PURE__ */ Symbol.for("@azure/core-client original request"); + function toPipelineRequest(webResource, options = {}) { + const compatWebResource = webResource; + const request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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; } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + return newRequest; + } + } + function toWebResourceLike(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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() { } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; + }; + if (options?.createProxy) { + return new Proxy(webResource, { + get(target, prop, receiver) { + if (prop === originalRequestSymbol) { + return request; + } 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") { + request.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)) { + request[prop] = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return webResource; } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + } + 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]); + } + } } /** - * Serializes the Poller operation. + * 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. */ - toString() { - return JSON.stringify({ - state: this.state - }); - } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); + set(headerName, headerValue) { + this._headersMap[getHeaderKey(headerName)] = { + name: headerName, + value: headerValue.toString() + }; } - }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + /** + * 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; } - }; - 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`. + * Get whether or not this header collection contains a header entry for the provided header name. */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve2, reject) => { - this.resolve = resolve2; - this.reject = reject; - }); - this.promise.catch(() => { - }); + contains(headerName) { + return !!this._headersMap[getHeaderKey(headerName)]; } /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. + * 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. */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); - } + remove(headerName) { + const result = this.contains(headerName); + delete this._headersMap[getHeaderKey(headerName)]; + return result; } /** - * 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. + * Get the headers that are contained this collection as an object. */ - async pollOnce(options = {}) { - if (!this.isDone()) { - this.operation = await this.operation.update({ - abortSignal: options.abortSignal, - fireProgress: this.fireProgress.bind(this) - }); - } - this.processUpdatedState(); + rawHeaders() { + return this.toJson({ preserveCase: true }); } /** - * 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. + * Get the headers that are contained in this collection as an array. */ - fireProgress(state) { - for (const callback of this.pollProgressCallbacks) { - callback(state); + headersArray() { + const headers = []; + for (const headerKey in this._headersMap) { + headers.push(this._headersMap[headerKey]); } + return headers; } /** - * Invokes the underlying operation's cancel method. + * Get the header names that are contained in this collection. */ - async cancelOnce(options = {}) { - this.operation = await this.operation.cancel(options); + headerNames() { + const headerNames = []; + const headers = this.headersArray(); + for (let i = 0; i < headers.length; ++i) { + headerNames.push(headers[i].name); + } + return headerNames; } /** - * 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. + * Get the header values that are contained in this collection. */ - poll(options = {}) { - if (!this.pollOncePromise) { - this.pollOncePromise = this.pollOnce(options); - const clearPollOncePromise = () => { - this.pollOncePromise = void 0; - }; - this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject); + headerValues() { + const headerValues = []; + const headers = this.headersArray(); + for (let i = 0; i < headers.length; ++i) { + headerValues.push(headers[i].value); } - return this.pollOncePromise; + return headerValues; } - processUpdatedState() { - if (this.operation.state.error) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - this.reject(this.operation.state.error); - throw this.operation.state.error; + /** + * 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; } - } - if (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + } else { + for (const headerKey in this._headersMap) { + const header = this._headersMap[headerKey]; + result[getHeaderKey(header.name)] = header.value; } } - if (this.isDone() && this.resolve) { - this.resolve(this.getResult()); - } + return result; } /** - * Returns a promise that will resolve once the underlying operation is completed. + * Get the string representation of this HTTP header collection. */ - 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); - }; + toString() { + return JSON.stringify(this.toJson({ preserveCase: true })); } /** - * Returns true if the poller has finished polling. + * Create a deep clone/copy of this HttpHeaders collection. */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); + clone() { + const resultPreservingCasing = {}; + for (const headerKey in this._headersMap) { + const header = this._headersMap[headerKey]; + resultPreservingCasing[header.name] = header.value; + } + return new _HttpHeaders(resultPreservingCasing); } - /** - * 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")); + }; + 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_commonjs8(); + var util_js_1 = require_util9(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); } - } + }); + } else { + return { + ...response, + request, + headers + }; } - /** - * Returns true if the poller is stopped. - */ - isStopped() { - return this.stopped; + } + 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) + }; } - /** - * 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"); + } + } +}); + +// 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_commonjs8(); + var core_client_1 = require_commonjs10(); + 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 + }); } - 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 - * } - * } - * } - * ``` + * Compatible send operation request function. * - * 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. + * @param operationArguments - Operation arguments + * @param operationSpec - Operation Spec + * @returns */ - toString() { - return this.operation.toString(); + 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; } }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new 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((resolve2) => setTimeout(() => resolve2(), this.config.intervalInMs)); + 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.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; + exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; + function createRequestPolicyFactoryPolicy(factories) { + const orderedFactories = factories.slice().reverse(); + return { + name: exports2.requestPolicyFactoryPolicyName, + async sendRequest(request, 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)(request, { createProxy: true }); + const response = await httpPipeline.sendRequest(webResourceLike); + return (0, response_js_1.toPipelineResponse)(response); + } + }; + } } }); -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { +// 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 }); - var coreRestPipeline = require_commonjs7(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs8(); - var coreUtil = require_commonjs4(); - var coreHttpCompat = require_commonjs10(); - var coreClient = require_commonjs9(); - var coreXml = require_commonjs11(); - var logger$1 = require_dist(); - var abortController = require_commonjs12(); - var crypto = require("crypto"); - var coreTracing = require_commonjs6(); - var stream = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs2 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; + exports2.convertHttpClient = convertHttpClient; + var response_js_1 = require_response2(); + var util_js_1 = require_util9(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); + return (0, response_js_1.toPipelineResponse)(response); + } + }; + } + } +}); + +// node_modules/@azure/core-http-compat/dist/commonjs/index.js +var require_commonjs11 = __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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); } - }); + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } } - }); + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); } - n.default = e; - return Object.freeze(n); - } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs2); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); - var BaseRequestPolicy = class { - /** - * The main method to implement that manipulates a request/response. - */ - constructor(_nextPolicy, _options) { - this._nextPolicy = _nextPolicy; - this._options = _options; + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; } - /** - * 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); + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; } - /** - * 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); + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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; } - }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { - Parameters: { - FORCE_BROWSER_NO_CACHE: "_", - SIGNATURE: "sig", - SNAPSHOT: "snapshot", - VERSIONID: "versionid", - TIMEOUT: "timeout" + const d = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; } - }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var 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" - }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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", + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _2 = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _2), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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_commonjs12 = __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_commonjs4(); + 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_commonjs13 = __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_constants9 = __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" ]; - var StorageBlobLoggingAllowedQueryParameters = [ + exports2.StorageBlobLoggingAllowedQueryParameters = [ "comp", "maxresults", "rscc", @@ -49065,9 +46925,9 @@ var require_dist7 = __commonJS({ "skv", "snapshot" ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ + exports2.BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; + exports2.BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; + exports2.PathStylePorts = [ "10000", "10001", "10002", @@ -49089,12 +46949,59 @@ var require_dist7 = __commonJS({ "11103", "11104" ]; - function escapeURLPath(url2) { - const urlParsed = new URL(url2); - let path2 = urlParsed.pathname; - path2 = path2 || "/"; - path2 = escape(path2); - urlParsed.pathname = path2; + } +}); + +// 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 = delay; + 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_commonjs8(); + var core_util_1 = require_commonjs6(); + var constants_js_1 = require_constants9(); + function escapeURLPath(url) { + const urlParsed = new URL(url); + let path3 = urlParsed.pathname; + path3 = path3 || "/"; + path3 = escape(path3); + urlParsed.pathname = path3; return urlParsed.toString(); } function getProxyUriFromDevConnString(connectionString) { @@ -49122,7 +47029,7 @@ var require_dist7 = __commonJS({ let proxyUri = ""; if (connectionString.startsWith("UseDevelopmentStorage=true")) { proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + connectionString = constants_js_1.DevelopmentConnectionString; } let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; @@ -49177,15 +47084,15 @@ var require_dist7 = __commonJS({ function escape(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 path2 = urlParsed.pathname; - path2 = path2 ? path2.endsWith("/") ? `${path2}${name}` : `${path2}/${name}` : name; - urlParsed.pathname = path2; + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path3 = urlParsed.pathname; + path3 = path3 ? path3.endsWith("/") ? `${path3}${name}` : `${path3}/${name}` : name; + urlParsed.pathname = path3; return urlParsed.toString(); } - function setURLParameter(url2, name, value) { - const urlParsed = new URL(url2); + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); const encodedName = encodeURIComponent(name); const encodedValue = value ? encodeURIComponent(value) : void 0; const searchString = urlParsed.search === "" ? "?" : urlParsed.search; @@ -49204,34 +47111,33 @@ var require_dist7 = __commonJS({ urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; return urlParsed.toString(); } - function getURLParameter(url2, name) { - var _a; - const urlParsed = new URL(url2); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : void 0; + function getURLParameter(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; } - function setURLHost(url2, host) { - const urlParsed = new URL(url2); + function setURLHost(url, host) { + const urlParsed = new URL(url); urlParsed.hostname = host; return urlParsed.toString(); } - function getURLPath(url2) { + function getURLPath(url) { try { - const urlParsed = new URL(url2); + const urlParsed = new URL(url); return urlParsed.pathname; } catch (e) { return void 0; } } - function getURLScheme(url2) { + function getURLScheme(url) { try { - const urlParsed = new URL(url2); + const urlParsed = new URL(url); return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; } catch (e) { return void 0; } } - function getURLPathAndQuery(url2) { - const urlParsed = new URL(url2); + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); const pathString = urlParsed.pathname; if (!pathString) { throw new RangeError("Invalid url without valid path."); @@ -49243,8 +47149,8 @@ var require_dist7 = __commonJS({ } return `${pathString}${queryString}`; } - function getURLQueries(url2) { - let queryString = new URL(url2).search; + function getURLQueries(url) { + let queryString = new URL(url).search; if (!queryString) { return {}; } @@ -49265,8 +47171,8 @@ var require_dist7 = __commonJS({ } return queries; } - function appendToURLQuery(url2, queryParts) { - const urlParsed = new URL(url2); + function appendToURLQuery(url, queryParts) { + const urlParsed = new URL(url); let query = urlParsed.search; if (query) { query += "&" + queryParts; @@ -49281,7 +47187,10 @@ var require_dist7 = __commonJS({ return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z"; } function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + 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; @@ -49329,11 +47238,31 @@ var require_dist7 = __commonJS({ return padString.slice(0, targetLength) + currentString; } } + function sanitizeURL(url) { + let safeURL = url; + 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); + function getAccountNameFromUrl(url) { + const parsedUrl = new URL(url); let accountName; try { if (parsedUrl.hostname.split(".")[1] === "blob") { @@ -49344,37 +47273,37 @@ var require_dist7 = __commonJS({ accountName = ""; } return accountName; - } catch (error4) { + } 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) && PathStylePorts.includes(parsedUrl.port); + 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(tags2) { - if (tags2 === void 0) { + function toBlobTagsString(tags) { + if (tags === void 0) { return void 0; } const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; + 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(tags2) { - if (tags2 === void 0) { + function toBlobTags(tags) { + if (tags === void 0) { return void 0; } const res = { blobTagSet: [] }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; + for (const key in tags) { + if (Object.prototype.hasOwnProperty.call(tags, key)) { + const value = tags[key]; res.blobTagSet.push({ key, value @@ -49383,12 +47312,12 @@ var require_dist7 = __commonJS({ } return res; } - function toTags(tags2) { - if (tags2 === void 0) { + function toTags(tags) { + if (tags === void 0) { return void 0; } const res = {}; - for (const blobTag of tags2.blobTagSet) { + for (const blobTag of tags.blobTagSet) { res[blobTag.key] = blobTag.value; } return res; @@ -49469,6 +47398,10 @@ var require_dist7 = __commonJS({ } return orProperties; } + function attachCredential(thing, credential) { + thing.credential = credential; + return thing; + } function httpAuthorizationToString(httpAuthorization) { return httpAuthorization ? httpAuthorization.scheme + " " + httpAuthorization.value : void 0; } @@ -49480,25 +47413,39 @@ var require_dist7 = __commonJS({ } } function ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + return { + ...internalResponse, + segment: { + blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { + const blobItem = { + ...blobItemInteral, + name: BlobNameToString(blobItemInteral.name) + }; + return blobItem; + }) + } + }; } function ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + 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 = []; @@ -49554,22 +47501,58 @@ var require_dist7 = __commonJS({ } 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"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { + })(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_commonjs13(); + var RequestPolicy_js_1 = require_RequestPolicy(); + var constants_js_1 = require_constants9(); + 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: exports2.StorageRetryPolicyType.EXPONENTIAL, + retryPolicyType: StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL, secondaryHost: "", tryTimeoutInMs: void 0 // Use server side default timeout strategy }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { + 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. * @@ -49577,15 +47560,15 @@ var require_dist7 = __commonJS({ * @param options - * @param retryOptions - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { + constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { super(nextPolicy, options); this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost + 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 }; } /** @@ -49610,21 +47593,21 @@ var require_dist7 = __commonJS({ const newRequest = request.clone(); const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); + newRequest.url = (0, utils_common_js_1.setURLHost)(newRequest.url, this.retryOptions.secondaryHost); } if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); + 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 { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); + 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) { - logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`); if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) { throw err; } @@ -49642,10 +47625,10 @@ var require_dist7 = __commonJS({ */ shouldRetry(isPrimaryRetry, attempt, response, err) { if (attempt >= this.retryOptions.maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); + log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); return false; } - const retriableErrors2 = [ + const retriableErrors = [ "ETIMEDOUT", "ESOCKETTIMEDOUT", "ECONNREFUSED", @@ -49658,9 +47641,9 @@ var require_dist7 = __commonJS({ // For default xhr based http client provided in ms-rest-js ]; if (err) { - for (const retriableError of retriableErrors2) { + for (const retriableError of retriableErrors) { if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); + log_js_1.logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); return true; } } @@ -49668,16 +47651,29 @@ var require_dist7 = __commonJS({ if (response || err) { const statusCode = response ? response.status : err ? err.statusCode : 0; if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); + log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); return true; } if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + log_js_1.logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); return true; } } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); + 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; @@ -49693,21 +47689,40 @@ var require_dist7 = __commonJS({ let delayTimeInMs = 0; if (isPrimaryRetry) { switch (this.retryOptions.retryPolicyType) { - case exports2.StorageRetryPolicyType.EXPONENTIAL: + case StorageRetryPolicyType_js_1.StorageRetryPolicyType.EXPONENTIAL: delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); break; - case exports2.StorageRetryPolicyType.FIXED: + case StorageRetryPolicyType_js_1.StorageRetryPolicyType.FIXED: delayTimeInMs = this.retryOptions.retryDelayInMs; break; } } else { delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); + 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 - @@ -49722,10 +47737,21 @@ var require_dist7 = __commonJS({ * @param options - */ create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + return new StorageRetryPolicy_js_1.StorageRetryPolicy(nextPolicy, options, this.retryOptions); } }; - var CredentialPolicy = class extends BaseRequestPolicy { + 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. * @@ -49744,6 +47770,16 @@ var require_dist7 = __commonJS({ return request; } }; + 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, @@ -50167,7 +48203,24 @@ var require_dist7 = __commonJS({ } return false; } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { + } +}); + +// 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_constants9(); + 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 - @@ -50184,31 +48237,31 @@ var require_dist7 = __commonJS({ * @param request - */ signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } const stringToSign = [ request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); return request; } /** * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key + * @see https://learn.microsoft.com/rest/api/storageservices/authenticate-with-shared-key * * @param request - * @param headerName - @@ -50218,7 +48271,7 @@ var require_dist7 = __commonJS({ if (!value) { return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { return ""; } return value; @@ -50238,10 +48291,10 @@ var require_dist7 = __commonJS({ */ getCanonicalizedHeadersString(request) { let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); + return value.name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE); }); headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); }); headersArray = headersArray.filter((value, index, array) => { if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { @@ -50262,10 +48315,10 @@ var require_dist7 = __commonJS({ * @param request - */ getCanonicalizedResourceString(request) { - const path2 = getURLPath(request.url) || "/"; + const path3 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path2}`; - const queries = getURLQueries(request.url); + canonicalizedResourceString += `/${this.factory.accountName}${path3}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -50285,6 +48338,16 @@ ${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 Credential = class { /** * Creates a RequestPolicy object. @@ -50296,7 +48359,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Method should be implemented in children classes."); } }; - var StorageSharedKeyCredential = class extends Credential { + exports2.Credential = Credential; + } +}); + +// 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 - @@ -50314,7 +48398,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ create(nextPolicy, options) { - return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this); + return new StorageSharedKeyCredentialPolicy_js_1.StorageSharedKeyCredentialPolicy(nextPolicy, options, this); } /** * Generates a hash signature for an HTTP request or for a SAS. @@ -50322,10 +48406,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param stringToSign - */ computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); + return (0, node_crypto_1.createHmac)("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); } }; - var AnonymousCredentialPolicy = class extends CredentialPolicy { + 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 - @@ -50337,7 +48432,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; super(nextPolicy, options); } }; - var AnonymousCredential = class extends Credential { + 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. * @@ -50345,1002 +48452,7405 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); + return new AnonymousCredentialPolicy_js_1.AnonymousCredentialPolicy(nextPolicy, options); } }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); + 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."); + } } - return _defaultHttpClient; - } - var storageBrowserPolicyName = "storageBrowserPolicy"; - function storageBrowserPolicy() { - return { - name: storageBrowserPolicyName, - async sendRequest(request, next) { - if (coreUtil.isNode) { - return next(request); - } - if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); - } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); - return next(request); + /** + * 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); } - }; - } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: 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 abortController.AbortError("The operation was aborted."); - function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; - if (attempt >= maxTries) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); - return false; + if (!size) { + size = this.readableHighWaterMark; } - if (error4) { - for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); - return true; + 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; } - } - if ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + this.pushedBytesLength += remaining; + i += remaining; } } - if (response || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; - if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } + if (outBuffers.length > 1) { + this.push(Buffer.concat(outBuffers)); + } else if (outBuffers.length === 1) { + this.push(outBuffers[0]); } - return false; } - function calculateDelay(isPrimaryRetry, attempt) { - let delayTimeInMs = 0; - if (isPrimaryRetry) { - switch (retryPolicyType) { - case StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); - break; - case StorageRetryPolicyType.FIXED: - delayTimeInMs = retryDelayInMs; - break; + }; + 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; } - } else { - delayTimeInMs = Math.random() * 1e3; + this.buffers.push(Buffer.allocUnsafe(len)); + } + if (buffers) { + this.fill(buffers, totalLength); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delayTimeInMs; } - return { - name: storageRetryPolicyName, - async sendRequest(request, next) { - if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); - } - const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; - let secondaryHas404 = false; - let attempt = 1; - let retryAgain = true; - let response; - let error4; - while (retryAgain) { - const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; - request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; - response = void 0; - error4 = void 0; - try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); - response = await next(request); - secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; - } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = e; - } else { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); - throw e; - } - } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); - if (retryAgain) { - await delay(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); - } - attempt++; + /** + * 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 (response) { - return response; + if (targetOffset === target.length) { + j++; + targetOffset = 0; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); } - }; - } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; - function storageSharedKeyCredentialPolicy(options) { - function signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + buffers.splice(0, i); + if (buffers.length > 0) { + buffers[0] = buffers[0].slice(sourceOffset); } - const stringToSign = [ - request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } - function getHeaderValueToSign(request, headerName) { - const value = request.headers.get(headerName); - if (!value) { - return ""; + /** + * 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 (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { - return ""; + if (maxBuffers <= 0) { + throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`); } - return value; - } - function getCanonicalizedHeadersString(request) { - let headersArray = []; - for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { - headersArray.push({ name, value }); - } + if (concurrency <= 0) { + throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`); } - headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); - }); - headersArray = headersArray.filter((value, index, array) => { - if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { - return false; - } - return true; - }); - let canonicalizedHeadersStringToSign = ""; - headersArray.forEach((header) => { - canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} -`; - }); - return canonicalizedHeadersStringToSign; + this.bufferSize = bufferSize; + this.maxBuffers = maxBuffers; + this.readable = readable; + this.outgoingHandler = outgoingHandler; + this.concurrency = concurrency; + this.encoding = encoding; } - function getCanonicalizedResourceString(request) { - const path2 = getURLPath(request.url) || "/"; - let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${options.accountName}${path2}`; - const queries = getURLQueries(request.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); + /** + * Start the scheduler, will return error when stream of any of the outgoingHandlers + * returns error. + * + */ + async do() { + return new Promise((resolve2, 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(); } - } - queryKeys.sort(); - for (const key of queryKeys) { - canonicalizedResourceString += ` -${key}:${decodeURIComponent(lowercaseQueries[key])}`; - } - } - return canonicalizedResourceString; + }); + 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(resolve2).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve2(); + } + } + }); + }); } - return { - name: storageSharedKeyCredentialPolicyName, - async sendRequest(request, next) { - signRequest(request); - return next(request); - } - }; - } - var StorageBrowserPolicy = class extends BaseRequestPolicy { /** - * Creates an instance of StorageBrowserPolicy. - * @param nextPolicy - - * @param options - + * Insert a new data into unresolved array. + * + * @param data - */ - // 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); + appendUnresolvedData(data) { + this.unresolvedDataArray.push(data); + this.unresolvedLength += data.length; } /** - * Sends out request. + * 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. * - * @param request - */ - async sendRequest(request) { - if (coreUtil.isNode) { - return this._nextPolicy.sendRequest(request); - } - if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + shiftBufferFromUnresolvedDataArray(buffer) { + if (!buffer) { + buffer = new PooledBuffer_js_1.PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); + } else { + buffer.fill(this.unresolvedDataArray, this.unresolvedLength); } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); - return this._nextPolicy.sendRequest(request); + this.unresolvedLength -= buffer.size; + return buffer; } - }; - var StorageBrowserPolicyFactory = class { /** - * Creates a StorageBrowserPolicyFactory object. + * 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. * - * @param nextPolicy - - * @param options - + * Return false when available buffers in incoming are not enough, else true. + * + * @returns Return false when buffers in incoming are not enough, else true. */ - create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); - } - }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; - function storageCorrectContentLengthPolicy() { - function correctContentLength(request) { - if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - } - return { - name: storageCorrectContentLengthPolicyName, - async sendRequest(request, next) { - correctContentLength(request); - return next(request); + 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(); } - }; - } - function isPipelineLike(pipeline) { - if (!pipeline || typeof pipeline !== "object") { - return false; + return true; } - const castPipeline = pipeline; - return Array.isArray(castPipeline.factories) && typeof castPipeline.options === "object" && typeof castPipeline.toServiceClientOptions === "function"; - } - var Pipeline = class { /** - * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface. - * - * @param factories - - * @param options - + * Try to trigger a outgoing handler for every buffer in outgoing. Stop when + * concurrency reaches. */ - constructor(factories, options = {}) { - this.factories = factories; - this.options = options; + async triggerOutgoingHandlers() { + let buffer; + do { + if (this.executingOutgoingHandlers >= this.concurrency) { + return; + } + buffer = this.outgoing.shift(); + if (buffer) { + this.triggerOutgoingHandler(buffer); + } + } while (buffer); } /** - * Transfer Pipeline object to ServiceClientOptions object which is required by - * ServiceClient constructor. + * Trigger a outgoing handler for a buffer shifted from outgoing. * - * @returns The ServiceClientOptions object from this Pipeline. + * @param buffer - */ - toServiceClientOptions() { - return { - httpClient: this.options.httpClient, - requestPolicyFactories: this.factories - }; + 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(); + } } }; - function newPipeline(credential, pipelineOptions = {}) { - if (!credential) { - credential = new AnonymousCredential(); + 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_commonjs8(); + var _defaultHttpClient; + function getCachedDefaultHttpClient() { + if (!_defaultHttpClient) { + _defaultHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); } - const pipeline = new Pipeline([], pipelineOptions); - pipeline._credential = credential; - return pipeline; + return _defaultHttpClient; } - function processDownlevelPipeline(pipeline) { - const knownFactoryFunctions = [ - isAnonymousCredential, - isStorageSharedKeyCredential, - isCoreHttpBearerTokenFactory, - isStorageBrowserPolicyFactory, - isStorageRetryPolicyFactory, - isStorageTelemetryPolicyFactory, - isCoreHttpPolicyFactory - ]; - if (pipeline.factories.length) { - const novelFactories = pipeline.factories.filter((factory) => { - return !knownFactoryFunctions.some((knownFactory) => knownFactory(factory)); - }); - if (novelFactories.length) { - const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); - return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), - afterRetry: hasInjector - }; + } +}); + +// 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_constants10 = __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 = delay; + 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_commonjs8(); + var core_util_1 = require_commonjs6(); + var constants_js_1 = require_constants10(); + function escapeURLPath(url) { + const urlParsed = new URL(url); + let path3 = urlParsed.pathname; + path3 = path3 || "/"; + path3 = escape(path3); + urlParsed.pathname = path3; + 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 void 0; + return proxyUri; } - function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); - let httpClient = pipeline._coreHttpClient; - if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); - pipeline._coreHttpClient = httpClient; + function getValueInConnString(connectionString, argument) { + const elements = connectionString.split(";"); + for (const element of elements) { + if (element.trim().startsWith(argument)) { + return element.trim().match(argument + "=(.*)")[1]; + } } - let corePipeline = pipeline._corePipeline; - if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; - const userAgentPrefix = restOptions.userAgentOptions && restOptions.userAgentOptions.userAgentPrefix ? `${restOptions.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - corePipeline = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } + 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'"); } - }, deserializationOptions: { - parseXML: coreXml.parseXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" - } + endpointSuffix = getValueInConnString(connectionString, "EndpointSuffix"); + if (!endpointSuffix) { + throw new Error("Invalid EndpointSuffix in the provided Connection String"); } - } })); - corePipeline.removePolicy({ phase: "Retry" }); - corePipeline.removePolicy({ name: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); - const downlevelResults = processDownlevelPipeline(pipeline); - if (downlevelResults) { - corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`; } - const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); + 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"); } - pipeline._corePipeline = corePipeline; + 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 }; } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); } - function getCredentialFromPipeline(pipeline) { - if (pipeline._credential) { - return pipeline._credential; - } - let credential = new AnonymousCredential(); - for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { - credential = factory.credential; - } else if (isStorageSharedKeyCredential(factory)) { - return factory; + function escape(text) { + return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); + } + function appendToURLPath(url, name) { + const urlParsed = new URL(url); + let path3 = urlParsed.pathname; + path3 = path3 ? path3.endsWith("/") ? `${path3}${name}` : `${path3}/${name}` : name; + urlParsed.pathname = path3; + return urlParsed.toString(); + } + function setURLParameter(url, name, value) { + const urlParsed = new URL(url); + 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); + } } } - return credential; + if (encodedValue) { + searchPieces.push(`${encodedName}=${encodedValue}`); + } + urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; + return urlParsed.toString(); } - function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { - return true; + function getURLParameter(url, name) { + const urlParsed = new URL(url); + return urlParsed.searchParams.get(name) ?? void 0; + } + function setURLHost(url, host) { + const urlParsed = new URL(url); + urlParsed.hostname = host; + return urlParsed.toString(); + } + function getURLPath(url) { + try { + const urlParsed = new URL(url); + return urlParsed.pathname; + } catch (e) { + return void 0; } - return factory.constructor.name === "StorageSharedKeyCredential"; } - function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { - return true; + function getURLScheme(url) { + try { + const urlParsed = new URL(url); + return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; + } catch (e) { + return void 0; } - return factory.constructor.name === "AnonymousCredential"; } - function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); + function getURLPathAndQuery(url) { + const urlParsed = new URL(url); + 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 isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { - return true; + function getURLQueries(url) { + let queryString = new URL(url).search; + if (!queryString) { + return {}; } - return factory.constructor.name === "StorageBrowserPolicyFactory"; + 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 isStorageRetryPolicyFactory(factory) { - if (factory instanceof StorageRetryPolicyFactory) { - return true; + function appendToURLQuery(url, queryParts) { + const urlParsed = new URL(url); + let query = urlParsed.search; + if (query) { + query += "&" + queryParts; + } else { + query = queryParts; } - return factory.constructor.name === "StorageRetryPolicyFactory"; + urlParsed.search = query; + return urlParsed.toString(); } - function isStorageTelemetryPolicyFactory(factory) { - return factory.constructor.name === "TelemetryPolicyFactory"; + 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 isInjectorPolicyFactory(factory) { - return factory.constructor.name === "InjectorPolicyFactory"; + function base64encode(content) { + return !core_util_1.isNodeLike ? btoa(content) : Buffer.from(content).toString("base64"); } - function isCoreHttpPolicyFactory(factory) { - const knownPolicies = [ - "GenerateClientRequestIdPolicy", - "TracingPolicy", - "LogPolicy", - "ProxyPolicy", - "DisableResponseDecompressionPolicy", - "KeepAlivePolicy", - "DeserializationPolicy" - ]; - const mockHttpClient = { - sendRequest: async (request) => { - return { - request, - headers: request.headers.clone(), - status: 500 - }; - } - }; - const mockRequestPolicyOptions = { - log(_logLevel, _message) { - }, - shouldLog(_logLevel) { - return false; + 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 delay(timeInMs, aborter, abortError) { + return new Promise((resolve2, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve2(); + }; + timeout = setTimeout(resolveHandler, timeInMs); + if (aborter !== void 0) { + aborter.addEventListener("abort", abortHandler); } - }; - const policyInstance = factory.create(mockHttpClient, mockRequestPolicyOptions); - const policyName = policyInstance.constructor.name; - return knownPolicies.some((knownPolicyName) => { - return policyName.startsWith(knownPolicyName); }); } - var 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" - } - } + 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; } - }; - var 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" - } - } - } + } + function sanitizeURL(url) { + let safeURL = url; + if (getURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE)) { + safeURL = setURLParameter(safeURL, constants_js_1.URLConstants.Parameters.SIGNATURE, "*****"); } - }; - var 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" - } - } + 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); } } - }; - var 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" - } - } + return headers; + } + function iEqual(str1, str2) { + return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); + } + function getAccountNameFromUrl(url) { + const parsedUrl = new URL(url); + 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."); } - }; - var 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" - } - } - } + } + 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]); } - }; - var 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" - } - } + 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_commonjs6(); + var constants_js_1 = require_constants10(); + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); } }; - var StorageError = { - serializedName: "StorageError", - type: { - name: "Composite", - className: "StorageError", - modelProperties: { - message: { - serializedName: "Message", - xmlName: "Message", - type: { - name: "String" - } - }, - code: { - serializedName: "Code", - xmlName: "Code", - type: { - name: "String" - } - }, - authenticationErrorDetail: { - serializedName: "AuthenticationErrorDetail", - xmlName: "AuthenticationErrorDetail", - type: { - name: "String" - } - } - } + 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); } }; - var BlobServiceStatistics = { - serializedName: "BlobServiceStatistics", - xmlName: "StorageServiceStats", - type: { - name: "Composite", - className: "BlobServiceStatistics", - modelProperties: { - geoReplication: { - serializedName: "GeoReplication", - xmlName: "GeoReplication", - type: { - name: "Composite", - className: "GeoReplication" - } - } - } + 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; } }; - var 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.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); } }; - var 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.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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); } }; - var 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.Credential = Credential; + } +}); + +// 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); } }; - var 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"] - } + 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_constants10(); + 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path3 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path3}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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_commonjs14 = __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_commonjs4(); + 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_commonjs14(); + var RequestPolicy_js_1 = require_RequestPolicy2(); + var constants_js_1 = require_constants10(); + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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_commonjs6(); + var constants_js_1 = require_constants10(); + var utils_common_js_1 = require_utils_common2(); + exports2.storageBrowserPolicyName = "storageBrowserPolicy"; + function storageBrowserPolicy() { + return { + name: exports2.storageBrowserPolicyName, + async sendRequest(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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_constants10(); + exports2.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; + function storageCorrectContentLengthPolicy() { + function correctContentLength(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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_commonjs14(); + var core_rest_pipeline_1 = require_commonjs8(); + var core_util_1 = require_commonjs6(); + var StorageRetryPolicyFactory_js_1 = require_StorageRetryPolicyFactory2(); + var constants_js_1 = require_constants10(); + 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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_constants10(); + var utils_common_js_1 = require_utils_common2(); + var SharedKeyComparator_js_1 = require_SharedKeyComparator2(); + exports2.storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; + function storageSharedKeyCredentialPolicy(options) { + function signRequest(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path3 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path3}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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_commonjs15 = __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_commonjs6(); + var constants_js_1 = require_constants9(); + var utils_common_js_1 = require_utils_common(); + exports2.storageBrowserPolicyName = "storageBrowserPolicy"; + function storageBrowserPolicy() { + return { + name: exports2.storageBrowserPolicyName, + async sendRequest(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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_commonjs13(); + var core_rest_pipeline_1 = require_commonjs8(); + var core_util_1 = require_commonjs6(); + var StorageRetryPolicyFactory_js_1 = require_StorageRetryPolicyFactory(); + var constants_js_1 = require_constants9(); + 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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_constants9(); + var utils_common_js_1 = require_utils_common(); + var SharedKeyComparator_js_1 = require_SharedKeyComparator(); + exports2.storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; + function storageSharedKeyCredentialPolicy(options) { + function signRequest(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; + } + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; + } + return value; + } + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; + }); + return canonicalizedHeadersStringToSign; + } + function getCanonicalizedResourceString(request) { + const path3 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${options.accountName}${path3}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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_commonjs6(); + var constants_js_1 = require_constants9(); + 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(request) { + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); + } + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); + } + }; + 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_constants9(); + exports2.storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; + function storageCorrectContentLengthPolicy() { + function correctContentLength(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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_commonjs11(); + var core_rest_pipeline_1 = require_commonjs8(); + var core_client_1 = require_commonjs10(); + var core_xml_1 = require_commonjs12(); + var core_auth_1 = require_commonjs9(); + 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_constants9(); + Object.defineProperty(exports2, "StorageOAuthScopes", { enumerable: true, get: function() { + return constants_js_1.StorageOAuthScopes; + } }); + var storage_common_1 = require_commonjs15(); + 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(pipeline) { + if (!pipeline || typeof pipeline !== "object") { + return false; + } + const castPipeline = pipeline; + 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 pipeline = new Pipeline([], pipelineOptions); + pipeline._credential = credential; + return pipeline; + } + function processDownlevelPipeline(pipeline) { + const knownFactoryFunctions = [ + isAnonymousCredential, + isStorageSharedKeyCredential, + isCoreHttpBearerTokenFactory, + isStorageBrowserPolicyFactory, + isStorageRetryPolicyFactory, + isStorageTelemetryPolicyFactory, + isCoreHttpPolicyFactory + ]; + if (pipeline.factories.length) { + const novelFactories = pipeline.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(pipeline) { + const { httpClient: v1Client, ...restOptions } = pipeline.options; + let httpClient = pipeline._coreHttpClient; + if (!httpClient) { + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); + pipeline._coreHttpClient = httpClient; + } + let corePipeline = pipeline._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(pipeline); + if (downlevelResults) { + corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); + } + const credential = getCredentialFromPipeline(pipeline); + 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" }); + } + pipeline._corePipeline = corePipeline; + } + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; + } + function getCredentialFromPipeline(pipeline) { + if (pipeline._credential) { + return pipeline._credential; + } + let credential = new AnonymousCredential_js_1.AnonymousCredential(); + for (const factory of pipeline.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 (request) => { + return { + request, + headers: request.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: "LeaseState", - xmlName: "LeaseState", + serializedName: "x-ms-lease-state", + xmlName: "x-ms-lease-state", type: { name: "Enum", allowedValues: [ @@ -51352,92 +55862,259 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ] } }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + leaseStatus: { + serializedName: "x-ms-lease-status", + xmlName: "x-ms-lease-status", type: { name: "Enum", - allowedValues: ["infinite", "fixed"] + allowedValues: ["locked", "unlocked"] } }, - publicAccess: { - serializedName: "PublicAccess", - xmlName: "PublicAccess", + contentLength: { + serializedName: "content-length", + xmlName: "content-length", type: { - name: "Enum", - allowedValues: ["container", "blob"] + name: "Number" } }, - hasImmutabilityPolicy: { - serializedName: "HasImmutabilityPolicy", - xmlName: "HasImmutabilityPolicy", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "Boolean" + name: "String" } }, - hasLegalHold: { - serializedName: "HasLegalHold", - xmlName: "HasLegalHold", + 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" } }, - defaultEncryptionScope: { - serializedName: "DefaultEncryptionScope", - xmlName: "DefaultEncryptionScope", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - preventEncryptionScopeOverride: { - serializedName: "DenyEncryptionScopeOverride", - xmlName: "DenyEncryptionScopeOverride", + 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" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + 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" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + 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" } }, - isImmutableStorageWithVersioningEnabled: { - serializedName: "ImmutableStorageWithVersioningEnabled", - xmlName: "ImmutableStorageWithVersioningEnabled", + 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" + } } } } }; - var KeyInfo = { - serializedName: "KeyInfo", + exports2.BlobGetPropertiesExceptionHeaders = { + serializedName: "Blob_getPropertiesExceptionHeaders", type: { name: "Composite", - className: "KeyInfo", + className: "BlobGetPropertiesExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - required: true, - xmlName: "Expiry", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -51445,64 +56122,43 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { - serializedName: "UserDelegationKey", + exports2.BlobDeleteHeaders = { + serializedName: "Blob_deleteHeaders", type: { name: "Composite", - className: "UserDelegationKey", + className: "BlobDeleteHeaders", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - signedExpiresOn: { - serializedName: "SignedExpiry", - required: true, - xmlName: "SignedExpiry", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - signedService: { - serializedName: "SignedService", - required: true, - xmlName: "SignedService", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - signedVersion: { - serializedName: "SignedVersion", - required: true, - xmlName: "SignedVersion", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -51510,49 +56166,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobSegment = { - serializedName: "FilterBlobSegment", - xmlName: "EnumerationResults", + exports2.BlobDeleteExceptionHeaders = { + serializedName: "Blob_deleteExceptionHeaders", type: { name: "Composite", - className: "FilterBlobSegment", + className: "BlobDeleteExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -51560,141 +56182,126 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobItem = { - serializedName: "FilterBlobItem", - xmlName: "Blob", + exports2.BlobUndeleteHeaders = { + serializedName: "Blob_undeleteHeaders", type: { name: "Composite", - className: "FilterBlobItem", + className: "BlobUndeleteHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - tags: { - serializedName: "Tags", - xmlName: "Tags", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobTags" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" } } } } }; - var BlobTags = { - serializedName: "BlobTags", - xmlName: "Tags", + exports2.BlobUndeleteExceptionHeaders = { + serializedName: "Blob_undeleteExceptionHeaders", type: { name: "Composite", - className: "BlobTags", + className: "BlobUndeleteExceptionHeaders", modelProperties: { - blobTagSet: { - serializedName: "BlobTagSet", - required: true, - xmlName: "TagSet", - xmlIsWrapped: true, - xmlElementName: "Tag", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobTag" - } - } + name: "String" } } } } }; - var BlobTag = { - serializedName: "BlobTag", - xmlName: "Tag", + exports2.BlobSetExpiryHeaders = { + serializedName: "Blob_setExpiryHeaders", type: { name: "Composite", - className: "BlobTag", + className: "BlobSetExpiryHeaders", modelProperties: { - key: { - serializedName: "Key", - required: true, - xmlName: "Key", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - value: { - serializedName: "Value", - required: true, - xmlName: "Value", + 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" } - } - } - } - }; - var SignedIdentifier = { - serializedName: "SignedIdentifier", - xmlName: "SignedIdentifier", - type: { - name: "Composite", - className: "SignedIdentifier", - modelProperties: { - id: { - serializedName: "Id", - required: true, - xmlName: "Id", + }, + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - accessPolicy: { - serializedName: "AccessPolicy", - xmlName: "AccessPolicy", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "AccessPolicy" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var AccessPolicy = { - serializedName: "AccessPolicy", + exports2.BlobSetExpiryExceptionHeaders = { + serializedName: "Blob_setExpiryExceptionHeaders", type: { name: "Composite", - className: "AccessPolicy", + className: "BlobSetExpiryExceptionHeaders", modelProperties: { - startsOn: { - serializedName: "Start", - xmlName: "Start", - type: { - name: "String" - } - }, - expiresOn: { - serializedName: "Expiry", - xmlName: "Expiry", - type: { - name: "String" - } - }, - permissions: { - serializedName: "Permission", - xmlName: "Permission", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -51702,63 +56309,64 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsFlatSegmentResponse = { - serializedName: "ListBlobsFlatSegmentResponse", - xmlName: "EnumerationResults", + exports2.BlobSetHttpHeadersHeaders = { + serializedName: "Blob_setHttpHeadersHeaders", type: { name: "Composite", - className: "ListBlobsFlatSegmentResponse", + className: "BlobSetHttpHeadersHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + 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" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobFlatListSegment" + name: "DateTimeRfc1123" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -51766,136 +56374,83 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobFlatListSegment = { - serializedName: "BlobFlatListSegment", - xmlName: "Blobs", + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", type: { name: "Composite", - className: "BlobFlatListSegment", + className: "BlobSetHttpHeadersExceptionHeaders", modelProperties: { - blobItems: { - serializedName: "BlobItems", - required: true, - xmlName: "BlobItems", - xmlElementName: "Blob", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobItemInternal = { - serializedName: "BlobItemInternal", - xmlName: "Blob", + exports2.BlobSetImmutabilityPolicyHeaders = { + serializedName: "Blob_setImmutabilityPolicyHeaders", type: { name: "Composite", - className: "BlobItemInternal", + className: "BlobSetImmutabilityPolicyHeaders", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - versionId: { - serializedName: "VersionId", - xmlName: "VersionId", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", 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", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "String" } }, - blobTags: { - serializedName: "BlobTags", - xmlName: "Tags", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Composite", - className: "BlobTags" + name: "DateTimeRfc1123" } }, - objectReplicationMetadata: { - serializedName: "ObjectReplicationMetadata", - xmlName: "OrMetadata", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "DateTimeRfc1123" } }, - hasVersionsOnly: { - serializedName: "HasVersionsOnly", - xmlName: "HasVersionsOnly", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "Boolean" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } } } }; - var BlobName = { - serializedName: "BlobName", + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", type: { name: "Composite", - className: "BlobName", + className: "BlobSetImmutabilityPolicyExceptionHeaders", modelProperties: { - encoded: { - serializedName: "Encoded", - xmlName: "Encoded", - xmlIsAttribute: true, - type: { - name: "Boolean" - } - }, - content: { - serializedName: "content", - xmlName: "content", - xmlIsMsText: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } @@ -51903,898 +56458,913 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { - serializedName: "BlobPropertiesInternal", - xmlName: "Properties", + exports2.BlobDeleteImmutabilityPolicyHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyHeaders", type: { name: "Composite", - className: "BlobPropertiesInternal", + className: "BlobDeleteImmutabilityPolicyHeaders", 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - contentEncoding: { - serializedName: "Content-Encoding", - xmlName: "Content-Encoding", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentLanguage: { - serializedName: "Content-Language", - xmlName: "Content-Language", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - contentMD5: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } - }, - contentDisposition: { - serializedName: "Content-Disposition", - xmlName: "Content-Disposition", + } + } + } + }; + 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" } - }, - cacheControl: { - serializedName: "Cache-Control", - xmlName: "Cache-Control", + } + } + } + }; + 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" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Number" + name: "String" } }, - blobType: { - serializedName: "BlobType", - xmlName: "BlobType", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Enum", - allowedValues: ["BlockBlob", "PageBlob", "AppendBlob"] + name: "String" } }, - leaseStatus: { - serializedName: "LeaseStatus", - xmlName: "LeaseStatus", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "DateTimeRfc1123" } }, - leaseState: { - serializedName: "LeaseState", - xmlName: "LeaseState", + legalHold: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "Boolean" } - }, - leaseDuration: { - serializedName: "LeaseDuration", - xmlName: "LeaseDuration", + } + } + } + }; + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetLegalHoldExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: ["infinite", "fixed"] + name: "String" } - }, - copyId: { - serializedName: "CopyId", - xmlName: "CopyId", + } + } + } + }; + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - copyStatus: { - serializedName: "CopyStatus", - xmlName: "CopyStatus", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "DateTimeRfc1123" } }, - copySource: { - serializedName: "CopySource", - xmlName: "CopySource", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - copyProgress: { - serializedName: "CopyProgress", - xmlName: "CopyProgress", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - copyCompletedOn: { - serializedName: "CopyCompletionTime", - xmlName: "CopyCompletionTime", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - copyStatusDescription: { - serializedName: "CopyStatusDescription", - xmlName: "CopyStatusDescription", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - serverEncrypted: { - serializedName: "ServerEncrypted", - xmlName: "ServerEncrypted", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - incrementalCopy: { - serializedName: "IncrementalCopy", - xmlName: "IncrementalCopy", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - destinationSnapshot: { - serializedName: "DestinationSnapshot", - xmlName: "DestinationSnapshot", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - deletedOn: { - serializedName: "DeletedTime", - xmlName: "DeletedTime", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "DateTimeRfc1123" + name: "String" } }, - remainingRetentionDays: { - serializedName: "RemainingRetentionDays", - xmlName: "RemainingRetentionDays", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - accessTier: { - serializedName: "AccessTier", - xmlName: "AccessTier", + } + } + } + }; + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetMetadataExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Enum", - allowedValues: [ - "P4", - "P6", - "P10", - "P15", - "P20", - "P30", - "P40", - "P50", - "P60", - "P70", - "P80", - "Hot", - "Cool", - "Archive", - "Cold" - ] + name: "String" } - }, - accessTierInferred: { - serializedName: "AccessTierInferred", - xmlName: "AccessTierInferred", + } + } + } + }; + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Boolean" + name: "String" } }, - archiveStatus: { - serializedName: "ArchiveStatus", - xmlName: "ArchiveStatus", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "rehydrate-pending-to-hot", - "rehydrate-pending-to-cool", - "rehydrate-pending-to-cold" - ] + name: "DateTimeRfc1123" } }, - customerProvidedKeySha256: { - serializedName: "CustomerProvidedKeySha256", - xmlName: "CustomerProvidedKeySha256", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "EncryptionScope", - xmlName: "EncryptionScope", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - accessTierChangedOn: { - serializedName: "AccessTierChangeTime", - xmlName: "AccessTierChangeTime", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - tagCount: { - serializedName: "TagCount", - xmlName: "TagCount", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - expiresOn: { - serializedName: "Expiry-Time", - xmlName: "Expiry-Time", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isSealed: { - serializedName: "Sealed", - xmlName: "Sealed", + } + } + } + }; + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", + type: { + name: "Composite", + className: "BlobAcquireLeaseExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - rehydratePriority: { - serializedName: "RehydratePriority", - xmlName: "RehydratePriority", + } + } + } + }; + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", + type: { + name: "Composite", + className: "BlobReleaseLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessedOn: { - serializedName: "LastAccessTime", - xmlName: "LastAccessTime", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyExpiresOn: { - serializedName: "ImmutabilityPolicyUntilDate", - xmlName: "ImmutabilityPolicyUntilDate", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "ImmutabilityPolicyMode", - xmlName: "ImmutabilityPolicyMode", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "String" } }, - legalHold: { - serializedName: "LegalHold", - xmlName: "LegalHold", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Boolean" + name: "String" + } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" } } } } }; - var ListBlobsHierarchySegmentResponse = { - serializedName: "ListBlobsHierarchySegmentResponse", - xmlName: "EnumerationResults", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "ListBlobsHierarchySegmentResponse", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { - serviceEndpoint: { - serializedName: "ServiceEndpoint", - required: true, - xmlName: "ServiceEndpoint", - xmlIsAttribute: true, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - containerName: { - serializedName: "ContainerName", - required: true, - xmlName: "ContainerName", - xmlIsAttribute: true, + } + } + } + }; + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", + type: { + name: "Composite", + className: "BlobRenewLeaseHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - prefix: { - serializedName: "Prefix", - xmlName: "Prefix", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - marker: { - serializedName: "Marker", - xmlName: "Marker", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { name: "String" } }, - maxPageSize: { - serializedName: "MaxResults", - xmlName: "MaxResults", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, - delimiter: { - serializedName: "Delimiter", - xmlName: "Delimiter", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - segment: { - serializedName: "Segment", - xmlName: "Blobs", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "BlobHierarchyListSegment" + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } } } } }; - var BlobHierarchyListSegment = { - serializedName: "BlobHierarchyListSegment", - xmlName: "Blobs", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobHierarchyListSegment", + className: "BlobRenewLeaseExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "BlobItemInternal" - } - } + name: "String" } } } } }; - var BlobPrefix = { - serializedName: "BlobPrefix", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "BlobPrefix", + className: "BlobChangeLeaseHeaders", modelProperties: { - name: { - serializedName: "Name", - xmlName: "Name", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Composite", - className: "BlobName" + name: "String" } - } - } - } - }; - var BlockLookupList = { - serializedName: "BlockLookupList", - xmlName: "BlockList", - type: { - name: "Composite", - className: "BlockLookupList", - modelProperties: { - committed: { - serializedName: "Committed", - xmlName: "Committed", - xmlElementName: "Committed", + }, + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + 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" } }, - uncommitted: { - serializedName: "Uncommitted", - xmlName: "Uncommitted", - xmlElementName: "Uncommitted", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "String" } }, - latest: { - serializedName: "Latest", - xmlName: "Latest", - xmlElementName: "Latest", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Sequence", - element: { - type: { - name: "String" - } - } + name: "DateTimeRfc1123" } } } } }; - var BlockList = { - serializedName: "BlockList", + exports2.BlobChangeLeaseExceptionHeaders = { + serializedName: "Blob_changeLeaseExceptionHeaders", type: { name: "Composite", - className: "BlockList", + className: "BlobChangeLeaseExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Block" - } - } + name: "String" } } } } }; - var Block = { - serializedName: "Block", + exports2.BlobBreakLeaseHeaders = { + serializedName: "Blob_breakLeaseHeaders", type: { name: "Composite", - className: "Block", + className: "BlobBreakLeaseHeaders", modelProperties: { - name: { - serializedName: "Name", - required: true, - xmlName: "Name", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - size: { - serializedName: "Size", - required: true, - xmlName: "Size", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { name: "Number" } - } - } - } - }; - var PageList = { - serializedName: "PageList", - type: { - name: "Composite", - className: "PageList", - modelProperties: { - pageRange: { - serializedName: "PageRange", - xmlName: "PageRange", - xmlElementName: "PageRange", + }, + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PageRange" - } - } + name: "String" } }, - clearRange: { - serializedName: "ClearRange", - xmlName: "ClearRange", - xmlElementName: "ClearRange", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ClearRange" - } - } + name: "String" } }, - continuationToken: { - serializedName: "NextMarker", - xmlName: "NextMarker", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } + }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } } } } }; - var PageRange = { - serializedName: "PageRange", - xmlName: "PageRange", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "PageRange", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", - type: { - name: "Number" - } - }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } } } } }; - var ClearRange = { - serializedName: "ClearRange", - xmlName: "ClearRange", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "ClearRange", + className: "BlobCreateSnapshotHeaders", modelProperties: { - start: { - serializedName: "Start", - required: true, - xmlName: "Start", + snapshot: { + serializedName: "x-ms-snapshot", + xmlName: "x-ms-snapshot", type: { - name: "Number" + name: "String" } }, - end: { - serializedName: "End", - required: true, - xmlName: "End", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Number" + name: "String" } - } - } - } - }; - var QueryRequest = { - serializedName: "QueryRequest", - xmlName: "QueryRequest", - type: { - name: "Composite", - className: "QueryRequest", - modelProperties: { - queryType: { - serializedName: "QueryType", - required: true, - xmlName: "QueryType", + }, + 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" } }, - expression: { - serializedName: "Expression", - required: true, - xmlName: "Expression", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - inputSerialization: { - serializedName: "InputSerialization", - xmlName: "InputSerialization", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Composite", - className: "QuerySerialization" + name: "String" } }, - outputSerialization: { - serializedName: "OutputSerialization", - xmlName: "OutputSerialization", + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { - name: "Composite", - className: "QuerySerialization" + 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" } } } } }; - var QuerySerialization = { - serializedName: "QuerySerialization", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "QuerySerialization", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { - format: { - serializedName: "Format", - xmlName: "Format", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Composite", - className: "QueryFormat" + name: "String" } } } } }; - var QueryFormat = { - serializedName: "QueryFormat", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "QueryFormat", + className: "BlobStartCopyFromURLHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Enum", - allowedValues: ["delimited", "json", "arrow", "parquet"] + name: "String" } }, - delimitedTextConfiguration: { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Composite", - className: "DelimitedTextConfiguration" + name: "DateTimeRfc1123" } }, - jsonTextConfiguration: { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Composite", - className: "JsonTextConfiguration" + name: "String" } }, - arrowConfiguration: { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Composite", - className: "ArrowConfiguration" + name: "String" } }, - parquetTextConfiguration: { - serializedName: "ParquetTextConfiguration", - xmlName: "ParquetTextConfiguration", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Dictionary", - value: { type: { name: "any" } } + name: "String" } - } - } - } - }; - var DelimitedTextConfiguration = { - serializedName: "DelimitedTextConfiguration", - xmlName: "DelimitedTextConfiguration", - type: { - name: "Composite", - className: "DelimitedTextConfiguration", - modelProperties: { - columnSeparator: { - serializedName: "ColumnSeparator", - xmlName: "ColumnSeparator", + }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", type: { name: "String" } }, - fieldQuote: { - serializedName: "FieldQuote", - xmlName: "FieldQuote", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { name: "String" } }, - escapeChar: { - serializedName: "EscapeChar", - xmlName: "EscapeChar", + copyStatus: { + serializedName: "x-ms-copy-status", + xmlName: "x-ms-copy-status", type: { - name: "String" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - headersPresent: { - serializedName: "HeadersPresent", - xmlName: "HasHeaders", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var JsonTextConfiguration = { - serializedName: "JsonTextConfiguration", - xmlName: "JsonTextConfiguration", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "JsonTextConfiguration", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { - recordSeparator: { - serializedName: "RecordSeparator", - xmlName: "RecordSeparator", + 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" + } } } } }; - var ArrowConfiguration = { - serializedName: "ArrowConfiguration", - xmlName: "ArrowConfiguration", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "ArrowConfiguration", + className: "BlobCopyFromURLHeaders", modelProperties: { - schema: { - serializedName: "Schema", - required: true, - xmlName: "Schema", - xmlIsWrapped: true, - xmlElementName: "Field", + etag: { + serializedName: "etag", + xmlName: "etag", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ArrowField" - } - } + 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" } } } } }; - var ArrowField = { - serializedName: "ArrowField", - xmlName: "Field", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "ArrowField", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { - type: { - serializedName: "Type", - required: true, - xmlName: "Type", - type: { - name: "String" - } - }, - name: { - serializedName: "Name", - xmlName: "Name", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } }, - precision: { - serializedName: "Precision", - xmlName: "Precision", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { - name: "Number" + name: "String" } }, - scale: { - serializedName: "Scale", - xmlName: "Scale", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { name: "Number" } @@ -52802,11 +57372,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesHeaders = { - serializedName: "Service_setPropertiesHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesHeaders", + className: "BlobAbortCopyFromURLHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52829,6 +57399,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + date: { + serializedName: "date", + xmlName: "date", + type: { + name: "DateTimeRfc1123" + } + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -52839,11 +57416,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesExceptionHeaders = { - serializedName: "Service_setPropertiesExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "ServiceSetPropertiesExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52855,11 +57432,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { - serializedName: "Service_getPropertiesHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesHeaders", + className: "BlobSetTierHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52892,11 +57469,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesExceptionHeaders = { - serializedName: "Service_getPropertiesExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "ServiceGetPropertiesExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52908,11 +57485,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsHeaders = { - serializedName: "Service_getStatisticsHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsHeaders", + className: "BlobGetAccountInfoHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -52942,21 +57519,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + skuName: { + serializedName: "x-ms-sku-name", + xmlName: "x-ms-sku-name", type: { - name: "String" + 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" } } } } }; - var ServiceGetStatisticsExceptionHeaders = { - serializedName: "Service_getStatisticsExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "ServiceGetStatisticsExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52968,12 +57573,179 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentHeaders = { - serializedName: "Service_listContainersSegmentHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentHeaders", + 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", @@ -52995,21 +57767,77 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ServiceListContainersSegmentExceptionHeaders = { - serializedName: "Service_listContainersSegmentExceptionHeaders", + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", - className: "ServiceListContainersSegmentExceptionHeaders", + className: "BlobQueryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53021,11 +57849,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { - serializedName: "Service_getUserDelegationKeyHeaders", + exports2.BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyHeaders", + className: "BlobGetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53065,11 +57893,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyExceptionHeaders = { - serializedName: "Service_getUserDelegationKeyExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "ServiceGetUserDelegationKeyExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53081,11 +57909,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoHeaders = { - serializedName: "Service_getAccountInfoHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoHeaders", + className: "BlobSetTagsHeaders", modelProperties: { clientRequestId: { serializedName: "x-ms-client-request-id", @@ -53115,41 +57943,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53160,11 +57953,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { - serializedName: "Service_getAccountInfoExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "ServiceGetAccountInfoExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53176,15 +57969,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { - serializedName: "Service_submitBatchHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchHeaders", + className: "PageBlobCreateHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + 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" } @@ -53203,9 +58017,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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" } @@ -53220,11 +58062,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { - serializedName: "Service_submitBatchExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "ServiceSubmitBatchExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53236,12 +58078,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { - serializedName: "Service_filterBlobsHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsHeaders", + 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", @@ -53270,6 +58147,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53280,11 +58178,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { - serializedName: "Service_filterBlobsExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "ServiceFilterBlobsExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53296,24 +58194,45 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { - serializedName: "Container_createHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "ContainerCreateHeaders", + className: "PageBlobClearPagesHeaders", modelProperties: { etag: { serializedName: "etag", xmlName: "etag", type: { - name: "String" + 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" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -53354,11 +58273,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateExceptionHeaders = { - serializedName: "Container_createExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "ContainerCreateExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53370,21 +58289,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { - serializedName: "Container_getPropertiesHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesHeaders", + className: "PageBlobUploadPagesFromURLHeaders", 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", @@ -53399,41 +58309,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "ByteArray" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "String" + name: "Number" } }, requestId: { @@ -53457,47 +58351,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } }, - defaultEncryptionScope: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Boolean" + name: "String" } }, errorCode: { @@ -53510,11 +58382,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { - serializedName: "Container_getPropertiesExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "ContainerGetPropertiesExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53522,16 +58394,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerDeleteHeaders = { - serializedName: "Container_deleteHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "ContainerDeleteHeaders", + 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", @@ -53570,11 +58477,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteExceptionHeaders = { - serializedName: "Container_deleteExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "ContainerDeleteExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53586,12 +58493,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { - serializedName: "Container_setMetadataHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "ContainerSetMetadataHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -53599,11 +58513,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "DateTimeRfc1123" + name: "Number" } }, clientRequestId: { @@ -53644,11 +58558,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataExceptionHeaders = { - serializedName: "Container_setMetadataExceptionHeaders", + exports2.PageBlobGetPageRangesDiffExceptionHeaders = { + serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", type: { name: "Composite", - className: "ContainerSetMetadataExceptionHeaders", + className: "PageBlobGetPageRangesDiffExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53660,20 +58574,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { - serializedName: "Container_getAccessPolicyHeaders", + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyHeaders", + className: "PageBlobResizeHeaders", 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", @@ -53688,6 +58594,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53726,11 +58639,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyExceptionHeaders = { - serializedName: "Container_getAccessPolicyExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "ContainerGetAccessPolicyExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53742,11 +58655,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { - serializedName: "Container_setAccessPolicyHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyHeaders", + className: "PageBlobUpdateSequenceNumberHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53762,6 +58675,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53800,11 +58720,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { - serializedName: "Container_setAccessPolicyExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "ContainerSetAccessPolicyExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53816,12 +58736,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { - serializedName: "Container_restoreHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "ContainerRestoreHeaders", + 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", @@ -53850,6 +58784,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53860,11 +58809,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreExceptionHeaders = { - serializedName: "Container_restoreExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "ContainerRestoreExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53876,12 +58825,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { - serializedName: "Container_renameHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "ContainerRenameHeaders", + 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", @@ -53903,6 +58873,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -53910,6 +58887,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53920,11 +58918,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameExceptionHeaders = { - serializedName: "Container_renameExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "ContainerRenameExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53936,58 +58934,40 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { - serializedName: "Container_submitBatchHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "ContainerSubmitBatchHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + etag: { + serializedName: "etag", + xmlName: "etag", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "String" + name: "DateTimeRfc1123" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ContainerSubmitBatchExceptionHeaders = { - serializedName: "Container_submitBatchExceptionHeaders", - type: { - name: "Composite", - className: "ContainerSubmitBatchExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", + }, + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } - } - } - } - }; - var ContainerFilterBlobsHeaders = { - serializedName: "Container_filterBlobsHeaders", - type: { - name: "Composite", - className: "ContainerFilterBlobsHeaders", - modelProperties: { + }, clientRequestId: { serializedName: "x-ms-client-request-id", xmlName: "x-ms-client-request-id", @@ -54015,15 +58995,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerFilterBlobsExceptionHeaders = { - serializedName: "Container_filterBlobsExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "ContainerFilterBlobsExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54035,11 +59057,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { - serializedName: "Container_acquireLeaseHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "ContainerAcquireLeaseHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54055,18 +59077,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "String" + name: "ByteArray" } }, requestId: { @@ -54089,82 +59111,57 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ContainerAcquireLeaseExceptionHeaders = { - serializedName: "Container_acquireLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerAcquireLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var ContainerReleaseLeaseHeaders = { - serializedName: "Container_releaseLeaseHeaders", - type: { - name: "Composite", - className: "ContainerReleaseLeaseHeaders", - modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", + }, + blobAppendOffset: { + serializedName: "x-ms-blob-append-offset", + xmlName: "x-ms-blob-append-offset", type: { name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + blobCommittedBlockCount: { + serializedName: "x-ms-blob-committed-block-count", + xmlName: "x-ms-blob-committed-block-count", type: { - name: "DateTimeRfc1123" + name: "Number" } }, - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - date: { - serializedName: "date", - xmlName: "date", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } } } } }; - var ContainerReleaseLeaseExceptionHeaders = { - serializedName: "Container_releaseLeaseExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "ContainerReleaseLeaseExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54172,15 +59169,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerRenewLeaseHeaders = { - serializedName: "Container_renewLeaseHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseHeaders", + className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54196,13 +59207,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54230,15 +59234,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", + type: { + name: "Boolean" + } } } } }; - var ContainerRenewLeaseExceptionHeaders = { - serializedName: "Container_renewLeaseExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "ContainerRenewLeaseExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54250,11 +59261,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { - serializedName: "Container_breakLeaseHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54270,11 +59281,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseTime: { - serializedName: "x-ms-lease-time", - xmlName: "x-ms-lease-time", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Number" + name: "ByteArray" } }, clientRequestId: { @@ -54298,21 +59309,56 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerBreakLeaseExceptionHeaders = { - serializedName: "Container_breakLeaseExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "ContainerBreakLeaseExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54324,11 +59370,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { - serializedName: "Container_changeLeaseHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "ContainerChangeLeaseHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54344,11 +59390,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -54372,73 +59418,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", type: { name: "DateTimeRfc1123" } - } - } - } - }; - var ContainerChangeLeaseExceptionHeaders = { - serializedName: "Container_changeLeaseExceptionHeaders", - type: { - name: "Composite", - className: "ContainerChangeLeaseExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } - } - }; - var 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", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - requestId: { - serializedName: "x-ms-request-id", - xmlName: "x-ms-request-id", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", - type: { - name: "DateTimeRfc1123" - } - }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -54449,11 +59463,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { - serializedName: "Container_listBlobFlatSegmentExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobFlatSegmentExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54461,21 +59475,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var ContainerListBlobHierarchySegmentHeaders = { - serializedName: "Container_listBlobHierarchySegmentHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentHeaders", + className: "BlockBlobStageBlockHeaders", modelProperties: { - contentType: { - serializedName: "content-type", - xmlName: "content-type", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "String" + name: "ByteArray" } }, clientRequestId: { @@ -54506,6 +59534,34 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54516,11 +59572,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { - serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "ContainerListBlobHierarchySegmentExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54532,12 +59588,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { - serializedName: "Container_getAccountInfoHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "ContainerGetAccountInfoHeaders", + 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", @@ -54566,50 +59636,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - skuName: { - serializedName: "x-ms-sku-name", - xmlName: "x-ms-sku-name", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "Enum", - allowedValues: [ - "Standard_LRS", - "Standard_GRS", - "Standard_RAGRS", - "Standard_ZRS", - "Premium_LRS" - ] + name: "Boolean" } }, - accountKind: { - serializedName: "x-ms-account-kind", - xmlName: "x-ms-account-kind", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", type: { - name: "Enum", - allowedValues: [ - "Storage", - "BlobStorage", - "StorageV2", - "FileStorage", - "BlockBlobStorage" - ] + name: "String" } }, - isHierarchicalNamespaceEnabled: { - serializedName: "x-ms-is-hns-enabled", - xmlName: "x-ms-is-hns-enabled", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Boolean" + name: "String" } - } - } - } - }; - var ContainerGetAccountInfoExceptionHeaders = { - serializedName: "Container_getAccountInfoExceptionHeaders", - type: { - name: "Composite", - className: "ContainerGetAccountInfoExceptionHeaders", - modelProperties: { + }, errorCode: { serializedName: "x-ms-error-code", xmlName: "x-ms-error-code", @@ -54620,72 +59667,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { - serializedName: "Blob_downloadHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobDownloadHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", 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", + copySourceErrorCode: { + serializedName: "x-ms-copy-source-error-code", + xmlName: "x-ms-copy-source-error-code", type: { name: "String" } }, - contentRange: { - serializedName: "content-range", - xmlName: "content-range", + copySourceStatusCode: { + serializedName: "x-ms-copy-source-status-code", + xmlName: "x-ms-copy-source-status-code", type: { - name: "String" + name: "Number" } - }, + } + } + } + }; + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", + type: { + name: "Composite", + className: "BlockBlobCommitBlockListHeaders", + modelProperties: { etag: { serializedName: "etag", xmlName: "etag", @@ -54693,127 +59710,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", 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", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "ByteArray" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "ByteArray" } }, clientRequestId: { @@ -54844,20 +59759,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54865,16 +59766,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { name: "Boolean" } @@ -54886,10263 +59780,7886 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + 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" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "ByteArray" + name: "String" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { name: "Number" } }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Boolean" + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "DateTimeRfc1123" } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + 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" } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", + } + } + } + }; + } +}); + +// 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: "ByteArray" + 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" } } } } }; - var 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.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" } } }; - var 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", + 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: [ - "available", - "leased", - "expired", - "breaking", - "broken" + "copy", + "deleted", + "metadata", + "snapshots", + "uncommittedblobs", + "versions", + "tags", + "immutabilitypolicy", + "legalhold", + "deletedwithversions" ] } - }, - 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" - } } } + }, + collectionFormat: "CSV" + }; + exports2.delimiter = { + parameterPath: "delimiter", + mapper: { + serializedName: "delimiter", + required: true, + xmlName: "delimiter", + type: { + name: "String" + } } }; - var 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.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var 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.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], + mapper: { + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", + type: { + name: "Boolean" } } }; - var 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.rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], + mapper: { + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", + type: { + name: "Boolean" } } }; - var 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.encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], + mapper: { + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", + type: { + name: "String" } } }; - var 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.encryptionKeySha256 = { + parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], + mapper: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", + type: { + name: "String" } } }; - var 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.encryptionAlgorithm = { + parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], + mapper: { + serializedName: "x-ms-encryption-algorithm", + xmlName: "x-ms-encryption-algorithm", + type: { + name: "String" } } }; - var 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.ifMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], + mapper: { + serializedName: "If-Match", + xmlName: "If-Match", + type: { + name: "String" } } }; - var 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.ifNoneMatch = { + parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], + mapper: { + serializedName: "If-None-Match", + xmlName: "If-None-Match", + type: { + name: "String" } } }; - var 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.ifTags = { + parameterPath: ["options", "modifiedAccessConditions", "ifTags"], + mapper: { + serializedName: "x-ms-if-tags", + xmlName: "x-ms-if-tags", + type: { + name: "String" } } }; - var 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.deleteSnapshots = { + parameterPath: ["options", "deleteSnapshots"], + mapper: { + serializedName: "x-ms-delete-snapshots", + xmlName: "x-ms-delete-snapshots", + type: { + name: "Enum", + allowedValues: ["include", "only"] } } }; - var 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.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" } } }; - var 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.comp12 = { + parameterPath: "comp", + mapper: { + defaultValue: "immutabilityPolicies", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.immutabilityPolicyExpiry = { + parameterPath: ["options", "immutabilityPolicyExpiry"], + mapper: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", + type: { + name: "DateTimeRfc1123" } } }; - var 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.immutabilityPolicyMode = { + parameterPath: ["options", "immutabilityPolicyMode"], + mapper: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", + type: { + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } } }; - var 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.comp13 = { + parameterPath: "comp", + mapper: { + defaultValue: "legalhold", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.legalHold = { + parameterPath: "legalHold", + mapper: { + serializedName: "x-ms-legal-hold", + required: true, + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var 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.encryptionScope = { + parameterPath: ["options", "encryptionScope"], + mapper: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", + type: { + name: "String" } } }; - var 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.comp14 = { + parameterPath: "comp", + mapper: { + defaultValue: "snapshot", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.rehydratePriority = { + parameterPath: ["options", "rehydratePriority"], + mapper: { + serializedName: "x-ms-rehydrate-priority", + xmlName: "x-ms-rehydrate-priority", + type: { + name: "Enum", + allowedValues: ["High", "Standard"] } } }; - var 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.sourceIfModifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfModifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-modified-since", + xmlName: "x-ms-source-if-modified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.sourceIfUnmodifiedSince = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfUnmodifiedSince" + ], + mapper: { + serializedName: "x-ms-source-if-unmodified-since", + xmlName: "x-ms-source-if-unmodified-since", + type: { + name: "DateTimeRfc1123" } } }; - var 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.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" } } }; - var 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.sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], + mapper: { + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", + type: { + name: "String" } } }; - var 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.copySource = { + parameterPath: "copySource", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.blobTagsString = { + parameterPath: ["options", "blobTagsString"], + mapper: { + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", + type: { + name: "String" } } }; - var 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.sealBlob = { + parameterPath: ["options", "sealBlob"], + mapper: { + serializedName: "x-ms-seal-blob", + xmlName: "x-ms-seal-blob", + type: { + name: "Boolean" } } }; - var 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.legalHold1 = { + parameterPath: ["options", "legalHold"], + mapper: { + serializedName: "x-ms-legal-hold", + xmlName: "x-ms-legal-hold", + type: { + name: "Boolean" } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.xMsRequiresSync = { + parameterPath: "xMsRequiresSync", + mapper: { + defaultValue: "true", + isConstant: true, + serializedName: "x-ms-requires-sync", + type: { + name: "String" } } }; - var 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.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], + mapper: { + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", + type: { + name: "ByteArray" } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], + mapper: { + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.fileRequestIntent = { + parameterPath: ["options", "fileRequestIntent"], + mapper: { + serializedName: "x-ms-file-request-intent", + xmlName: "x-ms-file-request-intent", + type: { + name: "String" } } }; - var 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.comp15 = { + parameterPath: "comp", + mapper: { + defaultValue: "copy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", + mapper: { + defaultValue: "abort", + isConstant: true, + serializedName: "x-ms-copy-action", + type: { + name: "String" } } }; - var 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.copyId = { + parameterPath: "copyId", + mapper: { + serializedName: "copyid", + required: true, + xmlName: "copyid", + type: { + name: "String" } } }; - var 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.comp16 = { + parameterPath: "comp", + mapper: { + defaultValue: "tier", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" + ] } } }; - var 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.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", + mapper: { + defaultValue: "query", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.comp18 = { + parameterPath: "comp", + mapper: { + defaultValue: "tags", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.blobSequenceNumber = { + parameterPath: ["options", "blobSequenceNumber"], + mapper: { + defaultValue: 0, + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", + type: { + name: "Number" } } }; - var 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.contentType1 = { + parameterPath: ["options", "contentType"], + mapper: { + defaultValue: "application/octet-stream", + isConstant: true, + serializedName: "Content-Type", + type: { + name: "String" } } }; - var 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.body1 = { + parameterPath: "body", + mapper: { + serializedName: "body", + required: true, + xmlName: "body", + type: { + name: "Stream" } } }; - var 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.accept2 = { + parameterPath: "accept", + mapper: { + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", + type: { + name: "String" } } }; - var 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.comp19 = { + parameterPath: "comp", + mapper: { + defaultValue: "page", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.pageWrite = { + parameterPath: "pageWrite", + mapper: { + defaultValue: "update", + isConstant: true, + serializedName: "x-ms-page-write", + type: { + name: "String" } } }; - var 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.ifSequenceNumberLessThanOrEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", + type: { + name: "Number" } } }; - var 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.ifSequenceNumberLessThan = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThan" + ], + mapper: { + serializedName: "x-ms-if-sequence-number-lt", + xmlName: "x-ms-if-sequence-number-lt", + type: { + name: "Number" } } }; - var 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.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" } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", - type: { - name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.sourceUrl = { + parameterPath: "sourceUrl", + mapper: { + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", + type: { + name: "String" } } }; - var 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.sourceRange = { + parameterPath: "sourceRange", + mapper: { + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", + type: { + name: "String" } } }; - var 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.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], + mapper: { + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", + type: { + name: "ByteArray" } } }; - var 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.range1 = { + parameterPath: "range", + mapper: { + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.comp20 = { + parameterPath: "comp", + mapper: { + defaultValue: "pagelist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], + mapper: { + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", + type: { + name: "String" } } }; - var 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.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], + mapper: { + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", + type: { + name: "String" } } }; - var 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.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"] } } }; - var 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.comp21 = { + parameterPath: "comp", + mapper: { + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blobType1 = { + parameterPath: "blobType", + mapper: { + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", + type: { + name: "String" } } }; - var 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.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" } } }; - var 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.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], + mapper: { + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", + type: { + name: "Boolean" } } }; - var 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.comp24 = { + parameterPath: "comp", + mapper: { + defaultValue: "block", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.blockId = { + parameterPath: "blockId", + mapper: { + serializedName: "blockid", + required: true, + xmlName: "blockid", + type: { + name: "String" } } }; - var 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.blocks = { + parameterPath: "blocks", + mapper: mappers_js_1.BlockLookupList + }; + exports2.comp25 = { + parameterPath: "comp", + mapper: { + defaultValue: "blocklist", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.listType = { + parameterPath: "listType", + mapper: { + defaultValue: "committed", + serializedName: "blocklisttype", + required: true, + xmlName: "blocklisttype", + type: { + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + } +}); + +// 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_commonjs10()); + 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); } }; - var 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.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 AppendBlobSealExceptionHeaders = { - serializedName: "AppendBlob_sealExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobSealExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } - } + 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 BlockBlobUploadExceptionHeaders = { - serializedName: "BlockBlob_uploadExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobUploadExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } - } + 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 BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 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" - } + var submitBatchOperationSpec = { + path: "/", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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_commonjs10()); + 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); } - }; - var BlockBlobStageBlockExceptionHeaders = { - serializedName: "BlockBlob_stageBlockExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * [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); } - }; - var 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" - } - } - } + /** + * [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); } - }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * [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); } - }; - var 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" - } - } - } + /** + * [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); } - }; - var BlockBlobCommitBlockListExceptionHeaders = { - serializedName: "BlockBlob_commitBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobCommitBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var 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.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 BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + 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 Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + 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 blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties + 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 accept = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 url = { - parameterPath: "url", - mapper: { - serializedName: "url", - required: true, - xmlName: "url", - type: { - name: "String" + var setAccessPolicyOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerSetAccessPolicyHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerSetAccessPolicyExceptionHeaders } }, - skipEncoding: true + 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 restype = { - parameterPath: "restype", - mapper: { - defaultValue: "service", - isConstant: true, - serializedName: "restype", - type: { - name: "String" + 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 comp = { - parameterPath: "comp", - mapper: { - defaultValue: "properties", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], - mapper: { - constraints: { - InclusiveMinimum: 0 + var submitBatchOperationSpec = { + path: "/{containerName}", + httpMethod: "POST", + responses: { + 202: { + bodyMapper: { + type: { name: "Stream" }, + serializedName: "parsedResponse" + }, + headersMapper: Mappers.ContainerSubmitBatchHeaders }, - serializedName: "timeout", - xmlName: "timeout", - type: { - name: "Number" + 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 version = { - parameterPath: "version", - mapper: { - defaultValue: "2024-11-04", - isConstant: true, - serializedName: "x-ms-version", - type: { - name: "String" + 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 requestId = { - parameterPath: ["options", "requestId"], - mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", - type: { - name: "String" + 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 accept1 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + 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 comp1 = { - parameterPath: "comp", - mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 comp2 = { - parameterPath: "comp", - mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prefix = { - parameterPath: ["options", "prefix"], - mapper: { - serializedName: "prefix", - xmlName: "prefix", - type: { - name: "String" + 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 marker = { - parameterPath: ["options", "marker"], - mapper: { - serializedName: "marker", - xmlName: "marker", - type: { - name: "String" + 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 maxPageSize = { - parameterPath: ["options", "maxPageSize"], - mapper: { - constraints: { - InclusiveMinimum: 1 + var listBlobHierarchySegmentOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.ListBlobsHierarchySegmentResponse, + headersMapper: Mappers.ContainerListBlobHierarchySegmentHeaders }, - serializedName: "maxresults", - xmlName: "maxresults", - type: { - name: "Number" + 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 include = { - parameterPath: ["options", "include"], - mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", - type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + var getAccountInfoOperationSpec = { + path: "/{containerName}", + httpMethod: "GET", + responses: { + 200: { + headersMapper: Mappers.ContainerGetAccountInfoHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerGetAccountInfoExceptionHeaders } }, - collectionFormat: "CSV" - }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + queryParameters: [ + Parameters.comp, + Parameters.timeoutInSeconds, + Parameters.restype1 + ], + urlParameters: [Parameters.url], + headerParameters: [ + Parameters.version, + Parameters.requestId, + Parameters.accept1 + ], + isXML: true, + serializer: xmlSerializer }; - var comp3 = { - parameterPath: "comp", - mapper: { - defaultValue: "userdelegationkey", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + } +}); + +// 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_commonjs10()); + 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; } - }; - var restype1 = { - parameterPath: "restype", - mapper: { - defaultValue: "account", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var body = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } + /** + * 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); } - }; - var comp4 = { - parameterPath: "comp", - mapper: { - defaultValue: "batch", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var contentLength = { - parameterPath: "contentLength", - mapper: { - serializedName: "Content-Length", - required: true, - xmlName: "Content-Length", - type: { - name: "Number" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var multipartContentType = { - parameterPath: "multipartContentType", - mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", - type: { - name: "String" - } + /** + * 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); } - }; - var comp5 = { - parameterPath: "comp", - mapper: { - defaultValue: "blobs", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var where = { - parameterPath: ["options", "where"], - mapper: { - serializedName: "where", - xmlName: "where", - type: { - name: "String" - } + /** + * 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); } - }; - var restype2 = { - parameterPath: "restype", - mapper: { - defaultValue: "container", - isConstant: true, - serializedName: "restype", - type: { - name: "String" - } + /** + * 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); } - }; - var metadata = { - parameterPath: ["options", "metadata"], - mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", - type: { - name: "Dictionary", - value: { type: { name: "String" } } - } + /** + * 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); } - }; - var access = { - parameterPath: ["options", "access"], - mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", - type: { - name: "Enum", - allowedValues: ["container", "blob"] - } + /** + * 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); } - }; - var defaultEncryptionScope = { - parameterPath: [ - "options", - "containerEncryptionScope", - "defaultEncryptionScope" - ], - mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", - type: { - name: "String" - } + /** + * [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); } - }; - var preventEncryptionScopeOverride = { - parameterPath: [ - "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" - ], - mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", - type: { - name: "Boolean" - } + /** + * [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); } - }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], - mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", - type: { - name: "String" - } + /** + * [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); } - }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], - mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], - mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", - type: { - name: "DateTimeRfc1123" - } + /** + * [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); } - }; - var comp6 = { - parameterPath: "comp", - mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var comp7 = { - parameterPath: "comp", - mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], - mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } - }; - var comp8 = { - parameterPath: "comp", - mapper: { - defaultValue: "undelete", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], - mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", - type: { - name: "String" - } + /** + * 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); } - }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], - mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", - type: { - name: "String" - } + /** + * 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); } }; - var comp9 = { - parameterPath: "comp", - mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 sourceContainerName = { - parameterPath: "sourceContainerName", - mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", - type: { - name: "String" + 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 sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], - mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", - type: { - name: "String" + 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 comp10 = { - parameterPath: "comp", - mapper: { - defaultValue: "lease", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 action = { - parameterPath: "action", - mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 duration = { - parameterPath: ["options", "duration"], - mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", - type: { - name: "Number" + 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 proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], - mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 action1 = { - parameterPath: "action", - mapper: { - defaultValue: "release", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 leaseId1 = { - parameterPath: "leaseId", - mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", - type: { - name: "String" + 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 action2 = { - parameterPath: "action", - mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 action3 = { - parameterPath: "action", - mapper: { - defaultValue: "break", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 breakPeriod = { - parameterPath: ["options", "breakPeriod"], - mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", - type: { - name: "Number" + 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 action4 = { - parameterPath: "action", - mapper: { - defaultValue: "change", - isConstant: true, - serializedName: "x-ms-lease-action", - type: { - name: "String" + 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 proposedLeaseId1 = { - parameterPath: "proposedLeaseId", - mapper: { - serializedName: "x-ms-proposed-lease-id", - required: true, - xmlName: "x-ms-proposed-lease-id", - type: { - name: "String" + 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 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" - ] - } - } + var breakLeaseOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.BlobBreakLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobBreakLeaseExceptionHeaders } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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 rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" + 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 rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" + 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 encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" + 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 encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" + 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 encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" + 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 }; - var ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" - } + } +}); + +// 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_commonjs10()); + 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; } - }; - var ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" - } + /** + * 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); } - }; - var ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } + /** + * 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); } - }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + /** + * 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, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * 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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * 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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * 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); } - }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" - } + /** + * 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); } }; - var blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" + 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 blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" + 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 blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" + 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 blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" + 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 comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" + 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 immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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 comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 }; - var encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" - } + } +}); + +// 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_commonjs10()); + 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); } - }; - var comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var 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" - ] - } + /** + * 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); } }; - var rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + 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 } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" - ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" + 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 sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" + var appendBlockFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 201: { + headersMapper: Mappers.AppendBlobAppendBlockFromUrlHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.AppendBlobAppendBlockFromUrlExceptionHeaders } - } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" + }, + 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 ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" + 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 }; - var copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" - } + } +}); + +// 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_commonjs10()); + 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; } - }; - var blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" - } + /** + * 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); } - }; - var sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } + /** + * 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); } }; - var 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.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 comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" + 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 copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" + 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 comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } - } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest + }, + 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 }; - var comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + } +}); + +// 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_commonjs11()); + 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(url, options) { + if (url === void 0) { + throw new Error("'url' cannot be null"); } - } - }; - var comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (!options) { + options = {}; } + const defaults = { + 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 = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + endpoint: options.endpoint ?? options.baseUri ?? "{url}" + }; + super(optionsWithDefaults); + this.url = url; + 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; }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags - }; - var transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" + 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); } }; - var transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } + 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(url, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + const storageClientContext = this.storageClientContext; + storageClientContext.requestContentType = void 0; } }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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_commonjs7(); + var constants_js_1 = require_constants9(); + 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; } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" + /** + * 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; } - } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" + if (permissionLike.add) { + blobSASPermissions.add = true; } - } - }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" + if (permissionLike.create) { + blobSASPermissions.create = true; } - } - }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" + if (permissionLike.write) { + blobSASPermissions.write = true; } - } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" + if (permissionLike.delete) { + blobSASPermissions.delete = true; } - } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.deleteVersion) { + blobSASPermissions.deleteVersion = true; } - } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.tag) { + blobSASPermissions.tag = true; } - } - }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + if (permissionLike.move) { + blobSASPermissions.move = true; } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" + if (permissionLike.execute) { + blobSASPermissions.execute = true; } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" + if (permissionLike.setImmutabilityPolicy) { + blobSASPermissions.setImmutabilityPolicy = true; } - } - }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + if (permissionLike.permanentDelete) { + blobSASPermissions.permanentDelete = true; } + return blobSASPermissions; } - }; - var sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + /** + * 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"); } - } - }; - var sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + if (this.add) { + permissions.push("a"); } - } - }; - var sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + if (this.create) { + permissions.push("c"); } - } - }; - var range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + if (this.write) { + permissions.push("w"); } - } - }; - var comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.delete) { + permissions.push("d"); } - } - }; - var prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + if (this.deleteVersion) { + permissions.push("x"); } - } - }; - var prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + if (this.tag) { + permissions.push("t"); } - } - }; - var 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"] + if (this.move) { + permissions.push("m"); } - } - }; - var comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.execute) { + permissions.push("e"); } - } - }; - var blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - } - }; - var comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (this.permanentDelete) { + permissions.push("y"); } + return permissions.join(""); } }; - var maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + 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; } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" - ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + /** + * 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; } - } - }; - var sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + if (permissionLike.add) { + containerSASPermissions.add = true; } - } - }; - var comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.create) { + containerSASPermissions.create = true; } - } - }; - var blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + if (permissionLike.write) { + containerSASPermissions.write = true; } - } - }; - var copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + if (permissionLike.delete) { + containerSASPermissions.delete = true; } - } - }; - var comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.list) { + containerSASPermissions.list = true; } - } - }; - var blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + if (permissionLike.deleteVersion) { + containerSASPermissions.deleteVersion = true; } - } - }; - var blocks = { - parameterPath: "blocks", - mapper: BlockLookupList - }; - var comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + if (permissionLike.tag) { + containerSASPermissions.tag = true; } - } - }; - var listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + 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; } - }; - var ServiceImpl = class { /** - * Initialize a new instance of the class Service class. - * @param client Reference to the service client + * Specifies Read access granted. */ - constructor(client) { - this.client = client; - } + read = false; /** - * 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. + * Specifies Add access granted. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); - } + add = false; /** - * 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. + * Specifies Create access granted. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); - } + create = false; /** - * 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. + * Specifies Write access granted. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); - } + write = false; /** - * The List Containers Segment operation returns a list of the containers under the specified account - * @param options The options parameters. + * Specifies Delete access granted. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); - } + delete = false; /** - * 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. + * Specifies Delete version access granted. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); - } + deleteVersion = false; /** - * Returns the sku name and account kind - * @param options The options parameters. + * Specifies List access granted. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); - } + list = false; /** - * 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. + * Specfies Tag access granted. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); - } + tag = false; /** - * 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. + * Specifies Move access granted. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); - } - }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var setPropertiesOperationSpec = { - path: "/", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + 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"); } - }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + if (this.add) { + permissions.push("a"); } - }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var listContainersSegmentOperationSpec = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - requestBody: keyInfo, - queryParameters: [ - restype, - timeoutInSeconds, - comp3 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ServiceGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 - }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 - }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$5 + 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(""); + } }; - var ContainerImpl = class { + 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 { /** - * Initialize a new instance of the class Container class. - * @param client Reference to the service client + * Azure Storage account name; readonly. */ - constructor(client) { - this.client = client; - } + accountName; /** - * 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. + * Azure Storage user delegation key; readonly. */ - create(options) { - return this.client.sendOperationRequest({ options }, createOperationSpec$2); - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$1); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec$1); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * operation sets one or more user-defined name-value pairs for the specified container. - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec$1); + 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 { /** - * gets the permissions for the specified container. The permissions indicate whether container data - * may be accessed publicly. - * @param options The options parameters. + * The storage API version. */ - getAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, getAccessPolicyOperationSpec); - } + version; /** - * sets the permissions for the specified container. The permissions indicate whether blobs in a - * container may be accessed publicly. - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setAccessPolicy(options) { - return this.client.sendOperationRequest({ options }, setAccessPolicyOperationSpec); - } + protocol; /** - * Restores a previously-deleted container. - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - restore(options) { - return this.client.sendOperationRequest({ options }, restoreOperationSpec); + 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; + } + } } /** - * Renames an existing container. - * @param sourceContainerName Required. Specifies the name of the container to rename. - * @param options The options parameters. + * Encodes all SAS query parameters into a string that can be appended to a URL. + * */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); + 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("&"); } /** - * 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. + * A private helper method used to filter and append query key/value pairs into an array. + * + * @param queries - + * @param key - + * @param value - */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); + tryAppendQueryParameter(queries, key, value) { + if (!value) { + return; + } + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); + } } - /** - * 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); + }; + 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_constants9(); + 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); } - /** - * [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$1); + if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { + throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); + 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); + } + } } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); + 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); + } + } } - /** - * [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$1); + 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."); + } } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); + 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."); } - /** - * [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); + let resource = "c"; + if (blobSASSignatureValues.blobName) { + resource = "b"; } - /** - * [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(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); + 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(); + } } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); + 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."); } - }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: ContainerDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp6 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince - ], - isXML: true, - serializer: xmlSerializer$4 - }; - 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: ContainerGetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders - } - }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerRestoreHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp8 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + } + 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(); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var BlobImpl = class { - /** - * 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); + 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, + timestamp2, + 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."); } - /** - * 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); + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; + } } - /** - * 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); + 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(); + } } - /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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, + timestamp2, + 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}`); } - /** - * 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(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); + 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'."); } - /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. - */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { + throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - /** - * 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); + if (blobSASSignatureValues.versionId && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } - /** - * 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); + if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { + throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - /** - * 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(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version < "2020-08-04") { + throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - /** - * 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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - /** - * [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); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version < "2019-10-10") { + throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version < "2019-12-12") { + throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - /** - * [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(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + 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."); } - /** - * [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(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + if (version < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - /** - * [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); + 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_commonjs6(); + var constants_js_1 = require_constants9(); + var tracing_js_1 = require_tracing(); + var utils_common_js_1 = require_utils_common(); + var BlobLeaseClient = class { + _leaseId; + _url; + _containerOrBlobOperation; + _isContainer; /** - * The Create Snapshot operation creates a read-only snapshot of a blob - * @param options The options parameters. + * Gets the lease Id. + * + * @readonly */ - createSnapshot(options) { - return this.client.sendOperationRequest({ options }, createSnapshotOperationSpec); + get leaseId() { + return this._leaseId; } /** - * 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. + * Gets the url. + * + * @readonly */ - startCopyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + get url() { + return this._url; } /** - * 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. + * Creates an instance of BlobLeaseClient. + * @param client - The client to make the lease operation requests. + * @param leaseId - Initial proposed lease id. */ - copyFromURL(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + 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; } /** - * 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. + * 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. */ - abortCopyFromURL(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + 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 + })); + }); } /** - * 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. + * 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. */ - setTier(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + 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; + }); } /** - * Returns the sku name and account kind - * @param options The options parameters. + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + 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 + })); + }); } /** - * The Query operation enables users to select/project on blob data by providing simple query - * expressions. - * @param options The options parameters. + * 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. */ - query(options) { - return this.client.sendOperationRequest({ options }, queryOperationSpec); + 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 + }); + }); } /** - * The Get Tags operation enables users to get the tags associated with a blob. - * @param options The options parameters. + * 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. */ - getTags(options) { - return this.client.sendOperationRequest({ options }, getTagsOperationSpec); + 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_commonjs13(); + 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; /** - * The Set Tags operation enables users to set tags on a blob. - * @param options The options parameters. + * 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 - */ - setTags(options) { - return this.client.sendOperationRequest({ options }, setTagsOperationSpec); + 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(); } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + _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; } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + if (!this.push(data)) { + this.source.pause(); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + }; + 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; } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 + 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); + } }; - var PageBlobImpl = class { + 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_commonjs6(); + var RetriableReadableStream_js_1 = require_RetriableReadableStream(); + var BlobDownloadResponse = class { /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - constructor(client) { - this.client = client; + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * 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. + * Returns if it was previously specified + * for the file. + * + * @readonly */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + get cacheControl() { + return this.originalResponse.cacheControl; } /** - * 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. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * 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. + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } /** - * 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. + * 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 */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * 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. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - constructor(client) { - this.client = client; + get contentType() { + return this.originalResponse.contentType; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * 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 */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get copyId() { + return this.originalResponse.copyId; } /** - * 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. + * 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 */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyProgress() { + return this.originalResponse.copyProgress; } /** - * 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. + * 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 */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + get copySource() { + return this.originalResponse.copySource; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - constructor(client) { - this.client = client; + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get leaseDuration() { + return this.originalResponse.leaseDuration; } /** - * 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. + * 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 */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get isServerEncrypted() { + return this.originalResponse.isServerEncrypted; } /** - * 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. + * 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 */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get blobContentMD5() { + return this.originalResponse.blobContentMD5; } /** - * 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. + * 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 */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get lastModified() { + return this.originalResponse.lastModified; } /** - * 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. + * 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 */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get lastAccessed() { + return this.originalResponse.lastAccessed; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * Returns the date and time the blob was created. + * + * @readonly */ - constructor(url2, options) { - var _a, _b; - if (url2 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url2; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); - } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + get createdOn() { + return this.originalResponse.createdOn; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * A name-value pair + * to associate with a file storage object. + * + * @readonly */ - constructor(url2, pipeline) { - this.url = escapeURLPath(url2); - this.accountName = getAccountNameFromUrl(url2); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; - } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + get metadata() { + return this.originalResponse.metadata; } /** - * 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. + * This header uniquely identifies the request + * that was made and can be used for troubleshooting the request. * - * @param permissions - + * @readonly */ - 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; + get requestId() { + return this.originalResponse.requestId; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. * - * @param permissionLike - + * @readonly */ - 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; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * Indicates the version of the Blob service used + * to execute the request. * - * @returns A string which represents the BlobSASPermissions + * @readonly */ - 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(""); - } - }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + get version() { + return this.originalResponse.version; } /** - * 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. + * Indicates the versionId of the downloaded blob version. * - * @param permissions - + * @readonly */ - 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; + get versionId() { + return this.originalResponse.versionId; } /** - * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Indicates whether version of this blob is a current version. * - * @param permissionLike - + * @readonly */ - 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; + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * 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 */ - 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(""); + 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; } - }; - var UserDelegationKeyCredential = class { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * Object Replication Policy Id of the destination blob. + * + * @readonly */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * If this blob has been sealed. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + get isSealed() { + return this.originalResponse.isSealed; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * Indicates immutability policy mode. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } - } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version2 >= "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.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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."); + /** + * Indicates if a legal hold is present on the blob. + * + * @readonly + */ + get legalHold() { + return this.originalResponse.legalHold; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get contentAsBlob() { + return this.originalResponse.blobBody; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + 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); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + }; + 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(stream, length, options = {}) { + const bytes = await stream.read(length, { abortSignal: options.abortSignal }); + if (bytes.length !== length) { + throw new Error("Hit stream end."); } + return bytes; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * Reads a single byte from the stream. + * + * @param stream - + * @param options - + */ + static async readByte(stream, options = {}) { + const buf = await _AvroParser.readFixedBytes(stream, 1, options); + return buf[0]; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + // 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(stream, options = {}) { + let zigZagEncoded = 0; + let significanceInBit = 0; + let byte, haveMoreByte, significanceInFloat; + do { + byte = await _AvroParser.readByte(stream, 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(stream, 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); } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + static async readLong(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readInt(stream, options = {}) { + return _AvroParser.readZigZagLong(stream, options); + } + static async readNull() { + return null; + } + static async readBoolean(stream, options = {}) { + const b = await _AvroParser.readByte(stream, options); + if (b === 1) { + return true; + } else if (b === 0) { + return false; } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + throw new Error("Byte was not a boolean."); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + static async readFloat(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 4, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat32(0, true); } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; + static async readDouble(stream, options = {}) { + const u8arr = await _AvroParser.readFixedBytes(stream, 8, options); + const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); + return view.getFloat64(0, true); + } + static async readBytes(stream, options = {}) { + const size = await _AvroParser.readLong(stream, options); + if (size < 0) { + throw new Error("Bytes size was negative."); } + return stream.read(size, { abortSignal: options.abortSignal }); } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + static async readString(stream, options = {}) { + const u8arr = await _AvroParser.readBytes(stream, options); + const utf8decoder = new TextDecoder(); + return utf8decoder.decode(u8arr); + } + static async readMapPair(stream, readItemMethod, options = {}) { + const key = await _AvroParser.readString(stream, options); + const value = await readItemMethod(stream, options); + return { key, value }; + } + static async readMap(stream, readItemMethod, options = {}) { + const readPairMethod = (s, opts = {}) => { + return _AvroParser.readMapPair(s, readItemMethod, opts); + }; + const pairs2 = await _AvroParser.readArray(stream, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; + } + return dict; + } + static async readArray(stream, readItemMethod, options = {}) { + const items = []; + for (let count = await _AvroParser.readLong(stream, options); count !== 0; count = await _AvroParser.readLong(stream, options)) { + if (count < 0) { + await _AvroParser.readLong(stream, options); + count = -count; + } + while (count--) { + const item = await readItemMethod(stream, 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); + return _AvroType.fromObjectSchema(schema2); } } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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}`); + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); + } } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { + } + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + } } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + }; + exports2.AvroType = AvroType; + var AvroPrimitiveType = class extends AvroType { + _primitive; + constructor(primitive) { + super(); + this._primitive = primitive; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + switch (this._primitive) { + case AvroPrimitive.NULL: + return AvroParser.readNull(); + case AvroPrimitive.BOOLEAN: + return AvroParser.readBoolean(stream, options); + case AvroPrimitive.INT: + return AvroParser.readInt(stream, options); + case AvroPrimitive.LONG: + return AvroParser.readLong(stream, options); + case AvroPrimitive.FLOAT: + return AvroParser.readFloat(stream, options); + case AvroPrimitive.DOUBLE: + return AvroParser.readDouble(stream, options); + case AvroPrimitive.BYTES: + return AvroParser.readBytes(stream, options); + case AvroPrimitive.STRING: + return AvroParser.readString(stream, options); + default: + throw new Error("Unknown Avro Primitive"); + } } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + }; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, options = {}) { + const value = await AvroParser.readInt(stream, options); + return this._symbols[value]; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + }; + var AvroUnionType = class extends AvroType { + _types; + constructor(types) { + super(); + this._types = types; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + async read(stream, options = {}) { + const typeIndex = await AvroParser.readInt(stream, options); + return this._types[typeIndex].read(stream, options); } - if (version2 < "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."); + }; + var AvroMapType = class extends AvroType { + _itemType; + constructor(itemType) { + super(); + this._itemType = itemType; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + read(stream, options = {}) { + const readItemMethod = (s, opts) => { + return this._itemType.read(s, opts); + }; + return AvroParser.readMap(stream, readItemMethod, options); } - if (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + }; + var AvroRecordType = class extends AvroType { + _name; + _fields; + constructor(fields, name) { + super(); + this._fields = fields; + this._name = name; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types + async read(stream, 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(stream, options); + } + } + return record; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; + }; + } +}); + +// 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; } - var BlobLeaseClient = class { - /** - * Gets the lease Id. - * - * @readonly - */ - get leaseId() { - return this._leaseId; + } +}); + +// 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; } - /** - * Gets the url. - * - * @readonly - */ - get url() { - return this._url; + _objectIndex; + get objectIndex() { + return this._objectIndex; } - /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. - */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + _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; } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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."); } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + this._metadata = await AvroParser_js_1.AvroParser.readMap(this._headerStream, AvroParser_js_1.AvroParser.readString, { + abortSignal: options.abortSignal }); - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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"); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal }); - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); + 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--; + } + } } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions + 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; + } } - /** - * To end the lease but ensure that another client cannot acquire a new lease - * until the current lease period has expired. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + }; + 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_commonjs13(); + 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((resolve2, 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(); + resolve2(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); + } + }); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } }; - var RetriableReadableStream = class extends stream.Readable { + 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 RetriableReadableStream. + * Creates an instance of BlobQuickQueryStream. * * @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.retries = 0; - this.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(); - } - }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); - }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } - }; - this.getter = getter; + constructor(source, options = {}) { + super(); 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(); + 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() { - 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); + if (this.avroPaused) { + this.readInternal().catch((err) => { + this.emit("error", err); + }); + } } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var BlobDownloadResponse = class { + 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_commonjs6(); + var BlobQuickQueryStream_js_1 = require_BlobQuickQueryStream(); + var BlobQueryResponse = class { /** * Indicates that the service supports * requests for partial file content. @@ -65258,7 +67775,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @readonly */ get copyCompletedOn() { - return this.originalResponse.copyCompletedOn; + return void 0; } /** * String identifier for the last attempted Copy @@ -65365,14 +67882,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; get etag() { return this.originalResponse.etag; } - /** - * The number of tags associated with the blob - * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } /** * The error code. * @@ -65415,23 +67924,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. @@ -65460,7 +67952,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.originalResponse.clientRequestId; } /** - * Indicates the version of the Blob service used + * Indicates the version of the File service used * to execute the request. * * @readonly @@ -65468,1140 +67960,1333 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 coreUtil.isNode ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - /** - * 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(this.originalResponse.readableStreamBody, getter, offset, count, options); - } - }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - 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 pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - 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; - } - }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); - } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); - } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; - try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { - } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); - } - } - }; - var AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; + /** + * 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; } - // 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"); - } + /** + * 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; } - }; - var AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; + /** + * The response body as a browser Blob. + * Always undefined in node.js. + * + * @readonly + */ + get blobBody() { + return void 0; } - // 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]; + /** + * 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; } - }; - var AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; + /** + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; } - async read(stream2, options = {}) { - const typeIndex = await AvroParser.readInt(stream2, options); - return this._types[typeIndex].read(stream2, options); + 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); } }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + 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_constants9(); + 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; } - // 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); + return tier; + } + function ensureCpkIfSpecified(cpk, isHttps) { + if (cpk && !isHttps) { + throw new RangeError("Customer-provided encryption key must be used over HTTPS."); } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; + if (cpk && !cpk.encryptionAlgorithm) { + cpk.encryptionAlgorithm = constants_js_1.EncryptionAlgorithmAES25; } - // 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); + } + 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 } } - return record; + }; + } + } +}); + +// 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_commonjs4(); + exports2.logger = (0, logger_1.createClientLogger)("core-lro"); + } +}); + +// node_modules/@azure/core-lro/dist/commonjs/poller/constants.js +var require_constants11 = __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_constants11(); + function deserializeState(serializedState) { + try { + return JSON.parse(serializedState).state; + } catch (e) { + throw new Error(`Unable to deserialize input state: ${serializedState}`); } - }; - 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; + } + 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 true; + return message + " " + innerMessage; } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; + 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); } - get objectIndex() { - return this._objectIndex; + 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; + } } - 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; + 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 + })); } - async initialize(options = {}) { - const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal - }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal - }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); + } + function buildResult(inputs) { + const { processResult, response, state } = inputs; + return processResult ? processResult(response, state) : response; + } + async function initOperation(inputs) { + const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 + }; } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal + } + 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 }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + processOperationStatus({ + status, + response, + state, + stateProxy, + isDone, + processResult, + getError, + setErrorAsResult }); - await 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--; - } + 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); } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; + } + case "DELETE": { + return void 0; + } + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); + } } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); - } - } - yield yield tslib.__await(result); + case "original-uri": { + return requestPath; } - }); + case "location": + default: { + return location; + } + } } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); + } + 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; } - return data; } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - get position() { - return this._position; + } + 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; } - async read(size, options = {}) { + 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 _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - throw ABORT_ERROR; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); } - if (size < 0) { - throw new Error(`size parameter should be positive: ${size}`); + case "Body": + default: { + return void 0; } - if (size === 0) { - return new Uint8Array(); + } + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getStatus(rawResponse); } - if (!this._readable.readable) { - throw new Error("Stream no longer readable."); + case "ResourceLocation": { + return toOperationStatus(rawResponse.statusCode); } - const chunk = this._readable.read(size); - if (chunk) { - this._position += chunk.length; - return this.toUint8Array(chunk); - } else { - return new Promise((resolve2, 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(); - resolve2(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); - } - }); + case "Body": { + return getProvisioningState(rawResponse); } + default: + throw new Error(`Internal error: Unexpected operation mode: ${mode}`); } - }; - var BlobQuickQueryStream = class extends stream.Readable { + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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_constants11(); + var core_util_1 = require_commonjs6(); + var createStateProxy = () => ({ /** - * Creates an instance of BlobQuickQueryStream. - * - * @param source - The current ReadableStream returned from getter - * @param options - + * 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. */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new 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 schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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; + 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, 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, + 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 }); } } - 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 }); - } + } 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`); } - 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 }); + } + })().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; } - 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 - }); + } + 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; } - break; - default: - throw Error(`Unknown schema ${schema2} in avro progress record.`); + } } - } while (!avroNext.done && !this.avroPaused); + }; + 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; } - }; - var BlobQueryResponse = class { - /** - * Indicates that the service supports - * requests for partial file content. - * - * @readonly - */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * Returns if it was previously specified - * for the file. - * - * @readonly - */ - get cacheControl() { - return this.originalResponse.cacheControl; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * 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; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly + * Serializes the Poller operation. */ - get contentEncoding() { - return this.originalResponse.contentEncoding; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + }; + 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); } - /** - * 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; + }; + 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 { /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; - } - /** - * The number of bytes present in the - * response body. + * 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); * - * @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. + * // You can assign more local properties here. + * } + * } + * ``` * - * @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. + * 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. * - * @readonly - */ - get contentRange() { - return this.originalResponse.contentRange; - } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * 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: * - * @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. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get copyCompletedOn() { - return void 0; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve2, reject) => { + this.resolve = resolve2; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get copyId() { - return this.originalResponse.copyId; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * 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. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get copySource() { - return this.originalResponse.copySource; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @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. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly + * Invokes the underlying operation's cancel method. */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * 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. * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; - } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + 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; } - /** - * 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; + 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()); + } } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get etag() { - return this.originalResponse.etag; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * The error code. - * - * @readonly + * Returns true if the poller has finished polling. */ - get errorCode() { - return this.originalResponse.errorCode; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * 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 + * Stops the poller from continuing to poll. */ - get isServerEncrypted() { - return this.originalResponse.isServerEncrypted; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * 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 + * Returns true if the poller is stopped. */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; + isStopped() { + return this.stopped; } /** - * Returns the date and time the file was last - * modified. Any operation that modifies the file or its properties updates - * the last modified time. + * Attempts to cancel the underlying operation. * - * @readonly - */ - get lastModified() { - return this.originalResponse.lastModified; - } - /** - * A name-value pair - * to associate with a file storage object. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * If it's called again before it finishes, it will throw an error. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get requestId() { - return this.originalResponse.requestId; + 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; } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * Returns the state of the operation. * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the File service used - * to execute the request. + * 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. * - * @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. + * Example: * - * @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. + * ```ts + * // Let's say we have our poller's operation state defined as: + * interface MyOperationState extends PollOperationState { + * privateProperty?: string; + * publicProperty?: string; + * } * - * @readonly - */ - get blobBody() { - return void 0; - } - /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * // 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; + * } * - * It will parse avor data returned by blob query. + * // Then, we define our Poller as follows: + * export class MyPoller extends Poller { + * // ... More content is needed here ... * - * @readonly + * 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. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobQueryResponse. - * - * @param originalResponse - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; + toString() { + return this.operation.toString(); } - return tier2; - } - function ensureCpkIfSpecified(cpk, isHttps) { - if (cpk && !isHttps) { - throw new RangeError("Customer-provided encryption key must be used over HTTPS."); + }; + 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_constants11(); + 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); } - if (cpk && !cpk.encryptionAlgorithm) { - cpk.encryptionAlgorithm = EncryptionAlgorithmAES25; + /** + * The method used by the poller to wait before attempting to update its operation. + */ + delay() { + return new Promise((resolve2) => setTimeout(() => resolve2(), this.config.intervalInMs)); } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { + }; + 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_commonjs16 = __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_commonjs6(); + var core_lro_1 = require_commonjs16(); + var BlobBeginCopyFromUrlPoller = class extends core_lro_1.Poller { + intervalInMs; constructor(options) { - const { blobClient, copySource: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; + const { blobClient, copySource, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; let state; if (resumeFrom) { state = JSON.parse(resumeFrom).state; } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, blobClient, - copySource: copySource2, + copySource, startCopyFromURLOptions - })); + }); super(operation); if (typeof onProgress === "function") { this.onProgress(onProgress); @@ -66609,20 +69294,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.intervalInMs = intervalInMs; } delay() { - return coreUtil.delay(this.intervalInMs); + return (0, core_util_1.delay)(this.intervalInMs); } }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; var cancel = async function cancel2(options = {}) { const state = this.state; - const { copyId: copyId2 } = state; + const { copyId } = state; if (state.isCompleted) { return makeBlobBeginCopyFromURLPollOperation(state); } - if (!copyId2) { + if (!copyId) { state.isCancelled = true; return makeBlobBeginCopyFromURLPollOperation(state); } - await state.blobClient.abortCopyFromURL(copyId2, { + await state.blobClient.abortCopyFromURL(copyId, { abortSignal: options.abortSignal }); state.isCancelled = true; @@ -66630,10 +69316,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; var update = async function update2(options = {}) { const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; + const { blobClient, copySource, startCopyFromURLOptions } = state; if (!state.isStarted) { state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, startCopyFromURLOptions); + const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions); state.copyId = result.copyId; if (result.copyStatus === "success") { state.result = result; @@ -66673,12 +69359,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; function makeBlobBeginCopyFromURLPollOperation(state) { return { - state: Object.assign({}, state), + 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.`); @@ -66688,27 +69383,61 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; if (concurrency < 1) { throw new RangeError("concurrency must be larger than 0"); } this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + this.emitter = new events_1.EventEmitter(); } /** * Add a operation into queue. @@ -66723,8 +69452,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.actives--; this.completed++; this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + } catch (error3) { + this.emitter.emit("error", error3); } }); } @@ -66739,9 +69468,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.parallelExecute(); return new Promise((resolve2, reject) => { this.emitter.on("finish", resolve2); - this.emitter.on("error", (error4) => { + this.emitter.on("error", (error3) => { this.state = BatchStates.Error; - reject(error4); + reject(error3); }); }); } @@ -66778,333 +69507,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BuffersStream = class extends stream.Readable { - /** - * 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]); - } - } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { - /** - * The size of the data contained in the pooled buffers. - */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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(this.buffers, this.size); - } - }; - var BufferScheduler = class { - /** - * 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) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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((resolve2, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve2).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve2(); - } - } - }); - }); - } - /** - * 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(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; - } - /** - * 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 buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } - } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; - } - /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. - */ - async triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); - } - } while (buffer2); - } - /** - * Trigger a outgoing handler for a buffer shifted from outgoing. - * - * @param buffer - - */ - async triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); - } - /** - * Return buffer used by outgoing handler into incoming. - * - * @param buffer - - */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); - } - } - }; - async function streamToBuffer(stream2, buffer2, offset, end, encoding) { + 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_constants9(); + async function streamToBuffer(stream, buffer, offset, end, encoding) { let pos = 0; const count = end - offset; return new Promise((resolve2, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream2.on("readable", () => { + const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), constants_js_1.REQUEST_TIMEOUT); + stream.on("readable", () => { if (pos >= count) { clearTimeout(timeout); resolve2(); return; } - let chunk = stream2.read(); + let chunk = stream.read(); if (!chunk) { return; } @@ -67112,28 +69544,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; chunk = Buffer.from(chunk, encoding); } const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); + buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); pos += chunkLength; }); - stream2.on("end", () => { + stream.on("end", () => { clearTimeout(timeout); if (pos < count) { reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); } resolve2(); }); - stream2.on("error", (msg) => { + stream.on("error", (msg) => { clearTimeout(timeout); reject(msg); }); }); } - async function streamToBuffer2(stream2, buffer2, encoding) { + async function streamToBuffer2(stream, buffer, encoding) { let pos = 0; - const bufferSize = buffer2.length; + const bufferSize = buffer.length; return new Promise((resolve2, reject) => { - stream2.on("readable", () => { - let chunk = stream2.read(); + stream.on("readable", () => { + let chunk = stream.read(); if (!chunk) { return; } @@ -67144,18 +69576,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); return; } - buffer2.fill(chunk, pos, pos + chunk.length); + buffer.fill(chunk, pos, pos + chunk.length); pos += chunk.length; }); - stream2.on("end", () => { + stream.on("end", () => { resolve2(pos); }); - stream2.on("error", reject); + stream.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve2, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); + }); + readableStream.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + readableStream.on("error", reject); }); } async function readStreamToLocalFile(rs, file) { return new Promise((resolve2, reject) => { - const ws = fs__namespace.createWriteStream(file); + const ws = node_fs_1.default.createWriteStream(file); rs.on("error", (err) => { reject(err); }); @@ -67166,9 +69610,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; rs.pipe(ws); }); } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + 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_commonjs8(); + var core_auth_1 = require_commonjs9(); + var core_util_1 = require_commonjs6(); + var core_util_2 = require_commonjs6(); + 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_commonjs15(); + var constants_js_1 = require_constants9(); + 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. */ @@ -67184,49 +69667,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { options = options || {}; let pipeline; - let url2; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + let url; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + 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. @@ -67235,8 +69718,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -67245,8 +69728,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param versionId - The versionId. * @returns A new BlobClient object pointing to the version of this blob. */ - withVersion(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), this.pipeline); + 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. @@ -67276,7 +69759,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * In Node.js, data returns in a Readable stream readableStreamBody * * In browsers, data returns in a promise blobBody * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob + * @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 @@ -67285,76 +69768,106 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```js - * // Download and convert a blob to a string + * ```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(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); + * 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): * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded + * ```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(), * ); * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(blob); - * }); + * 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress + onDownloadProgress: core_util_1.isNodeLike ? void 0 : options.onProgress // for Node.js, progress is reported by RetriableReadableStream }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), + 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 = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { + 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 = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS; + 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`); @@ -67362,8 +69875,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!res.etag) { throw new RangeError(`File download response doesn't contain valid etag header`); } - return new BlobDownloadResponse(wrappedRes, async (start) => { - var _a2; + return new BlobDownloadResponse_js_1.BlobDownloadResponse(wrappedRes, async (start) => { const updatedDownloadOptions = { leaseAccessConditions: options.conditions, modifiedAccessConditions: { @@ -67371,9 +69883,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; ifModifiedSince: options.conditions.ifModifiedSince, ifNoneMatch: options.conditions.ifNoneMatch, ifUnmodifiedSince: options.conditions.ifUnmodifiedSince, - ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions + ifTags: options.conditions?.tagConditions }, - range: rangeToString({ + range: (0, Range_js_1.rangeToString)({ count: offset + res.contentLength - start, offset: start }), @@ -67382,7 +69894,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }; - return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody; + return (await this.blobContext.download({ + abortSignal: options.abortSignal, + ...updatedDownloadOptions + })).readableStreamBody; }, offset, res.contentLength, { maxRetryRequests: options.maxRetryRequests, onProgress: options.onProgress @@ -67399,9 +69914,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - options to Exists operation. */ async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); + (0, models_js_1.ensureCpkIfSpecified)(options.customerProvidedKey, this.isHttps); await this.getProperties({ abortSignal: options.abortSignal, customerProvidedKey: options.customerProvidedKey, @@ -67412,7 +69927,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } catch (e) { if (e.statusCode === 404) { return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { + } else if (e.statusCode === 409 && (e.details.errorCode === constants_js_1.BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === constants_js_1.BlobDoesNotUseCustomerSpecifiedEncryption)) { return true; } throw e; @@ -67422,7 +69937,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties + * @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 @@ -67433,17 +69948,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getProperties(options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); + return { + ...res, + _response: res._response, + // _response is made non-enumerable + objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, + objectReplicationSourceProperties: (0, utils_common_js_1.parseObjectReplicationRecord)(res.objectReplicationRules) + }; }); } /** @@ -67451,19 +69974,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -67473,19 +69998,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/delete-blob * * @param options - Optional options to Blob Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -67495,13 +70028,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * @see https://learn.microsoft.com/rest/api/storageservices/undelete-blob * * @param options - Optional options to Blob Undelete operation. */ async undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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 })); @@ -67512,7 +70045,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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 @@ -67524,14 +70057,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async setHTTPHeaders(blobHTTPHeaders, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); @@ -67542,22 +70077,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * If no option provided, or no metadata defined in the parameter, the blob * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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(metadata2, options = {}) { + async setMetadata(metadata, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ + (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: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -67573,15 +70110,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param tags - * @param options - */ - async setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + tags: (0, utils_common_js_1.toBlobTags)(tags) })); }); } @@ -67591,15 +70130,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); + const wrappedResponse = { + ...response, + _response: response._response, + // _response is made non-enumerable + tags: (0, utils_common_js_1.toTags)({ blobTagSet: response.blobTagSet }) || {} + }; return wrappedResponse; }); } @@ -67610,24 +70156,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the blob. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions @@ -67648,57 +70196,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @see https://learn.microsoft.com/rest/api/storageservices/copy-blob * - * Example using automatic polling: + * ```ts snippet:ClientsBeginCopyFromURL + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobClient = containerClient.getBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); - * } - * const result = copyPoller.getResult(); - * ``` + * // Example using automatic polling + * const automaticCopyPoller = await blobClient.beginCopyFromURL("url"); + * const automaticResult = await automaticCopyPoller.pollUntilDone(); * - * Example using progress updates: + * // Example using manual polling + * const manualCopyPoller = await blobClient.beginCopyFromURL("url"); + * while (!manualCopyPoller.isDone()) { + * await manualCopyPoller.poll(); + * } + * const manualResult = manualCopyPoller.getResult(); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { + * // Example using progress updates + * const progressUpdatesCopyPoller = await blobClient.beginCopyFromURL("url", { * onProgress(state) { * console.log(`Progress: ${state.copyProgress}`); - * } + * }, * }); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const progressUpdatesResult = await progressUpdatesCopyPoller.pollUntilDone(); * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress + * // 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 result = await copyPoller.pollUntilDone(); - * ``` + * const pollingIntervalResult = await pollingIntervalCopyPoller.pollUntilDone(); * - * Example using copy cancellation: - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); + * // Example using copy cancellation: + * const cancelCopyPoller = await blobClient.beginCopyFromURL("url"); * // cancel operation after starting it. * try { - * await copyPoller.cancelOperation(); + * await cancelCopyPoller.cancelOperation(); * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * cancelCopyPoller.getResult(); + * } catch (err: any) { + * if (err.name === "PollerCancelledError") { + * console.log("The copy was cancelled."); * } * } * ``` @@ -67706,15 +70255,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param copySource - url to the source Azure Blob/File. * @param options - Optional options to the Blob Start Copy From URL operation. */ - async beginCopyFromURL(copySource2, options = {}) { + async beginCopyFromURL(copySource, options = {}) { const client = { abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), getProperties: (...args) => this.getProperties(...args), startCopyFromURL: (...args) => this.startCopyFromURL(...args) }; - const poller = new BlobBeginCopyFromUrlPoller({ + const poller = new BlobStartCopyFromUrlPoller_js_1.BlobBeginCopyFromUrlPoller({ blobClient: client, - copySource: copySource2, + copySource, intervalInMs: options.intervalInMs, onProgress: options.onProgress, resumeFrom: options.resumeFrom, @@ -67726,14 +70275,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * @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(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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 @@ -67743,36 +70292,39 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * @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(copySource2, options = {}) { + async syncCopyFromURL(copySource, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, + 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 })); }); @@ -67783,31 +70335,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * @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(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, rehydratePriority: options.rehydratePriority, tracingOptions: updatedOptions.tracingOptions })); }); } async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; + let buffer; let offset = 0; let count = 0; let options = param4; if (param1 instanceof Buffer) { - buffer2 = param1; + buffer = param1; offset = param2 || 0; count = typeof param3 === "number" ? param3 : 0; } else { @@ -67815,12 +70368,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; count = typeof param2 === "number" ? param2 : 0; options = param3 || {}; } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; + let blockSize = options.blockSize ?? 0; if (blockSize < 0) { throw new RangeError("blockSize option must be >= 0"); } if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + blockSize = constants_js_1.DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; } if (offset < 0) { throw new RangeError("offset option must be >= 0"); @@ -67831,26 +70384,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 (!buffer2) { + if (!buffer) { try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + 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 (buffer2.length < count) { + 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(options.concurrency); + 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; @@ -67864,8 +70420,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; customerProvidedKey: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions }); - const stream2 = response.readableStreamBody; - await streamToBuffer(stream2, buffer2, off - offset, chunkEnd - offset); + const stream = response.readableStreamBody; + await (0, utils_js_1.streamToBuffer)(stream, buffer, off - offset, chunkEnd - offset); transferProgress += chunkEnd - off; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress }); @@ -67873,7 +70429,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } await batch.do(); - return buffer2; + return buffer; }); } /** @@ -67893,10 +70449,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * at the specified path. */ async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 readStreamToLocalFile(response.readableStreamBody, filePath); + await (0, utils_js_1.readStreamToLocalFile)(response.readableStreamBody, filePath); } response.blobDownloadStream = void 0; return response; @@ -67911,7 +70470,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); containerName = pathComponents[1]; blobName = pathComponents[3]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); containerName = pathComponents[2]; blobName = pathComponents[4]; @@ -67927,7 +70486,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return { blobName, containerName }; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract blobName and containerName with provided information."); } } @@ -67939,21 +70498,23 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * @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(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; + async startCopyFromURL(copySource, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { + return (0, utils_common_js_1.assertResponse)(await this.blobContext.startCopyFromURL(copySource, { abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { sourceIfMatch: options.sourceConditions.ifMatch, sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, @@ -67961,12 +70522,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, sourceIfTags: options.sourceConditions.tagConditions }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), sealBlob: options.sealBlob, tracingOptions: updatedOptions.tracingOptions })); @@ -67978,18 +70539,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve2) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve2(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, this.credential).toString(); + resolve2((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -67998,17 +70565,67 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; + 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((resolve2) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve2((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. @@ -68016,8 +70633,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to delete immutability policy on the blob. */ async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ + 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 })); }); @@ -68028,8 +70645,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set immutability policy on the blob. */ async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ + 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 @@ -68042,8 +70659,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Optional options to set legal hold on the blob. */ async setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { + 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 })); }); @@ -68053,60 +70670,65 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.appendBlobContext = this.storageClientContext.appendBlob; } /** @@ -68117,40 +70739,55 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - Options to the Append Block Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); + * ```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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -68158,20 +70795,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param options - */ async createIfNotExists(options = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68184,20 +70832,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async seal(options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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://docs.microsoft.com/rest/api/storageservices/append-block + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * * @param body - Data to be appended. * @param contentLength - Length of the body in bytes. @@ -68206,29 +70856,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(""); + * 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(""); + * const existingAppendBlobClient = containerClient.getAppendBlobClient(blobName); * await existingAppendBlobClient.appendBlock(content, content.length); * ``` */ - async appendBlock(body2, contentLength2, options = {}) { + async appendBlock(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, @@ -68243,7 +70908,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-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 @@ -68257,74 +70922,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { + (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: rangeToString({ offset: sourceOffset, count }), + sourceRange: (0, Range_js_1.rangeToString)({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; + url = urlOrConnectionString; if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { options = blobNameOrOptions; } - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.blockBlobContext = this.storageClientContext.blockBlob; this._blobContext = this.storageClientContext.blob; } @@ -68336,8 +71016,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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. @@ -68346,15 +71026,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage (Node.js): * - * ```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"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * 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) { + * async function streamToBuffer(readableStream: NodeJS.ReadableStream): Promise { * return new Promise((resolve, reject) => { - * const chunks = []; + * const chunks: Buffer[] = []; * readableStream.on("data", (data) => { * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); * }); @@ -68370,26 +71067,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { + (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 tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ + 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: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) + inputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.inputTextConfiguration), + outputSerialization: (0, utils_common_js_1.toQuerySerialization)(options.outputTextConfiguration) }, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, tracingOptions: updatedOptions.tracingOptions })); - return new BlobQueryResponse(response, { + return new BlobQueryResponse_js_1.BlobQueryResponse(response, { abortSignal: options.abortSignal, onProgress: options.onProgress, onError: options.onError @@ -68407,7 +71106,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link uploadStream} or {@link uploadBrowserData} for better performance * with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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. @@ -68418,32 +71117,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(body2, contentLength2, options = {}) { + async upload(body, contentLength, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -68468,22 +71183,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async syncUploadFromURL(sourceURL, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); + (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://docs.microsoft.com/rest/api/storageservices/put-block + * @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. @@ -68491,10 +71221,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Block Blob Stage Block operation. * @returns Response data for the Block Blob Stage Block operation. */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { + 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: { @@ -68512,7 +71242,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * @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 @@ -68529,18 +71259,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { + 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 : rangeToString({ offset, count }), + sourceRange: offset === 0 && !count ? void 0 : (0, Range_js_1.rangeToString)({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + copySourceAuthorization: (0, utils_common_js_1.httpAuthorizationToString)(options.sourceAuthorization), + fileRequestIntent: options.sourceShareTokenIntent, tracingOptions: updatedOptions.tracingOptions })); }); @@ -68551,30 +71282,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * @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(blocks2, options = {}) { + async commitBlockList(blocks, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -68582,20 +71315,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * Returns the list of blocks that have been uploaded as part of a block blob * using the specified block list filter. - * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list + * @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(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); if (!res.committedBlocks) { @@ -68624,18 +71359,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { + if (core_util_1.isNodeLike) { + let buffer; if (data instanceof Buffer) { - buffer2 = data; + buffer = data; } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); + buffer = Buffer.from(data); } else { data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength); } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); + 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); @@ -68662,7 +71397,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadBrowserData(browserData, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadBrowserData", options, async (updatedOptions) => { + 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); }); @@ -68683,23 +71418,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); + 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 = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_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 > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { + 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 / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + 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; } } } @@ -68709,32 +71443,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); + 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 > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); + 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 = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; - const batch = new Batch(options.concurrency); + const batch = new Batch_js_1.Batch(options.concurrency); for (let i = 0; i < numBlocks; i++) { batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, i); const start = blockSize * i; const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; + const contentLength = end - start; blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { + await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, { abortSignal: options.abortSignal, conditions: options.conditions, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions }); - transferProgress += contentLength2; + transferProgress += contentLength; if (options.onProgress) { options.onProgress({ loadedBytes: transferProgress @@ -68760,15 +71494,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Response data for the Blob Upload operation. */ async uploadFile(filePath, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; + 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 () => fsCreateReadStream(filePath, { + return () => (0, utils_js_1.fsCreateReadStream)(filePath, { autoClose: true, end: count ? offset + count - 1 : Infinity, start: offset }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + }, size, { + ...options, + tracingOptions: updatedOptions.tracingOptions + }); }); } /** @@ -68787,27 +71524,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to Upload Stream to Block Blob operation. * @returns Response data for the Blob Upload operation. */ - async uploadStream(stream2, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { + async uploadStream(stream, bufferSize = constants_js_1.DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { if (!options.blobHTTPHeaders) { options.blobHTTPHeaders = {}; } if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); + const blockIDPrefix = (0, core_util_2.randomUUID)(); let transferProgress = 0; const blockList = []; - const scheduler = new BufferScheduler( - stream2, + const scheduler = new storage_common_1.BufferScheduler( + stream, bufferSize, maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); + async (body, length) => { + const blockID = (0, utils_common_js_1.generateBlockID)(blockIDPrefix, blockNum); blockList.push(blockID); blockNum++; - await this.stageBlock(blockID, body2, length, { + await this.stageBlock(blockID, body, length, { customerProvidedKey: options.customerProvidedKey, conditions: options.conditions, encryptionScope: options.encryptionScope, @@ -68825,50 +71562,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; Math.ceil(maxConcurrency / 4 * 3) ); await scheduler.do(); - return assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); + 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 pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); this.pageBlobContext = this.storageClientContext.pageBlob; } /** @@ -68879,13 +71624,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param snapshot - The snapshot timestamp. * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + 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://docs.microsoft.com/rest/api/storageservices/put-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. @@ -68893,23 +71638,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, + immutabilityPolicyExpiry: options.immutabilityPolicy?.expiriesOn, + immutabilityPolicyMode: options.immutabilityPolicy?.policyMode, legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + tier: (0, models_js_1.toAccessTier)(options.tier), + blobTagsString: (0, utils_common_js_1.toBlobTagsString)(options.tags), tracingOptions: updatedOptions.tracingOptions })); }); @@ -68918,21 +71665,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * @see https://learn.microsoft.com/rest/api/storageservices/put-blob * * @param size - size of the page blob. * @param options - */ async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + 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 (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -68940,7 +71699,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * * @param body - Data to upload * @param offset - Offset of destination page blob @@ -68948,19 +71707,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Page Blob Upload Pages operation. * @returns Response data for the Page Blob Upload Pages operation. */ - async uploadPages(body2, offset, count, options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, requestOptions: { onUploadProgress: options.onProgress }, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, @@ -68973,7 +71734,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * The Upload Pages operation writes a range of pages to a page blob where the * contents are read from a URL. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-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 @@ -68984,32 +71745,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + sourceIfMatch: options.sourceConditions?.ifMatch, + sourceIfModifiedSince: options.sourceConditions?.ifModifiedSince, + sourceIfNoneMatch: options.sourceConditions?.ifNoneMatch, + sourceIfUnmodifiedSince: options.sourceConditions?.ifUnmodifiedSince }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), + 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://docs.microsoft.com/rest/api/storageservices/put-page + * @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. @@ -69018,13 +71782,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async clearPages(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, @@ -69034,7 +71800,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -69043,16 +71809,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** @@ -69060,22 +71828,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); @@ -69095,17 +71865,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to List Page Ranges operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -69114,94 +71882,79 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param count - Number of bytes to get. * @param options - Options to List Page Ranges operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```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); * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` + * // 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()`: * - * ```js - * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * // 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()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: * - * ```js - * let i = 1; + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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 - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -69227,13 +71980,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -69243,17 +71999,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async getPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(result); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(result); }); } /** @@ -69262,7 +72020,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -69270,20 +72028,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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: rangeToString({ + range: (0, Range_js_1.rangeToString)({ offset, count }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, + marker, + maxPageSize: options?.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); @@ -69304,17 +72064,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to the Page Blob Get Page Ranges Diff operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 @@ -69324,94 +72082,88 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. * - * Example using `for await` syntax: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js + * const offset = 0; + * const count = 1024; + * const previousSnapshot = ""; + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * for await (const pageRange of pageBlobClient.listPageRangesDiff(offset, count, previousSnapshot)) { + * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { + * // 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: - * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // 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 - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = pageBlobClient + * .listPageRangesDiff(offset, count, previousSnapshot) + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * 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. @@ -69420,7 +72172,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ listPageRangesDiff(offset, count, prevSnapshot, options = {}) { options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options + }); return { /** * The next method, part of the iteration protocol @@ -69438,13 +72192,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * @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. @@ -69452,24 +72209,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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, prevSnapshotUrl2, options = {}) { + async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + prevSnapshotUrl, + range: (0, Range_js_1.rangeToString)({ offset, count }), tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + return (0, PageBlobRangeResponse_js_1.rangeResponseFromModel)(response); }); } /** * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * * @param size - Target size * @param options - Options to the Page Blob Resize operation. @@ -69477,12 +72236,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ async resize(size, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, encryptionScope: options.encryptionScope, tracingOptions: updatedOptions.tracingOptions })); @@ -69490,22 +72251,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * @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(sequenceNumberAction2, sequenceNumber, options = {}) { + async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); @@ -69515,38 +72278,72 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * @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(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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_constants9(); async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); + 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(str2) { return Buffer.byteLength(str2); } + } +}); + +// 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_commonjs8(); + var core_http_compat_1 = require_commonjs11(); + var constants_js_1 = require_constants9(); + 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."); @@ -69557,15 +72354,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.batchResponse = batchResponse; this.subRequests = subRequests; this.responseBatchBoundary = this.batchResponse.contentType.split("=")[1]; - this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`; + this.perResponsePrefix = `--${this.responseBatchBoundary}${constants_js_1.HTTP_LINE_ENDING}`; this.batchResponseEnding = `--${this.responseBatchBoundary}--`; } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response + // For example of response, please refer to https://learn.microsoft.com/rest/api/storageservices/blob-batch#response async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { + 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 getBodyAsText(this.batchResponse); + 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) { @@ -69577,18 +72374,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; for (let index = 0; index < subResponseCount; index++) { const subResponse = subResponses[index]; const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`); + 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(HeaderConstants.CONTENT_ID)) { + if (responseLine.startsWith(constants_js_1.HeaderConstants.CONTENT_ID)) { contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); } - if (responseLine.startsWith(HTTP_VERSION_1_1)) { + if (responseLine.startsWith(constants_js_1.HTTP_VERSION_1_1)) { subRespHeaderStartFound = true; const tokens = responseLine.split(SPACE_DELIMITER); deserializedSubResponse.status = parseInt(tokens[1]); @@ -69608,7 +72405,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } const tokens = responseLine.split(HTTP_HEADER_DELIMITER); deserializedSubResponse.headers.set(tokens[0], tokens[1]); - if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) { + if (tokens[0] === constants_js_1.HeaderConstants.X_MS_ERROR_CODE) { deserializedSubResponse.errorCode = tokens[1]; subRespFailed = true; } @@ -69623,7 +72420,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; deserializedSubResponse._request = this.subRequests.get(contentId); deserializedSubResponses[contentId] = deserializedSubResponse; } else { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + log_js_1.logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); } if (subRespFailed) { subResponsesFailedCount++; @@ -69638,6 +72435,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + 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"; @@ -69677,6 +72484,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; resolve2(); }); } + static keys = {}; + static listeners = {}; static onUnlockEvent(key, handler) { if (this.listeners[key] === void 0) { this.listeners[key] = [handler]; @@ -69693,11 +72502,36 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - Mutex.keys = {}; - Mutex.listeners = {}; + 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_commonjs6(); + var core_auth_1 = require_commonjs9(); + var core_rest_pipeline_1 = require_commonjs8(); + var core_util_2 = require_commonjs6(); + 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_commonjs12(); + var constants_js_1 = require_constants9(); + var StorageSharedKeyCredential_js_1 = require_StorageSharedKeyCredential(); + var tracing_js_1 = require_tracing(); + var core_client_1 = require_commonjs10(); + var StorageSharedKeyCredentialPolicyV2_js_1 = require_StorageSharedKeyCredentialPolicyV22(); var BlobBatch = class { + batchRequest; + batch = "batch"; + batchType; constructor() { - this.batch = "batch"; this.batchRequest = new InnerBatchRequest(); } /** @@ -69721,13 +72555,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.batchRequest.getSubRequests(); } async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); + await Mutex_js_1.Mutex.lock(this.batch); try { this.batchRequest.preAddSubRequest(subRequest); await assembleSubRequestFunc(); this.batchRequest.postAddSubRequest(subRequest); } finally { - await Mutex.unlock(this.batch); + await Mutex_js_1.Mutex.unlock(this.batch); } } setBatchType(batchType) { @@ -69739,13 +72573,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url2; + let url; let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; options = credentialOrOptions; } else { @@ -69754,28 +72588,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("delete"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).delete(updatedOptions); + await new Clients_js_1.BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions); }); }); } async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url2; + let url; let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url2 = urlOrBlobClient; + 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))) { + url = urlOrBlobClient; credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url2 = urlOrBlobClient.url; + tier = tierOrOptions; + } else if (urlOrBlobClient instanceof Clients_js_1.BlobClient) { + url = urlOrBlobClient.url; credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; + tier = credentialOrTier; options = tierOrOptions; } else { throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); @@ -69783,24 +72617,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options) { options = {}; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { this.setBatchType("setAccessTier"); await this.addSubRequestInternal({ - url: url2, + url, credential }, async () => { - await new BlobClient(url2, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); + await new Clients_js_1.BlobClient(url, 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 = coreUtil.randomUUID(); + const tempGuid = (0, core_util_1.randomUUID)(); this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`; + 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(); @@ -69813,9 +72655,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, + const corePipeline = (0, core_rest_pipeline_1.createEmptyPipeline)(); + corePipeline.addPolicy((0, core_client_1.serializationPolicy)({ + stringifyXML: core_xml_1.stringifyXML, serializerOptions: { xml: { xmlCharKey: "#" @@ -69824,19 +72666,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }), { phase: "Serialize" }); corePipeline.addPolicy(batchHeaderFilterPolicy()); corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } - const pipeline = new Pipeline([]); + const pipeline = new Pipeline_js_1.Pipeline([]); pipeline._credential = credential; pipeline._corePipeline = corePipeline; return pipeline; @@ -69845,24 +72687,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; this.body += [ this.subRequestPrefix, // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, + `${constants_js_1.HeaderConstants.CONTENT_ID}: ${this.operationCount}`, // sub request's content ID "", // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.url)} ${constants_js_1.HTTP_VERSION_1_1}${constants_js_1.HTTP_LINE_ENDING}` // sub request start line with method - ].join(HTTP_LINE_ENDING); + ].join(constants_js_1.HTTP_LINE_ENDING); for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + this.body += `${name}: ${value}${constants_js_1.HTTP_LINE_ENDING}`; } - this.body += HTTP_LINE_ENDING; + this.body += constants_js_1.HTTP_LINE_ENDING; } preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + 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 path2 = getURLPath(subRequest.url); - if (!path2 || path2 === "") { + const path3 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path3 || path3 === "") { throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } } @@ -69872,7 +72714,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } // Return the http request body with assembling the ending line to the sub request body. getHttpRequestBody() { - return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`; + return `${this.body}${this.batchRequestEnding}${constants_js_1.HTTP_LINE_ENDING}`; } getMultipartContentType() { return this.multipartContentType; @@ -69889,7 +72731,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return { request, status: 200, - headers: coreRestPipeline.createHttpHeaders() + headers: (0, core_rest_pipeline_1.createHttpHeaders)() }; } }; @@ -69900,7 +72742,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; async sendRequest(request, next) { let xMsHeaderName = ""; for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { xMsHeaderName = name; } } @@ -69911,19 +72753,37 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }; } + } +}); + +// 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 { - constructor(url2, credentialOrPipeline, options) { + serviceOrContainerContext; + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else { - pipeline = newPipeline(credentialOrPipeline, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } - const storageClientContext = new StorageContextClient(url2, getCoreClientOptions(pipeline)); - const path2 = getURLPath(url2); - if (path2 && path2 !== "/") { + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path3 = (0, utils_common_js_1.getURLPath)(url); + if (path3 && path3 !== "/") { this.serviceOrContainerContext = storageClientContext.container; } else { this.serviceOrContainerContext = storageClientContext.service; @@ -69934,10 +72794,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * A BlobBatch represents an aggregated set of operations on blobs. */ createBatch() { - return new BlobBatch(); + return new BlobBatch_js_1.BlobBatch(); } async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options); @@ -69948,7 +72808,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return this.submitBatch(batch); } async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, options) { - const batch = new BlobBatch(); + const batch = new BlobBatch_js_1.BlobBatch(); for (const urlOrBlobClient of urlsOrBlobClients) { if (typeof urlOrBlobClient === "string") { await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options); @@ -69966,11 +72826,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" + * ```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); @@ -69978,17 +72852,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using a lease: * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } + * ```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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @param batchRequest - A set of Delete or SetTier operations. * @param options - @@ -69997,10 +72886,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!batchRequest || batchRequest.getSubRequests().size === 0) { throw new RangeError("Batch request should contain one or more sub requests."); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests()); + 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, @@ -70017,7 +72908,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }); } }; - var ContainerClient = class extends StorageClient { + 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_commonjs8(); + var core_util_1 = require_commonjs6(); + var core_auth_1 = require_commonjs9(); + 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. */ @@ -70026,48 +72945,48 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url2; + let url; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url2 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } else if (core_util_1.isNodeLike && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipelineOrContainerName)) { + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url2 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); + url = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url2 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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, pipeline); + super(url, pipeline); 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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. @@ -70075,34 +72994,52 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); + * ```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 tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); + 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://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * @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 tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { throw e; } @@ -70119,7 +73056,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ async exists(options = {}) { - return tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-exists", options, async (updatedOptions) => { try { await this.getProperties({ abortSignal: options.abortSignal, @@ -70141,7 +73078,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobClient object for the given blob name. */ getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -70149,7 +73086,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - An append blob name */ getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -70159,15 +73096,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js - * const content = "Hello world!"; + * ```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 blockBlobClient = containerClient.getBlockBlobClient(""); + * const content = "Hello world!"; * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); * ``` */ getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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} @@ -70175,12 +73124,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param blobName - A page blob name */ getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties + * @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 @@ -70193,14 +73142,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); + 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ @@ -70208,8 +73161,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ + 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, @@ -70220,19 +73173,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * @see https://learn.microsoft.com/rest/api/storageservices/delete-container * * @param options - Options to Container Delete operation. */ async deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { try { const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + return { + succeeded: true, + ...res, + _response: res._response + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); + if (e.details?.errorCode === "ContainerNotFound") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } throw e; } @@ -70244,24 +73204,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * If no option provided, or no metadata defined in the parameter, the container * metadata will be removed. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * @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(metadata2, options = {}) { + 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ + 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: metadata2, + metadata, modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); @@ -70274,7 +73234,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * * @param options - Options to Container Get Access Policy operation. */ @@ -70282,8 +73242,8 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.getAccessPolicy({ + 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 @@ -70332,29 +73292,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * @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(access2, containerAcl2, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { const acl = []; - for (const identifier of containerAcl2 || []) { + for (const identifier of containerAcl || []) { acl.push({ accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", + expiresOn: identifier.accessPolicy.expiresOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.expiresOn) : "", permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" + startsOn: identifier.accessPolicy.startsOn ? (0, utils_common_js_1.truncatedISO8061Date)(identifier.accessPolicy.startsOn) : "" }, id: identifier.id }); } - return assertResponse(await this.containerContext.setAccessPolicy({ + return (0, utils_common_js_1.assertResponse)(await this.containerContext.setAccessPolicy({ abortSignal: options.abortSignal, - access: access2, + access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions, @@ -70369,7 +73329,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns A new BlobLeaseClient object for managing leases on the container. */ getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** * Creates a new block blob, or updates the content of an existing block blob. @@ -70383,7 +73343,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better * performance with concurrency uploading. * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 @@ -70393,10 +73353,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure the Block Blob Upload operation. * @returns Block Blob upload response data and the corresponding BlockBlobClient instance. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { + 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(body2, contentLength2, updatedOptions); + const response = await blockBlobClient.upload(body, contentLength, updatedOptions); return { blockBlobClient, response @@ -70408,14 +73368,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * @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 tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { let blobClient = this.getBlobClient(blobName); if (options.versionId) { blobClient = blobClient.withVersion(options.versionId); @@ -70428,18 +73388,38 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); + 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; }); } @@ -70448,23 +73428,46 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * @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(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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; }); } @@ -70480,44 +73483,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -70525,64 +73510,63 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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: * - * ```js - * let i = 1; + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * @@ -70590,41 +73574,44 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns An asyncIterableIterator that supports paging. */ listBlobsFlat(options = {}) { - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(updatedOptions); return { /** @@ -70643,7 +73630,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -70660,17 +73650,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list blobs operation. */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); + 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. @@ -70678,35 +73666,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param delimiter - The character or string used to define the virtual hierarchy * @param options - Options to list blobs operation. */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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. @@ -70714,118 +73689,138 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```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(), + * ); * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); + * 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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.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 - ${item.name}`); + * console.log(`\tBlobItem: name - ${value.name}`); * } - * entity = await iter.next(); + * ({ value, done } = await iter.next()); * } - * ``` * - * Example using `byPage()`: - * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; + * // 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 response.segment.blobItems) { + * for (const blob of page.segment.blobItems) { * console.log(`\tBlobItem: name - ${blob.name}`); * } * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.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(delimiter2, options = {}) { - if (delimiter2 === "") { + listBlobsByHierarchy(delimiter, options = {}) { + if (delimiter === "") { throw new RangeError("delimiter should contain one or more characters"); } - const include2 = []; + const include = []; if (options.includeCopy) { - include2.push("copy"); + include.push("copy"); } if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSnapshots) { - include2.push("snapshots"); + include.push("snapshots"); } if (options.includeVersions) { - include2.push("versions"); + include.push("versions"); } if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); + include.push("uncommittedblobs"); } if (options.includeTags) { - include2.push("tags"); + include.push("tags"); } if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); + include.push("deletedwithversions"); } if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); + include.push("immutabilitypolicy"); } if (options.includeLegalHold) { - include2.push("legalhold"); + include.push("legalhold"); } if (options.prefix === "") { options.prefix = void 0; } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, updatedOptions); + const updatedOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; + const iter = this.listItemsByHierarchy(delimiter, updatedOptions); return { /** * The next method, part of the iteration protocol @@ -70843,7 +73838,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listHierarchySegments(delimiter2, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } @@ -70864,23 +73862,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -70900,18 +73902,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -70922,27 +73922,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); + 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 @@ -70952,53 +73936,54 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example using `for await` syntax: * - * ```js + * ```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()`: - * - * ```js - * let i = 1; + * // Example using `iter.next()` syntax + * i = 1; * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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: - * - * ```js - * let i = 1; + * // 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 @@ -71006,11 +73991,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * .findBlobsByTags("tagkey='tagvalue'") * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints blob names + * // Prints 10 blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -71022,7 +74006,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -71041,7 +74027,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -71050,14 +74039,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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 })); @@ -71069,7 +74058,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; const parsedUrl = new URL(this.url); if (parsedUrl.hostname.split(".")[1] === "blob") { containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { + } else if ((0, utils_common_js_1.isIpEndpointStyle)(parsedUrl)) { containerName = parsedUrl.pathname.split("/")[2]; } else { containerName = parsedUrl.pathname.split("/")[1]; @@ -71079,7 +74068,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; throw new Error("Provided containerName is invalid."); } return containerName; - } catch (error4) { + } catch (error3) { throw new Error("Unable to extract containerName with provided information."); } } @@ -71089,18 +74078,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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((resolve2) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve2(appendToURLQuery(this.url, sas)); + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, this.credential).toString(); + resolve2((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** @@ -71109,45 +74101,78 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * @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)) { + 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 generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + 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((resolve2) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve2((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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this container. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + 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 { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - } /** * Parse initializes the AccountSASPermissions fields from a string. * @@ -71251,6 +74276,58 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. @@ -71258,7 +74335,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Using this method will guarantee the resource types are in * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -71305,12 +74382,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.service = false; - this.container = false; - this.object = false; - } /** * 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. @@ -71336,10 +74418,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * */ toString() { @@ -71356,13 +74450,17 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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 { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; - } /** * 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. @@ -71391,6 +74489,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } 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. * @@ -71412,44 +74526,62 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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_constants9(); + var utils_common_js_1 = require_utils_common(); function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential).sasQueryParameters; } function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) { - const version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-10-10") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2019-12-12") { + 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 && version2 < "2020-12-06") { + if (accountSASSignatureValues.encryptionScope && version < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); + 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 (version2 >= "2020-12-06") { + if (version >= "2020-12-06") { stringToSign = [ sharedKeyCredential.accountName, parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", "" // Account SAS requires an additional newline character @@ -71460,22 +74592,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; parsedPermissions, parsedServices, parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", + 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 : "", - version2, + version, "" // Account SAS requires an additional newline character ].join("\n"); } const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); return { - sasQueryParameters: new SASQueryParameters(version2, 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), + 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 }; } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { + } +}); + +// 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_commonjs9(); + var core_rest_pipeline_1 = require_commonjs8(); + var core_util_1 = require_commonjs6(); + 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. @@ -71490,35 +74650,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; */ static fromConnectionString(connectionString, options) { options = options || {}; - const extractedCreds = extractConnectionStringParts(connectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(connectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); + if (core_util_1.isNodeLike) { + const sharedKeyCredential = new StorageSharedKeyCredential_js_1.StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - const pipeline = newPipeline(sharedKeyCredential, options); + const pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); return new _BlobServiceClient(extractedCreds.url, pipeline); } else { throw new Error("Account connection string is only supported in Node.js environment"); } } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); } else { throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } } - constructor(url2, credentialOrPipeline, options) { + constructor(url, credentialOrPipeline, options) { let pipeline; - if (isPipelineLike(credentialOrPipeline)) { + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); + } else if (core_util_1.isNodeLike && credentialOrPipeline instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential_js_1.AnonymousCredential || (0, core_auth_1.isTokenCredential)(credentialOrPipeline)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); } else { - pipeline = newPipeline(new AnonymousCredential(), options); + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); } - super(url2, pipeline); + super(url, pipeline); this.serviceContext = this.storageClientContext.service; } /** @@ -71529,22 +74689,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * Example usage: * - * ```js + * ```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(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * 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 tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); const containerCreateResponse = await containerClient.create(updatedOptions); return { @@ -71561,7 +74730,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @returns Container deletion response. */ async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { const containerClient = this.getContainerClient(containerName); return containerClient.delete(updatedOptions); }); @@ -71575,47 +74744,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to configure Container Restore operation. * @returns Container deletion response. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); + 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 = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, + const containerUndeleteResponse = (0, utils_common_js_2.assertResponse)(await containerContext.restore({ + deletedContainerName, + deletedContainerVersion, tracingOptions: updatedOptions.tracingOptions })); return { containerClient, containerUndeleteResponse }; }); } - /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. - */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); - } /** * Gets the properties of a storage account’s Blob service, including properties * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ + 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 })); @@ -71624,15 +74775,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; /** * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * @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 tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { + 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 })); @@ -71642,14 +74793,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats + * @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 tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ + 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 })); @@ -71660,14 +74811,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * for the specified account. * The Get Account Information operation is available on service versions beginning * with version 2018-03-28. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * @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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ + 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 })); @@ -71675,7 +74826,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } /** * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2 + * @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 @@ -71687,9 +74838,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to the Service List Container Segment operation. * @returns Response data for the Service List Container Segment operation. */ - async listContainersSegment(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); + 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 + })); }); } /** @@ -71710,23 +74867,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - async findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ + 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: marker2, + marker, maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); + 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; }); } @@ -71746,18 +74907,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to find blobs by tags. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + 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. @@ -71768,27 +74927,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * however, only a subset of the OData filter syntax is supported in the Blob service. * @param options - Options to findBlobsByTagsItems. */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 @@ -71796,57 +74939,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the blobs in pages. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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++}: ${container.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` - * - * Example using `iter.next()`: * - * ```js - * let i = 1; + * // Use iter.next() to iterate the blobs + * i = 1; * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Blob ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // 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 @@ -71858,7 +74997,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints blob names * if (response.blobs) { * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); + * console.log(`Blob ${i++}: ${blob.name}`); * } * } * ``` @@ -71870,7 +75009,9 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - Options to find blobs by tags. */ findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); + const listSegmentOptions = { + ...options + }; const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** @@ -71889,7 +75030,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -71905,45 +75049,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * items. The marker value is opaque to the client. * @param options - Options to list containers operation. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); - } - }); + 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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); + 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 @@ -71951,45 +75077,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * * .byPage() returns an async iterable iterator to list the containers in pages. * - * Example using `for await` syntax: + * ```ts snippet:BlobServiceClientListContainers + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js + * 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}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; + * // Use iter.next() to iterate the containers + * i = 1; * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); + * let { value, done } = await iter.next(); + * while (!done) { + * console.log(`Container ${i++}: ${value.name}`); + * ({ value, done } = await iter.next()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } + * // 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}`); * } * } - * ``` - * - * Example using paging with a marker: * - * ```js - * let i = 1; + * // Use paging with a marker + * i = 1; * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; * @@ -72011,7 +75133,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * // Prints 10 container names * if (response.containerItems) { * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); + * console.log(`Container ${i++}: ${container.name}`); * } * } * ``` @@ -72023,17 +75145,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (options.prefix === "") { options.prefix = void 0; } - const include2 = []; + const include = []; if (options.includeDeleted) { - include2.push("deleted"); + include.push("deleted"); } if (options.includeMetadata) { - include2.push("metadata"); + include.push("metadata"); } if (options.includeSystem) { - include2.push("system"); + include.push("system"); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); + const listSegmentOptions = { + ...options, + ...include.length > 0 ? { include } : {} + }; const iter = this.listItems(listSegmentOptions); return { /** @@ -72052,7 +75177,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } @@ -72062,16 +75190,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Retrieves a user delegation key for the Blob service. This is only a valid operation when using * bearer token authentication. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key + * @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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, false) + 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 @@ -72085,19 +75213,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; signedVersion: response.signedVersion, value: response.value }; - const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey); + 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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/blob-batch * * @returns A new BlobBatchClient object for this service. */ getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } /** * Only available for BlobServiceClient constructed with a shared key credential. @@ -72105,7 +75241,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -72113,21 +75249,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - const sas = generateAccountSASQueryParameters(Object.assign({ + const sas = (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParameters)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return appendToURLQuery(this.url, sas); + 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. @@ -72135,7 +75272,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * 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://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas + * @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. @@ -72143,66 +75280,124 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { + 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 (expiresOn2 === void 0) { + if (expiresOn === void 0) { const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + expiresOn = new Date(now.getTime() + 3600 * 1e3); } - return generateAccountSASQueryParametersInternal(Object.assign({ + return (0, AccountSASSignatureValues_js_1.generateAccountSASQueryParametersInternal)({ permissions, - expiresOn: expiresOn2, + expiresOn, resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; + services: AccountSASServices_js_1.AccountSASServices.parse("b").toString(), + ...options + }, this.credential).stringToSign; } }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; - } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + } +}); + +// 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_commonjs17 = __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_commonjs8(); + 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; + } }); } }); @@ -72210,7 +75405,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; var require_blob_upload = __commonJS({ "node_modules/@actions/artifact/lib/internal/upload/blob-upload.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -72223,31 +75418,31 @@ var require_blob_upload = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function(o2) { + 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 ownKeys(o); + return ownKeys2(o); }; return function(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") __createBinding4(result, mod, k[i]); + for (var k = ownKeys2(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding2(result, mod, k[i]); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -72276,18 +75471,18 @@ var require_blob_upload = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.uploadZipToBlobStorage = uploadZipToBlobStorage; - var storage_blob_1 = require_dist7(); + var storage_blob_1 = require_commonjs17(); var config_1 = require_config(); - var core14 = __importStar4(require_core()); - var crypto = __importStar4(require("crypto")); - var stream = __importStar4(require("stream")); + var core14 = __importStar2(require_core()); + var crypto2 = __importStar2(require("crypto")); + var stream = __importStar2(require("stream")); var errors_1 = require_errors2(); function uploadZipToBlobStorage(authenticatedUploadURL, zipUploadStream) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let uploadByteCount = 0; let lastProgressTime = Date.now(); const abortController = new AbortController(); - const chunkTimer = (interval) => __awaiter4(this, void 0, void 0, function* () { + const chunkTimer = (interval) => __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { const timer = setInterval(() => { if (Date.now() - lastProgressTime > interval) { @@ -72317,7 +75512,7 @@ var require_blob_upload = __commonJS({ }; let sha256Hash = void 0; const uploadStream = new stream.PassThrough(); - const hashStream = crypto.createHash("sha256"); + const hashStream = crypto2.createHash("sha256"); zipUploadStream.pipe(uploadStream); zipUploadStream.pipe(hashStream).setEncoding("hex"); core14.info("Beginning upload of artifact content to blob storage"); @@ -72326,11 +75521,11 @@ var require_blob_upload = __commonJS({ blockBlobClient.uploadStream(uploadStream, bufferSize, maxConcurrency, options), chunkTimer((0, config_1.getUploadChunkTimeout)()) ]); - } catch (error4) { - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + } 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 error4; + throw error3; } finally { abortController.abort(); } @@ -72469,7 +75664,7 @@ var require_brace_expansion = __commonJS({ function lte(i, y) { return i <= y; } - function gte5(i, y) { + function gte6(i, y) { return i >= y; } function expand(str2, isTop) { @@ -72519,7 +75714,7 @@ var require_brace_expansion = __commonJS({ var reverse = y < x; if (reverse) { incr *= -1; - test = gte5; + test = gte6; } var pad = n.some(isPadded); N = []; @@ -72574,9 +75769,9 @@ var require_minimatch = __commonJS({ return new Minimatch(pattern, options).match(p); }; module2.exports = minimatch; - var path2 = require_path(); - minimatch.sep = path2.sep; - var GLOBSTAR = Symbol("globstar **"); + var path3 = require_path(); + minimatch.sep = path3.sep; + var GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); minimatch.GLOBSTAR = GLOBSTAR; var expand = require_brace_expansion(); var plTypes = { @@ -72640,7 +75835,7 @@ var require_minimatch = __commonJS({ throw new TypeError("pattern is too long"); } }; - var SUBPARSE = Symbol("subparse"); + var SUBPARSE = /* @__PURE__ */ Symbol("subparse"); minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe(); minimatch.match = (list, pattern, options = {}) => { const mm = new Minimatch(pattern, options); @@ -73084,8 +76279,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; const options = this.options; - if (path2.sep !== "/") { - f = f.split(path2.sep).join("/"); + if (path3.sep !== "/") { + f = f.split(path3.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -73123,13 +76318,13 @@ var require_minimatch = __commonJS({ var require_readdir_glob = __commonJS({ "node_modules/readdir-glob/index.js"(exports2, module2) { module2.exports = readdirGlob; - var fs2 = require("fs"); + var fs3 = require("fs"); var { EventEmitter } = require("events"); var { Minimatch } = require_minimatch(); var { resolve: resolve2 } = require("path"); function readdir(dir, strict) { return new Promise((resolve3, reject) => { - fs2.readdir(dir, { withFileTypes: true }, (err, files) => { + fs3.readdir(dir, { withFileTypes: true }, (err, files) => { if (err) { switch (err.code) { case "ENOTDIR": @@ -73162,7 +76357,7 @@ var require_readdir_glob = __commonJS({ } function stat(file, followSymlinks) { return new Promise((resolve3, reject) => { - const statFunc = followSymlinks ? fs2.stat : fs2.lstat; + const statFunc = followSymlinks ? fs3.stat : fs3.lstat; statFunc(file, (err, stats) => { if (err) { switch (err.code) { @@ -73183,8 +76378,8 @@ var require_readdir_glob = __commonJS({ }); }); } - async function* exploreWalkAsync(dir, path2, followSymlinks, useStat, shouldSkip, strict) { - let files = await readdir(path2 + dir, strict); + async function* exploreWalkAsync(dir, path3, followSymlinks, useStat, shouldSkip, strict) { + let files = await readdir(path3 + dir, strict); for (const file of files) { let name = file.name; if (name === void 0) { @@ -73193,7 +76388,7 @@ var require_readdir_glob = __commonJS({ } const filename = dir + "/" + name; const relative = filename.slice(1); - const absolute = path2 + "/" + relative; + const absolute = path3 + "/" + relative; let stats = null; if (useStat || followSymlinks) { stats = await stat(absolute, followSymlinks); @@ -73207,15 +76402,15 @@ var require_readdir_glob = __commonJS({ if (stats.isDirectory()) { if (!shouldSkip(relative)) { yield { relative, absolute, stats }; - yield* exploreWalkAsync(filename, path2, followSymlinks, useStat, shouldSkip, false); + yield* exploreWalkAsync(filename, path3, followSymlinks, useStat, shouldSkip, false); } } else { yield { relative, absolute, stats }; } } } - async function* explore(path2, followSymlinks, useStat, shouldSkip) { - yield* exploreWalkAsync("", path2, followSymlinks, useStat, shouldSkip, true); + async function* explore(path3, followSymlinks, useStat, shouldSkip) { + yield* exploreWalkAsync("", path3, followSymlinks, useStat, shouldSkip, true); } function readOptions(options) { return { @@ -73406,9 +76601,9 @@ var require_async = __commonJS({ invokeCallback(callback, err && (err instanceof Error || err.message) ? err : new Error(err)); }); } - function invokeCallback(callback, error4, value) { + function invokeCallback(callback, error3, value) { try { - callback(error4, value); + callback(error3, value); } catch (err) { setImmediate$1((e) => { throw e; @@ -73682,7 +76877,7 @@ var require_async = __commonJS({ } var mapSeries$1 = awaitify(mapSeries, 3); var applyEachSeries = applyEach$1(mapSeries$1); - const PROMISE_SYMBOL = Symbol("promiseCallback"); + const PROMISE_SYMBOL = /* @__PURE__ */ Symbol("promiseCallback"); function promiseCallback() { let resolve2, reject2; function callback(err, ...args) { @@ -74262,8 +77457,8 @@ var require_async = __commonJS({ var mapLimit$1 = awaitify(mapLimit, 4); function concatLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val2, iterCb) => { - _iteratee(val2, (err, ...args) => { + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, ...args) => { if (err) return iterCb(err); return iterCb(err, args); }); @@ -74469,10 +77664,10 @@ var require_async = __commonJS({ var forever$1 = awaitify(forever, 2); function groupByLimit(coll, limit, iteratee, callback) { var _iteratee = wrapAsync(iteratee); - return mapLimit$1(coll, limit, (val2, iterCb) => { - _iteratee(val2, (err, key) => { + return mapLimit$1(coll, limit, (val, iterCb) => { + _iteratee(val, (err, key) => { if (err) return iterCb(err); - return iterCb(err, { key, val: val2 }); + return iterCb(err, { key, val }); }); }, (err, mapResults) => { var result = {}; @@ -74480,11 +77675,11 @@ var require_async = __commonJS({ for (var i = 0; i < mapResults.length; i++) { if (mapResults[i]) { var { key } = mapResults[i]; - var { val: val2 } = mapResults[i]; + var { val } = mapResults[i]; if (hasOwnProperty.call(result, key)) { - result[key].push(val2); + result[key].push(val); } else { - result[key] = [val2]; + result[key] = [val]; } } } @@ -74503,8 +77698,8 @@ var require_async = __commonJS({ callback = once(callback); var newObj = {}; var _iteratee = wrapAsync(iteratee); - return eachOfLimit$2(limit)(obj, (val2, key, next) => { - _iteratee(val2, key, (err, result) => { + return eachOfLimit$2(limit)(obj, (val, key, next) => { + _iteratee(val, key, (err, result) => { if (err) return next(err); newObj[key] = result; next(err); @@ -74714,10 +77909,10 @@ var require_async = __commonJS({ function reflect(fn) { var _fn = wrapAsync(fn); return initialParams(function reflectOn(args, reflectCallback) { - args.push((error4, ...cbArgs) => { + args.push((error3, ...cbArgs) => { let retVal = {}; - if (error4) { - retVal.error = error4; + if (error3) { + retVal.error = error3; } if (cbArgs.length > 0) { var value = cbArgs; @@ -74873,13 +78068,13 @@ var require_async = __commonJS({ var timer; function timeoutCallback() { var name = asyncFn.name || "anonymous"; - var error4 = new Error('Callback function "' + name + '" timed out.'); - error4.code = "ETIMEDOUT"; + var error3 = new Error('Callback function "' + name + '" timed out.'); + error3.code = "ETIMEDOUT"; if (info7) { - error4.info = info7; + error3.info = info7; } timedOut = true; - callback(error4); + callback(error3); } args.push((...cbArgs) => { if (!timedOut) { @@ -74922,7 +78117,7 @@ var require_async = __commonJS({ return callback[PROMISE_SYMBOL]; } function tryEach(tasks, callback) { - var error4 = null; + var error3 = null; var result; return eachSeries$1(tasks, (task, taskCb) => { wrapAsync(task)((err, ...args) => { @@ -74932,10 +78127,10 @@ var require_async = __commonJS({ } else { result = args; } - error4 = err; + error3 = err; taskCb(err ? null : {}); }); - }, () => callback(error4, result)); + }, () => callback(error3, result)); } var tryEach$1 = awaitify(tryEach); function unmemoize(fn) { @@ -75227,54 +78422,54 @@ var require_polyfills = __commonJS({ } var chdir; module2.exports = patch; - function patch(fs2) { + function patch(fs3) { if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs2); - } - if (!fs2.lutimes) { - patchLutimes(fs2); - } - fs2.chown = chownFix(fs2.chown); - fs2.fchown = chownFix(fs2.fchown); - fs2.lchown = chownFix(fs2.lchown); - fs2.chmod = chmodFix(fs2.chmod); - fs2.fchmod = chmodFix(fs2.fchmod); - fs2.lchmod = chmodFix(fs2.lchmod); - fs2.chownSync = chownFixSync(fs2.chownSync); - fs2.fchownSync = chownFixSync(fs2.fchownSync); - fs2.lchownSync = chownFixSync(fs2.lchownSync); - fs2.chmodSync = chmodFixSync(fs2.chmodSync); - fs2.fchmodSync = chmodFixSync(fs2.fchmodSync); - fs2.lchmodSync = chmodFixSync(fs2.lchmodSync); - fs2.stat = statFix(fs2.stat); - fs2.fstat = statFix(fs2.fstat); - fs2.lstat = statFix(fs2.lstat); - fs2.statSync = statFixSync(fs2.statSync); - fs2.fstatSync = statFixSync(fs2.fstatSync); - fs2.lstatSync = statFixSync(fs2.lstatSync); - if (fs2.chmod && !fs2.lchmod) { - fs2.lchmod = function(path2, mode, cb) { + patchLchmod(fs3); + } + if (!fs3.lutimes) { + patchLutimes(fs3); + } + fs3.chown = chownFix(fs3.chown); + fs3.fchown = chownFix(fs3.fchown); + fs3.lchown = chownFix(fs3.lchown); + fs3.chmod = chmodFix(fs3.chmod); + fs3.fchmod = chmodFix(fs3.fchmod); + fs3.lchmod = chmodFix(fs3.lchmod); + fs3.chownSync = chownFixSync(fs3.chownSync); + fs3.fchownSync = chownFixSync(fs3.fchownSync); + fs3.lchownSync = chownFixSync(fs3.lchownSync); + fs3.chmodSync = chmodFixSync(fs3.chmodSync); + fs3.fchmodSync = chmodFixSync(fs3.fchmodSync); + fs3.lchmodSync = chmodFixSync(fs3.lchmodSync); + fs3.stat = statFix(fs3.stat); + fs3.fstat = statFix(fs3.fstat); + fs3.lstat = statFix(fs3.lstat); + fs3.statSync = statFixSync(fs3.statSync); + fs3.fstatSync = statFixSync(fs3.fstatSync); + fs3.lstatSync = statFixSync(fs3.lstatSync); + if (fs3.chmod && !fs3.lchmod) { + fs3.lchmod = function(path3, mode, cb) { if (cb) process.nextTick(cb); }; - fs2.lchmodSync = function() { + fs3.lchmodSync = function() { }; } - if (fs2.chown && !fs2.lchown) { - fs2.lchown = function(path2, uid, gid, cb) { + if (fs3.chown && !fs3.lchown) { + fs3.lchown = function(path3, uid, gid, cb) { if (cb) process.nextTick(cb); }; - fs2.lchownSync = function() { + fs3.lchownSync = function() { }; } if (platform === "win32") { - fs2.rename = typeof fs2.rename !== "function" ? fs2.rename : (function(fs$rename) { + fs3.rename = typeof fs3.rename !== "function" ? fs3.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() { - fs2.stat(to, function(stater, st) { + fs3.stat(to, function(stater, st) { if (stater && stater.code === "ENOENT") fs$rename(from, to, CB); else @@ -75290,9 +78485,9 @@ var require_polyfills = __commonJS({ } if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename); return rename; - })(fs2.rename); + })(fs3.rename); } - fs2.read = typeof fs2.read !== "function" ? fs2.read : (function(fs$read) { + fs3.read = typeof fs3.read !== "function" ? fs3.read : (function(fs$read) { function read(fd, buffer, offset, length, position, callback_) { var callback; if (callback_ && typeof callback_ === "function") { @@ -75300,22 +78495,22 @@ var require_polyfills = __commonJS({ callback = function(er, _2, __) { if (er && er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; - return fs$read.call(fs2, fd, buffer, offset, length, position, callback); + return fs$read.call(fs3, fd, buffer, offset, length, position, callback); } callback_.apply(this, arguments); }; } - return fs$read.call(fs2, fd, buffer, offset, length, position, callback); + return fs$read.call(fs3, fd, buffer, offset, length, position, callback); } if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read); return read; - })(fs2.read); - fs2.readSync = typeof fs2.readSync !== "function" ? fs2.readSync : /* @__PURE__ */ (function(fs$readSync) { + })(fs3.read); + fs3.readSync = typeof fs3.readSync !== "function" ? fs3.readSync : /* @__PURE__ */ (function(fs$readSync) { return function(fd, buffer, offset, length, position) { var eagCounter = 0; while (true) { try { - return fs$readSync.call(fs2, fd, buffer, offset, length, position); + return fs$readSync.call(fs3, fd, buffer, offset, length, position); } catch (er) { if (er.code === "EAGAIN" && eagCounter < 10) { eagCounter++; @@ -75325,11 +78520,11 @@ var require_polyfills = __commonJS({ } } }; - })(fs2.readSync); - function patchLchmod(fs3) { - fs3.lchmod = function(path2, mode, callback) { - fs3.open( - path2, + })(fs3.readSync); + function patchLchmod(fs4) { + fs4.lchmod = function(path3, mode, callback) { + fs4.open( + path3, constants.O_WRONLY | constants.O_SYMLINK, mode, function(err, fd) { @@ -75337,80 +78532,80 @@ var require_polyfills = __commonJS({ if (callback) callback(err); return; } - fs3.fchmod(fd, mode, function(err2) { - fs3.close(fd, function(err22) { + fs4.fchmod(fd, mode, function(err2) { + fs4.close(fd, function(err22) { if (callback) callback(err2 || err22); }); }); } ); }; - fs3.lchmodSync = function(path2, mode) { - var fd = fs3.openSync(path2, constants.O_WRONLY | constants.O_SYMLINK, mode); + fs4.lchmodSync = function(path3, mode) { + var fd = fs4.openSync(path3, constants.O_WRONLY | constants.O_SYMLINK, mode); var threw = true; var ret; try { - ret = fs3.fchmodSync(fd, mode); + ret = fs4.fchmodSync(fd, mode); threw = false; } finally { if (threw) { try { - fs3.closeSync(fd); + fs4.closeSync(fd); } catch (er) { } } else { - fs3.closeSync(fd); + fs4.closeSync(fd); } } return ret; }; } - function patchLutimes(fs3) { - if (constants.hasOwnProperty("O_SYMLINK") && fs3.futimes) { - fs3.lutimes = function(path2, at, mt, cb) { - fs3.open(path2, constants.O_SYMLINK, function(er, fd) { + function patchLutimes(fs4) { + if (constants.hasOwnProperty("O_SYMLINK") && fs4.futimes) { + fs4.lutimes = function(path3, at, mt, cb) { + fs4.open(path3, constants.O_SYMLINK, function(er, fd) { if (er) { if (cb) cb(er); return; } - fs3.futimes(fd, at, mt, function(er2) { - fs3.close(fd, function(er22) { + fs4.futimes(fd, at, mt, function(er2) { + fs4.close(fd, function(er22) { if (cb) cb(er2 || er22); }); }); }); }; - fs3.lutimesSync = function(path2, at, mt) { - var fd = fs3.openSync(path2, constants.O_SYMLINK); + fs4.lutimesSync = function(path3, at, mt) { + var fd = fs4.openSync(path3, constants.O_SYMLINK); var ret; var threw = true; try { - ret = fs3.futimesSync(fd, at, mt); + ret = fs4.futimesSync(fd, at, mt); threw = false; } finally { if (threw) { try { - fs3.closeSync(fd); + fs4.closeSync(fd); } catch (er) { } } else { - fs3.closeSync(fd); + fs4.closeSync(fd); } } return ret; }; - } else if (fs3.futimes) { - fs3.lutimes = function(_a, _b, _c, cb) { + } else if (fs4.futimes) { + fs4.lutimes = function(_a, _b, _c, cb) { if (cb) process.nextTick(cb); }; - fs3.lutimesSync = function() { + fs4.lutimesSync = function() { }; } } function chmodFix(orig) { if (!orig) return orig; return function(target, mode, cb) { - return orig.call(fs2, target, mode, function(er) { + return orig.call(fs3, target, mode, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -75420,7 +78615,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, mode) { try { - return orig.call(fs2, target, mode); + return orig.call(fs3, target, mode); } catch (er) { if (!chownErOk(er)) throw er; } @@ -75429,7 +78624,7 @@ var require_polyfills = __commonJS({ function chownFix(orig) { if (!orig) return orig; return function(target, uid, gid, cb) { - return orig.call(fs2, target, uid, gid, function(er) { + return orig.call(fs3, target, uid, gid, function(er) { if (chownErOk(er)) er = null; if (cb) cb.apply(this, arguments); }); @@ -75439,7 +78634,7 @@ var require_polyfills = __commonJS({ if (!orig) return orig; return function(target, uid, gid) { try { - return orig.call(fs2, target, uid, gid); + return orig.call(fs3, target, uid, gid); } catch (er) { if (!chownErOk(er)) throw er; } @@ -75459,13 +78654,13 @@ var require_polyfills = __commonJS({ } if (cb) cb.apply(this, arguments); } - return options ? orig.call(fs2, target, options, callback) : orig.call(fs2, target, callback); + return options ? orig.call(fs3, target, options, callback) : orig.call(fs3, target, callback); }; } function statFixSync(orig) { if (!orig) return orig; return function(target, options) { - var stats = options ? orig.call(fs2, target, options) : orig.call(fs2, target); + var stats = options ? orig.call(fs3, target, options) : orig.call(fs3, target); if (stats) { if (stats.uid < 0) stats.uid += 4294967296; if (stats.gid < 0) stats.gid += 4294967296; @@ -75494,16 +78689,16 @@ var require_legacy_streams = __commonJS({ "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { var Stream = require("stream").Stream; module2.exports = legacy; - function legacy(fs2) { + function legacy(fs3) { return { ReadStream, WriteStream }; - function ReadStream(path2, options) { - if (!(this instanceof ReadStream)) return new ReadStream(path2, options); + function ReadStream(path3, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path3, options); Stream.call(this); var self2 = this; - this.path = path2; + this.path = path3; this.fd = null; this.readable = true; this.paused = false; @@ -75537,7 +78732,7 @@ var require_legacy_streams = __commonJS({ }); return; } - fs2.open(this.path, this.flags, this.mode, function(err, fd) { + fs3.open(this.path, this.flags, this.mode, function(err, fd) { if (err) { self2.emit("error", err); self2.readable = false; @@ -75548,10 +78743,10 @@ var require_legacy_streams = __commonJS({ self2._read(); }); } - function WriteStream(path2, options) { - if (!(this instanceof WriteStream)) return new WriteStream(path2, options); + function WriteStream(path3, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path3, options); Stream.call(this); - this.path = path2; + this.path = path3; this.fd = null; this.writable = true; this.flags = "w"; @@ -75576,7 +78771,7 @@ var require_legacy_streams = __commonJS({ this.busy = false; this._queue = []; if (this.fd === null) { - this._open = fs2.open; + this._open = fs3.open; this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); this.flush(); } @@ -75611,7 +78806,7 @@ var require_clone = __commonJS({ // node_modules/graceful-fs/graceful-fs.js var require_graceful_fs = __commonJS({ "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - var fs2 = require("fs"); + var fs3 = require("fs"); var polyfills = require_polyfills(); var legacy = require_legacy_streams(); var clone = require_clone(); @@ -75619,8 +78814,8 @@ var require_graceful_fs = __commonJS({ var gracefulQueue; var previousSymbol; if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = Symbol.for("graceful-fs.queue"); - previousSymbol = Symbol.for("graceful-fs.previous"); + gracefulQueue = /* @__PURE__ */ Symbol.for("graceful-fs.queue"); + previousSymbol = /* @__PURE__ */ Symbol.for("graceful-fs.previous"); } else { gracefulQueue = "___graceful-fs.queue"; previousSymbol = "___graceful-fs.previous"; @@ -75643,12 +78838,12 @@ var require_graceful_fs = __commonJS({ m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); console.error(m); }; - if (!fs2[gracefulQueue]) { + if (!fs3[gracefulQueue]) { queue = global[gracefulQueue] || []; - publishQueue(fs2, queue); - fs2.close = (function(fs$close) { + publishQueue(fs3, queue); + fs3.close = (function(fs$close) { function close(fd, cb) { - return fs$close.call(fs2, fd, function(err) { + return fs$close.call(fs3, fd, function(err) { if (!err) { resetQueue(); } @@ -75660,48 +78855,48 @@ var require_graceful_fs = __commonJS({ value: fs$close }); return close; - })(fs2.close); - fs2.closeSync = (function(fs$closeSync) { + })(fs3.close); + fs3.closeSync = (function(fs$closeSync) { function closeSync(fd) { - fs$closeSync.apply(fs2, arguments); + fs$closeSync.apply(fs3, arguments); resetQueue(); } Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync }); return closeSync; - })(fs2.closeSync); + })(fs3.closeSync); if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { process.on("exit", function() { - debug4(fs2[gracefulQueue]); - require("assert").equal(fs2[gracefulQueue].length, 0); + debug4(fs3[gracefulQueue]); + require("assert").equal(fs3[gracefulQueue].length, 0); }); } } var queue; if (!global[gracefulQueue]) { - publishQueue(global, fs2[gracefulQueue]); - } - module2.exports = patch(clone(fs2)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs2.__patched) { - module2.exports = patch(fs2); - fs2.__patched = true; - } - function patch(fs3) { - polyfills(fs3); - fs3.gracefulify = patch; - fs3.createReadStream = createReadStream; - fs3.createWriteStream = createWriteStream2; - var fs$readFile = fs3.readFile; - fs3.readFile = readFile; - function readFile(path2, options, cb) { + publishQueue(global, fs3[gracefulQueue]); + } + module2.exports = patch(clone(fs3)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs3.__patched) { + module2.exports = patch(fs3); + fs3.__patched = true; + } + function patch(fs4) { + polyfills(fs4); + fs4.gracefulify = patch; + fs4.createReadStream = createReadStream; + fs4.createWriteStream = createWriteStream3; + var fs$readFile = fs4.readFile; + fs4.readFile = readFile; + function readFile(path3, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$readFile(path2, options, cb); - function go$readFile(path3, options2, cb2, startTime) { - return fs$readFile(path3, options2, function(err) { + return go$readFile(path3, options, cb); + function go$readFile(path4, options2, cb2, startTime) { + return fs$readFile(path4, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path3, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$readFile, [path4, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -75709,16 +78904,16 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$writeFile = fs3.writeFile; - fs3.writeFile = writeFile; - function writeFile(path2, data, options, cb) { + var fs$writeFile = fs4.writeFile; + fs4.writeFile = writeFile; + function writeFile(path3, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$writeFile(path2, data, options, cb); - function go$writeFile(path3, data2, options2, cb2, startTime) { - return fs$writeFile(path3, data2, options2, function(err) { + return go$writeFile(path3, data, options, cb); + function go$writeFile(path4, data2, options2, cb2, startTime) { + return fs$writeFile(path4, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$writeFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -75726,17 +78921,17 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$appendFile = fs3.appendFile; + var fs$appendFile = fs4.appendFile; if (fs$appendFile) - fs3.appendFile = appendFile; - function appendFile(path2, data, options, cb) { + fs4.appendFile = appendFile; + function appendFile(path3, data, options, cb) { if (typeof options === "function") cb = options, options = null; - return go$appendFile(path2, data, options, cb); - function go$appendFile(path3, data2, options2, cb2, startTime) { - return fs$appendFile(path3, data2, options2, function(err) { + return go$appendFile(path3, data, options, cb); + function go$appendFile(path4, data2, options2, cb2, startTime) { + return fs$appendFile(path4, data2, options2, function(err) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path3, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$appendFile, [path4, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -75744,9 +78939,9 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$copyFile = fs3.copyFile; + var fs$copyFile = fs4.copyFile; if (fs$copyFile) - fs3.copyFile = copyFile; + fs4.copyFile = copyFile; function copyFile(src, dest, flags, cb) { if (typeof flags === "function") { cb = flags; @@ -75764,34 +78959,34 @@ var require_graceful_fs = __commonJS({ }); } } - var fs$readdir = fs3.readdir; - fs3.readdir = readdir; + var fs$readdir = fs4.readdir; + fs4.readdir = readdir; var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path2, options, cb) { + function readdir(path3, options, cb) { if (typeof options === "function") cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path3, options2, cb2, startTime) { - return fs$readdir(path3, fs$readdirCallback( - path3, + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path4, options2, cb2, startTime) { + return fs$readdir(path4, fs$readdirCallback( + path4, options2, cb2, startTime )); - } : function go$readdir2(path3, options2, cb2, startTime) { - return fs$readdir(path3, options2, fs$readdirCallback( - path3, + } : function go$readdir2(path4, options2, cb2, startTime) { + return fs$readdir(path4, options2, fs$readdirCallback( + path4, options2, cb2, startTime )); }; - return go$readdir(path2, options, cb); - function fs$readdirCallback(path3, options2, cb2, startTime) { + return go$readdir(path3, options, cb); + function fs$readdirCallback(path4, options2, cb2, startTime) { return function(err, files) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) enqueue([ go$readdir, - [path3, options2, cb2], + [path4, options2, cb2], err, startTime || Date.now(), Date.now() @@ -75806,63 +79001,63 @@ var require_graceful_fs = __commonJS({ } } if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs3); + var legStreams = legacy(fs4); ReadStream = legStreams.ReadStream; WriteStream = legStreams.WriteStream; } - var fs$ReadStream = fs3.ReadStream; + var fs$ReadStream = fs4.ReadStream; if (fs$ReadStream) { ReadStream.prototype = Object.create(fs$ReadStream.prototype); ReadStream.prototype.open = ReadStream$open; } - var fs$WriteStream = fs3.WriteStream; + var fs$WriteStream = fs4.WriteStream; if (fs$WriteStream) { WriteStream.prototype = Object.create(fs$WriteStream.prototype); WriteStream.prototype.open = WriteStream$open; } - Object.defineProperty(fs3, "ReadStream", { + Object.defineProperty(fs4, "ReadStream", { get: function() { return ReadStream; }, - set: function(val2) { - ReadStream = val2; + set: function(val) { + ReadStream = val; }, enumerable: true, configurable: true }); - Object.defineProperty(fs3, "WriteStream", { + Object.defineProperty(fs4, "WriteStream", { get: function() { return WriteStream; }, - set: function(val2) { - WriteStream = val2; + set: function(val) { + WriteStream = val; }, enumerable: true, configurable: true }); var FileReadStream = ReadStream; - Object.defineProperty(fs3, "FileReadStream", { + Object.defineProperty(fs4, "FileReadStream", { get: function() { return FileReadStream; }, - set: function(val2) { - FileReadStream = val2; + set: function(val) { + FileReadStream = val; }, enumerable: true, configurable: true }); var FileWriteStream = WriteStream; - Object.defineProperty(fs3, "FileWriteStream", { + Object.defineProperty(fs4, "FileWriteStream", { get: function() { return FileWriteStream; }, - set: function(val2) { - FileWriteStream = val2; + set: function(val) { + FileWriteStream = val; }, enumerable: true, configurable: true }); - function ReadStream(path2, options) { + function ReadStream(path3, options) { if (this instanceof ReadStream) return fs$ReadStream.apply(this, arguments), this; else @@ -75882,7 +79077,7 @@ var require_graceful_fs = __commonJS({ } }); } - function WriteStream(path2, options) { + function WriteStream(path3, options) { if (this instanceof WriteStream) return fs$WriteStream.apply(this, arguments), this; else @@ -75900,22 +79095,22 @@ var require_graceful_fs = __commonJS({ } }); } - function createReadStream(path2, options) { - return new fs3.ReadStream(path2, options); + function createReadStream(path3, options) { + return new fs4.ReadStream(path3, options); } - function createWriteStream2(path2, options) { - return new fs3.WriteStream(path2, options); + function createWriteStream3(path3, options) { + return new fs4.WriteStream(path3, options); } - var fs$open = fs3.open; - fs3.open = open; - function open(path2, flags, mode, cb) { + var fs$open = fs4.open; + fs4.open = open; + function open(path3, flags, mode, cb) { if (typeof mode === "function") cb = mode, mode = null; - return go$open(path2, flags, mode, cb); - function go$open(path3, flags2, mode2, cb2, startTime) { - return fs$open(path3, flags2, mode2, function(err, fd) { + return go$open(path3, flags, mode, cb); + function go$open(path4, flags2, mode2, cb2, startTime) { + return fs$open(path4, flags2, mode2, function(err, fd) { if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path3, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + enqueue([go$open, [path4, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); else { if (typeof cb2 === "function") cb2.apply(this, arguments); @@ -75923,20 +79118,20 @@ var require_graceful_fs = __commonJS({ }); } } - return fs3; + return fs4; } function enqueue(elem) { debug4("ENQUEUE", elem[0].name, elem[1]); - fs2[gracefulQueue].push(elem); + fs3[gracefulQueue].push(elem); retry3(); } var retryTimer; function resetQueue() { var now = Date.now(); - for (var i = 0; i < fs2[gracefulQueue].length; ++i) { - if (fs2[gracefulQueue][i].length > 2) { - fs2[gracefulQueue][i][3] = now; - fs2[gracefulQueue][i][4] = now; + for (var i = 0; i < fs3[gracefulQueue].length; ++i) { + if (fs3[gracefulQueue][i].length > 2) { + fs3[gracefulQueue][i][3] = now; + fs3[gracefulQueue][i][4] = now; } } retry3(); @@ -75944,9 +79139,9 @@ var require_graceful_fs = __commonJS({ function retry3() { clearTimeout(retryTimer); retryTimer = void 0; - if (fs2[gracefulQueue].length === 0) + if (fs3[gracefulQueue].length === 0) return; - var elem = fs2[gracefulQueue].shift(); + var elem = fs3[gracefulQueue].shift(); var fn = elem[0]; var args = elem[1]; var err = elem[2]; @@ -75968,7 +79163,7 @@ var require_graceful_fs = __commonJS({ debug4("RETRY", fn.name, args); fn.apply(null, args.concat([startTime])); } else { - fs2[gracefulQueue].push(elem); + fs3[gracefulQueue].push(elem); } } if (retryTimer === void 0) { @@ -76111,7 +79306,7 @@ var require_safe_buffer = __commonJS({ }); // node_modules/core-util-is/lib/util.js -var require_util11 = __commonJS({ +var require_util10 = __commonJS({ "node_modules/core-util-is/lib/util.js"(exports2) { function isArray(arg) { if (Array.isArray) { @@ -76268,7 +79463,7 @@ var require_BufferList = __commonJS({ this.head = this.tail = null; this.length = 0; }; - BufferList.prototype.join = function join2(s) { + BufferList.prototype.join = function join3(s) { if (this.length === 0) return ""; var p = this.head; var ret = "" + p.data; @@ -76393,7 +79588,7 @@ var require_stream_writable = __commonJS({ var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick; var Duplex; Writable.WritableState = WritableState; - var util = Object.create(require_util11()); + var util = Object.create(require_util10()); util.inherits = require_inherits(); var internalUtil = { deprecate: require_node2() @@ -76829,7 +80024,7 @@ var require_stream_duplex = __commonJS({ return keys2; }; module2.exports = Duplex; - var util = Object.create(require_util11()); + var util = Object.create(require_util10()); util.inherits = require_inherits(); var Readable = require_stream_readable(); var Writable = require_stream_writable(); @@ -77154,7 +80349,7 @@ var require_stream_readable = __commonJS({ function _isUint8Array(obj) { return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array; } - var util = Object.create(require_util11()); + var util = Object.create(require_util10()); util.inherits = require_inherits(); var debugUtil = require("util"); var debug4 = void 0; @@ -77823,7 +81018,7 @@ var require_stream_transform = __commonJS({ "use strict"; module2.exports = Transform; var Duplex = require_stream_duplex(); - var util = Object.create(require_util11()); + var util = Object.create(require_util10()); util.inherits = require_inherits(); util.inherits(Transform, Duplex); function afterTransform(er, data) { @@ -77923,7 +81118,7 @@ var require_stream_passthrough = __commonJS({ "use strict"; module2.exports = PassThrough; var Transform = require_stream_transform(); - var util = Object.create(require_util11()); + var util = Object.create(require_util10()); util.inherits = require_inherits(); util.inherits(PassThrough, Transform); function PassThrough(options) { @@ -78016,22 +81211,22 @@ var require_lazystream = __commonJS({ // node_modules/normalize-path/index.js var require_normalize_path = __commonJS({ "node_modules/normalize-path/index.js"(exports2, module2) { - module2.exports = function(path2, stripTrailing) { - if (typeof path2 !== "string") { + module2.exports = function(path3, stripTrailing) { + if (typeof path3 !== "string") { throw new TypeError("expected path to be a string"); } - if (path2 === "\\" || path2 === "/") return "/"; - var len = path2.length; - if (len <= 1) return path2; + if (path3 === "\\" || path3 === "/") return "/"; + var len = path3.length; + if (len <= 1) return path3; var prefix = ""; - if (len > 4 && path2[3] === "\\") { - var ch = path2[2]; - if ((ch === "?" || ch === ".") && path2.slice(0, 2) === "\\\\") { - path2 = path2.slice(2); + if (len > 4 && path3[3] === "\\") { + var ch = path3[2]; + if ((ch === "?" || ch === ".") && path3.slice(0, 2) === "\\\\") { + path3 = path3.slice(2); prefix = "//"; } } - var segs = path2.split(/[/\\]+/); + var segs = path3.split(/[/\\]+/); if (stripTrailing !== false && segs[segs.length - 1] === "") { segs.pop(); } @@ -78841,8 +82036,8 @@ var require_primordials = __commonJS({ PromiseReject(err) { return Promise.reject(err); }, - PromiseResolve(val2) { - return Promise.resolve(val2); + PromiseResolve(val) { + return Promise.resolve(val); }, ReflectApply: Reflect.apply, RegExpPrototypeTest(self2, value) { @@ -78867,8 +82062,8 @@ var require_primordials = __commonJS({ SymbolAsyncIterator: Symbol.asyncIterator, SymbolHasInstance: Symbol.hasInstance, SymbolIterator: Symbol.iterator, - SymbolDispose: Symbol.dispose || Symbol("Symbol.dispose"), - SymbolAsyncDispose: Symbol.asyncDispose || Symbol("Symbol.asyncDispose"), + SymbolDispose: Symbol.dispose || /* @__PURE__ */ Symbol("Symbol.dispose"), + SymbolAsyncDispose: Symbol.asyncDispose || /* @__PURE__ */ Symbol("Symbol.asyncDispose"), TypedArrayPrototypeSet(self2, buf, len) { return self2.set(buf, len); }, @@ -79547,7 +82742,7 @@ var require_abort_controller = __commonJS({ }); // node_modules/readable-stream/lib/ours/util.js -var require_util12 = __commonJS({ +var require_util11 = __commonJS({ "node_modules/readable-stream/lib/ours/util.js"(exports2, module2) { "use strict"; var bufferModule = require("buffer"); @@ -79730,7 +82925,7 @@ var require_util12 = __commonJS({ return ac.signal; } }; - module2.exports.promisify.custom = Symbol.for("nodejs.util.promisify.custom"); + module2.exports.promisify.custom = /* @__PURE__ */ Symbol.for("nodejs.util.promisify.custom"); } }); @@ -79738,9 +82933,9 @@ var require_util12 = __commonJS({ var require_errors3 = __commonJS({ "node_modules/readable-stream/lib/ours/errors.js"(exports2, module2) { "use strict"; - var { format, inspect, AggregateError: CustomAggregateError } = require_util12(); + var { format, inspect, AggregateError: CustomAggregateError } = require_util11(); var AggregateError = globalThis.AggregateError || CustomAggregateError; - var kIsNodeError = Symbol("kIsNodeError"); + var kIsNodeError = /* @__PURE__ */ Symbol("kIsNodeError"); var kTypes = [ "string", "function", @@ -79761,14 +82956,14 @@ var require_errors3 = __commonJS({ throw new codes.ERR_INTERNAL_ASSERTION(message); } } - function addNumericalSeparator(val2) { + function addNumericalSeparator(val) { let res = ""; - let i = val2.length; - const start = val2[0] === "-" ? 1 : 0; + let i = val.length; + const start = val[0] === "-" ? 1 : 0; for (; i >= start + 4; i -= 3) { - res = `_${val2.slice(i - 3, i)}${res}`; + res = `_${val.slice(i - 3, i)}${res}`; } - return `${val2.slice(0, i)}${res}`; + return `${val.slice(0, i)}${res}`; } function getMessage(key, msg, args) { if (typeof msg === "function") { @@ -80074,8 +83269,8 @@ var require_validators = __commonJS({ hideStackFrames, codes: { ERR_SOCKET_BAD_PORT, ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_INVALID_ARG_VALUE, ERR_OUT_OF_RANGE, ERR_UNKNOWN_SIGNAL } } = require_errors3(); - var { normalizeEncoding } = require_util12(); - var { isAsyncFunction, isArrayBufferView } = require_util12().types; + var { normalizeEncoding } = require_util11(); + var { isAsyncFunction, isArrayBufferView } = require_util11().types; var signals = {}; function isInt32(value) { return value === (value | 0); @@ -80322,7 +83517,7 @@ var require_process = __commonJS({ }); // node_modules/readable-stream/lib/internal/streams/utils.js -var require_utils6 = __commonJS({ +var require_utils7 = __commonJS({ "node_modules/readable-stream/lib/internal/streams/utils.js"(exports2, module2) { "use strict"; var { SymbolAsyncIterator, SymbolIterator, SymbolFor } = require_primordials(); @@ -80536,7 +83731,7 @@ var require_end_of_stream = __commonJS({ var process2 = require_process(); var { AbortError, codes } = require_errors3(); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2, ERR_STREAM_PREMATURE_CLOSE } = codes; - var { kEmptyObject, once } = require_util12(); + var { kEmptyObject, once } = require_util11(); var { validateAbortSignal, validateFunction, validateObject, validateBoolean } = require_validators(); var { Promise: Promise2, PromisePrototypeThen, SymbolDispose } = require_primordials(); var { @@ -80554,7 +83749,7 @@ var require_end_of_stream = __commonJS({ isNodeStream, willEmitClose: _willEmitClose, kIsClosedPromise - } = require_utils6(); + } = require_utils7(); var addAbortListener; function isRequest(stream) { return stream.setHeader && typeof stream.abort === "function"; @@ -80709,7 +83904,7 @@ var require_end_of_stream = __commonJS({ if (options.signal.aborted) { process2.nextTick(abort); } else { - addAbortListener = addAbortListener || require_util12().addAbortListener; + addAbortListener = addAbortListener || require_util11().addAbortListener; const disposable = addAbortListener(options.signal, abort); const originalCallback = callback; callback = once((...args) => { @@ -80736,7 +83931,7 @@ var require_end_of_stream = __commonJS({ if (options.signal.aborted) { process2.nextTick(abort); } else { - addAbortListener = addAbortListener || require_util12().addAbortListener; + addAbortListener = addAbortListener || require_util11().addAbortListener; const disposable = addAbortListener(options.signal, abort); const originalCallback = callback; callback = once((...args) => { @@ -80792,7 +83987,7 @@ var require_destroy2 = __commonJS({ AbortError } = require_errors3(); var { Symbol: Symbol2 } = require_primordials(); - var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils6(); + var { kIsDestroyed, isDestroyed, isFinished, isServerRequest } = require_utils7(); var kDestroy = Symbol2("kDestroy"); var kConstruct = Symbol2("kConstruct"); function checkError(err, w, r) { @@ -81130,7 +84325,7 @@ var require_add_abort_signal = __commonJS({ "use strict"; var { SymbolDispose } = require_primordials(); var { AbortError, codes } = require_errors3(); - var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils6(); + var { isNodeStream, isWebStream, kControllerErrorFunction } = require_utils7(); var eos = require_end_of_stream(); var { ERR_INVALID_ARG_TYPE: ERR_INVALID_ARG_TYPE2 } = codes; var addAbortListener; @@ -81166,7 +84361,7 @@ var require_add_abort_signal = __commonJS({ if (signal.aborted) { onAbort(); } else { - addAbortListener = addAbortListener || require_util12().addAbortListener; + addAbortListener = addAbortListener || require_util11().addAbortListener; const disposable = addAbortListener(signal, onAbort); eos(stream, disposable[SymbolDispose]); } @@ -81181,7 +84376,7 @@ var require_buffer_list = __commonJS({ "use strict"; var { StringPrototypeSlice, SymbolIterator, TypedArrayPrototypeSet, Uint8Array: Uint8Array2 } = require_primordials(); var { Buffer: Buffer2 } = require("buffer"); - var { inspect } = require_util12(); + var { inspect } = require_util11(); module2.exports = class BufferList { constructor() { this.head = null; @@ -81317,7 +84512,7 @@ var require_buffer_list = __commonJS({ return ret; } // Make sure the linked list only shows the minimal necessary information. - [Symbol.for("nodejs.util.inspect.custom")](_2, options) { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")](_2, options) { return inspect(this, { ...options, // Only inspect one level. @@ -81415,19 +84610,19 @@ var require_from = __commonJS({ next(); } }; - readable._destroy = function(error4, cb) { + readable._destroy = function(error3, cb) { PromisePrototypeThen( - close(error4), - () => process2.nextTick(cb, error4), + close(error3), + () => process2.nextTick(cb, error3), // nextTick is here in case cb throws - (e) => process2.nextTick(cb, e || error4) + (e) => process2.nextTick(cb, e || error3) ); }; - async function close(error4) { - const hadError = error4 !== void 0 && error4 !== null; + async function close(error3) { + const hadError = error3 !== void 0 && error3 !== null; const hasThrow = typeof iterator.throw === "function"; if (hadError && hasThrow) { - const { value, done } = await iterator.throw(error4); + const { value, done } = await iterator.throw(error3); await value; if (done) { return; @@ -81492,7 +84687,7 @@ var require_readable3 = __commonJS({ var { Buffer: Buffer2 } = require("buffer"); var { addAbortSignal } = require_add_abort_signal(); var eos = require_end_of_stream(); - var debug4 = require_util12().debuglog("stream", (fn) => { + var debug4 = require_util11().debuglog("stream", (fn) => { debug4 = fn; }); var BufferList = require_buffer_list(); @@ -81635,12 +84830,12 @@ var require_readable3 = __commonJS({ this.destroy(err); }; Readable.prototype[SymbolAsyncDispose] = function() { - let error4; + let error3; if (!this.destroyed) { - error4 = this.readableEnded ? null : new AbortError(); - this.destroy(error4); + error3 = this.readableEnded ? null : new AbortError(); + this.destroy(error3); } - return new Promise2((resolve2, reject) => eos(this, (err) => err && err !== error4 ? reject(err) : resolve2(null))); + return new Promise2((resolve2, reject) => eos(this, (err) => err && err !== error3 ? reject(err) : resolve2(null))); }; Readable.prototype.push = function(chunk, encoding) { return readableAddChunk(this, chunk, encoding, false); @@ -82193,14 +85388,14 @@ var require_readable3 = __commonJS({ } } stream.on("readable", next); - let error4; + let error3; const cleanup = eos( stream, { writable: false }, (err) => { - error4 = err ? aggregateTwoErrors(error4, err) : null; + error3 = err ? aggregateTwoErrors(error3, err) : null; callback(); callback = nop; } @@ -82210,19 +85405,19 @@ var require_readable3 = __commonJS({ const chunk = stream.destroyed ? null : stream.read(); if (chunk !== null) { yield chunk; - } else if (error4) { - throw error4; - } else if (error4 === null) { + } else if (error3) { + throw error3; + } else if (error3 === null) { return; } else { await new Promise2(next); } } } catch (err) { - error4 = aggregateTwoErrors(error4, err); - throw error4; + error3 = aggregateTwoErrors(error3, err); + throw error3; } finally { - if ((error4 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error4 === void 0 || stream._readableState.autoDestroy)) { + if ((error3 || (options === null || options === void 0 ? void 0 : options.destroyOnReturn) !== false) && (error3 === void 0 || stream._readableState.autoDestroy)) { destroyImpl.destroyer(stream, null); } else { stream.off("readable", next); @@ -82237,9 +85432,9 @@ var require_readable3 = __commonJS({ const r = this._readableState; return !!r && r.readable !== false && !r.destroyed && !r.errorEmitted && !r.endEmitted; }, - set(val2) { + set(val) { if (this._readableState) { - this._readableState.readable = !!val2; + this._readableState.readable = !!val; } } }, @@ -82951,9 +86146,9 @@ var require_writable = __commonJS({ const w = this._writableState; return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended; }, - set(val2) { + set(val) { if (this._writableState) { - this._writableState.writable = !!val2; + this._writableState.writable = !!val; } } }, @@ -83067,7 +86262,7 @@ var require_duplexify = __commonJS({ isDuplexNodeStream, isReadableStream, isWritableStream - } = require_utils6(); + } = require_utils7(); var eos = require_end_of_stream(); var { AbortError, @@ -83077,7 +86272,7 @@ var require_duplexify = __commonJS({ var Duplex = require_duplex(); var Readable = require_readable3(); var Writable = require_writable(); - var { createDeferredPromise } = require_util12(); + var { createDeferredPromise } = require_util11(); var from = require_from(); var Blob2 = globalThis.Blob || bufferModule.Blob; var isBlob = typeof Blob2 !== "undefined" ? function isBlob2(b) { @@ -83150,9 +86345,9 @@ var require_duplexify = __commonJS({ const promise = FunctionPrototypeCall( then2, value, - (val2) => { - if (val2 != null) { - throw new ERR_INVALID_RETURN_VALUE("nully", "body", val2); + (val) => { + if (val != null) { + throw new ERR_INVALID_RETURN_VALUE("nully", "body", val); } }, (err) => { @@ -83206,9 +86401,9 @@ var require_duplexify = __commonJS({ FunctionPrototypeCall( then, body, - (val2) => { - if (val2 != null) { - d.push(val2); + (val) => { + if (val != null) { + d.push(val); } d.push(null); }, @@ -83591,13 +86786,13 @@ var require_transform = __commonJS({ const rState = this._readableState; const wState = this._writableState; const length = rState.length; - this._transform(chunk, encoding, (err, val2) => { + this._transform(chunk, encoding, (err, val) => { if (err) { callback(err); return; } - if (val2 != null) { - this.push(val2); + if (val != null) { + this.push(val); } if (wState.ended || // Backwards compat. length === rState.length || // Backwards compat. @@ -83638,12 +86833,12 @@ var require_passthrough2 = __commonJS({ }); // node_modules/readable-stream/lib/internal/streams/pipeline.js -var require_pipeline3 = __commonJS({ +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_util12(); + var { once } = require_util11(); var destroyImpl = require_destroy2(); var Duplex = require_duplex(); var { @@ -83667,7 +86862,7 @@ var require_pipeline3 = __commonJS({ isWebStream, isReadableStream, isReadableFinished - } = require_utils6(); + } = require_utils7(); var AbortController2 = globalThis.AbortController || require_abort_controller().AbortController; var PassThrough; var Readable; @@ -83700,26 +86895,26 @@ var require_pipeline3 = __commonJS({ validateFunction(streams[streams.length - 1], "streams[stream.length - 1]"); return streams.pop(); } - function makeAsyncIterable(val2) { - if (isIterable(val2)) { - return val2; - } else if (isReadableNodeStream(val2)) { - return fromReadable(val2); + function makeAsyncIterable(val) { + if (isIterable(val)) { + return val; + } else if (isReadableNodeStream(val)) { + return fromReadable(val); } - throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val2); + throw new ERR_INVALID_ARG_TYPE2("val", ["Readable", "Iterable", "AsyncIterable"], val); } - async function* fromReadable(val2) { + async function* fromReadable(val) { if (!Readable) { Readable = require_readable3(); } - yield* Readable.prototype[SymbolAsyncIterator].call(val2); + yield* Readable.prototype[SymbolAsyncIterator].call(val); } async function pumpToNode(iterable, writable, finish, { end }) { - let error4; + let error3; let onresolve = null; const resume = (err) => { if (err) { - error4 = err; + error3 = err; } if (onresolve) { const callback = onresolve; @@ -83728,12 +86923,12 @@ var require_pipeline3 = __commonJS({ } }; const wait = () => new Promise2((resolve2, reject) => { - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { onresolve = () => { - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve2(); } @@ -83763,7 +86958,7 @@ var require_pipeline3 = __commonJS({ } finish(); } catch (err) { - finish(error4 !== err ? aggregateTwoErrors(error4, err) : err); + finish(error3 !== err ? aggregateTwoErrors(error3, err) : err); } finally { cleanup(); writable.off("drain", resume); @@ -83812,12 +87007,12 @@ var require_pipeline3 = __commonJS({ function abort() { finishImpl(new AbortError()); } - addAbortListener = addAbortListener || require_util12().addAbortListener; + addAbortListener = addAbortListener || require_util11().addAbortListener; let disposable; if (outerSignal) { disposable = addAbortListener(outerSignal, abort); } - let error4; + let error3; let value; const destroys = []; let finishCount = 0; @@ -83826,23 +87021,23 @@ var require_pipeline3 = __commonJS({ } function finishImpl(err, final) { var _disposable; - if (err && (!error4 || error4.code === "ERR_STREAM_PREMATURE_CLOSE")) { - error4 = err; + if (err && (!error3 || error3.code === "ERR_STREAM_PREMATURE_CLOSE")) { + error3 = err; } - if (!error4 && !final) { + if (!error3 && !final) { return; } while (destroys.length) { - destroys.shift()(error4); + destroys.shift()(error3); } ; (_disposable = disposable) === null || _disposable === void 0 ? void 0 : _disposable[SymbolDispose](); ac.abort(); if (final) { - if (!error4) { + if (!error3) { lastStreamCleanup.forEach((fn) => fn()); } - process2.nextTick(callback, error4, value); + process2.nextTick(callback, error3, value); } } let ret; @@ -83913,10 +87108,10 @@ var require_pipeline3 = __commonJS({ finishCount++; then.call( ret, - (val2) => { - value = val2; - if (val2 != null) { - pt.write(val2); + (val) => { + value = val; + if (val != null) { + pt.write(val); } if (end) { pt.end(); @@ -84069,7 +87264,7 @@ var require_pipeline3 = __commonJS({ var require_compose = __commonJS({ "node_modules/readable-stream/lib/internal/streams/compose.js"(exports2, module2) { "use strict"; - var { pipeline } = require_pipeline3(); + var { pipeline } = require_pipeline4(); var Duplex = require_duplex(); var { destroyer } = require_destroy2(); var { @@ -84080,7 +87275,7 @@ var require_compose = __commonJS({ isTransformStream, isWritableStream, isReadableStream - } = require_utils6(); + } = require_utils7(); var { AbortError, codes: { ERR_INVALID_ARG_VALUE, ERR_MISSING_ARGS } @@ -84273,8 +87468,8 @@ var require_operators = __commonJS({ var { finished } = require_end_of_stream(); var staticCompose = require_compose(); var { addAbortSignalNoValidate } = require_add_abort_signal(); - var { isWritable, isNodeStream } = require_utils6(); - var { deprecate } = require_util12(); + var { isWritable, isNodeStream } = require_utils7(); + var { deprecate } = require_util11(); var { ArrayPrototypePush, Boolean: Boolean2, @@ -84327,7 +87522,7 @@ var require_operators = __commonJS({ validateInteger(highWaterMark, "options.highWaterMark", 0); highWaterMark += concurrency; return async function* map3() { - const signal = require_util12().AbortSignalAny( + const signal = require_util11().AbortSignalAny( [options === null || options === void 0 ? void 0 : options.signal].filter(Boolean2) ); const stream = this; @@ -84355,7 +87550,7 @@ var require_operators = __commonJS({ } async function pump() { try { - for await (let val2 of stream) { + for await (let val of stream) { if (done) { return; } @@ -84363,17 +87558,17 @@ var require_operators = __commonJS({ throw new AbortError(); } try { - val2 = fn(val2, signalOpt); - if (val2 === kEmpty) { + val = fn(val, signalOpt); + if (val === kEmpty) { continue; } - val2 = PromiseResolve(val2); + val = PromiseResolve(val); } catch (err) { - val2 = PromiseReject(err); + val = PromiseReject(err); } cnt += 1; - PromisePrototypeThen(val2, afterItemProcessed, onCatch); - queue.push(val2); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue.push(val); if (next) { next(); next = null; @@ -84386,9 +87581,9 @@ var require_operators = __commonJS({ } queue.push(kEof); } catch (err) { - const val2 = PromiseReject(err); - PromisePrototypeThen(val2, afterItemProcessed, onCatch); - queue.push(val2); + const val = PromiseReject(err); + PromisePrototypeThen(val, afterItemProcessed, onCatch); + queue.push(val); } finally { done = true; if (next) { @@ -84401,15 +87596,15 @@ var require_operators = __commonJS({ try { while (true) { while (queue.length > 0) { - const val2 = await queue[0]; - if (val2 === kEof) { + const val = await queue[0]; + if (val === kEof) { return; } if (signal.aborted) { throw new AbortError(); } - if (val2 !== kEmpty) { - yield val2; + if (val !== kEmpty) { + yield val; } queue.shift(); maybeResume(); @@ -84436,14 +87631,14 @@ var require_operators = __commonJS({ } return async function* asIndexedPairs2() { let index = 0; - for await (const val2 of this) { + 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 [index++, val2]; + yield [index++, val]; } }.call(this); } @@ -84563,22 +87758,22 @@ var require_operators = __commonJS({ validateAbortSignal(options.signal, "options.signal"); } const result = []; - for await (const val2 of this) { + 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, val2); + ArrayPrototypePush(result, val); } return result; } function flatMap(fn, options) { const values = map2.call(this, fn, options); return async function* flatMap2() { - for await (const val2 of values) { - yield* val2; + for await (const val of values) { + yield* val; } }.call(this); } @@ -84605,13 +87800,13 @@ var require_operators = __commonJS({ if (options !== null && options !== void 0 && (_options$signal5 = options.signal) !== null && _options$signal5 !== void 0 && _options$signal5.aborted) { throw new AbortError(); } - for await (const val2 of this) { + 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 (number-- <= 0) { - yield val2; + yield val; } } }.call(this); @@ -84629,13 +87824,13 @@ var require_operators = __commonJS({ if (options !== null && options !== void 0 && (_options$signal7 = options.signal) !== null && _options$signal7 !== void 0 && _options$signal7.aborted) { throw new AbortError(); } - for await (const val2 of this) { + 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 (number-- > 0) { - yield val2; + yield val; } if (number <= 0) { return; @@ -84668,8 +87863,8 @@ 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_utils6(); - var { pipelineImpl: pl } = require_pipeline3(); + var { isIterable, isNodeStream, isWebStream } = require_utils7(); + var { pipelineImpl: pl } = require_pipeline4(); var { finished } = require_end_of_stream(); require_stream2(); function pipeline(...streams) { @@ -84712,18 +87907,18 @@ var require_stream2 = __commonJS({ var { ObjectDefineProperty, ObjectKeys, ReflectApply } = require_primordials(); var { promisify: { custom: customPromisify } - } = require_util12(); + } = require_util11(); var { streamReturningOperators, promiseReturningOperators } = require_operators(); var { codes: { ERR_ILLEGAL_CONSTRUCTOR } } = require_errors3(); var compose = require_compose(); var { setDefaultHighWaterMark, getDefaultHighWaterMark } = require_state3(); - var { pipeline } = require_pipeline3(); + var { pipeline } = require_pipeline4(); var { destroyer } = require_destroy2(); var eos = require_end_of_stream(); var promises2 = require_promises(); - var utils = require_utils6(); + var utils = require_utils7(); var Stream = module2.exports = require_legacy().Stream; Stream.isDestroyed = utils.isDestroyed; Stream.isDisturbed = utils.isDisturbed; @@ -85692,52 +88887,128 @@ var require_isPlainObject = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/brace-expansion/index.js -var require_brace_expansion2 = __commonJS({ - "node_modules/archiver-utils/node_modules/brace-expansion/index.js"(exports2, module2) { - var balanced = require_balanced_match(); - module2.exports = expandTop; +// node_modules/@isaacs/balanced-match/dist/commonjs/index.js +var require_commonjs18 = __commonJS({ + "node_modules/@isaacs/balanced-match/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.range = exports2.balanced = void 0; + var balanced = (a, b, str2) => { + const ma = a instanceof RegExp ? maybeMatch(a, str2) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str2) : b; + const r = ma !== null && mb != null && (0, exports2.range)(ma, mb, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + ma.length, r[1]), + post: str2.slice(r[1] + mb.length) + }; + }; + exports2.balanced = balanced; + var maybeMatch = (reg, str2) => { + const m = str2.match(reg); + return m ? m[0] : null; + }; + var range = (a, b, str2) => { + let begs, beg, left, right = void 0, result; + let ai = str2.indexOf(a); + let bi = str2.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str2.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 = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== void 0) { + result = [left, right]; + } + } + return result; + }; + exports2.range = range; + } +}); + +// node_modules/@isaacs/brace-expansion/dist/commonjs/index.js +var require_commonjs19 = __commonJS({ + "node_modules/@isaacs/brace-expansion/dist/commonjs/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.expand = expand; + var balanced_match_1 = require_commonjs18(); 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; function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + return !isNaN(str2) ? parseInt(str2, 10) : str2.charCodeAt(0); } function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + return str2.replace(slashPattern, escSlash).replace(openPattern, escOpen).replace(closePattern, escClose).replace(commaPattern, escComma).replace(periodPattern, escPeriod); } function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + return str2.replace(escSlashPattern, "\\").replace(escOpenPattern, "{").replace(escClosePattern, "}").replace(escCommaPattern, ",").replace(escPeriodPattern, "."); } function parseCommaParts(str2) { - if (!str2) + if (!str2) { return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) + } + const parts = []; + const m = (0, balanced_match_1.balanced)("{", "}", str2); + if (!m) { return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); + } + const { pre, body, post } = m; + const p = pre.split(","); p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); + 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 expandTop(str2) { - if (!str2) + function expand(str2) { + if (!str2) { return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); } - return expand(escapeBraces(str2), true).map(unescapeBraces); + if (str2.slice(0, 2) === "{}") { + str2 = "\\{\\}" + str2.slice(2); + } + return expand_(escapeBraces(str2), true).map(unescapeBraces); } function embrace(str2) { return "{" + str2 + "}"; @@ -85748,76 +89019,77 @@ var require_brace_expansion2 = __commonJS({ function lte(i, y) { return i <= y; } - function gte5(i, y) { + function gte6(i, y) { return i >= y; } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m) return [str2]; - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; + function expand_(str2, isTop) { + const expansions = []; + const m = (0, balanced_match_1.balanced)("{", "}", str2); + if (!m) + return [str2]; + const pre = m.pre; + const post = m.post.length ? expand_(m.post, false) : [""]; if (/\$$/.test(m.pre)) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + "{" + m.body + "}" + post[k]; + for (let k = 0; k < post.length; k++) { + const expansion = pre + "{" + m.body + "}" + post[k]; expansions.push(expansion); } } else { - 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; + 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(/,(?!,).*\}/)) { str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); + return expand_(str2); } return [str2]; } - var n; + let n; if (isSequence) { n = m.body.split(/\.\./); } else { n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); + if (n.length === 1 && n[0] !== void 0) { + n = expand_(n[0], false).map(embrace); if (n.length === 1) { - return post.map(function(p) { - return m.pre + n[0] + p; - }); + return post.map((p) => m.pre + n[0] + p); } } } - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; + let N; + if (isSequence && n[0] !== void 0 && n[1] !== void 0) { + 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.abs(numeric(n[2])) : 1; + let test = lte; + const reverse = y < x; if (reverse) { incr *= -1; - test = gte5; + test = gte6; } - var pad = n.some(isPadded); + const pad = n.some(isPadded); N = []; - for (var i = x; test(i, y); i += incr) { - var c; + for (let i = x; test(i, y); i += incr) { + let c; if (isAlphaSequence) { c = String.fromCharCode(i); - if (c === "\\") + if (c === "\\") { c = ""; + } } else { c = String(i); if (pad) { - var need = width - c.length; + const need = width - c.length; if (need > 0) { - var z = new Array(need + 1).join("0"); - if (i < 0) + const z = new Array(need + 1).join("0"); + if (i < 0) { c = "-" + z + c.slice(1); - else + } else { c = z + c; + } } } } @@ -85825,15 +89097,16 @@ var require_brace_expansion2 = __commonJS({ } } else { N = []; - for (var j = 0; j < n.length; j++) { - N.push.apply(N, expand(n[j], false)); + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], false)); } } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { expansions.push(expansion); + } } } } @@ -85842,9 +89115,9 @@ var require_brace_expansion2 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js var require_assert_valid_pattern = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.assertValidPattern = void 0; @@ -85861,9 +89134,9 @@ var require_assert_valid_pattern = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/brace-expressions.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js var require_brace_expressions = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/brace-expressions.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.parseClass = void 0; @@ -85978,22 +89251,25 @@ var require_brace_expressions = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/unescape.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js var require_unescape = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/unescape.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/unescape.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = void 0; - var unescape = (s, { windowsPathsNoEscape = false } = {}) => { - return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1"); + var unescape = (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"); }; exports2.unescape = unescape; } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/ast.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js var require_ast = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/ast.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.AST = void 0; @@ -86349,7 +89625,7 @@ var require_ast = __commonJS({ if (this.#root === this) this.#fillNegs(); if (!this.type) { - const noEmpty = this.isStart() && this.isEnd(); + 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" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot); this.#hasMagic = this.#hasMagic || hasMagic; @@ -86459,10 +89735,7 @@ var require_ast = __commonJS({ } } if (c === "*") { - if (noEmpty && glob2 === "*") - re += starNoEmpty; - else - re += star; + re += noEmpty && glob2 === "*" ? starNoEmpty : star; hasMagic = true; continue; } @@ -86480,29 +89753,29 @@ var require_ast = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/escape.js +// node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js var require_escape = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/escape.js"(exports2) { + "node_modules/glob/node_modules/minimatch/dist/commonjs/escape.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.escape = void 0; - var escape = (s, { windowsPathsNoEscape = false } = {}) => { + var escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {}) => { + if (magicalBraces) { + return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&"); + } return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&"); }; exports2.escape = escape; } }); -// node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/index.js -var require_commonjs13 = __commonJS({ - "node_modules/archiver-utils/node_modules/minimatch/dist/commonjs/index.js"(exports2) { +// node_modules/glob/node_modules/minimatch/dist/commonjs/index.js +var require_commonjs20 = __commonJS({ + "node_modules/glob/node_modules/minimatch/dist/commonjs/index.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.unescape = exports2.escape = exports2.AST = exports2.Minimatch = exports2.match = exports2.makeRe = exports2.braceExpand = exports2.defaults = exports2.filter = exports2.GLOBSTAR = exports2.sep = exports2.minimatch = void 0; - var brace_expansion_1 = __importDefault4(require_brace_expansion2()); + var brace_expansion_1 = require_commonjs19(); var assert_valid_pattern_js_1 = require_assert_valid_pattern(); var ast_js_1 = require_ast(); var escape_js_1 = require_escape(); @@ -86566,13 +89839,13 @@ var require_commonjs13 = __commonJS({ 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 path2 = { + var path3 = { win32: { sep: "\\" }, posix: { sep: "/" } }; - exports2.sep = defaultPlatform === "win32" ? path2.win32.sep : path2.posix.sep; + exports2.sep = defaultPlatform === "win32" ? path3.win32.sep : path3.posix.sep; exports2.minimatch.sep = exports2.sep; - exports2.GLOBSTAR = Symbol("globstar **"); + exports2.GLOBSTAR = /* @__PURE__ */ Symbol("globstar **"); exports2.minimatch.GLOBSTAR = exports2.GLOBSTAR; var qmark = "[^/]"; var star = qmark + "*?"; @@ -86625,7 +89898,7 @@ var require_commonjs13 = __commonJS({ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { return [pattern]; } - return (0, brace_expansion_1.default)(pattern); + return (0, brace_expansion_1.expand)(pattern); }; exports2.braceExpand = braceExpand; exports2.minimatch.braceExpand = exports2.braceExpand; @@ -87149,16 +90422,27 @@ var require_commonjs13 = __commonJS({ pp[i] = twoStar; } } else if (next === void 0) { - pp[i - 1] = prev + "(?:\\/|" + twoStar + ")?"; + pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?"; } else if (next !== exports2.GLOBSTAR) { pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next; pp[i + 1] = exports2.GLOBSTAR; } }); - return pp.filter((p) => p !== exports2.GLOBSTAR).join("/"); + const filtered = pp.filter((p) => p !== exports2.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] = set2.length > 1 ? ["(?:", ")"] : ["", ""]; re = "^" + open + re + close + "$"; + if (this.partial) { + re = "^(?:\\/|" + open + re.slice(1, -1) + close + ")$"; + } if (this.negate) re = "^(?!" + re + ").+$"; try { @@ -87245,9 +90529,9 @@ var require_commonjs13 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/lru-cache/dist/commonjs/index.js -var require_commonjs14 = __commonJS({ - "node_modules/archiver-utils/node_modules/lru-cache/dist/commonjs/index.js"(exports2) { +// node_modules/lru-cache/dist/commonjs/index.js +var require_commonjs21 = __commonJS({ + "node_modules/lru-cache/dist/commonjs/index.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.LRUCache = void 0; @@ -87294,7 +90578,6 @@ var require_commonjs14 = __commonJS({ }; } var shouldWarn = (code) => !warned.has(code); - var TYPE = Symbol("type"); var isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n); var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null; var ZeroArray = class extends Array { @@ -87336,6 +90619,7 @@ var require_commonjs14 = __commonJS({ #max; #maxSize; #dispose; + #onInsert; #disposeAfter; #fetchMethod; #memoMethod; @@ -87417,6 +90701,7 @@ var require_commonjs14 = __commonJS({ #hasDispose; #hasFetchMethod; #hasDisposeAfter; + #hasOnInsert; /** * Do not call this method unless you need to inspect the * inner workings of the cache. If anything returned by this @@ -87493,6 +90778,12 @@ var require_commonjs14 = __commonJS({ get dispose() { return this.#dispose; } + /** + * {@link LRUCache.OptionsBase.onInsert} (read-only) + */ + get onInsert() { + return this.#onInsert; + } /** * {@link LRUCache.OptionsBase.disposeAfter} (read-only) */ @@ -87500,7 +90791,7 @@ var require_commonjs14 = __commonJS({ return this.#disposeAfter; } constructor(options) { - const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; + const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options; if (max !== 0 && !isPosInt(max)) { throw new TypeError("max option must be a nonnegative integer"); } @@ -87542,6 +90833,9 @@ var require_commonjs14 = __commonJS({ if (typeof dispose === "function") { this.#dispose = dispose; } + if (typeof onInsert === "function") { + this.#onInsert = onInsert; + } if (typeof disposeAfter === "function") { this.#disposeAfter = disposeAfter; this.#disposed = []; @@ -87550,6 +90844,7 @@ var require_commonjs14 = __commonJS({ this.#disposed = void 0; } this.#hasDispose = !!this.#dispose; + this.#hasOnInsert = !!this.#onInsert; this.#hasDisposeAfter = !!this.#disposeAfter; this.noDisposeOnSet = !!noDisposeOnSet; this.noUpdateTTL = !!noUpdateTTL; @@ -87952,7 +91247,7 @@ var require_commonjs14 = __commonJS({ } /** * Return an array of [key, {@link LRUCache.Entry}] tuples which can be - * passed to {@link LRLUCache#load}. + * passed to {@link LRUCache#load}. * * The `start` fields are calculated relative to a portable `Date.now()` * timestamp, even if `performance.now()` is available. @@ -88063,6 +91358,9 @@ var require_commonjs14 = __commonJS({ if (status) status.set = "add"; noUpdateTTL = false; + if (this.#hasOnInsert) { + this.#onInsert?.(v, k, "add"); + } } else { this.#moveToTail(index); const oldVal = this.#valList[index]; @@ -88098,6 +91396,9 @@ var require_commonjs14 = __commonJS({ } else if (status) { status.set = "update"; } + if (this.#hasOnInsert) { + this.onInsert?.(v, k, v === oldVal ? "update" : "replace"); + } } if (ttl !== 0 && !this.#ttls) { this.#initializeTTLTracking(); @@ -88125,14 +91426,14 @@ var require_commonjs14 = __commonJS({ pop() { try { while (this.#size) { - const val2 = this.#valList[this.#head]; + const val = this.#valList[this.#head]; this.#evict(true); - if (this.#isBackgroundFetch(val2)) { - if (val2.__staleWhileFetching) { - return val2.__staleWhileFetching; + if (this.#isBackgroundFetch(val)) { + if (val.__staleWhileFetching) { + return val.__staleWhileFetching; } - } else if (val2 !== void 0) { - return val2; + } else if (val !== void 0) { + return val; } } } finally { @@ -88623,10 +91924,10 @@ var require_commonjs14 = __commonJS({ }); // node_modules/minipass/dist/commonjs/index.js -var require_commonjs15 = __commonJS({ +var require_commonjs22 = __commonJS({ "node_modules/minipass/dist/commonjs/index.js"(exports2) { "use strict"; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -88636,7 +91937,7 @@ var require_commonjs15 = __commonJS({ stderr: null }; var node_events_1 = require("node:events"); - var node_stream_1 = __importDefault4(require("node:stream")); + var node_stream_1 = __importDefault2(require("node:stream")); var node_string_decoder_1 = require("node:string_decoder"); var isStream = (s) => !!s && typeof s === "object" && (s instanceof Minipass || s instanceof node_stream_1.default || (0, exports2.isReadable)(s) || (0, exports2.isWritable)(s)); exports2.isStream = isStream; @@ -88645,37 +91946,37 @@ var require_commonjs15 = __commonJS({ exports2.isReadable = isReadable; var isWritable = (s) => !!s && typeof s === "object" && s instanceof node_events_1.EventEmitter && typeof s.write === "function" && typeof s.end === "function"; exports2.isWritable = isWritable; - var EOF = Symbol("EOF"); - var MAYBE_EMIT_END = Symbol("maybeEmitEnd"); - var EMITTED_END = Symbol("emittedEnd"); - var EMITTING_END = Symbol("emittingEnd"); - var EMITTED_ERROR = Symbol("emittedError"); - var CLOSED = Symbol("closed"); - var READ = Symbol("read"); - var FLUSH = Symbol("flush"); - var FLUSHCHUNK = Symbol("flushChunk"); - var ENCODING = Symbol("encoding"); - var DECODER = Symbol("decoder"); - var FLOWING = Symbol("flowing"); - var PAUSED = Symbol("paused"); - var RESUME = Symbol("resume"); - var BUFFER = Symbol("buffer"); - var PIPES = Symbol("pipes"); - var BUFFERLENGTH = Symbol("bufferLength"); - var BUFFERPUSH = Symbol("bufferPush"); - var BUFFERSHIFT = Symbol("bufferShift"); - var OBJECTMODE = Symbol("objectMode"); - var DESTROYED = Symbol("destroyed"); - var ERROR = Symbol("error"); - var EMITDATA = Symbol("emitData"); - var EMITEND = Symbol("emitEnd"); - var EMITEND2 = Symbol("emitEnd2"); - var ASYNC = Symbol("async"); - var ABORT = Symbol("abort"); - var ABORTED = Symbol("aborted"); - var SIGNAL = Symbol("signal"); - var DATALISTENERS = Symbol("dataListeners"); - var DISCARDED = Symbol("discarded"); + var EOF = /* @__PURE__ */ Symbol("EOF"); + var MAYBE_EMIT_END = /* @__PURE__ */ Symbol("maybeEmitEnd"); + var EMITTED_END = /* @__PURE__ */ Symbol("emittedEnd"); + var EMITTING_END = /* @__PURE__ */ Symbol("emittingEnd"); + var EMITTED_ERROR = /* @__PURE__ */ Symbol("emittedError"); + var CLOSED = /* @__PURE__ */ Symbol("closed"); + var READ = /* @__PURE__ */ Symbol("read"); + var FLUSH = /* @__PURE__ */ Symbol("flush"); + var FLUSHCHUNK = /* @__PURE__ */ Symbol("flushChunk"); + var ENCODING = /* @__PURE__ */ Symbol("encoding"); + var DECODER = /* @__PURE__ */ Symbol("decoder"); + var FLOWING = /* @__PURE__ */ Symbol("flowing"); + var PAUSED = /* @__PURE__ */ Symbol("paused"); + var RESUME = /* @__PURE__ */ Symbol("resume"); + var BUFFER = /* @__PURE__ */ Symbol("buffer"); + var PIPES = /* @__PURE__ */ Symbol("pipes"); + var BUFFERLENGTH = /* @__PURE__ */ Symbol("bufferLength"); + var BUFFERPUSH = /* @__PURE__ */ Symbol("bufferPush"); + var BUFFERSHIFT = /* @__PURE__ */ Symbol("bufferShift"); + var OBJECTMODE = /* @__PURE__ */ Symbol("objectMode"); + var DESTROYED = /* @__PURE__ */ Symbol("destroyed"); + var ERROR = /* @__PURE__ */ Symbol("error"); + var EMITDATA = /* @__PURE__ */ Symbol("emitData"); + var EMITEND = /* @__PURE__ */ Symbol("emitEnd"); + var EMITEND2 = /* @__PURE__ */ Symbol("emitEnd2"); + var ASYNC = /* @__PURE__ */ Symbol("async"); + var ABORT = /* @__PURE__ */ Symbol("abort"); + var ABORTED = /* @__PURE__ */ Symbol("aborted"); + var SIGNAL = /* @__PURE__ */ Symbol("signal"); + var DATALISTENERS = /* @__PURE__ */ Symbol("dataListeners"); + var DISCARDED = /* @__PURE__ */ Symbol("discarded"); var defer = (fn) => Promise.resolve().then(fn); var nodefer = (fn) => fn(); var isEndish = (ev) => ev === "end" || ev === "finish" || ev === "prefinish"; @@ -89514,11 +92815,11 @@ var require_commonjs15 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js -var require_commonjs16 = __commonJS({ - "node_modules/archiver-utils/node_modules/path-scurry/dist/commonjs/index.js"(exports2) { +// node_modules/path-scurry/dist/commonjs/index.js +var require_commonjs23 = __commonJS({ + "node_modules/path-scurry/dist/commonjs/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -89531,30 +92832,30 @@ var require_commonjs16 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.PathScurry = exports2.Path = exports2.PathScurryDarwin = exports2.PathScurryPosix = exports2.PathScurryWin32 = exports2.PathScurryBase = exports2.PathPosix = exports2.PathWin32 = exports2.PathBase = exports2.ChildrenCache = exports2.ResolveCache = void 0; - var lru_cache_1 = require_commonjs14(); + var lru_cache_1 = require_commonjs21(); var node_path_1 = require("node:path"); var node_url_1 = require("node:url"); var fs_1 = require("fs"); - var actualFS = __importStar4(require("node:fs")); + var actualFS = __importStar2(require("node:fs")); var realpathSync = fs_1.realpathSync.native; var promises_1 = require("node:fs/promises"); - var minipass_1 = require_commonjs15(); + var minipass_1 = require_commonjs22(); var defaultFS = { lstatSync: fs_1.lstatSync, readdir: fs_1.readdir, @@ -89632,7 +92933,7 @@ var require_commonjs16 = __commonJS({ } }; exports2.ChildrenCache = ChildrenCache; - var setAsCwd = Symbol("PathScurry setAsCwd"); + var setAsCwd = /* @__PURE__ */ Symbol("PathScurry setAsCwd"); var PathBase = class { /** * the basename of this path @@ -89769,6 +93070,8 @@ var require_commonjs16 = __commonJS({ /** * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively, * this property refers to the *parent* path, not the path object itself. + * + * @deprecated */ get path() { return this.parentPath; @@ -89818,12 +93121,12 @@ var require_commonjs16 = __commonJS({ /** * Get the Path object referenced by the string path, resolved from this Path */ - resolve(path2) { - if (!path2) { + resolve(path3) { + if (!path3) { return this; } - const rootPath = this.getRootString(path2); - const dir = path2.substring(rootPath.length); + const rootPath = this.getRootString(path3); + const dir = path3.substring(rootPath.length); const dirParts = dir.split(this.splitSep); const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts); return result; @@ -90576,8 +93879,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - getRootString(path2) { - return node_path_1.win32.parse(path2).root; + getRootString(path3) { + return node_path_1.win32.parse(path3).root; } /** * @internal @@ -90624,8 +93927,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - getRootString(path2) { - return path2.startsWith("/") ? "/" : ""; + getRootString(path3) { + return path3.startsWith("/") ? "/" : ""; } /** * @internal @@ -90675,8 +93978,8 @@ var require_commonjs16 = __commonJS({ * * @internal */ - constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs: fs2 = defaultFS } = {}) { - this.#fs = fsFromOption(fs2); + constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs: fs3 = defaultFS } = {}) { + this.#fs = fsFromOption(fs3); if (cwd instanceof URL || cwd.startsWith("file://")) { cwd = (0, node_url_1.fileURLToPath)(cwd); } @@ -90715,11 +94018,11 @@ var require_commonjs16 = __commonJS({ /** * Get the depth of a provided path, string, or the cwd */ - depth(path2 = this.cwd) { - if (typeof path2 === "string") { - path2 = this.cwd.resolve(path2); + depth(path3 = this.cwd) { + if (typeof path3 === "string") { + path3 = this.cwd.resolve(path3); } - return path2.depth(); + return path3.depth(); } /** * Return the cache of child entries. Exposed so subclasses can create @@ -91206,9 +94509,9 @@ var require_commonjs16 = __commonJS({ process2(); return results; } - chdir(path2 = this.cwd) { + chdir(path3 = this.cwd) { const oldCwd = this.cwd; - this.cwd = typeof path2 === "string" ? this.cwd.resolve(path2) : path2; + this.cwd = typeof path3 === "string" ? this.cwd.resolve(path3) : path3; this.cwd[setAsCwd](oldCwd); } }; @@ -91235,8 +94538,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - newRoot(fs2) { - return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs2 }); + newRoot(fs3) { + return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs3 }); } /** * Return true if the provided path string is an absolute path @@ -91265,8 +94568,8 @@ var require_commonjs16 = __commonJS({ /** * @internal */ - newRoot(fs2) { - return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs2 }); + newRoot(fs3) { + return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs3 }); } /** * Return true if the provided path string is an absolute path @@ -91288,13 +94591,13 @@ var require_commonjs16 = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/pattern.js +// node_modules/glob/dist/commonjs/pattern.js var require_pattern = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/pattern.js"(exports2) { + "node_modules/glob/dist/commonjs/pattern.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Pattern = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var isPatternList = (pl) => pl.length >= 1; var isGlobList = (gl) => gl.length >= 1; var Pattern = class _Pattern { @@ -91462,13 +94765,13 @@ var require_pattern = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/ignore.js +// node_modules/glob/dist/commonjs/ignore.js var require_ignore = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/ignore.js"(exports2) { + "node_modules/glob/dist/commonjs/ignore.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Ignore = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var pattern_js_1 = require_pattern(); var defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux"; var Ignore = class { @@ -91559,13 +94862,13 @@ var require_ignore = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/processor.js +// node_modules/glob/dist/commonjs/processor.js var require_processor = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/processor.js"(exports2) { + "node_modules/glob/dist/commonjs/processor.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Processor = exports2.SubWalks = exports2.MatchRecord = exports2.HasWalkedCache = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var HasWalkedCache = class _HasWalkedCache { store; constructor(store = /* @__PURE__ */ new Map()) { @@ -91596,8 +94899,8 @@ var require_processor = __commonJS({ } // match, absolute, ifdir entries() { - return [...this.store.entries()].map(([path2, n]) => [ - path2, + return [...this.store.entries()].map(([path3, n]) => [ + path3, !!(n & 2), !!(n & 1) ]); @@ -91792,13 +95095,13 @@ var require_processor = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/walker.js +// node_modules/glob/dist/commonjs/walker.js var require_walker = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/walker.js"(exports2) { + "node_modules/glob/dist/commonjs/walker.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.GlobStream = exports2.GlobWalker = exports2.GlobUtil = void 0; - var minipass_1 = require_commonjs15(); + var minipass_1 = require_commonjs22(); var ignore_js_1 = require_ignore(); var processor_js_1 = require_processor(); var makeIgnore = (ignore, opts) => typeof ignore === "string" ? new ignore_js_1.Ignore([ignore], opts) : Array.isArray(ignore) ? new ignore_js_1.Ignore(ignore, opts) : ignore; @@ -91815,9 +95118,9 @@ var require_walker = __commonJS({ signal; maxDepth; includeChildMatches; - constructor(patterns, path2, opts) { + constructor(patterns, path3, opts) { this.patterns = patterns; - this.path = path2; + this.path = path3; this.opts = opts; this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/"; this.includeChildMatches = opts.includeChildMatches !== false; @@ -91836,11 +95139,11 @@ var require_walker = __commonJS({ }); } } - #ignored(path2) { - return this.seen.has(path2) || !!this.#ignore?.ignored?.(path2); + #ignored(path3) { + return this.seen.has(path3) || !!this.#ignore?.ignored?.(path3); } - #childrenIgnored(path2) { - return !!this.#ignore?.childrenIgnored?.(path2); + #childrenIgnored(path3) { + return !!this.#ignore?.childrenIgnored?.(path3); } // backpressure mechanism pause() { @@ -92056,8 +95359,8 @@ var require_walker = __commonJS({ exports2.GlobUtil = GlobUtil; var GlobWalker = class extends GlobUtil { matches = /* @__PURE__ */ new Set(); - constructor(patterns, path2, opts) { - super(patterns, path2, opts); + constructor(patterns, path3, opts) { + super(patterns, path3, opts); } matchEmit(e) { this.matches.add(e); @@ -92095,8 +95398,8 @@ var require_walker = __commonJS({ exports2.GlobWalker = GlobWalker; var GlobStream = class extends GlobUtil { results; - constructor(patterns, path2, opts) { - super(patterns, path2, opts); + constructor(patterns, path3, opts) { + super(patterns, path3, opts); this.results = new minipass_1.Minipass({ signal: this.signal, objectMode: true @@ -92132,15 +95435,15 @@ var require_walker = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/glob.js +// node_modules/glob/dist/commonjs/glob.js var require_glob = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/glob.js"(exports2) { + "node_modules/glob/dist/commonjs/glob.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.Glob = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var node_url_1 = require("node:url"); - var path_scurry_1 = require_commonjs16(); + var path_scurry_1 = require_commonjs23(); var pattern_js_1 = require_pattern(); var walker_js_1 = require_walker(); var defaultPlatform = typeof process === "object" && process && typeof process.platform === "string" ? process.platform : "linux"; @@ -92345,13 +95648,13 @@ var require_glob = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/has-magic.js +// node_modules/glob/dist/commonjs/has-magic.js var require_has_magic = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/has-magic.js"(exports2) { + "node_modules/glob/dist/commonjs/has-magic.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.hasMagic = void 0; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var hasMagic = (pattern, options = {}) => { if (!Array.isArray(pattern)) { pattern = [pattern]; @@ -92366,9 +95669,9 @@ var require_has_magic = __commonJS({ } }); -// node_modules/archiver-utils/node_modules/glob/dist/commonjs/index.js -var require_commonjs17 = __commonJS({ - "node_modules/archiver-utils/node_modules/glob/dist/commonjs/index.js"(exports2) { +// node_modules/glob/dist/commonjs/index.js +var require_commonjs24 = __commonJS({ + "node_modules/glob/dist/commonjs/index.js"(exports2) { "use strict"; 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; @@ -92377,10 +95680,10 @@ var require_commonjs17 = __commonJS({ exports2.globSync = globSync; exports2.globIterateSync = globIterateSync; exports2.globIterate = globIterate; - var minimatch_1 = require_commonjs13(); + var minimatch_1 = require_commonjs20(); var glob_js_1 = require_glob(); var has_magic_js_1 = require_has_magic(); - var minimatch_2 = require_commonjs13(); + var minimatch_2 = require_commonjs20(); Object.defineProperty(exports2, "escape", { enumerable: true, get: function() { return minimatch_2.escape; } }); @@ -92451,13 +95754,13 @@ var require_commonjs17 = __commonJS({ // node_modules/archiver-utils/file.js var require_file3 = __commonJS({ "node_modules/archiver-utils/file.js"(exports2, module2) { - var fs2 = require_graceful_fs(); - var path2 = require("path"); + var fs3 = require_graceful_fs(); + var path3 = require("path"); var flatten = require_flatten(); var difference = require_difference(); var union = require_union(); var isPlainObject = require_isPlainObject(); - var glob2 = require_commonjs17(); + var glob2 = require_commonjs24(); var file = module2.exports = {}; var pathSeparatorRe = /[\/\\]/g; var processPatterns = function(patterns, fn) { @@ -92477,8 +95780,8 @@ var require_file3 = __commonJS({ return result; }; file.exists = function() { - var filepath = path2.join.apply(path2, arguments); - return fs2.existsSync(filepath); + var filepath = path3.join.apply(path3, arguments); + return fs3.existsSync(filepath); }; file.expand = function(...args) { var options = isPlainObject(args[0]) ? args.shift() : {}; @@ -92491,12 +95794,12 @@ var require_file3 = __commonJS({ }); if (options.filter) { matches = matches.filter(function(filepath) { - filepath = path2.join(options.cwd || "", filepath); + filepath = path3.join(options.cwd || "", filepath); try { if (typeof options.filter === "function") { return options.filter(filepath); } else { - return fs2.statSync(filepath)[options.filter](); + return fs3.statSync(filepath)[options.filter](); } } catch (e) { return false; @@ -92508,7 +95811,7 @@ var require_file3 = __commonJS({ file.expandMapping = function(patterns, destBase, options) { options = Object.assign({ rename: function(destBase2, destPath) { - return path2.join(destBase2 || "", destPath); + return path3.join(destBase2 || "", destPath); } }, options); var files = []; @@ -92516,14 +95819,14 @@ var require_file3 = __commonJS({ file.expand(options, patterns).forEach(function(src) { var destPath = src; if (options.flatten) { - destPath = path2.basename(destPath); + destPath = path3.basename(destPath); } if (options.ext) { destPath = destPath.replace(/(\.[^\/]*)?$/, options.ext); } var dest = options.rename(destBase, destPath, options); if (options.cwd) { - src = path2.join(options.cwd, src); + src = path3.join(options.cwd, src); } dest = dest.replace(pathSeparatorRe, "/"); src = src.replace(pathSeparatorRe, "/"); @@ -92604,8 +95907,8 @@ var require_file3 = __commonJS({ // node_modules/archiver-utils/index.js var require_archiver_utils = __commonJS({ "node_modules/archiver-utils/index.js"(exports2, module2) { - var fs2 = require_graceful_fs(); - var path2 = require("path"); + var fs3 = require_graceful_fs(); + var path3 = require("path"); var isStream = require_is_stream(); var lazystream = require_lazystream(); var normalizePath = require_normalize_path(); @@ -92653,7 +95956,7 @@ var require_archiver_utils = __commonJS({ }; utils.lazyReadStream = function(filepath) { return new lazystream.Readable(function() { - return fs2.createReadStream(filepath); + return fs3.createReadStream(filepath); }); }; utils.normalizeInputSource = function(source) { @@ -92681,7 +95984,7 @@ var require_archiver_utils = __commonJS({ callback = base; base = dirpath; } - fs2.readdir(dirpath, function(err, list) { + fs3.readdir(dirpath, function(err, list) { var i = 0; var file; var filepath; @@ -92693,11 +95996,11 @@ var require_archiver_utils = __commonJS({ if (!file) { return callback(null, results); } - filepath = path2.join(dirpath, file); - fs2.stat(filepath, function(err2, stats) { + filepath = path3.join(dirpath, file); + fs3.stat(filepath, function(err2, stats) { results.push({ path: filepath, - relative: path2.relative(base, filepath).replace(/\\/g, "/"), + relative: path3.relative(base, filepath).replace(/\\/g, "/"), stats }); if (stats && stats.isDirectory()) { @@ -92721,7 +96024,7 @@ var require_archiver_utils = __commonJS({ }); // node_modules/archiver/lib/error.js -var require_error2 = __commonJS({ +var require_error3 = __commonJS({ "node_modules/archiver/lib/error.js"(exports2, module2) { var util = require("util"); var ERROR_CODES = { @@ -92756,13 +96059,13 @@ var require_error2 = __commonJS({ // node_modules/archiver/lib/core.js var require_core2 = __commonJS({ "node_modules/archiver/lib/core.js"(exports2, module2) { - var fs2 = require("fs"); + var fs3 = require("fs"); var glob2 = require_readdir_glob(); var async = require_async(); - var path2 = require("path"); + var path3 = require("path"); var util = require_archiver_utils(); var inherits = require("util").inherits; - var ArchiverError = require_error2(); + var ArchiverError = require_error3(); var Transform = require_ours().Transform; var win32 = process.platform === "win32"; var Archiver = function(format, options) { @@ -92820,7 +96123,7 @@ var require_core2 = __commonJS({ data.sourcePath = filepath; task.data = data; this._entriesCount++; - if (data.stats && data.stats instanceof fs2.Stats) { + if (data.stats && data.stats instanceof fs3.Stats) { task = this._updateQueueTaskWithStats(task, data.stats); if (task) { if (data.stats.size) { @@ -92991,7 +96294,7 @@ var require_core2 = __commonJS({ callback(); return; } - fs2.lstat(task.filepath, function(err, stats) { + fs3.lstat(task.filepath, function(err, stats) { if (this._state.aborted) { setImmediate(callback); return; @@ -93034,10 +96337,10 @@ var require_core2 = __commonJS({ task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) { - var linkPath = fs2.readlinkSync(task.filepath); - var dirName = path2.dirname(task.filepath); + var linkPath = fs3.readlinkSync(task.filepath); + var dirName = path3.dirname(task.filepath); task.data.type = "symlink"; - task.data.linkname = path2.relative(dirName, path2.resolve(dirName, linkPath)); + task.data.linkname = path3.relative(dirName, path3.resolve(dirName, linkPath)); task.data.sourceType = "buffer"; task.source = Buffer.concat([]); } else { @@ -93305,7 +96608,7 @@ var require_archive_entry = __commonJS({ }); // node_modules/compress-commons/lib/archivers/zip/util.js -var require_util13 = __commonJS({ +var require_util12 = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/util.js"(exports2, module2) { var util = module2.exports = {}; util.dateToDos = function(d, forceLocalTime) { @@ -93316,7 +96619,7 @@ var require_util13 = __commonJS({ } else if (year >= 2044) { return 2141175677; } - var val2 = { + var val = { year, month: forceLocalTime ? d.getMonth() : d.getUTCMonth(), date: forceLocalTime ? d.getDate() : d.getUTCDate(), @@ -93324,7 +96627,7 @@ var require_util13 = __commonJS({ minutes: forceLocalTime ? d.getMinutes() : d.getUTCMinutes(), seconds: forceLocalTime ? d.getSeconds() : d.getUTCSeconds() }; - return val2.year - 1980 << 25 | val2.month + 1 << 21 | val2.date << 16 | val2.hours << 11 | val2.minutes << 5 | val2.seconds / 2; + return val.year - 1980 << 25 | val.month + 1 << 21 | val.date << 16 | val.hours << 11 | val.minutes << 5 | val.seconds / 2; }; util.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); @@ -93363,7 +96666,7 @@ var require_util13 = __commonJS({ // node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js var require_general_purpose_bit = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/general-purpose-bit.js"(exports2, module2) { - var zipUtil = require_util13(); + var zipUtil = require_util12(); var DATA_DESCRIPTOR_FLAG = 1 << 3; var ENCRYPTION_FLAG = 1 << 0; var NUMBER_OF_SHANNON_FANO_TREES_FLAG = 1 << 2; @@ -93490,7 +96793,7 @@ var require_unix_stat = __commonJS({ }); // node_modules/compress-commons/lib/archivers/zip/constants.js -var require_constants8 = __commonJS({ +var require_constants12 = __commonJS({ "node_modules/compress-commons/lib/archivers/zip/constants.js"(exports2, module2) { module2.exports = { WORD: 4, @@ -93574,8 +96877,8 @@ var require_zip_archive_entry = __commonJS({ var ArchiveEntry = require_archive_entry(); var GeneralPurposeBit = require_general_purpose_bit(); var UnixStat = require_unix_stat(); - var constants = require_constants8(); - var zipUtil = require_util13(); + var constants = require_constants12(); + var zipUtil = require_util12(); var ZipArchiveEntry = module2.exports = function(name) { if (!(this instanceof ZipArchiveEntry)) { return new ZipArchiveEntry(name); @@ -93755,7 +97058,7 @@ var require_is_stream2 = __commonJS({ }); // node_modules/compress-commons/lib/util/index.js -var require_util14 = __commonJS({ +var require_util13 = __commonJS({ "node_modules/compress-commons/lib/util/index.js"(exports2, module2) { var Stream = require("stream").Stream; var PassThrough = require_ours().PassThrough; @@ -93783,7 +97086,7 @@ var require_archive_output_stream = __commonJS({ var isStream = require_is_stream2(); var Transform = require_ours().Transform; var ArchiveEntry = require_archive_entry(); - var util = require_util14(); + var util = require_util13(); var ArchiveOutputStream = module2.exports = function(options) { if (!(this instanceof ArchiveOutputStream)) { return new ArchiveOutputStream(options); @@ -93962,1625 +97265,2434 @@ var require_crc32 = __commonJS({ } }); -// node_modules/crc32-stream/lib/crc32-stream.js -var require_crc32_stream = __commonJS({ - "node_modules/crc32-stream/lib/crc32-stream.js"(exports2, module2) { - "use strict"; - var { Transform } = require_ours(); - var crc32 = require_crc32(); - var CRC32Stream = class extends Transform { - constructor(options) { - super(options); - this.checksum = Buffer.allocUnsafe(4); - this.checksum.writeInt32BE(0, 0); - this.rawSize = 0; +// node_modules/crc32-stream/lib/crc32-stream.js +var require_crc32_stream = __commonJS({ + "node_modules/crc32-stream/lib/crc32-stream.js"(exports2, module2) { + "use strict"; + var { Transform } = require_ours(); + var crc32 = require_crc32(); + var CRC32Stream = class extends 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 = crc32.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 = CRC32Stream; + } +}); + +// node_modules/crc32-stream/lib/deflate-crc32-stream.js +var require_deflate_crc32_stream = __commonJS({ + "node_modules/crc32-stream/lib/deflate-crc32-stream.js"(exports2, module2) { + "use strict"; + var { DeflateRaw } = require("zlib"); + var crc32 = require_crc32(); + var DeflateCRC32Stream = class extends 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 = crc32.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 = DeflateCRC32Stream; + } +}); + +// node_modules/crc32-stream/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/crc32-stream/lib/index.js"(exports2, module2) { + "use strict"; + module2.exports = { + CRC32Stream: require_crc32_stream(), + DeflateCRC32Stream: require_deflate_crc32_stream() + }; + } +}); + +// node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js +var require_zip_archive_output_stream = __commonJS({ + "node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js"(exports2, module2) { + var inherits = require("util").inherits; + var crc32 = require_crc32(); + var { CRC32Stream } = require_lib3(); + var { DeflateCRC32Stream } = require_lib3(); + var ArchiveOutputStream = require_archive_output_stream(); + var ZipArchiveEntry = require_zip_archive_entry(); + var GeneralPurposeBit = require_general_purpose_bit(); + var constants = require_constants12(); + var util = require_util13(); + var zipUtil = require_util12(); + var ZipArchiveOutputStream = module2.exports = function(options) { + if (!(this instanceof ZipArchiveOutputStream)) { + return new ZipArchiveOutputStream(options); + } + options = this.options = this._defaults(options); + ArchiveOutputStream.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(ZipArchiveOutputStream, ArchiveOutputStream); + ZipArchiveOutputStream.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(); + } + }; + ZipArchiveOutputStream.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(crc32.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; + } + }; + ZipArchiveOutputStream.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); + }; + ZipArchiveOutputStream.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; + }; + ZipArchiveOutputStream.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(); + }; + ZipArchiveOutputStream.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 + }; + }; + ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { + var deflate = ae.getMethod() === constants.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; + }; + ZipArchiveOutputStream.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); + }; + ZipArchiveOutputStream.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)); + }; + ZipArchiveOutputStream.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); + }; + ZipArchiveOutputStream.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())); + } + }; + ZipArchiveOutputStream.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; + }; + ZipArchiveOutputStream.prototype.getComment = function(comment) { + return this._archive.comment !== null ? this._archive.comment : ""; + }; + ZipArchiveOutputStream.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; + }; + ZipArchiveOutputStream.prototype.setComment = function(comment) { + this._archive.comment = comment; + }; + } +}); + +// node_modules/compress-commons/lib/compress-commons.js +var require_compress_commons = __commonJS({ + "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/zip-stream/index.js +var require_zip_stream = __commonJS({ + "node_modules/zip-stream/index.js"(exports2, module2) { + var inherits = require("util").inherits; + var ZipArchiveOutputStream = require_compress_commons().ZipArchiveOutputStream; + var ZipArchiveEntry = require_compress_commons().ZipArchiveEntry; + var util = require_archiver_utils(); + var ZipStream = module2.exports = function(options) { + if (!(this instanceof ZipStream)) { + return new ZipStream(options); } - _transform(chunk, encoding, callback) { - if (chunk) { - this.checksum = crc32.buf(chunk, this.checksum) >>> 0; - this.rawSize += chunk.length; - } - callback(null, chunk); + options = this.options = options || {}; + options.zlib = options.zlib || {}; + ZipArchiveOutputStream.call(this, options); + if (typeof options.level === "number" && options.level >= 0) { + options.zlib.level = options.level; + delete options.level; } - digest(encoding) { - const checksum = Buffer.allocUnsafe(4); - checksum.writeUInt32BE(this.checksum >>> 0, 0); - return encoding ? checksum.toString(encoding) : checksum; + if (!options.forceZip64 && typeof options.zlib.level === "number" && options.zlib.level === 0) { + options.store = true; } - hex() { - return this.digest("hex").toUpperCase(); + options.namePrependSlash = options.namePrependSlash || false; + if (options.comment && options.comment.length > 0) { + this.setComment(options.comment); } - size() { - return this.rawSize; + }; + inherits(ZipStream, ZipArchiveOutputStream); + ZipStream.prototype._normalizeFileData = function(data) { + data = util.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 = util.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 = util.dateify(data.date); + return data; }; - module2.exports = CRC32Stream; - } -}); - -// node_modules/crc32-stream/lib/deflate-crc32-stream.js -var require_deflate_crc32_stream = __commonJS({ - "node_modules/crc32-stream/lib/deflate-crc32-stream.js"(exports2, module2) { - "use strict"; - var { DeflateRaw } = require("zlib"); - var crc32 = require_crc32(); - var DeflateCRC32Stream = class extends DeflateRaw { - constructor(options) { - super(options); - this.checksum = Buffer.allocUnsafe(4); - this.checksum.writeInt32BE(0, 0); - this.rawSize = 0; - this.compressedSize = 0; + ZipStream.prototype.entry = function(source, data, callback) { + if (typeof callback !== "function") { + callback = this._emitErrorCallback.bind(this); } - push(chunk, encoding) { - if (chunk) { - this.compressedSize += chunk.length; - } - return super.push(chunk, encoding); + data = this._normalizeFileData(data); + if (data.type !== "file" && data.type !== "directory" && data.type !== "symlink") { + callback(new Error(data.type + " entries not currently supported")); + return; } - _transform(chunk, encoding, callback) { - if (chunk) { - this.checksum = crc32.buf(chunk, this.checksum) >>> 0; - this.rawSize += chunk.length; - } - super._transform(chunk, encoding, callback); + if (typeof data.name !== "string" || data.name.length === 0) { + callback(new Error("entry name must be a non-empty string value")); + return; } - digest(encoding) { - const checksum = Buffer.allocUnsafe(4); - checksum.writeUInt32BE(this.checksum >>> 0, 0); - return encoding ? checksum.toString(encoding) : checksum; + 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; } - hex() { - return this.digest("hex").toUpperCase(); + var entry = new ZipArchiveEntry(data.name); + entry.setTime(data.date, this.options.forceLocalTime); + if (data.namePrependSlash) { + entry.setName(data.name, true); } - size(compressed = false) { - if (compressed) { - return this.compressedSize; - } else { - return this.rawSize; + 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 ZipArchiveOutputStream.prototype.entry.call(this, entry, source, callback); }; - module2.exports = DeflateCRC32Stream; - } -}); - -// node_modules/crc32-stream/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/crc32-stream/lib/index.js"(exports2, module2) { - "use strict"; - module2.exports = { - CRC32Stream: require_crc32_stream(), - DeflateCRC32Stream: require_deflate_crc32_stream() + ZipStream.prototype.finalize = function() { + this.finish(); }; } }); -// node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js -var require_zip_archive_output_stream = __commonJS({ - "node_modules/compress-commons/lib/archivers/zip/zip-archive-output-stream.js"(exports2, module2) { - var inherits = require("util").inherits; - var crc32 = require_crc32(); - var { CRC32Stream } = require_lib4(); - var { DeflateCRC32Stream } = require_lib4(); - var ArchiveOutputStream = require_archive_output_stream(); - var ZipArchiveEntry = require_zip_archive_entry(); - var GeneralPurposeBit = require_general_purpose_bit(); - var constants = require_constants8(); - var util = require_util14(); - var zipUtil = require_util13(); - var ZipArchiveOutputStream = module2.exports = function(options) { - if (!(this instanceof ZipArchiveOutputStream)) { - return new ZipArchiveOutputStream(options); +// node_modules/archiver/lib/plugins/zip.js +var require_zip = __commonJS({ + "node_modules/archiver/lib/plugins/zip.js"(exports2, module2) { + var engine = require_zip_stream(); + var util = require_archiver_utils(); + var Zip = function(options) { + if (!(this instanceof Zip)) { + return new Zip(options); } - options = this.options = this._defaults(options); - ArchiveOutputStream.call(this, options); - this._entry = null; - this._entries = []; - this._archive = { - centralLength: 0, - centralOffset: 0, + options = this.options = util.defaults(options, { comment: "", - finish: false, - finished: false, - processing: false, - forceZip64: options.forceZip64, - forceLocalTime: options.forceLocalTime + forceUTC: false, + namePrependSlash: false, + store: false + }); + this.supports = { + directory: true, + symlink: true }; + this.engine = new engine(options); }; - inherits(ZipArchiveOutputStream, ArchiveOutputStream); - ZipArchiveOutputStream.prototype._afterAppend = function(ae) { - this._entries.push(ae); - if (ae.getGeneralPurposeBit().usesDataDescriptor()) { - this._writeDataDescriptor(ae); + Zip.prototype.append = function(source, data, callback) { + this.engine.entry(source, data, callback); + }; + Zip.prototype.finalize = function() { + this.engine.finalize(); + }; + Zip.prototype.on = function() { + return this.engine.on.apply(this.engine, arguments); + }; + Zip.prototype.pipe = function() { + return this.engine.pipe.apply(this.engine, arguments); + }; + Zip.prototype.unpipe = function() { + return this.engine.unpipe.apply(this.engine, arguments); + }; + module2.exports = Zip; + } +}); + +// 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; } - this._archive.processing = false; - this._entry = null; - if (this._archive.finish && !this._archive.finished) { - this._finish(); + clear() { + this.top = this.btm = 0; + this.next = null; + this.buffer.fill(void 0); } - }; - ZipArchiveOutputStream.prototype._appendBuffer = function(ae, source, callback) { - if (source.length === 0) { - ae.setMethod(constants.METHOD_STORED); + 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; } - var method = ae.getMethod(); - if (method === constants.METHOD_STORED) { - ae.setSize(source.length); - ae.setCompressedSize(source.length); - ae.setCrc(crc32.buf(source) >>> 0); + 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; } - 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; + peek() { + return this.buffer[this.btm]; + } + isEmpty() { + return this.buffer[this.btm] === void 0; } }; - ZipArchiveOutputStream.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); - }; - ZipArchiveOutputStream.prototype._defaults = function(o) { - if (typeof o !== "object") { - o = {}; + } +}); + +// 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; } - if (typeof o.zlib !== "object") { - o.zlib = {}; + clear() { + this.head = this.tail; + this.head.clear(); + this.length = 0; } - if (typeof o.zlib.level !== "number") { - o.zlib.level = constants.ZLIB_BEST_SPEED; + 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); + } } - o.forceZip64 = !!o.forceZip64; - o.forceLocalTime = !!o.forceLocalTime; - return o; + 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(string, encoding) { + return Buffer.byteLength(string, encoding); + } + function compare2(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 equals(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, string, offset, length, encoding) { + return toBuffer(buffer).write(string, 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: compare2, + concat, + copy, + equals, + 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 }; - ZipArchiveOutputStream.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(); + } +}); + +// 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; } - this._writeCentralDirectoryEnd(); - this._archive.processing = false; - this._archive.finish = true; - this._archive.finished = true; - this.end(); - }; - ZipArchiveOutputStream.prototype._normalizeEntry = function(ae) { - if (ae.getMethod() === -1) { - ae.setMethod(constants.METHOD_DEFLATED); + get remaining() { + return 0; } - if (ae.getMethod() === constants.METHOD_DEFLATED) { - ae.getGeneralPurposeBit().useDataDescriptor(true); - ae.setVersionNeededToExtract(constants.MIN_VERSION_DATA_DESCRIPTOR); + decode(tail) { + return b4a.toString(tail, this.encoding); } - if (ae.getTime() === -1) { - ae.setTime(/* @__PURE__ */ new Date(), this._archive.forceLocalTime); + flush() { + return ""; } - ae._offsets = { - file: 0, - data: 0, - contents: 0 - }; }; - ZipArchiveOutputStream.prototype._smartStream = function(ae, callback) { - var deflate = ae.getMethod() === constants.METHOD_DEFLATED; - var process2 = deflate ? new DeflateCRC32Stream(this.options.zlib) : new CRC32Stream(); - var error4 = 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(error4, ae); + } +}); + +// 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; } - process2.once("end", handleStuff.bind(this)); - process2.once("error", function(err) { - error4 = err; - }); - process2.pipe(this, { end: false }); - return process2; - }; - ZipArchiveOutputStream.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; + get remaining() { + return this.bytesSeen; } - 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); - }; - ZipArchiveOutputStream.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)); - }; - ZipArchiveOutputStream.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); + 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; } - 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); + flush() { + const result = this.bytesNeeded > 0 ? "\uFFFD" : ""; + this.codePoint = 0; + this.bytesNeeded = 0; + this.bytesSeen = 0; + this.lowerBoundary = 128; + this.upperBoundary = 191; + return result; } - 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); }; - ZipArchiveOutputStream.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())); + } +}); + +// 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); + } } - }; - ZipArchiveOutputStream.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); + get remaining() { + return this.decoder.remaining; } - if (gpb.usesUTF8ForNames()) { - name = Buffer.from(name); + push(data) { + if (typeof data === "string") return data; + return this.decoder.decode(data); } - 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())); + // 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; } - this.write(zipUtil.getShortBytes(name.length)); - this.write(zipUtil.getShortBytes(extra.length)); - this.write(name); - this.write(extra); - ae._offsets.contents = this.offset; - }; - ZipArchiveOutputStream.prototype.getComment = function(comment) { - return this._archive.comment !== null ? this._archive.comment : ""; - }; - ZipArchiveOutputStream.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; - }; - ZipArchiveOutputStream.prototype.setComment = function(comment) { - this._archive.comment = comment; - }; - } -}); - -// node_modules/compress-commons/lib/compress-commons.js -var require_compress_commons = __commonJS({ - "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() }; + 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/zip-stream/index.js -var require_zip_stream = __commonJS({ - "node_modules/zip-stream/index.js"(exports2, module2) { - var inherits = require("util").inherits; - var ZipArchiveOutputStream = require_compress_commons().ZipArchiveOutputStream; - var ZipArchiveEntry = require_compress_commons().ZipArchiveEntry; - var util = require_archiver_utils(); - var ZipStream = module2.exports = function(options) { - if (!(this instanceof ZipStream)) { - return new ZipStream(options); - } - options = this.options = options || {}; - options.zlib = options.zlib || {}; - ZipArchiveOutputStream.call(this, options); - if (typeof options.level === "number" && options.level >= 0) { - options.zlib.level = options.level; - delete options.level; +// node_modules/streamx/index.js +var require_streamx = __commonJS({ + "node_modules/streamx/index.js"(exports2, module2) { + var { EventEmitter } = 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(stream, { highWaterMark = 16384, map: map2 = null, mapWritable, byteLength, byteLengthWritable } = {}) { + this.stream = stream; + 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 || map2; + this.afterWrite = afterWrite.bind(this); + this.afterUpdateNextTick = updateWriteNT.bind(this); } - if (!options.forceZip64 && typeof options.zlib.level === "number" && options.zlib.level === 0) { - options.store = true; + get ended() { + return (this.stream._duplexState & WRITE_DONE) !== 0; } - options.namePrependSlash = options.namePrependSlash || false; - if (options.comment && options.comment.length > 0) { - this.setComment(options.comment); + 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; } - }; - inherits(ZipStream, ZipArchiveOutputStream); - ZipStream.prototype._normalizeFileData = function(data) { - data = util.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 = util.sanitizePath(data.name); - if (!isSymlink && data.name.slice(-1) === "/") { - isDir = true; - data.type = "directory"; - } else if (isDir) { - data.name += "/"; + 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 stream = this.stream; + buffer.push(data); + while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) { + buffer.push(stream._writableState.shift()); } + if ((stream._duplexState & OPEN_STATUS) !== 0) return cb(null); + stream._writev(buffer, cb); } - if (isDir || isSymlink) { - data.store = true; + update() { + const stream = this.stream; + stream._duplexState |= WRITE_UPDATING; + do { + while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) { + const data = this.shift(); + stream._duplexState |= WRITE_ACTIVE_AND_WRITING; + stream._write(data, this.afterWrite); + } + if ((stream._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); + } while (this.continueUpdate() === true); + stream._duplexState &= WRITE_NOT_UPDATING; } - data.date = util.dateify(data.date); - return data; - }; - ZipStream.prototype.entry = function(source, data, callback) { - if (typeof callback !== "function") { - callback = this._emitErrorCallback.bind(this); + updateNonPrimary() { + const stream = this.stream; + if ((stream._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) { + stream._duplexState = (stream._duplexState | WRITE_ACTIVE) & WRITE_NOT_FINISHING; + stream._final(afterFinal.bind(this)); + return; + } + if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) { + if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) { + stream._duplexState |= ACTIVE; + stream._destroy(afterDestroy.bind(this)); + } + return; + } + if ((stream._duplexState & IS_OPENING) === OPENING) { + stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING; + stream._open(afterOpen.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; + continueUpdate() { + if ((this.stream._duplexState & WRITE_NEXT_TICK) === 0) return false; + this.stream._duplexState &= WRITE_NOT_NEXT_TICK; + return true; } - if (typeof data.name !== "string" || data.name.length === 0) { - callback(new Error("entry name must be a non-empty string value")); - return; + updateCallback() { + if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) this.update(); + else this.updateNextTick(); } - 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; + 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 entry = new ZipArchiveEntry(data.name); - entry.setTime(data.date, this.options.forceLocalTime); - if (data.namePrependSlash) { - entry.setName(data.name, true); + }; + var ReadableState = class { + constructor(stream, { highWaterMark = 16384, map: map2 = null, mapReadable, byteLength, byteLengthReadable } = {}) { + this.stream = stream; + 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 || map2; + this.pipeTo = null; + this.afterRead = afterRead.bind(this); + this.afterUpdateNextTick = updateReadNT.bind(this); } - if (data.store) { - entry.setMethod(0); + get ended() { + return (this.stream._duplexState & READ_DONE) !== 0; } - if (data.comment.length > 0) { - entry.setComment(data.comment); + 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", noop); + if (isStreamx(pipeTo)) { + pipeTo._writableState.pipeline = this.pipeline; + if (cb) pipeTo.on("error", noop); + 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); } - if (data.type === "symlink" && typeof data.mode !== "number") { - data.mode = 40960; + push(data) { + const stream = this.stream; + if (data === null) { + this.highWaterMark = 0; + stream._duplexState = (stream._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED; + return false; + } + if (this.map !== null) { + data = this.map(data); + if (data === null) { + stream._duplexState &= READ_PUSHED; + return this.buffered < this.highWaterMark; + } + } + this.buffered += this.byteLength(data); + this.queue.push(data); + stream._duplexState = (stream._duplexState | READ_QUEUED) & READ_PUSHED; + return this.buffered < this.highWaterMark; } - if (typeof data.mode === "number") { - if (data.type === "symlink") { - data.mode |= 40960; + 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); } - entry.setUnixMode(data.mode); + this.push(pending[pending.length - 1]); } - if (data.type === "symlink" && typeof data.linkname === "string") { - source = Buffer.from(data.linkname); + read() { + const stream = this.stream; + if ((stream._duplexState & READ_STATUS) === READ_QUEUED) { + const data = this.shift(); + if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED; + if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data); + return data; + } + if (this.readAhead === false) { + stream._duplexState |= READ_READ_AHEAD; + this.updateNextTick(); + } + return null; } - return ZipArchiveOutputStream.prototype.entry.call(this, entry, source, callback); - }; - ZipStream.prototype.finalize = function() { - this.finish(); - }; - } -}); - -// node_modules/archiver/lib/plugins/zip.js -var require_zip = __commonJS({ - "node_modules/archiver/lib/plugins/zip.js"(exports2, module2) { - var engine = require_zip_stream(); - var util = require_archiver_utils(); - var Zip = function(options) { - if (!(this instanceof Zip)) { - return new Zip(options); + drain() { + const stream = this.stream; + while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) { + const data = this.shift(); + if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED; + if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data); + } } - options = this.options = util.defaults(options, { - comment: "", - forceUTC: false, - namePrependSlash: false, - store: false - }); - this.supports = { - directory: true, - symlink: true - }; - this.engine = new engine(options); - }; - Zip.prototype.append = function(source, data, callback) { - this.engine.entry(source, data, callback); - }; - Zip.prototype.finalize = function() { - this.engine.finalize(); - }; - Zip.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); - }; - Zip.prototype.pipe = function() { - return this.engine.pipe.apply(this.engine, arguments); - }; - Zip.prototype.unpipe = function() { - return this.engine.unpipe.apply(this.engine, arguments); - }; - module2.exports = Zip; - } -}); - -// 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; + update() { + const stream = this.stream; + stream._duplexState |= READ_UPDATING; + do { + this.drain(); + while (this.buffered < this.highWaterMark && (stream._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) { + stream._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH; + stream._read(this.afterRead); + this.drain(); + } + if ((stream._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) { + stream._duplexState |= READ_EMITTED_READABLE; + stream.emit("readable"); + } + if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); + } while (this.continueUpdate() === true); + stream._duplexState &= READ_NOT_UPDATING; } - clear() { - this.top = this.btm = 0; - this.next = null; - this.buffer.fill(void 0); + updateNonPrimary() { + const stream = this.stream; + if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) { + stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING; + stream.emit("end"); + if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING; + if (this.pipeTo !== null) this.pipeTo.end(); + } + if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) { + if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) { + stream._duplexState |= ACTIVE; + stream._destroy(afterDestroy.bind(this)); + } + return; + } + if ((stream._duplexState & IS_OPENING) === OPENING) { + stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING; + stream._open(afterOpen.bind(this)); + } } - push(data) { - if (this.buffer[this.top] !== void 0) return false; - this.buffer[this.top] = data; - this.top = this.top + 1 & this.mask; + continueUpdate() { + if ((this.stream._duplexState & READ_NEXT_TICK) === 0) return false; + this.stream._duplexState &= READ_NOT_NEXT_TICK; 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; + updateCallback() { + if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) this.update(); + else this.updateNextTick(); } - peek() { - return this.buffer[this.btm]; + 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); } - isEmpty() { - return this.buffer[this.btm] === void 0; + }; + var TransformState = class { + constructor(stream) { + this.data = null; + this.afterTransform = afterTransform.bind(stream); + this.afterFinal = null; } }; - } -}); - -// 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; + var Pipeline = class { + constructor(src, dst, cb) { + this.from = src; + this.to = dst; + this.afterPipe = cb; + this.error = null; + this.pipeToFinished = false; } - clear() { - this.head = this.tail; - this.head.clear(); - this.length = 0; + finished() { + this.pipeToFinished = true; } - push(val2) { - this.length++; - if (!this.head.push(val2)) { - const prev = this.head; - this.head = prev.next = new FixedFIFO(2 * this.head.buffer.length); - this.head.push(val2); + done(stream, err) { + if (err) this.error = err; + if (stream === 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; + } } - } - shift() { - if (this.length !== 0) this.length--; - const val2 = this.tail.shift(); - if (val2 === void 0 && this.tail.next) { - const next = this.tail.next; - this.tail.next = null; - this.tail = next; - return this.tail.shift(); + if (stream === this.from) { + this.from = null; + if (this.to !== null) { + if ((stream._duplexState & READ_DONE) === 0) { + this.to.destroy(this.error || new Error("Readable stream closed before ending")); + } + return; + } } - return val2; - } - peek() { - const val2 = this.tail.peek(); - if (val2 === void 0 && this.tail.next) return this.tail.next.peek(); - return val2; - } - isEmpty() { - return this.length === 0; + if (this.afterPipe !== null) this.afterPipe(this.error); + this.to = this.from = this.afterPipe = null; } }; - } -}); - -// 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(string, encoding) { - return Buffer.byteLength(string, encoding); - } - function compare2(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 equals(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, string, offset, length, encoding) { - return toBuffer(buffer).write(string, 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 afterDrain() { + this.stream._duplexState |= READ_PIPE_DRAINED; + this.updateCallback(); } - function readUInt32LE(buffer, offset) { - return toBuffer(buffer).readUInt32LE(offset); + function afterFinal(err) { + const stream = this.stream; + if (err) stream.destroy(err); + if ((stream._duplexState & DESTROY_STATUS) === 0) { + stream._duplexState |= WRITE_DONE; + stream.emit("finish"); + } + if ((stream._duplexState & AUTO_DESTROY) === DONE) { + stream._duplexState |= DESTROYING; + } + stream._duplexState &= WRITE_NOT_ACTIVE; + if ((stream._duplexState & WRITE_UPDATING) === 0) this.update(); + else this.updateNextTick(); } - function readInt32LE(buffer, offset) { - return toBuffer(buffer).readInt32LE(offset); + function afterDestroy(err) { + const stream = this.stream; + if (!err && this.error !== STREAM_DESTROYED) err = this.error; + if (err) stream.emit("error", err); + stream._duplexState |= DESTROYED; + stream.emit("close"); + const rs = stream._readableState; + const ws = stream._writableState; + if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream, err); + if (ws !== null) { + while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false); + if (ws.pipeline !== null) ws.pipeline.done(stream, err); + } } - function writeDoubleBE(buffer, value, offset) { - return toBuffer(buffer).writeDoubleBE(value, offset); + function afterWrite(err) { + const stream = this.stream; + if (err) stream.destroy(err); + stream._duplexState &= WRITE_NOT_ACTIVE; + if (this.drains !== null) tickDrains(this.drains); + if ((stream._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) { + stream._duplexState &= WRITE_DRAINED; + if ((stream._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) { + stream.emit("drain"); + } + } + this.updateCallback(); } - function writeFloatBE(buffer, value, offset) { - return toBuffer(buffer).writeFloatBE(value, offset); + 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 writeUInt32BE(buffer, value, offset) { - return toBuffer(buffer).writeUInt32BE(value, offset); + function updateReadNT() { + if ((this.stream._duplexState & READ_UPDATING) === 0) { + this.stream._duplexState &= READ_NOT_NEXT_TICK; + this.update(); + } } - function writeInt32BE(buffer, value, offset) { - return toBuffer(buffer).writeInt32BE(value, offset); + function updateWriteNT() { + if ((this.stream._duplexState & WRITE_UPDATING) === 0) { + this.stream._duplexState &= WRITE_NOT_NEXT_TICK; + this.update(); + } } - function readDoubleBE(buffer, offset) { - return toBuffer(buffer).readDoubleBE(offset); + function tickDrains(drains) { + for (let i = 0; i < drains.length; i++) { + if (--drains[i].writes === 0) { + drains.shift().resolve(true); + i--; + } + } } - function readFloatBE(buffer, offset) { - return toBuffer(buffer).readFloatBE(offset); + function afterOpen(err) { + const stream = this.stream; + if (err) stream.destroy(err); + if ((stream._duplexState & DESTROYING) === 0) { + if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) stream._duplexState |= READ_PRIMARY; + if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) stream._duplexState |= WRITE_PRIMARY; + stream.emit("open"); + } + stream._duplexState &= NOT_ACTIVE; + if (stream._writableState !== null) { + stream._writableState.updateCallback(); + } + if (stream._readableState !== null) { + stream._readableState.updateCallback(); + } } - function readUInt32BE(buffer, offset) { - return toBuffer(buffer).readUInt32BE(offset); + function afterTransform(err, data) { + if (data !== void 0 && data !== null) this.push(data); + this._writableState.afterWrite(err); } - function readInt32BE(buffer, offset) { - return toBuffer(buffer).readInt32BE(offset); + 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(); + } + } } - module2.exports = { - isBuffer, - isEncoding, - alloc, - allocUnsafe, - allocUnsafeSlow, - byteLength, - compare: compare2, - concat, - copy, - equals, - 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; + var Stream = class extends EventEmitter { + 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); } - get remaining() { - return 0; + _open(cb) { + cb(null); } - decode(tail) { - return b4a.toString(tail, this.encoding); + _destroy(cb) { + cb(null); } - flush() { - return ""; + _predestroy() { } - }; - } -}); - -// 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 readable() { + return this._readableState !== null ? true : void 0; } - get remaining() { - return this.bytesSeen; + get writable() { + return this._writableState !== null ? true : void 0; } - 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; + 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 (byte < this.lowerBoundary || byte > this.upperBoundary) { - this.codePoint = 0; - this.bytesNeeded = 0; - this.bytesSeen = 0; - this.lowerBoundary = 128; - this.upperBoundary = 191; - result += "\uFFFD"; - continue; + if (this._writableState !== null) { + this._writableState.highWaterMark = 0; + this._writableState.error = err; } - 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; + this._duplexState |= PREDESTROYING; + this._predestroy(); + this._duplexState &= NOT_PREDESTROYING; + if (this._readableState !== null) this._readableState.updateNextTick(); + if (this._writableState !== null) this._writableState.updateNextTick(); } - 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); + var Readable = 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); } } - get remaining() { - return this.decoder.remaining; + setEncoding(encoding) { + const dec = new TextDecoder2(encoding); + const map2 = 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 : map2(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) { - if (typeof data === "string") return data; - return this.decoder.decode(data); + this._readableState.updateNextTick(); + return this._readableState.push(data); } - // For Node.js compatibility - write(data) { - return this.push(data); + unshift(data) { + this._readableState.updateNextTick(); + return this._readableState.unshift(data); } - end(data) { - let result = ""; - if (data) result = this.push(data); - result += this.decoder.flush(); - return result; + resume() { + this._duplexState |= READ_RESUMED_READ_AHEAD; + this._readableState.updateNextTick(); + return this; } - }; - 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); + pause() { + this._duplexState &= this._readableState.readAhead === false ? READ_PAUSED_NO_READ_AHEAD : READ_PAUSED; + return this; } - } - } -}); - -// node_modules/streamx/index.js -var require_streamx = __commonJS({ - "node_modules/streamx/index.js"(exports2, module2) { - var { EventEmitter } = 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 || Symbol("asyncIterator"); - var WritableState = class { - constructor(stream, { highWaterMark = 16384, map: map2 = null, mapWritable, byteLength, byteLengthWritable } = {}) { - this.stream = stream; - 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 || map2; - this.afterWrite = afterWrite.bind(this); - this.afterUpdateNextTick = updateWriteNT.bind(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); + } } - get ended() { - return (this.stream._duplexState & WRITE_DONE) !== 0; + 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 stream = 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(resolve2, reject) { + promiseResolve = resolve2; + promiseReject = reject; + const data = stream.read(); + if (data !== null) ondata(data); + else if ((stream._duplexState & DESTROYED) !== 0) ondata(null); + }); + }, + return() { + return destroy(null); + }, + throw(err) { + return destroy(err); + } + }; + function onreadable() { + if (promiseResolve !== null) ondata(stream.read()); + } + function onclose() { + if (promiseResolve !== null) ondata(null); + } + function ondata(data) { + if (promiseReject === null) return; + if (error3) promiseReject(error3); + else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED); + else promiseResolve({ value: data, done: data === null }); + promiseReject = promiseResolve = null; + } + function destroy(err) { + stream.destroy(err); + return new Promise((resolve2, reject) => { + if (stream._duplexState & DESTROYED) return resolve2({ value: void 0, done: true }); + stream.once("close", function() { + if (err) reject(err); + else resolve2({ value: void 0, done: true }); + }); + }); + } } - 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; + }; + 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(); } - 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; + cork() { + this._duplexState |= WRITE_CORKED; } - 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; + uncork() { + this._duplexState &= WRITE_NOT_CORKED; + this._writableState.updateNextTick(); } - autoBatch(data, cb) { - const buffer = []; - const stream = this.stream; - buffer.push(data); - while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED_AND_ACTIVE) { - buffer.push(stream._writableState.shift()); - } - if ((stream._duplexState & OPEN_STATUS) !== 0) return cb(null); - stream._writev(buffer, cb); + _writev(batch, cb) { + cb(null); } - update() { - const stream = this.stream; - stream._duplexState |= WRITE_UPDATING; - do { - while ((stream._duplexState & WRITE_STATUS) === WRITE_QUEUED) { - const data = this.shift(); - stream._duplexState |= WRITE_ACTIVE_AND_WRITING; - stream._write(data, this.afterWrite); - } - if ((stream._duplexState & WRITE_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); - } while (this.continueUpdate() === true); - stream._duplexState &= WRITE_NOT_UPDATING; + _write(data, cb) { + this._writableState.autoBatch(data, cb); } - updateNonPrimary() { - const stream = this.stream; - if ((stream._duplexState & WRITE_FINISHING_STATUS) === WRITE_FINISHING) { - stream._duplexState = (stream._duplexState | WRITE_ACTIVE) & WRITE_NOT_FINISHING; - stream._final(afterFinal.bind(this)); - return; - } - if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) { - if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) { - stream._duplexState |= ACTIVE; - stream._destroy(afterDestroy.bind(this)); - } - return; - } - if ((stream._duplexState & IS_OPENING) === OPENING) { - stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING; - stream._open(afterOpen.bind(this)); - } + _final(cb) { + cb(null); } - continueUpdate() { - if ((this.stream._duplexState & WRITE_NEXT_TICK) === 0) return false; - this.stream._duplexState &= WRITE_NOT_NEXT_TICK; - return true; + static isBackpressured(ws) { + return (ws._duplexState & WRITE_BACKPRESSURE_STATUS) !== 0; } - updateCallback() { - if ((this.stream._duplexState & WRITE_UPDATE_SYNC_STATUS) === WRITE_PRIMARY) this.update(); - else this.updateNextTick(); + 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((resolve2) => { + state.drains.push({ writes, resolve: resolve2 }); + }); } - 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); + write(data) { + this._writableState.updateNextTick(); + return this._writableState.push(data); + } + end(data) { + this._writableState.updateNextTick(); + this._writableState.end(data); + return this; } }; - var ReadableState = class { - constructor(stream, { highWaterMark = 16384, map: map2 = null, mapReadable, byteLength, byteLengthReadable } = {}) { - this.stream = stream; - 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 || map2; - this.pipeTo = null; - this.afterRead = afterRead.bind(this); - this.afterUpdateNextTick = updateReadNT.bind(this); + var Duplex = class extends Readable { + // 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; + } } - get ended() { - return (this.stream._duplexState & READ_DONE) !== 0; + cork() { + this._duplexState |= WRITE_CORKED; } - 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", noop); - if (isStreamx(pipeTo)) { - pipeTo._writableState.pipeline = this.pipeline; - if (cb) pipeTo.on("error", noop); - 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); + uncork() { + this._duplexState &= WRITE_NOT_CORKED; + this._writableState.updateNextTick(); } - push(data) { - const stream = this.stream; - if (data === null) { - this.highWaterMark = 0; - stream._duplexState = (stream._duplexState | READ_ENDING) & READ_NON_PRIMARY_AND_PUSHED; - return false; - } - if (this.map !== null) { - data = this.map(data); - if (data === null) { - stream._duplexState &= READ_PUSHED; - return this.buffered < this.highWaterMark; - } - } - this.buffered += this.byteLength(data); - this.queue.push(data); - stream._duplexState = (stream._duplexState | READ_QUEUED) & READ_PUSHED; - return this.buffered < this.highWaterMark; + _writev(batch, cb) { + cb(null); } - shift() { - const data = this.queue.shift(); - this.buffered -= this.byteLength(data); - if (this.buffered === 0) this.stream._duplexState &= READ_NOT_QUEUED; - return data; + _write(data, cb) { + this._writableState.autoBatch(data, cb); } - 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); + _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 Transform = 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; } - this.push(pending[pending.length - 1]); } - read() { - const stream = this.stream; - if ((stream._duplexState & READ_STATUS) === READ_QUEUED) { - const data = this.shift(); - if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED; - if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data); - return data; + _write(data, cb) { + if (this._readableState.buffered >= this._readableState.highWaterMark) { + this._transformState.data = data; + } else { + this._transform(data, this._transformState.afterTransform); } - if (this.readAhead === false) { - stream._duplexState |= READ_READ_AHEAD; - this.updateNextTick(); + } + _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); } - return null; } - drain() { - const stream = this.stream; - while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) { - const data = this.shift(); - if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED; - if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit("data", data); + destroy(err) { + super.destroy(err); + if (this._transformState.data !== null) { + this._transformState.data = null; + this._transformState.afterTransform(); } } - update() { - const stream = this.stream; - stream._duplexState |= READ_UPDATING; - do { - this.drain(); - while (this.buffered < this.highWaterMark && (stream._duplexState & SHOULD_NOT_READ) === READ_READ_AHEAD) { - stream._duplexState |= READ_ACTIVE_AND_NEEDS_PUSH; - stream._read(this.afterRead); - this.drain(); - } - if ((stream._duplexState & READ_READABLE_STATUS) === READ_EMIT_READABLE_AND_QUEUED) { - stream._duplexState |= READ_EMITTED_READABLE; - stream.emit("readable"); - } - if ((stream._duplexState & READ_PRIMARY_AND_ACTIVE) === 0) this.updateNonPrimary(); - } while (this.continueUpdate() === true); - stream._duplexState &= READ_NOT_UPDATING; + _transform(data, cb) { + cb(null, data); } - updateNonPrimary() { - const stream = this.stream; - if ((stream._duplexState & READ_ENDING_STATUS) === READ_ENDING) { - stream._duplexState = (stream._duplexState | READ_DONE) & READ_NOT_ENDING; - stream.emit("end"); - if ((stream._duplexState & AUTO_DESTROY) === DONE) stream._duplexState |= DESTROYING; - if (this.pipeTo !== null) this.pipeTo.end(); + _flush(cb) { + cb(null); + } + _final(cb) { + this._transformState.afterFinal = cb; + this._flush(transformAfterFlush.bind(this)); + } + }; + var PassThrough = class extends Transform { + }; + 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((resolve2, reject) => { + return pipeline(...streams, (err) => { + if (err) return reject(err); + resolve2(); + }); + }); + } + function pipeline(stream, ...streams) { + const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...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); } - if ((stream._duplexState & DESTROY_STATUS) === DESTROYING) { - if ((stream._duplexState & ACTIVE_OR_TICKING) === 0) { - stream._duplexState |= ACTIVE; - stream._destroy(afterDestroy.bind(this)); - } - return; + 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))); } - if ((stream._duplexState & IS_OPENING) === OPENING) { - stream._duplexState = (stream._duplexState | ACTIVE) & NOT_OPENING; - stream._open(afterOpen.bind(this)); + } + 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); } } - continueUpdate() { - if ((this.stream._duplexState & READ_NEXT_TICK) === 0) return false; - this.stream._duplexState &= READ_NOT_NEXT_TICK; - return true; + function onerror(err) { + if (!err || error3) return; + error3 = err; + for (const s of all) { + s.destroy(err); + } } - updateCallback() { - if ((this.stream._duplexState & READ_UPDATE_SYNC_STATUS) === READ_PRIMARY) this.update(); - else this.updateNextTick(); + } + function echo(s) { + return s; + } + function isStream(stream) { + return !!stream._readableState || !!stream._writableState; + } + function isStreamx(stream) { + return typeof stream._duplexState === "number" && isStream(stream); + } + function isEnded(stream) { + return !!stream._readableState && stream._readableState.ended; + } + function isFinished(stream) { + return !!stream._writableState && stream._writableState.ended; + } + function getStreamError(stream, opts = {}) { + const err = stream._readableState && stream._readableState.error || stream._writableState && stream._writableState.error; + return !opts.all && err === STREAM_DESTROYED ? null : err; + } + function isReadStreamx(stream) { + return isStreamx(stream) && stream.readable; + } + function isTypedArray(data) { + return typeof data === "object" && data !== null && typeof data.byteLength === "number"; + } + function defaultByteLength(data) { + return isTypedArray(data) ? data.byteLength : 1024; + } + function noop() { + } + 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, + pipelinePromise, + isStream, + isStreamx, + isEnded, + isFinished, + getStreamError, + Stream, + Writable, + Readable, + Duplex, + Transform, + // Export PassThrough for compatibility with Node.js core's stream module + PassThrough + }; + } +}); + +// 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"); + } } - 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); + 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; }; - var TransformState = class { - constructor(stream) { - this.data = null; - this.afterTransform = afterTransform.bind(stream); - this.afterFinal = null; + 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; }; - 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(stream, err) { - if (err) this.error = err; - if (stream === 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 (stream === this.from) { - this.from = null; - if (this.to !== null) { - if ((stream._duplexState & READ_DONE) === 0) { - this.to.destroy(this.error || new Error("Readable stream closed before ending")); - } - return; - } + 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 type2 = 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 (this.afterPipe !== null) this.afterPipe(this.error); - this.to = this.from = this.afterPipe = null; } + if (typeflag === 0 && name && name[name.length - 1] === "/") typeflag = 5; + return { + name, + mode, + uid, + gid, + size, + mtime: new Date(1e3 * mtime), + type: type2, + linkname, + uname, + gname, + devmajor, + devminor, + pax: null + }; }; - function afterDrain() { - this.stream._duplexState |= READ_PIPE_DRAINED; - this.updateCallback(); + function isUSTAR(buf) { + return b4a.equals(USTAR_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6)); } - function afterFinal(err) { - const stream = this.stream; - if (err) stream.destroy(err); - if ((stream._duplexState & DESTROY_STATUS) === 0) { - stream._duplexState |= WRITE_DONE; - stream.emit("finish"); - } - if ((stream._duplexState & AUTO_DESTROY) === DONE) { - stream._duplexState |= DESTROYING; + 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(index, len, defaultValue) { + if (typeof index !== "number") return defaultValue; + index = ~~index; + if (index >= len) return len; + if (index >= 0) return index; + index += len; + if (index >= 0) return index; + 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"; } - stream._duplexState &= WRITE_NOT_ACTIVE; - if ((stream._duplexState & WRITE_UPDATING) === 0) this.update(); - else this.updateNextTick(); + return null; } - function afterDestroy(err) { - const stream = this.stream; - if (!err && this.error !== STREAM_DESTROYED) err = this.error; - if (err) stream.emit("error", err); - stream._duplexState |= DESTROYED; - stream.emit("close"); - const rs = stream._readableState; - const ws = stream._writableState; - if (rs !== null && rs.pipeline !== null) rs.pipeline.done(stream, err); - if (ws !== null) { - while (ws.drains !== null && ws.drains.length > 0) ws.drains.shift().resolve(false); - if (ws.pipeline !== null) ws.pipeline.done(stream, err); + 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 afterWrite(err) { - const stream = this.stream; - if (err) stream.destroy(err); - stream._duplexState &= WRITE_NOT_ACTIVE; - if (this.drains !== null) tickDrains(this.drains); - if ((stream._duplexState & WRITE_DRAIN_STATUS) === WRITE_UNDRAINED) { - stream._duplexState &= WRITE_DRAINED; - if ((stream._duplexState & WRITE_EMIT_DRAIN) === WRITE_EMIT_DRAIN) { - stream.emit("drain"); - } + function indexOf(block, num, offset, end) { + for (; offset < end; offset++) { + if (block[offset] === num) return offset; } - this.updateCallback(); + return end; } - 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 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 updateReadNT() { - if ((this.stream._duplexState & READ_UPDATING) === 0) { - this.stream._duplexState &= READ_NOT_NEXT_TICK; - this.update(); - } + 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 updateWriteNT() { - if ((this.stream._duplexState & WRITE_UPDATING) === 0) { - this.stream._duplexState &= WRITE_NOT_NEXT_TICK; - this.update(); + 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 tickDrains(drains) { - for (let i = 0; i < drains.length; i++) { - if (--drains[i].writes === 0) { - drains.shift().resolve(true); - i--; - } + function encodeSize(num, buf, off) { + if (num.toString(8).length > 11) { + encodeSizeBin(num, buf, off); + } else { + b4a.write(buf, encodeOct(num, 11), off); } } - function afterOpen(err) { - const stream = this.stream; - if (err) stream.destroy(err); - if ((stream._duplexState & DESTROYING) === 0) { - if ((stream._duplexState & READ_PRIMARY_STATUS) === 0) stream._duplexState |= READ_PRIMARY; - if ((stream._duplexState & WRITE_PRIMARY_STATUS) === 0) stream._duplexState |= WRITE_PRIMARY; - stream.emit("open"); + 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); } - stream._duplexState &= NOT_ACTIVE; - if (stream._writableState !== null) { - stream._writableState.updateCallback(); + let sum = 0; + const l = tuple.length; + for (i = 0; i < l; i++) { + sum += tuple[i] * Math.pow(256, i); } - if (stream._readableState !== null) { - stream._readableState.updateCallback(); + 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 afterTransform(err, data) { - if (data !== void 0 && data !== null) this.push(data); - this._writableState.afterWrite(err); + function decodeStr(val, offset, length, encoding) { + return b4a.toString(val.subarray(offset, indexOf(val, 0, offset, offset + length)), encoding); } - 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(); - } + function addLength(str2) { + const len = b4a.byteLength(str2); + let digits = Math.floor(Math.log(len) / Math.log(10)) + 1; + if (len + digits >= Math.pow(10, digits)) digits++; + return len + digits + str2; + } + } +}); + +// node_modules/tar-stream/extract.js +var require_extract = __commonJS({ + "node_modules/tar-stream/extract.js"(exports2, module2) { + var { Writable, Readable, getStreamError } = require_streamx(); + var FIFO = require_fast_fifo(); + var b4a = require_b4a(); + var headers = require_headers2(); + var EMPTY = b4a.alloc(0); + var BufferList = class { + constructor() { + this.buffered = 0; + this.shifted = 0; + this.queue = new FIFO(); + this._offset = 0; } - if (this._writableState !== null) { - if (name === "drain") { - this._duplexState |= WRITE_EMIT_DRAIN; - this._writableState.updateNextTick(); + 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 EMPTY; + 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); } - } - var Stream = class extends EventEmitter { - 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)); - } + _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.on("newListener", newListener); + this.buffered -= size; + this.shifted += size; + return buf.subarray(this._offset, this._offset += size); } - _open(cb) { - cb(null); + }; + var Source = class extends Readable { + constructor(self2, header, offset) { + super(); + this.header = header; + this.offset = offset; + this._parent = self2; } - _destroy(cb) { + _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)); } - 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(); + _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 Readable = class _Readable extends Stream { + var Extract = class extends Writable { 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); - } + if (!opts) opts = {}; + this._buffer = new BufferList(); + this._offset = 0; + this._header = null; + this._stream = null; + this._missing = 0; + this._longHeader = false; + this._callback = noop; + 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); } - setEncoding(encoding) { - const dec = new TextDecoder2(encoding); - const map2 = 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 : map2(next); + _unlock(err) { + this._locked = false; + if (err) { + this.destroy(err); + this._continueWrite(err); + return; } + this._update(); } - _read(cb) { - cb(null); - } - pipe(dest, cb) { - this._readableState.updateNextTick(); - this._readableState.pipe(dest, cb); - return dest; + _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; } - read() { - this._readableState.updateNextTick(); - return this._readableState.read(); + _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; + } } - push(data) { - this._readableState.updateNextTick(); - return this._readableState.push(data); + _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; + } } - unshift(data) { - this._readableState.updateNextTick(); - return this._readableState.unshift(data); + _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; } - resume() { - this._duplexState |= READ_RESUMED_READ_AHEAD; - this._readableState.updateNextTick(); - return this; + _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; } - pause() { - this._duplexState &= this._readableState.readAhead === false ? READ_PAUSED_NO_READ_AHEAD : READ_PAUSED; - return this; + _createStream() { + return new Source(this, this._header, this._offset); } - 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); + _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; } - }); - return rs; - function push(data) { - if (data.done) rs.push(null); - else rs.push(data.value); + if (this._buffer.buffered < 512) break; + if (this._stream !== null || this._consumeHeader() === false) return; } + this._continueWrite(null); } - 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); - } - }); + _continueWrite(err) { + const cb = this._callback; + this._callback = noop; + cb(err); } - static isBackpressured(rs) { - return (rs._duplexState & READ_BACKPRESSURE_STATUS) !== 0 || rs._readableState.buffered >= rs._readableState.highWaterMark; + _write(data, cb) { + this._callback = cb; + this._buffer.push(data); + this._update(); } - static isPaused(rs) { - return (rs._duplexState & READ_RESUMED) === 0; + _final(cb) { + this._finished = this._missing === 0 && this._buffer.buffered === 0; + cb(this._finished ? null : new Error("Unexpected end of data")); } - [asyncIterator]() { - const stream = this; - let error4 = null; + _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) => { - error4 = err; + error3 = err; }); - this.on("readable", onreadable); this.on("close", onclose); return { - [asyncIterator]() { + [Symbol.asyncIterator]() { return this; }, next() { - return new Promise(function(resolve2, reject) { - promiseResolve = resolve2; - promiseReject = reject; - const data = stream.read(); - if (data !== null) ondata(data); - else if ((stream._duplexState & DESTROYED) !== 0) ondata(null); - }); + return new Promise(onnext); }, return() { return destroy(null); @@ -95589,24 +99701,52 @@ var require_streamx = __commonJS({ return destroy(err); } }; - function onreadable() { - if (promiseResolve !== null) ondata(stream.read()); + function consumeCallback(err) { + if (!entryCallback) return; + const cb = entryCallback; + entryCallback = null; + cb(err); } - function onclose() { - if (promiseResolve !== null) ondata(null); + function onnext(resolve2, reject) { + if (error3) { + return reject(error3); + } + if (entryStream) { + resolve2({ value: entryStream, done: false }); + entryStream = null; + return; + } + promiseResolve = resolve2; + promiseReject = reject; + consumeCallback(null); + if (extract2._finished && promiseResolve) { + promiseResolve({ value: void 0, done: true }); + promiseResolve = promiseReject = null; + } } - function ondata(data) { - if (promiseReject === null) return; - if (error4) promiseReject(error4); - else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED); - else promiseResolve({ value: data, done: data === null }); - promiseReject = promiseResolve = null; + function onentry(header, stream, callback) { + entryCallback = callback; + stream.on("error", noop); + if (promiseResolve) { + promiseResolve({ value: stream, done: false }); + promiseResolve = promiseReject = null; + } else { + entryStream = stream; + } + } + function onclose() { + consumeCallback(error3); + if (!promiseResolve) return; + if (error3) promiseReject(error3); + else promiseResolve({ value: void 0, done: true }); + promiseResolve = promiseReject = null; } function destroy(err) { - stream.destroy(err); + extract2.destroy(err); + consumeCallback(err); return new Promise((resolve2, reject) => { - if (stream._duplexState & DESTROYED) return resolve2({ value: void 0, done: true }); - stream.once("close", function() { + if (extract2.destroyed) return resolve2({ value: void 0, done: true }); + extract2.once("close", function() { if (err) reject(err); else resolve2({ value: void 0, done: true }); }); @@ -95614,3796 +99754,3753 @@ var require_streamx = __commonJS({ } } }; - 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(); - } + module2.exports = function extract2(opts) { + return new Extract(opts); + }; + function noop() { + } + function overflow(size) { + size &= 511; + return size && 512 - size; + } + } +}); + +// node_modules/tar-stream/constants.js +var require_constants13 = __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, Writable, getStreamError } = require_streamx(); + var b4a = require_b4a(); + var constants = require_constants13(); + 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); } - cork() { - this._duplexState |= WRITE_CORKED; + _open(cb) { + this._openCallback = cb; + if (this._pack._stream === this) this._continueOpen(); } - uncork() { - this._duplexState &= WRITE_NOT_CORKED; - this._writableState.updateNextTick(); + _continuePack(err) { + if (this._callback === null) return; + const callback = this._callback; + this._callback = null; + callback(err); } - _writev(batch, cb) { + _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) { - 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((resolve2) => { - state.drains.push({ writes, resolve: resolve2 }); - }); - } - 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 Readable { - // 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; + 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; } - 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); + _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); } - write(data) { - this._writableState.updateNextTick(); - return this._writableState.push(data); + _getError() { + return getStreamError(this) || new Error("tar entry destroyed"); } - end(data) { - this._writableState.updateNextTick(); - this._writableState.end(data); - return this; + _predestroy() { + this._pack.destroy(this._getError()); + } + _destroy(cb) { + this._pack._done(this); + this._continuePack(this._finished ? null : this._getError()); + cb(); } }; - var Transform = class extends Duplex { + var Pack = class extends Readable { 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; - } + this._drain = noop; + this._finalized = false; + this._finalizing = false; + this._pending = []; + this._stream = null; } - _write(data, cb) { - if (this._readableState.buffered >= this._readableState.highWaterMark) { - this._transformState.data = data; - } else { - this._transform(data, this._transformState.afterTransform); + entry(header, buffer, callback) { + if (this._finalized || this.destroying) throw new Error("already finalized or destroyed"); + if (typeof buffer === "function") { + callback = buffer; + buffer = null; } - } - _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); + if (!callback) callback = noop; + 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; } - } - destroy(err) { - super.destroy(err); - if (this._transformState.data !== null) { - this._transformState.data = null; - this._transformState.afterTransform(); + if (sink._isVoid) { + return sink; } + return sink; } - _transform(data, cb) { - cb(null, data); - } - _flush(cb) { - cb(null); + 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); } - _final(cb) { - this._transformState.afterFinal = cb; - this._flush(transformAfterFlush.bind(this)); + _done(stream) { + if (stream !== this._stream) return; + this._stream = null; + if (this._finalizing) this.finalize(); + if (this._pending.length) this._pending.shift()._continueOpen(); } - }; - var PassThrough = class extends Transform { - }; - 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((resolve2, reject) => { - return pipeline(...streams, (err) => { - if (err) return reject(err); - resolve2(); - }); - }); - } - function pipeline(stream, ...streams) { - const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...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 error4 = 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); + _encode(header) { + if (!header.pax) { + const buf = headers.encode(header); + if (buf) { + this.push(buf); + return; + } } - src = dest; + this._encodePax(header); } - if (done) { - let fin = false; - const autoDestroy = isStreamx(dest) || !!(dest._writableState && dest._writableState.autoDestroy); - dest.on("error", (err) => { - if (error4 === null) error4 = err; - }); - dest.on("finish", () => { - fin = true; - if (!autoDestroy) done(error4); + _encodePax(header) { + const paxHeader = headers.encodePax({ + name: header.name, + linkname: header.linkname, + pax: header.pax }); - if (autoDestroy) { - dest.on("close", () => done(error4 || (fin ? null : PREMATURE_CLOSE))); - } + 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)); } - 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); - } + _doDrain() { + const drain = this._drain; + this._drain = noop; + drain(); } - function onerror(err) { - if (!err || error4) return; - error4 = err; - for (const s of all) { - s.destroy(err); + _predestroy() { + const err = getStreamError(this); + if (this._stream) this._stream.destroy(err); + while (this._pending.length) { + const stream = this._pending.shift(); + stream.destroy(err); + stream._continueOpen(); } + this._doDrain(); } - } - function echo(s) { - return s; - } - function isStream(stream) { - return !!stream._readableState || !!stream._writableState; - } - function isStreamx(stream) { - return typeof stream._duplexState === "number" && isStream(stream); - } - function isEnded(stream) { - return !!stream._readableState && stream._readableState.ended; - } - function isFinished(stream) { - return !!stream._writableState && stream._writableState.ended; - } - function getStreamError(stream, opts = {}) { - const err = stream._readableState && stream._readableState.error || stream._writableState && stream._writableState.error; - return !opts.all && err === STREAM_DESTROYED ? null : err; - } - function isReadStreamx(stream) { - return isStreamx(stream) && stream.readable; - } - function isTypedArray(data) { - return typeof data === "object" && data !== null && typeof data.byteLength === "number"; - } - function defaultByteLength(data) { - return isTypedArray(data) ? data.byteLength : 1024; + _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 noop() { } - function abort() { - this.destroy(new Error("Stream aborted.")); + function overflow(self2, size) { + size &= 511; + if (size) self2.push(END_OF_TAR.subarray(0, 512 - size)); } - function isWritev(s) { - return s._writev !== Writable.prototype._writev && s._writev !== Duplex.prototype._writev; + function mapWritable(buf) { + return b4a.isBuffer(buf) ? buf : b4a.from(buf); } - module2.exports = { - pipeline, - pipelinePromise, - isStream, - isStreamx, - isEnded, - isFinished, - getStreamError, - Stream, - Writable, - Readable, - Duplex, - Transform, - // Export PassThrough for compatibility with Node.js core's stream module - PassThrough - }; } }); -// 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); +// 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/archiver/lib/plugins/tar.js +var require_tar = __commonJS({ + "node_modules/archiver/lib/plugins/tar.js"(exports2, module2) { + var zlib = require("zlib"); + var engine = require_tar_stream(); + var util = require_archiver_utils(); + var Tar = function(options) { + if (!(this instanceof Tar)) { + return new Tar(options); + } + options = this.options = util.defaults(options, { + gzip: false + }); + if (typeof options.gzipOptions !== "object") { + options.gzipOptions = {}; + } + this.supports = { + directory: true, + symlink: true + }; + this.engine = engine.pack(options); + this.compressor = false; + if (options.gzip) { + this.compressor = zlib.createGzip(options.gzipOptions); + this.compressor.on("error", this._onCompressorError.bind(this)); + } }; - 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"); + Tar.prototype._onCompressorError = function(err) { + this.engine.emit("error", err); + }; + Tar.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); + }); } - 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); + 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") { + util.collectStream(source, append); } - 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; + Tar.prototype.finalize = function() { + this.engine.finalize(); }; - 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 type2 = 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)) { + Tar.prototype.on = function() { + return this.engine.on.apply(this.engine, arguments); + }; + Tar.prototype.pipe = function(destination, options) { + if (this.compressor) { + return this.engine.pipe.apply(this.engine, [this.compressor]).pipe(destination, options); } else { - if (!allowUnknownFormat) { - throw new Error("Invalid tar header: unknown format."); - } + return this.engine.pipe.apply(this.engine, arguments); } - if (typeflag === 0 && name && name[name.length - 1] === "/") typeflag = 5; - return { - name, - mode, - uid, - gid, - size, - mtime: new Date(1e3 * mtime), - type: type2, - 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(index, len, defaultValue) { - if (typeof index !== "number") return defaultValue; - index = ~~index; - if (index >= len) return len; - if (index >= 0) return index; - index += len; - if (index >= 0) return index; - 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; + Tar.prototype.unpipe = function() { + if (this.compressor) { + return this.compressor.unpipe.apply(this.compressor, arguments); + } else { + return this.engine.unpipe.apply(this.engine, arguments); } - 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(val2, n) { - val2 = val2.toString(8); - if (val2.length > n) return SEVENS.slice(0, n) + " "; - return ZEROS.slice(0, n - val2.length) + val2 + " "; + }; + module2.exports = Tar; + } +}); + +// node_modules/buffer-crc32/dist/index.cjs +var require_dist4 = __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; } - 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); + 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; } - } - function encodeSize(num, buf, off) { - if (num.toString(8).length > 11) { - encodeSizeBin(num, buf, off); + if (typeof input === "number") { + return Buffer.alloc(input); + } else if (typeof input === "string") { + return Buffer.from(input); } else { - b4a.write(buf, encodeOct(num, 11), off); + throw new Error("input must be buffer, number, or string, received " + typeof input); } } - 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 bufferizeInt(num) { + const tmp = ensureBuffer(4); + tmp.writeInt32BE(num, 0); + return tmp; } - function decodeOct(val2, offset, length) { - val2 = val2.subarray(offset, offset + length); - offset = 0; - if (val2[offset] & 128) { - return parse256(val2); - } else { - while (offset < val2.length && val2[offset] === 32) offset++; - const end = clamp(indexOf(val2, 32, offset, val2.length), val2.length, val2.length); - while (offset < end && val2[offset] === 0) offset++; - if (end === offset) return 0; - return parseInt(b4a.toString(val2.subarray(offset, end)), 8); + 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 decodeStr(val2, offset, length, encoding) { - return b4a.toString(val2.subarray(offset, indexOf(val2, 0, offset, offset + length)), encoding); - } - function addLength(str2) { - const len = b4a.byteLength(str2); - let digits = Math.floor(Math.log(len) / Math.log(10)) + 1; - if (len + digits >= Math.pow(10, digits)) digits++; - return len + digits + str2; + function crc32() { + return bufferizeInt(_crc32.apply(null, arguments)); } + crc32.signed = function() { + return _crc32.apply(null, arguments); + }; + crc32.unsigned = function() { + return _crc32.apply(null, arguments) >>> 0; + }; + var bufferCrc32 = crc32; + var index = /* @__PURE__ */ getDefaultExportFromCjs(bufferCrc32); + module2.exports = index; } }); -// node_modules/tar-stream/extract.js -var require_extract = __commonJS({ - "node_modules/tar-stream/extract.js"(exports2, module2) { - var { Writable, Readable, getStreamError } = require_streamx(); - var FIFO = require_fast_fifo(); - var b4a = require_b4a(); - var headers = require_headers2(); - var EMPTY = 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 EMPTY; - 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); +// node_modules/archiver/lib/plugins/json.js +var require_json = __commonJS({ + "node_modules/archiver/lib/plugins/json.js"(exports2, module2) { + var inherits = require("util").inherits; + var Transform = require_ours().Transform; + var crc32 = require_dist4(); + var util = require_archiver_utils(); + var Json = function(options) { + if (!(this instanceof Json)) { + return new Json(options); } + options = this.options = util.defaults(options, {}); + Transform.call(this, options); + this.supports = { + directory: true, + symlink: true + }; + this.files = []; }; - var Source = class extends Readable { - 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); - } + inherits(Json, Transform); + Json.prototype._transform = function(chunk, encoding, callback) { + callback(null, chunk); }; - 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 = noop; - 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; + Json.prototype._writeStringified = function() { + var fileString = JSON.stringify(this.files); + this.write(fileString); + }; + Json.prototype.append = function(source, data, callback) { + var self2 = this; + data.crc32 = 0; + function onend(err, sourceBuffer) { if (err) { - this.destroy(err); - this._continueWrite(err); + callback(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); + data.size = sourceBuffer.length || 0; + data.crc32 = crc32.unsigned(sourceBuffer); + self2.files.push(data); + callback(null, data); } - _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); + if (data.sourceType === "buffer") { + onend(null, source); + } else if (data.sourceType === "stream") { + util.collectStream(source, onend); } - _continueWrite(err) { - const cb = this._callback; - this._callback = noop; - cb(err); + }; + Json.prototype.finalize = function() { + this._writeStringified(); + this.end(); + }; + module2.exports = Json; + } +}); + +// node_modules/archiver/index.js +var require_archiver = __commonJS({ + "node_modules/archiver/index.js"(exports2, module2) { + var Archiver = 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 Archiver(format, options); + instance.setFormat(format); + instance.setModule(new formats[format](options)); + return instance; + } else { + throw new Error("create(" + format + "): format not registered"); } - _write(data, cb) { - this._callback = cb; - this._buffer.push(data); - this._update(); + }; + vending.registerFormat = function(format, module3) { + if (formats[format]) { + throw new Error("register(" + format + "): format already registered"); } - _final(cb) { - this._finished = this._missing === 0 && this._buffer.buffered === 0; - cb(this._finished ? null : new Error("Unexpected end of data")); + if (typeof module3 !== "function") { + throw new Error("register(" + format + "): format module invalid"); } - _predestroy() { - this._continueWrite(null); + if (typeof module3.prototype.append !== "function" || typeof module3.prototype.finalize !== "function") { + throw new Error("register(" + format + "): format module missing methods"); } - _destroy(cb) { - if (this._stream) this._stream.destroy(getStreamError(this)); - cb(null); + formats[format] = module3; + }; + vending.isRegisteredFormat = function(format) { + if (formats[format]) { + return true; } - [Symbol.asyncIterator]() { - let error4 = null; - let promiseResolve = null; - let promiseReject = null; - let entryStream = null; - let entryCallback = null; - const extract2 = this; - this.on("entry", onentry); - this.on("error", (err) => { - error4 = err; - }); - this.on("close", onclose); - return { - [Symbol.asyncIterator]() { - return this; - }, - next() { - return new Promise(onnext); - }, - return() { - return destroy(null); - }, - throw(err) { - return destroy(err); - } + return false; + }; + vending.registerFormat("zip", require_zip()); + vending.registerFormat("tar", require_tar()); + 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 || /* @__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; }; - function consumeCallback(err) { - if (!entryCallback) return; - const cb = entryCallback; - entryCallback = null; - cb(err); + 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]); } - function onnext(resolve2, reject) { - if (error4) { - return reject(error4); - } - if (entryStream) { - resolve2({ value: entryStream, done: false }); - entryStream = null; - return; - } - promiseResolve = resolve2; - promiseReject = reject; - consumeCallback(null); - if (extract2._finished && promiseResolve) { - promiseResolve({ value: void 0, done: true }); - promiseResolve = promiseReject = null; + __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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - function onentry(header, stream, callback) { - entryCallback = callback; - stream.on("error", noop); - if (promiseResolve) { - promiseResolve({ value: stream, done: false }); - promiseResolve = promiseReject = null; - } else { - entryStream = stream; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - function onclose() { - consumeCallback(error4); - if (!promiseResolve) return; - if (error4) promiseReject(error4); - else promiseResolve({ value: void 0, done: true }); - promiseResolve = promiseReject = null; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - function destroy(err) { - extract2.destroy(err); - consumeCallback(err); - return new Promise((resolve2, reject) => { - if (extract2.destroyed) return resolve2({ value: void 0, done: true }); - extract2.once("close", function() { - if (err) reject(err); - else resolve2({ value: void 0, done: true }); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.ZipUploadStream = exports2.DEFAULT_COMPRESSION_LEVEL = void 0; + exports2.createZipUploadStream = createZipUploadStream; + var stream = __importStar2(require("stream")); + var promises_1 = require("fs/promises"); + var archiver2 = __importStar2(require_archiver()); + var core14 = __importStar2(require_core()); + var config_1 = require_config(); + exports2.DEFAULT_COMPRESSION_LEVEL = 6; + var ZipUploadStream = class extends stream.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) { + core14.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); + const zip = archiver2.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); + core14.debug(`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`); + core14.debug(`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`); + zip.pipe(zipUploadStream); + zip.finalize(); + return zipUploadStream; + }); + } + var zipErrorCallback = (error3) => { + core14.error("An error has occurred while creating the zip file for upload"); + core14.info(error3); + throw new Error("An error has occurred during zip creation for the artifact"); + }; + var zipWarningCallback = (error3) => { + if (error3.code === "ENOENT") { + core14.warning("ENOENT warning during artifact zip creation. No such file or directory"); + core14.info(error3); + } else { + core14.warning(`A non-blocking warning has occurred during artifact zip creation: ${error3.code}`); + core14.info(error3); } }; - module2.exports = function extract2(opts) { - return new Extract(opts); + var zipFinishCallback = () => { + core14.debug("Zip stream for upload has finished."); }; - function noop() { - } - function overflow(size) { - size &= 511; - return size && 512 - size; - } - } -}); - -// node_modules/tar-stream/constants.js -var require_constants9 = __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 + var zipEndCallback = () => { + core14.debug("Zip stream for upload has ended."); }; - 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, Writable, getStreamError } = require_streamx(); - var b4a = require_b4a(); - var constants = require_constants9(); - 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); +// 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]; + } }; } - _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); + 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]); } - cb(null); + __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(resolve2) { + resolve2(value); + }); } - _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 new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - overflow(this._pack, this.header.size); - this._pack._done(this); - } - _final(cb) { - if (this.written !== this.header.size) { - return cb(new Error("Size mismatch")); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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(); - } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - var Pack = class extends Readable { - constructor(opts) { - super(opts); - this._drain = noop; - 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; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.uploadArtifact = uploadArtifact; + var core14 = __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_util8(); + var blob_upload_1 = require_blob_upload(); + var zip_1 = require_zip2(); + var generated_1 = require_generated(); + var errors_1 = require_errors2(); + 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] : [])); } - if (!callback) callback = noop; - 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; + 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; } - if (sink._isVoid) { - return sink; + const createArtifactResp = yield artifactClient.CreateArtifact(createArtifactReq); + if (!createArtifactResp.ok) { + throw new errors_1.InvalidResponseError("CreateArtifact: response from backend was not ok"); } - return sink; - } - finalize() { - if (this._stream || this._pending.length > 0) { - this._finalizing = true; - return; + 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}` + }); } - if (this._finalized) return; - this._finalized = true; - this.push(END_OF_TAR); - this.push(null); - } - _done(stream) { - if (stream !== 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; - } + core14.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"); } - 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 + const artifactId = BigInt(finalizeArtifactResp.artifactId); + core14.info(`Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}`); + return { + size: uploadResult.uploadSize, + digest: uploadResult.sha256Hash, + id: Number(artifactId) }; - 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 = noop; - drain(); - } - _predestroy() { - const err = getStreamError(this); - if (this._stream) this._stream.destroy(err); - while (this._pending.length) { - const stream = this._pending.shift(); - stream.destroy(err); - stream._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 noop() { - } - 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/archiver/lib/plugins/tar.js -var require_tar = __commonJS({ - "node_modules/archiver/lib/plugins/tar.js"(exports2, module2) { - var zlib = require("zlib"); - var engine = require_tar_stream(); - var util = require_archiver_utils(); - var Tar = function(options) { - if (!(this instanceof Tar)) { - return new Tar(options); - } - options = this.options = util.defaults(options, { - gzip: false - }); - if (typeof options.gzipOptions !== "object") { - options.gzipOptions = {}; +// 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]; } - this.supports = { - directory: true, - symlink: true - }; - this.engine = engine.pack(options); - this.compressor = false; - if (options.gzip) { - this.compressor = zlib.createGzip(options.gzipOptions); - this.compressor.on("error", this._onCompressorError.bind(this)); + 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; }; - Tar.prototype._onCompressorError = function(err) { - this.engine.emit("error", err); + Traverse.prototype.map = function(cb) { + return walk(this.value, cb, true); }; - Tar.prototype.append = function(source, data, callback) { - var self2 = this; - data.mtime = data.date; - function append(err, sourceBuffer) { - if (err) { - callback(err); - return; + Traverse.prototype.forEach = function(cb) { + this.value = walk(this.value, cb, false); + return this.value; + }; + Traverse.prototype.reduce = function(cb, init) { + var skip = arguments.length === 1; + var acc = skip ? this.value : init; + this.forEach(function(x) { + if (!this.isRoot || !skip) { + acc = cb.call(this, acc, x); } - self2.engine.entry(data, sourceBuffer, function(err2) { - callback(err2, data); - }); + }); + return acc; + }; + Traverse.prototype.deepEqual = function(obj) { + if (arguments.length !== 1) { + throw new Error( + "deepEqual requires exactly one object to compare against" + ); } - 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); + 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; }); - source.pipe(entry); - } else if (data.sourceType === "stream") { - util.collectStream(source, append); - } - }; - Tar.prototype.finalize = function() { - this.engine.finalize(); + 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; }; - Tar.prototype.on = function() { - return this.engine.on.apply(this.engine, arguments); + Traverse.prototype.paths = function() { + var acc = []; + this.forEach(function(x) { + acc.push(this.path); + }); + return acc; }; - Tar.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); - } + Traverse.prototype.nodes = function() { + var acc = []; + this.forEach(function(x) { + acc.push(this.node); + }); + return acc; }; - Tar.prototype.unpipe = function() { - if (this.compressor) { - return this.compressor.unpipe.apply(this.compressor, arguments); - } else { - return this.engine.unpipe.apply(this.engine, arguments); - } + 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); }; - module2.exports = Tar; - } -}); - -// node_modules/buffer-crc32/dist/index.cjs -var require_dist8 = __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_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 walk(root, cb, immutable) { + var path3 = []; + var parents = []; + var alive = true; + return (function walker(node_) { + var node = immutable ? copy(node_) : node_; + var modifiers = {}; + var state = { + node, + node_, + path: [].concat(path3), + parent: parents.slice(-1)[0], + key: path3.slice(-1)[0], + isRoot: path3.length === 0, + level: path3.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) { + path3.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); + path3.pop(); + }); + parents.pop(); + } + if (modifiers.after) modifiers.after.call(state, state.node); + return state; + })(root).node; } - function crc32() { - return bufferizeInt(_crc32.apply(null, arguments)); + 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; } - crc32.signed = function() { - return _crc32.apply(null, arguments); - }; - crc32.unsigned = function() { - return _crc32.apply(null, arguments) >>> 0; - }; - var bufferCrc32 = crc32; - var index = /* @__PURE__ */ getDefaultExportFromCjs(bufferCrc32); - module2.exports = index; } }); -// node_modules/archiver/lib/plugins/json.js -var require_json = __commonJS({ - "node_modules/archiver/lib/plugins/json.js"(exports2, module2) { - var inherits = require("util").inherits; - var Transform = require_ours().Transform; - var crc32 = require_dist8(); - var util = require_archiver_utils(); - var Json = function(options) { - if (!(this instanceof Json)) { - return new Json(options); - } - options = this.options = util.defaults(options, {}); - Transform.call(this, options); - this.supports = { - directory: true, - symlink: true - }; - this.files = []; - }; - inherits(Json, Transform); - Json.prototype._transform = function(chunk, encoding, callback) { - callback(null, chunk); - }; - Json.prototype._writeStringified = function() { - var fileString = JSON.stringify(this.files); - this.write(fileString); +// node_modules/chainsaw/index.js +var require_chainsaw = __commonJS({ + "node_modules/chainsaw/index.js"(exports2, module2) { + var Traverse = require_traverse(); + var EventEmitter = 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(); }; - Json.prototype.append = function(source, data, callback) { - var self2 = this; - data.crc32 = 0; - function onend(err, sourceBuffer) { - if (err) { - callback(err); - return; + Chainsaw.saw = function(builder, handlers) { + var saw = new EventEmitter(); + 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); } - data.size = sourceBuffer.length || 0; - data.crc32 = crc32.unsigned(sourceBuffer); - self2.files.push(data); - callback(null, data); - } - if (data.sourceType === "buffer") { - onend(null, source); - } else if (data.sourceType === "stream") { - util.collectStream(source, onend); - } - }; - Json.prototype.finalize = function() { - this._writeStringified(); - this.end(); + }; + 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; }; - module2.exports = Json; + 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/archiver/index.js -var require_archiver = __commonJS({ - "node_modules/archiver/index.js"(exports2, module2) { - var Archiver = 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 Archiver(format, options); - instance.setFormat(format); - instance.setModule(new formats[format](options)); - return instance; - } else { - throw new Error("create(" + format + "): format not registered"); +// 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"); + } } - }; - vending.registerFormat = function(format, module3) { - if (formats[format]) { - throw new Error("register(" + format + "): format already registered"); + for (var i = 0; i < arguments.length; i++) { + var buf = arguments[i]; + this.buffers.push(buf); + this.length += buf.length; } - if (typeof module3 !== "function") { - throw new Error("register(" + format + "): format module invalid"); + 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"); + } } - if (typeof module3.prototype.append !== "function" || typeof module3.prototype.finalize !== "function") { - throw new Error("register(" + format + "): format module missing methods"); + for (var i = 0; i < arguments.length; i++) { + var buf = arguments[i]; + this.buffers.unshift(buf); + this.length += buf.length; } - formats[format] = module3; + return this.length; }; - vending.isRegisteredFormat = function(format) { - if (formats[format]) { - return true; - } - return false; + Buffers.prototype.copy = function(dst, dStart, start, end) { + return this.slice(start, end).copy(dst, dStart, 0, end - start); }; - vending.registerFormat("zip", require_zip()); - vending.registerFormat("tar", require_tar()); - 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 __createBinding4 = 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]; - } }; + Buffers.prototype.splice = function(i, howMany) { + var buffers = this.buffers; + var index = i >= 0 ? i : this.length - i; + var reps = [].slice.call(arguments, 2); + if (howMany === void 0) { + howMany = this.length - index; + } else if (howMany > this.length - index) { + howMany = this.length - index; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + for (var i = 0; i < reps.length; i++) { + this.length += reps[i].length; } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + var removed = new Buffers(); + var bytes = 0; + var startBytes = 0; + for (var ii = 0; ii < buffers.length && startBytes + buffers[ii].length < index; ii++) { + startBytes += buffers[ii].length; + } + if (index - startBytes > 0) { + var start = index - 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]; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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++; } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + 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); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + } + this.length -= removed.length; + return removed; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.ZipUploadStream = exports2.DEFAULT_COMPRESSION_LEVEL = void 0; - exports2.createZipUploadStream = createZipUploadStream; - var stream = __importStar4(require("stream")); - var promises_1 = require("fs/promises"); - var archiver2 = __importStar4(require_archiver()); - var core14 = __importStar4(require_core()); - var config_1 = require_config(); - exports2.DEFAULT_COMPRESSION_LEVEL = 6; - var ZipUploadStream = class extends stream.Transform { - constructor(bufferSize) { - super({ - highWaterMark: bufferSize - }); + 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; } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - _transform(chunk, enc, cb) { - cb(null, chunk); + 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; }; - exports2.ZipUploadStream = ZipUploadStream; - function createZipUploadStream(uploadSpecification_1) { - return __awaiter4(this, arguments, void 0, function* (uploadSpecification, compressionLevel = exports2.DEFAULT_COMPRESSION_LEVEL) { - core14.debug(`Creating Artifact archive with compressionLevel: ${compressionLevel}`); - const zip = archiver2.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); - core14.debug(`Zip write high watermark value ${zipUploadStream.writableHighWaterMark}`); - core14.debug(`Zip read high watermark value ${zipUploadStream.readableHighWaterMark}`); - zip.pipe(zipUploadStream); - zip.finalize(); - return zipUploadStream; - }); - } - var zipErrorCallback = (error4) => { - core14.error("An error has occurred while creating the zip file for upload"); - core14.info(error4); - throw new Error("An error has occurred during zip creation for the artifact"); - }; - var zipWarningCallback = (error4) => { - if (error4.code === "ENOENT") { - core14.warning("ENOENT warning during artifact zip creation. No such file or directory"); - core14.info(error4); - } else { - core14.warning(`A non-blocking warning has occurred during artifact zip creation: ${error4.code}`); - core14.info(error4); + 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++; } }; - var zipFinishCallback = () => { - core14.debug("Zip stream for upload has finished."); + Buffers.prototype.get = function get(i) { + var pos = this.pos(i); + return this.buffers[pos.buf].get(pos.offset); }; - var zipEndCallback = () => { - core14.debug("Zip stream for upload has ended."); + Buffers.prototype.set = function set2(i, b) { + var pos = this.pos(i); + return this.buffers[pos.buf].set(pos.offset, b); }; - } -}); - -// 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 __createBinding4 = 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]; - } }; + 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"); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + if (!needle.length) { + return 0; } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + if (!this.length) { + return -1; + } + var i = 0, j = 0, match = 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; } } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var char = this.buffers[i][j]; + if (char == needle[match]) { + if (match == 0) { + mstart = { + i, + j, + pos + }; } + match++; + if (match == needle.length) { + return mstart.pos; + } + } else if (match != 0) { + i = mstart.i; + j = mstart.j; + pos = mstart.pos; + match = 0; } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + j++; + pos++; + } + }; + Buffers.prototype.toBuffer = function() { + return this.slice(); + }; + Buffers.prototype.toString = function(encoding, start, end) { + return this.slice(start, end).toString(encoding); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadArtifact = uploadArtifact; - var core14 = __importStar4(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_util8(); - var blob_upload_1 = require_blob_upload(); - var zip_1 = require_zip2(); - var generated_1 = require_generated(); - var errors_1 = require_errors2(); - function uploadArtifact(name, files, rootDirectory, options) { - return __awaiter4(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}` - }); - } - core14.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); - core14.info(`Artifact ${name}.zip successfully finalized. Artifact ID ${artifactId}`); - return { - size: uploadResult.uploadSize, - digest: uploadResult.sha256Hash, - id: Number(artifactId) - }; - }); - } } }); -// 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_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; } - node = node[key]; } - return node; + var vars = { + get: function(name) { + return getset(name); + }, + set: function(name, value) { + return getset(name, value); + }, + store: store || {} + }; + return vars; }; - 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_modules/binary/index.js +var require_binary = __commonJS({ + "node_modules/binary/index.js"(exports2, module2) { + var Chainsaw = require_chainsaw(); + var EventEmitter = 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); } - 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, init) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init; - this.forEach(function(x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; + 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; }; - Traverse.prototype.deepEqual = function(obj) { - if (arguments.length !== 1) { - throw new Error( - "deepEqual requires exactly one object to compare against" - ); + 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 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 offset = null; + function dispatch() { + if (!pending) { + if (caughtEnd) done = true; + return; } - 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(); + 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); } } } - }); - 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]; - } + } + function builder(saw) { + function next() { + if (!done) saw.next(); } - 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]); + 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(); }); - parents.pop(); - nodes.pop(); - return dst; - } else { - return src; - } - })(this.value); - }; - function walk(root, cb, immutable) { - var path2 = []; - var parents = []; - var alive = true; - return (function walker(node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - var state = { - node, - node_, - path: [].concat(path2), - parent: parents.slice(-1)[0], - key: path2.slice(-1)[0], - isRoot: path2.length === 0, - level: path2.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); + }; + self2.skip = function(bytes) { + if (typeof bytes === "string") { + bytes = vars.get(bytes); + } + getBytes(bytes, function() { + next(); + }); + }; + self2.scan = function find2(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 { - delete state.parent.node[state.key]; + i = Math.max(buffers.length - search.length - offset - taken, 0); } - }, - 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; - } + taken += i; + }; + dispatch(); }; - 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) { - path2.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); - path2.pop(); + self2.peek = function(cb) { + offset = 0; + saw.nest(function() { + cb.call(this, vars.store); + this.tap(function() { + offset = null; + }); }); - 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); + }; + return self2; + } + ; + var stream = Chainsaw.light(builder); + stream.writable = true; + var buffers = Buffers(); + stream.write = function(buf) { + buffers.push(buf); + dispatch(); }; - }); - 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 EventEmitter = 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(); + var vars = Vars(); + var done = false, caughtEnd = false; + stream.end = function() { + caughtEnd = true; + }; + stream.pipe = Stream.prototype.pipe; + Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function(name) { + stream[name] = EventEmitter.prototype[name]; + }); + return stream; }; - Chainsaw.saw = function(builder, handlers) { - var saw = new EventEmitter(); - 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; - }); + exports2.parse = function parse(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); } - }); - process.nextTick(function() { - saw.emit("begin"); - saw.next(); - }); - return ch; - }; - saw.pop = function() { - return saw.actions.shift(); + return self2; + }; + }); + var offset = 0; + var vars = Vars(); + self2.vars = vars.store; + self2.tap = function(cb) { + cb.call(self2, vars.store); + return self2; }; - 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); + 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; }; - saw.nest = function(cb) { - var args = [].slice.call(arguments, 1); - var autonext = true; - if (typeof cb === "boolean") { - var autonext = cb; - cb = args.shift(); + self2.loop = function(cb) { + var end = false; + var ender = function() { + end = true; + }; + while (end === false) { + cb.call(self2, ender, vars.store); } - 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(); + return self2; + }; + self2.buffer = function(name, size) { + if (typeof size === "string") { + size = vars.get(size); } - cb.apply(s.chain(), args); - if (autonext !== false) s.on("end", saw.next); + var buf = buffer.slice(offset, Math.min(buffer.length, offset + size)); + offset += size; + vars.set(name, buf); + return self2; }; - saw.record = function() { - upgradeChainsaw(saw); + self2.skip = function(bytes) { + if (typeof bytes === "string") { + bytes = vars.get(bytes); + } + offset += bytes; + return self2; }; - ["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++]; + 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; }; - saw.trap = function(name, cb) { - var ps = Array.isArray(name) ? name : [name]; - saw.actions.push({ - path: ps, - step: saw.step, - cb, - trap: true - }); + self2.peek = function(cb) { + var was = offset; + cb.call(self2, vars.store); + offset = was; + return self2; }; - 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(); + self2.flush = function() { + vars.store = {}; + return self2; }; - saw.jump = function(step) { - saw.step = step; - saw.next(); + 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/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); +// node_modules/unzip-stream/lib/matcher-stream.js +var require_matcher_stream = __commonJS({ + "node_modules/unzip-stream/lib/matcher-stream.js"(exports2, module2) { + var Transform = require("stream").Transform; + var util = require("util"); + function MatcherStream(patternDesc, matchFn) { + if (!(this instanceof MatcherStream)) { + return new MatcherStream(); + } + Transform.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; } - 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"); + util.inherits(MatcherStream, Transform); + 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; } - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.push(buf); - this.length += buf.length; + 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 stream = require("stream"); + var inherits = require("util").inherits; + function Entry() { + if (!(this instanceof Entry)) { + return new Entry(); + } + stream.PassThrough.call(this); + this.path = null; + this.type = null; + this.isDirectory = false; + } + inherits(Entry, stream.PassThrough); + Entry.prototype.autodrain = function() { + return this.pipe(new stream.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 binary2 = require_binary(); + var stream = require("stream"); + var util = require("util"); + var zlib = 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); + } + stream.Transform.call(this); + this.options = options || {}; + this.data = new Buffer(""); + this.state = states.STREAM_START; + this.skippedBytes = 0; + this.parsedEntity = null; + this.outStreamInfo = {}; + } + util.inherits(UnzipStream, stream.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; } - 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"); - } + var chunkLength = chunk.length; + if (chunkLength < requiredLength) { + return 0; } - for (var i = 0; i < arguments.length; i++) { - var buf = arguments[i]; - this.buffers.unshift(buf); - this.length += buf.length; + 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 path3 = 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) { + path3 = 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: path3, + 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; } - 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 index = i >= 0 ? i : this.length - i; - var reps = [].slice.call(arguments, 2); - if (howMany === void 0) { - howMany = this.length - index; - } else if (howMany > this.length - index) { - howMany = this.length - index; - } - 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 < index; ii++) { - startBytes += buffers[ii].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; } - if (index - startBytes > 0) { - var start = index - 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 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; + } } - var buf1 = new Buffer(orig.length - start - howMany); - for (var i = start + howMany; i < orig.length; i++) { - buf1[i - howMany - start] = orig[i]; + if (!compressedSizeMatches) { + return; } - 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 = []; + 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 { - buffers.splice(ii, 1, buf0, buf1); - ii += 2; + self2.data = matchedChunk.slice(sliceOffset); } - } else { - removed.push(buffers[ii].slice(start)); - buffers[ii] = buffers[ii].slice(0, start); - ii++; - } + return true; + }); + this.outStreamInfo.stream = matcherStream; + } else { + this.outStreamInfo.stream = new stream.PassThrough(); } - if (reps.length > 0) { - buffers.splice.apply(buffers, [ii, 0].concat(reps)); - ii += reps.length; + 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; } - 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); - } + var isCompressed = vars.compressionMethod > 0; + if (isCompressed) { + var inflater = zlib.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(); } - 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; + UnzipStream.prototype._readFile = function(data) { + var vars = binary2.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 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; + var index = 0; + while (index < data.length) { + var vars = binary2.parse(data).skip(index).word16lu("extraId").word16lu("extraSize").vars; + index += 4; + var fieldType = void 0; + switch (vars.extraId) { + case 1: + fieldType = "Zip64 extended information extra field"; + var z64vars = binary2.parse(data.slice(index, index + 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(index); + var offset = 1; + if (vars.extraSize >= offset + 4 && timestampFields & 1) { + extra.mtime = new Date(data.readUInt32LE(index + offset) * 1e3); + offset += 4; + } + if (vars.extraSize >= offset + 4 && timestampFields & 2) { + extra.atime = new Date(data.readUInt32LE(index + offset) * 1e3); + offset += 4; + } + if (vars.extraSize >= offset + 4 && timestampFields & 4) { + extra.ctime = new Date(data.readUInt32LE(index + offset) * 1e3); + } + break; + case 28789: + fieldType = "Info-ZIP Unicode Path Extra Field"; + var fieldVer = data.readUInt8(index); + if (fieldVer === 1) { + var offset = 1; + var nameCrc32 = data.readUInt32LE(index + offset); + offset += 4; + var pathBuffer = data.slice(index + 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(index + offset) * 1e3); + offset += 4; + var mtime = new Date(data.readUInt32LE(index + offset) * 1e3); + offset += 4; + extra.atime = atime; + extra.mtime = mtime; + if (vars.extraSize >= 12) { + var uid = data.readUInt16LE(index + offset); + offset += 2; + var gid = data.readUInt16LE(index + 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(index + offset); + offset += 2; + var gid = data.readUInt16LE(index + offset); + offset += 2; + extra.uid = uid; + extra.gid = gid; + } + break; + case 30837: + fieldType = "Info-ZIP New Unix"; + var offset = 0; + var extraVer = data.readUInt8(index); + offset += 1; + if (extraVer === 1) { + var uidSize = data.readUInt8(index + offset); + offset += 1; + if (uidSize <= 6) { + extra.uid = data.readUIntLE(index + offset, uidSize); + } + offset += uidSize; + var gidSize = data.readUInt8(index + offset); + offset += 1; + if (gidSize <= 6) { + extra.gid = data.readUIntLE(index + offset, gidSize); + } + } + break; + case 30062: + fieldType = "ASi Unix"; + var offset = 0; + if (vars.extraSize >= 14) { + var crc = data.readUInt32LE(index + offset); + offset += 4; + var mode = data.readUInt16LE(index + offset); + offset += 2; + var sizdev = data.readUInt32LE(index + offset); + offset += 4; + var uid = data.readUInt16LE(index + offset); + offset += 2; + var gid = data.readUInt16LE(index + offset); + offset += 2; + extra.mode = mode; + extra.uid = uid; + extra.gid = gid; + if (vars.extraSize > 14) { + var start = index + offset; + var end = index + 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(index, index + vars.extraSize).inspect() + }); + } + index += vars.extraSize; } - return target; + return result; }; - 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++; + UnzipStream.prototype._readDataDescriptor = function(data, zip64Mode) { + if (zip64Mode) { + var vars = binary2.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars; + return vars; } + var vars = binary2.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars; + return vars; }; - Buffers.prototype.get = function get(i) { - var pos = this.pos(i); - return this.buffers[pos.buf].get(pos.offset); + UnzipStream.prototype._readCentralDirectoryEntry = function(data) { + var vars = binary2.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; }; - Buffers.prototype.set = function set2(i, b) { - var pos = this.pos(i); - return this.buffers[pos.buf].set(pos.offset, b); + UnzipStream.prototype._readEndOfCentralDirectory64 = function(data) { + var vars = binary2.parse(data).word64lu("centralDirectoryRecordSize").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskNumberWithCentralDirectoryStart").word64lu("centralDirectoryEntries").word64lu("totalCentralDirectoryEntries").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars; + return vars; }; - 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"); + UnzipStream.prototype._readEndOfCentralDirectory = function(data) { + var vars = binary2.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 (!needle.length) { - return 0; + if (this.options.decodeString) { + return this.options.decodeString(buffer); } - if (!this.length) { - return -1; + let result = ""; + for (var i = 0; i < buffer.length; i++) { + result += cp437[buffer[i]]; } - var i = 0, j = 0, match = 0, mstart, pos = 0; - if (offset) { - var p = this.pos(offset); - i = p.buf; - j = p.offset; - pos = offset; + 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; } - 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[match]) { - if (match == 0) { - mstart = { - i, - j, - pos - }; + 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(""); } - match++; - if (match == needle.length) { - return mstart.pos; + 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 if (match != 0) { - i = mstart.i; - j = mstart.j; - pos = mstart.pos; - match = 0; + } 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(); + }); } - j++; - pos++; + return; } + cb(); }; - Buffers.prototype.toBuffer = function() { - return this.slice(); + UnzipStream.prototype.drainAll = function() { + this._drainAllEntries = true; }; - Buffers.prototype.toString = function(encoding, start, end) { - return this.slice(start, end).toString(encoding); + 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); }; - } -}); - -// 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]; + 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(); }); - var key = keys[keys.length - 1]; - if (arguments.length == 1) { - return node[key]; - } else { - return node[key] = value; - } + return; } - var vars = { - get: function(name) { - return getset(name); - }, - set: function(name, value) { - return getset(name, value); - }, - store: store || {} - }; - return vars; + 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/binary/index.js -var require_binary = __commonJS({ - "node_modules/binary/index.js"(exports2, module2) { - var Chainsaw = require_chainsaw(); - var EventEmitter = 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); +// node_modules/unzip-stream/lib/parser-stream.js +var require_parser_stream = __commonJS({ + "node_modules/unzip-stream/lib/parser-stream.js"(exports2, module2) { + var Transform = require("stream").Transform; + var util = require("util"); + var UnzipStream = require_unzip_stream(); + function ParserStream(opts) { + if (!(this instanceof ParserStream)) { + return new ParserStream(opts); } - 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(); + var transformOpts = opts || {}; + Transform.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); + }); + } + util.inherits(ParserStream, Transform); + 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"); }); - } - return s; + cb(); + }); }; - 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(); + ParserStream.prototype.on = function(eventName, fn) { + if (eventName === "entry") { + return Transform.prototype.on.call(this, "data", fn); } - 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); - } - } - } + return Transform.prototype.on.call(this, eventName, fn); + }; + ParserStream.prototype.drainAll = function() { + this.unzipStream.drainAll(); + return this.pipe(new Transform({ 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 path3 = require("path"); + var fs3 = 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 }; } - 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 find2(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 mode = opts.mode; + var xfs = opts.fs || fs3; + if (mode === void 0) { + mode = _0777; } - ; - var stream = Chainsaw.light(builder); - stream.writable = true; - var buffers = Buffers(); - stream.write = function(buf) { - buffers.push(buf); - dispatch(); - }; - var vars = Vars(); - var done = false, caughtEnd = false; - stream.end = function() { - caughtEnd = true; - }; - stream.pipe = Stream.prototype.pipe; - Object.getOwnPropertyNames(EventEmitter.prototype).forEach(function(name) { - stream[name] = EventEmitter.prototype[name]; - }); - return stream; - }; - exports2.parse = function parse(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; + if (!made) made = null; + var cb = f || /* istanbul ignore next */ + function() { }; - 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; + p = path3.resolve(p); + xfs.mkdir(p, mode, function(er) { + if (!er) { + made = made || p; + return cb(null, made); } - 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; + switch (er.code) { + case "ENOENT": + if (path3.dirname(p) === p) return cb(er); + mkdirP(path3.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, stat) { + if (er2 || !stat.isDirectory()) cb(er, made); + else cb(null, made); + }); + break; + } + }); } - function decodeBEu(bytes) { - var acc = 0; - for (var i = 0; i < bytes.length; i++) { - acc += Math.pow(256, bytes.length - i - 1) * bytes[i]; + mkdirP.sync = function sync(p, opts, made) { + if (!opts || typeof opts !== "object") { + opts = { mode: opts }; } - return acc; - } - function decodeBEs(bytes) { - var val2 = decodeBEu(bytes); - if ((bytes[0] & 128) == 128) { - val2 -= Math.pow(256, bytes.length); + var mode = opts.mode; + var xfs = opts.fs || fs3; + if (mode === void 0) { + mode = _0777; } - return val2; - } - function decodeLEs(bytes) { - var val2 = decodeLEu(bytes); - if ((bytes[bytes.length - 1] & 128) == 128) { - val2 -= Math.pow(256, bytes.length); + if (!made) made = null; + p = path3.resolve(p); + try { + xfs.mkdirSync(p, mode); + made = made || p; + } catch (err0) { + switch (err0.code) { + case "ENOENT": + made = sync(path3.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 stat; + try { + stat = xfs.statSync(p); + } catch (err1) { + throw err0; + } + if (!stat.isDirectory()) throw err0; + break; + } } - return val2; - } - 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; - } + return made; + }; } }); -// node_modules/unzip-stream/lib/matcher-stream.js -var require_matcher_stream = __commonJS({ - "node_modules/unzip-stream/lib/matcher-stream.js"(exports2, module2) { - var Transform = require("stream").Transform; +// node_modules/unzip-stream/lib/extract.js +var require_extract2 = __commonJS({ + "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { + var fs3 = require("fs"); + var path3 = require("path"); var util = require("util"); - function MatcherStream(patternDesc, matchFn) { - if (!(this instanceof MatcherStream)) { - return new MatcherStream(); - } + var mkdirp = require_mkdirp(); + var Transform = require("stream").Transform; + var UnzipStream = require_unzip_stream(); + function Extract(opts) { + if (!(this instanceof Extract)) + return new Extract(opts); Transform.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; + 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); + }); } - util.inherits(MatcherStream, Transform); - 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); + util.inherits(Extract, Transform); + 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); } - 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; + allDone(); + }); }; - MatcherStream.prototype._transform = function(chunk, encoding, cb) { - this.data = Buffer.concat([this.data, chunk]); - var firstIteration = true; - while (this.checkDataChunk(!firstIteration)) { - firstIteration = false; + Extract.prototype._processEntry = function(entry) { + var self2 = this; + var destPath = path3.join(this.opts.path, entry.path); + var directory = entry.isDirectory ? destPath : path3.dirname(destPath); + this.unfinishedEntries++; + var writeFileFn = function() { + var pipedStream = fs3.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(); } - cb(); - }; - MatcherStream.prototype._flush = function(cb) { - if (this.data.length > 0) { - var firstIteration = true; - while (this.checkDataChunk(!firstIteration)) { - firstIteration = false; + 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; } - if (this.data.length > 0) { - this.push(this.data); - this.data = null; - } - cb(); }; - module2.exports = MatcherStream; + module2.exports = Extract; } }); -// node_modules/unzip-stream/lib/entry.js -var require_entry = __commonJS({ - "node_modules/unzip-stream/lib/entry.js"(exports2, module2) { +// node_modules/unzip-stream/unzip.js +var require_unzip = __commonJS({ + "node_modules/unzip-stream/unzip.js"(exports2) { "use strict"; - var stream = require("stream"); - var inherits = require("util").inherits; - function Entry() { - if (!(this instanceof Entry)) { - return new Entry(); - } - stream.PassThrough.call(this); - this.path = null; - this.type = null; - this.isDirectory = false; - } - inherits(Entry, stream.PassThrough); - Entry.prototype.autodrain = function() { - return this.pipe(new stream.Transform({ transform: function(d, e, cb) { - cb(); - } })); - }; - module2.exports = Entry; + exports2.Parse = require_parser_stream(); + exports2.Extract = require_extract2(); } }); -// node_modules/unzip-stream/lib/unzip-stream.js -var require_unzip_stream = __commonJS({ - "node_modules/unzip-stream/lib/unzip-stream.js"(exports2, module2) { +// 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 binary2 = require_binary(); - var stream = require("stream"); - var util = require("util"); - var zlib = 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); - } - stream.Transform.call(this); - this.options = options || {}; - this.data = new Buffer(""); - this.state = states.STREAM_START; - this.skippedBytes = 0; - this.parsedEntity = null; - this.outStreamInfo = {}; - } - util.inherits(UnzipStream, stream.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 path2 = 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) { - path2 = 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: path2, - 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 __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]; + } }; } - 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 + 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; }; - 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; - } + 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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (!compressedSizeMatches) { - return; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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]); + } + function step(result) { + result.done ? resolve2(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.streamExtractExternal = streamExtractExternal; + exports2.downloadArtifactPublic = downloadArtifactPublic; + exports2.downloadArtifactInternal = downloadArtifactInternal; + var promises_1 = __importDefault2(require("fs/promises")); + var crypto2 = __importStar2(require("crypto")); + var stream = __importStar2(require("stream")); + var github2 = __importStar2(require_github()); + var core14 = __importStar2(require_core()); + var httpClient = __importStar2(require_lib()); + var unzip_stream_1 = __importDefault2(require_unzip()); + var user_agent_1 = require_user_agent(); + var config_1 = require_config(); + var artifact_twirp_client_1 = require_artifact_twirp_client2(); + var generated_1 = require_generated(); + var util_1 = require_util8(); + var errors_1 = require_errors2(); + var scrubQueryParameters = (url) => { + const parsed = new URL(url); + parsed.search = ""; + return parsed.toString(); + }; + function exists(path3) { + return __awaiter2(this, void 0, void 0, function* () { + try { + yield promises_1.default.access(path3); + return true; + } catch (error3) { + if (error3.code === "ENOENT") { + return false; } else { - self2.data = matchedChunk.slice(sliceOffset); + throw error3; } - return true; - }); - this.outStreamInfo.stream = matcherStream; - } else { - this.outStreamInfo.stream = new stream.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)); + } + }); + } + function streamExtract(url, directory) { + return __awaiter2(this, void 0, void 0, function* () { + let retryCount = 0; + while (retryCount < 5) { + try { + return yield streamExtractExternal(url, directory); + } catch (error3) { + retryCount++; + core14.debug(`Failed to download artifact after ${retryCount} retries due to ${error3.message}. Retrying in 5 seconds...`); + yield new Promise((resolve2) => setTimeout(resolve2, 5e3)); + } + } + throw new Error(`Artifact download failed after ${retryCount} retries.`); + }); + } + function streamExtractExternal(url_1, directory_1) { + return __awaiter2(this, arguments, void 0, function* (url, directory, opts = { timeout: 30 * 1e3 }) { + const client = new httpClient.HttpClient((0, user_agent_1.getUserAgentString)()); + const response = yield client.get(url); + 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((resolve2, 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 = crypto2.createHash("sha256").setEncoding("hex"); + const passThrough = new stream.PassThrough(); + response.message.pipe(passThrough); + passThrough.pipe(hashStream); + const extractStream = passThrough; + extractStream.on("data", () => { + timer.refresh(); + }).on("error", (error3) => { + core14.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(); + core14.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); + } + resolve2({ sha256Digest: `sha256:${sha256Digest}` }); + }).on("error", (error3) => { + reject(error3); + }); }); - this.outStreamInfo.stream.pipe(new Entry().autodrain()); - return; - } - var isCompressed = vars.compressionMethod > 0; - if (isCompressed) { - var inflater = zlib.createInflateRaw(); - inflater.on("error", function(err) { - self2.state = states.ERROR; - self2.emit("error", err); + }); + } + 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 = github2.getOctokit(token); + let digestMismatch = false; + core14.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" + } }); - 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 = binary2.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 index = 0; - while (index < data.length) { - var vars = binary2.parse(data).skip(index).word16lu("extraId").word16lu("extraSize").vars; - index += 4; - var fieldType = void 0; - switch (vars.extraId) { - case 1: - fieldType = "Zip64 extended information extra field"; - var z64vars = binary2.parse(data.slice(index, index + 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(index); - var offset = 1; - if (vars.extraSize >= offset + 4 && timestampFields & 1) { - extra.mtime = new Date(data.readUInt32LE(index + offset) * 1e3); - offset += 4; - } - if (vars.extraSize >= offset + 4 && timestampFields & 2) { - extra.atime = new Date(data.readUInt32LE(index + offset) * 1e3); - offset += 4; - } - if (vars.extraSize >= offset + 4 && timestampFields & 4) { - extra.ctime = new Date(data.readUInt32LE(index + offset) * 1e3); - } - break; - case 28789: - fieldType = "Info-ZIP Unicode Path Extra Field"; - var fieldVer = data.readUInt8(index); - if (fieldVer === 1) { - var offset = 1; - var nameCrc32 = data.readUInt32LE(index + offset); - offset += 4; - var pathBuffer = data.slice(index + 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(index + offset) * 1e3); - offset += 4; - var mtime = new Date(data.readUInt32LE(index + offset) * 1e3); - offset += 4; - extra.atime = atime; - extra.mtime = mtime; - if (vars.extraSize >= 12) { - var uid = data.readUInt16LE(index + offset); - offset += 2; - var gid = data.readUInt16LE(index + 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(index + offset); - offset += 2; - var gid = data.readUInt16LE(index + offset); - offset += 2; - extra.uid = uid; - extra.gid = gid; - } - break; - case 30837: - fieldType = "Info-ZIP New Unix"; - var offset = 0; - var extraVer = data.readUInt8(index); - offset += 1; - if (extraVer === 1) { - var uidSize = data.readUInt8(index + offset); - offset += 1; - if (uidSize <= 6) { - extra.uid = data.readUIntLE(index + offset, uidSize); - } - offset += uidSize; - var gidSize = data.readUInt8(index + offset); - offset += 1; - if (gidSize <= 6) { - extra.gid = data.readUIntLE(index + offset, gidSize); - } + 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`); + } + core14.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); + try { + core14.info(`Starting download of artifact to: ${downloadPath}`); + const extractResponse = yield streamExtract(location, downloadPath); + core14.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; + core14.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core14.debug(`Expected digest: ${options.expectedHash}`); } - break; - case 30062: - fieldType = "ASi Unix"; - var offset = 0; - if (vars.extraSize >= 14) { - var crc = data.readUInt32LE(index + offset); - offset += 4; - var mode = data.readUInt16LE(index + offset); - offset += 2; - var sizdev = data.readUInt32LE(index + offset); - offset += 4; - var uid = data.readUInt16LE(index + offset); - offset += 2; - var gid = data.readUInt16LE(index + offset); - offset += 2; - extra.mode = mode; - extra.uid = uid; - extra.gid = gid; - if (vars.extraSize > 14) { - var start = index + offset; - var end = index + vars.extraSize - 14; - var symlinkName = this._decodeString(data.slice(start, end)); - extra.symlink = symlinkName; - } + } + } catch (error3) { + throw new Error(`Unable to download and extract artifact: ${error3.message}`); + } + return { downloadPath, digestMismatch }; + }); + } + 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) { + core14.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); + core14.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); + try { + core14.info(`Starting download of artifact to: ${downloadPath}`); + const extractResponse = yield streamExtract(signedUrl, downloadPath); + core14.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; + core14.debug(`Computed digest: ${extractResponse.sha256Digest}`); + core14.debug(`Expected digest: ${options.expectedHash}`); } - break; + } + } catch (error3) { + throw new Error(`Unable to download and extract artifact: ${error3.message}`); } - if (this.options.debug) { - result.debug.push({ - extraId: "0x" + vars.extraId.toString(16), - description: fieldType, - data: data.slice(index, index + vars.extraSize).inspect() - }); + return { downloadPath, digestMismatch }; + }); + } + function resolveOrCreateDirectory() { + return __awaiter2(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { + if (!(yield exists(downloadPath))) { + core14.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); + yield promises_1.default.mkdir(downloadPath, { recursive: true }); + } else { + core14.debug(`Artifact destination folder already exists: ${downloadPath}`); } - index += vars.extraSize; + 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]; + } }; } - return result; - }; - UnzipStream.prototype._readDataDescriptor = function(data, zip64Mode) { - if (zip64Mode) { - var vars = binary2.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars; - return vars; + 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.getRetryOptions = getRetryOptions; + var core14 = __importStar2(require_core()); + var defaultMaxRetryNumber = 5; + var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; + function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { + var _a; + if (retries <= 0) { + return [{ enabled: false }, defaultOptions.request]; } - var vars = binary2.parse(data).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars; - return vars; - }; - UnzipStream.prototype._readCentralDirectoryEntry = function(data) { - var vars = binary2.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 = binary2.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 = binary2.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"); + const retryOptions = { + enabled: true + }; + if (exemptStatusCodes.length > 0) { + retryOptions.doNotRetry = exemptStatusCodes; } - if (this.options.decodeString) { - return this.options.decodeString(buffer); + const requestOptions = Object.assign(Object.assign({}, defaultOptions.request), { retries }); + core14.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : "octokit default: [400, 401, 403, 404, 422]"})`); + return [retryOptions, requestOptions]; + } + } +}); + +// node_modules/@octokit/plugin-request-log/dist-node/index.js +var require_dist_node16 = __commonJS({ + "node_modules/@octokit/plugin-request-log/dist-node/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var VERSION = "1.0.4"; + function requestLog(octokit) { + octokit.hook.wrap("request", (request, options) => { + octokit.log.debug("request", options); + const start = Date.now(); + const requestOptions = octokit.request.endpoint.parse(options); + const path3 = requestOptions.url.replace(options.baseUrl, ""); + return request(options).then((response) => { + octokit.log.info(`${requestOptions.method} ${path3} - ${response.status} in ${Date.now() - start}ms`); + return response; + }).catch((error3) => { + octokit.log.info(`${requestOptions.method} ${path3} - ${error3.status} in ${Date.now() - start}ms`); + throw error3; + }); + }); + } + requestLog.VERSION = VERSION; + exports2.requestLog = requestLog; + } +}); + +// node_modules/@actions/artifact/node_modules/@octokit/plugin-retry/dist-node/index.js +var require_dist_node17 = __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 Bottleneck = _interopDefault(require_light()); + async function errorRequest(octokit, state, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - let result = ""; - for (var i = 0; i < buffer.length; i++) { - result += cp437[buffer[i]]; + 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); } - 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; + throw error3; + } + async function wrapRequest(state, request, options) { + const limiter = new Bottleneck(); + limiter.on("failed", function(error3, info7) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; + options.request.retryCount = info7.retryCount + 1; + if (maxRetries > info7.retryCount) { + return after * state.retryAfterBaseValue; + } + }); + return limiter.schedule(request, options); + } + var VERSION = "3.0.9"; + function retry3(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", errorRequest.bind(null, octokit, state)); + octokit.hook.wrap("request", wrapRequest.bind(null, state)); } - 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); + return { + retry: { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { + retries, + retryAfter + }); + return error3; } - } 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; + }; + } + retry3.VERSION = VERSION; + exports2.VERSION = VERSION; + exports2.retry = retry3; + } +}); + +// 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]; + } }; } - 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; + 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]); } - cb(); + __setModuleDefault2(result, mod); + return result; }; - 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(); + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); - return; - } - if (self2.state === states.FILE_DATA) { - return cb(new Error("Stream finished in an invalid state, uncompression failed")); } - setImmediate(cb); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - module2.exports = UnzipStream; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getArtifactPublic = getArtifactPublic; + exports2.getArtifactInternal = getArtifactInternal; + var github_1 = require_github(); + var plugin_retry_1 = require_dist_node17(); + var core14 = __importStar2(require_core()); + var utils_1 = require_utils4(); + var retry_options_1 = require_retry_options(); + var plugin_request_log_1 = require_dist_node16(); + var util_1 = require_util8(); + var user_agent_1 = require_user_agent(); + var artifact_twirp_client_1 = require_artifact_twirp_client2(); + var generated_1 = require_generated(); + var errors_1 = require_errors2(); + function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + 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 github2 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); + const getArtifactResp = yield github2.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} (${(_a = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp.headers) === null || _a === void 0 ? void 0 : _a["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]; + core14.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 + } + }; + }); + } + function getArtifactInternal(artifactName) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + 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]; + core14.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: (_a = artifact2.digest) === null || _a === void 0 ? void 0 : _a.value + } + }; + }); + } } }); -// node_modules/unzip-stream/lib/parser-stream.js -var require_parser_stream = __commonJS({ - "node_modules/unzip-stream/lib/parser-stream.js"(exports2, module2) { - var Transform = require("stream").Transform; - var util = require("util"); - var UnzipStream = require_unzip_stream(); - function ParserStream(opts) { - if (!(this instanceof ParserStream)) { - return new ParserStream(opts); +// 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(resolve2) { + resolve2(value); + }); } - var transformOpts = opts || {}; - Transform.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(error4) { - self2.emit("error", error4); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - util.inherits(ParserStream, Transform); - 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"); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.deleteArtifactPublic = deleteArtifactPublic; + exports2.deleteArtifactInternal = deleteArtifactInternal; + var core_1 = require_core(); + var github_1 = require_github(); + var user_agent_1 = require_user_agent(); + var retry_options_1 = require_retry_options(); + var utils_1 = require_utils4(); + var plugin_request_log_1 = require_dist_node16(); + var plugin_retry_1 = require_dist_node17(); + var artifact_twirp_client_1 = require_artifact_twirp_client2(); + var util_1 = require_util8(); + var generated_1 = require_generated(); + var get_artifact_1 = require_get_artifact(); + var errors_1 = require_errors2(); + function deleteArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + 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 github2 = (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 github2.rest.actions.deleteArtifact({ + owner: repositoryOwner, + repo: repositoryName, + artifact_id: getArtifactResp.artifact.id }); - cb(); + if (deleteArtifactResp.status !== 204) { + throw new errors_1.InvalidResponseError(`Invalid response from GitHub API: ${deleteArtifactResp.status} (${(_a = deleteArtifactResp === null || deleteArtifactResp === void 0 ? void 0 : deleteArtifactResp.headers) === null || _a === void 0 ? void 0 : _a["x-github-request-id"]})`); + } + return { + id: getArtifactResp.artifact.id + }; }); - }; - ParserStream.prototype.on = function(eventName, fn) { - if (eventName === "entry") { - return Transform.prototype.on.call(this, "data", fn); - } - return Transform.prototype.on.call(this, eventName, fn); - }; - ParserStream.prototype.drainAll = function() { - this.unzipStream.drainAll(); - return this.pipe(new Transform({ objectMode: true, transform: function(d, e, cb) { - cb(); - } })); - }; - module2.exports = ParserStream; + } + 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) + }; + }); + } } }); -// node_modules/mkdirp/index.js -var require_mkdirp = __commonJS({ - "node_modules/mkdirp/index.js"(exports2, module2) { - var path2 = require("path"); - var fs2 = 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 || fs2; - if (mode === void 0) { - mode = _0777; +// 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(resolve2) { + resolve2(value); + }); } - if (!made) made = null; - var cb = f || /* istanbul ignore next */ - function() { - }; - p = path2.resolve(p); - xfs.mkdir(p, mode, function(er) { - if (!er) { - made = made || p; - return cb(null, made); + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - switch (er.code) { - case "ENOENT": - if (path2.dirname(p) === p) return cb(er); - mkdirP(path2.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, stat) { - if (er2 || !stat.isDirectory()) cb(er, made); - else cb(null, made); - }); - break; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - mkdirP.sync = function sync(p, opts, made) { - if (!opts || typeof opts !== "object") { - opts = { mode: opts }; - } - var mode = opts.mode; - var xfs = opts.fs || fs2; - if (mode === void 0) { - mode = _0777; - } - if (!made) made = null; - p = path2.resolve(p); - try { - xfs.mkdirSync(p, mode); - made = made || p; - } catch (err0) { - switch (err0.code) { - case "ENOENT": - made = sync(path2.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 stat; - try { - stat = xfs.statSync(p); - } catch (err1) { - throw err0; - } - if (!stat.isDirectory()) throw err0; - break; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.listArtifactsPublic = listArtifactsPublic; + exports2.listArtifactsInternal = listArtifactsInternal; + var core_1 = require_core(); + var github_1 = require_github(); + var user_agent_1 = require_user_agent(); + var retry_options_1 = require_retry_options(); + var utils_1 = require_utils4(); + var plugin_request_log_1 = require_dist_node16(); + var plugin_retry_1 = require_dist_node17(); + var artifact_twirp_client_1 = require_artifact_twirp_client2(); + var util_1 = require_util8(); + var config_1 = require_config(); + 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 github2 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); + let currentPageNumber = 1; + const { data: listArtifactResponse } = yield github2.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 github2.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 + }); + } } - } - return made; - }; - } -}); - -// node_modules/unzip-stream/lib/extract.js -var require_extract2 = __commonJS({ - "node_modules/unzip-stream/lib/extract.js"(exports2, module2) { - var fs2 = require("fs"); - var path2 = require("path"); - var util = require("util"); - var mkdirp = require_mkdirp(); - var Transform = require("stream").Transform; - var UnzipStream = require_unzip_stream(); - function Extract(opts) { - if (!(this instanceof Extract)) - return new Extract(opts); - Transform.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(error4) { - self2.emit("error", error4); + if (latest) { + artifacts = filterLatest(artifacts); + } + (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); + return { + artifacts + }; }); } - util.inherits(Extract, Transform); - 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"); + 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 _a; + return { + name: artifact2.name, + id: Number(artifact2.databaseId), + size: Number(artifact2.size), + createdAt: artifact2.createdAt ? generated_1.Timestamp.toDate(artifact2.createdAt) : void 0, + digest: (_a = artifact2.digest) === null || _a === void 0 ? void 0 : _a.value + }; }); - cb(); - }; - this.unzipStream.end(function() { - if (self2.unfinishedEntries > 0) { - self2.afterFlushWait = true; - return self2.on("await-finished", allDone); + if (latest) { + artifacts = filterLatest(artifacts); } - allDone(); + (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); + return { + artifacts + }; }); - }; - Extract.prototype._processEntry = function(entry) { - var self2 = this; - var destPath = path2.join(this.opts.path, entry.path); - var directory = entry.isDirectory ? destPath : path2.dirname(destPath); - this.unfinishedEntries++; - var writeFileFn = function() { - var pipedStream = fs2.createWriteStream(destPath); - pipedStream.on("close", function() { - self2.unfinishedEntries--; - self2._notifyAwaiter(); - }); - pipedStream.on("error", function(error4) { - self2.emit("error", error4); - }); - 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; + } + 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); } - 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(); + return latestArtifacts; + } } }); -// 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) { +// node_modules/@actions/artifact/lib/internal/client.js +var require_client2 = __commonJS({ + "node_modules/@actions/artifact/lib/internal/client.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -99430,202 +103527,442 @@ var require_download_artifact = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + 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.streamExtractExternal = streamExtractExternal; - exports2.downloadArtifactPublic = downloadArtifactPublic; - exports2.downloadArtifactInternal = downloadArtifactInternal; - var promises_1 = __importDefault4(require("fs/promises")); - var crypto = __importStar4(require("crypto")); - var stream = __importStar4(require("stream")); - var github2 = __importStar4(require_github()); - var core14 = __importStar4(require_core()); - var httpClient = __importStar4(require_lib3()); - var unzip_stream_1 = __importDefault4(require_unzip()); - var user_agent_1 = require_user_agent(); + exports2.DefaultArtifactClient = void 0; + var core_1 = require_core(); var config_1 = require_config(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var generated_1 = require_generated(); - var util_1 = require_util8(); + 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_errors2(); - var scrubQueryParameters = (url) => { - const parsed = new URL(url); - parsed.search = ""; - return parsed.toString(); - }; - function exists(path2) { - return __awaiter4(this, void 0, void 0, function* () { - try { - yield promises_1.default.access(path2); - return true; - } catch (error4) { - if (error4.code === "ENOENT") { - return false; - } else { - throw error4; + 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; } - } - }); - } - function streamExtract(url, directory) { - return __awaiter4(this, void 0, void 0, function* () { - let retryCount = 0; - while (retryCount < 5) { + }); + } + downloadArtifact(artifactId, options) { + return __awaiter2(this, void 0, void 0, function* () { try { - return yield streamExtractExternal(url, directory); - } catch (error4) { - retryCount++; - core14.debug(`Failed to download artifact after ${retryCount} retries due to ${error4.message}. Retrying in 5 seconds...`); - yield new Promise((resolve2) => setTimeout(resolve2, 5e3)); + 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; } - } - throw new Error(`Artifact download failed after ${retryCount} retries.`); - }); - } - function streamExtractExternal(url_1, directory_1) { - return __awaiter4(this, arguments, void 0, function* (url, directory, opts = { timeout: 30 * 1e3 }) { - const client = new httpClient.HttpClient((0, user_agent_1.getUserAgentString)()); - const response = yield client.get(url); - 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((resolve2, 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 = crypto.createHash("sha256").setEncoding("hex"); - const passThrough = new stream.PassThrough(); - response.message.pipe(passThrough); - passThrough.pipe(hashStream); - const extractStream = passThrough; - extractStream.on("data", () => { - timer.refresh(); - }).on("error", (error4) => { - core14.debug(`response.message: Artifact download failed: ${error4.message}`); - clearTimeout(timer); - reject(error4); - }).pipe(unzip_stream_1.default.Extract({ path: directory })).on("close", () => { - clearTimeout(timer); - if (hashStream) { - hashStream.end(); - sha256Digest = hashStream.read(); - core14.info(`SHA256 digest of downloaded artifact is ${sha256Digest}`); + }); + } + listArtifacts(options) { + return __awaiter2(this, void 0, void 0, function* () { + try { + if ((0, config_1.isGhes)()) { + throw new errors_1.GHESNotSupportedError(); } - resolve2({ sha256Digest: `sha256:${sha256Digest}` }); - }).on("error", (error4) => { - reject(error4); - }); + 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; + } }); - }); - } - function downloadArtifactPublic(artifactId, repositoryOwner, repositoryName, token, options) { - return __awaiter4(this, void 0, void 0, function* () { - const downloadPath = yield resolveOrCreateDirectory(options === null || options === void 0 ? void 0 : options.path); - const api = github2.getOctokit(token); - let digestMismatch = false; - core14.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" + } + 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; } }); - 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`); + } + 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_errors2(), 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_utils8 = __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 os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.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"; } - core14.info(`Redirecting to blob download url: ${scrubQueryParameters(location)}`); - try { - core14.info(`Starting download of artifact to: ${downloadPath}`); - const extractResponse = yield streamExtract(location, downloadPath); - core14.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; - core14.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core14.debug(`Expected digest: ${options.expectedHash}`); + 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)}`; + } } } - } catch (error4) { - throw new Error(`Unable to download and extract artifact: ${error4.message}`); } - return { downloadPath, digestMismatch }; + 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 crypto2 = __importStar2(require("crypto")); + var fs3 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils8(); + 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 (!fs3.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" }); } - function downloadArtifactInternal(artifactId, options) { - return __awaiter4(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) { - core14.warning("Multiple artifacts found, defaulting to first."); + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.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}${os2.EOL}${convertedValue}${os2.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"]; } - const signedReq = { - workflowRunBackendId: artifacts[0].workflowRunBackendId, - workflowJobRunBackendId: artifacts[0].workflowJobRunBackendId, - name: artifacts[0].name - }; - const { signedUrl } = yield artifactClient.GetSignedArtifactURL(signedReq); - core14.info(`Redirecting to blob download url: ${scrubQueryParameters(signedUrl)}`); + })(); + if (proxyVar) { try { - core14.info(`Starting download of artifact to: ${downloadPath}`); - const extractResponse = yield streamExtract(signedUrl, downloadPath); - core14.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; - core14.debug(`Computed digest: ${extractResponse.sha256Digest}`); - core14.debug(`Expected digest: ${options.expectedHash}`); - } - } - } catch (error4) { - throw new Error(`Unable to download and extract artifact: ${error4.message}`); + return new DecodedURL(proxyVar); + } catch (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); } - return { downloadPath, digestMismatch }; - }); + } else { + return void 0; + } } - function resolveOrCreateDirectory() { - return __awaiter4(this, arguments, void 0, function* (downloadPath = (0, config_1.getGitHubWorkspaceDir)()) { - if (!(yield exists(downloadPath))) { - core14.debug(`Artifact destination folder does not exist, creating: ${downloadPath}`); - yield promises_1.default.mkdir(downloadPath, { recursive: true }); - } else { - core14.debug(`Artifact destination folder already exists: ${downloadPath}`); + 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 downloadPath; - }); + } + 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(url, base) { + super(url, 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/lib/internal/find/retry-options.js -var require_retry_options = __commonJS({ - "node_modules/@actions/artifact/lib/internal/find/retry-options.js"(exports2) { +// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -99638,305 +103975,613 @@ var require_retry_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); + 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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - __setModuleDefault4(result, mod); - return result; - }; - })(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRetryOptions = getRetryOptions; - var core14 = __importStar4(require_core()); - var defaultMaxRetryNumber = 5; - var defaultExemptStatusCodes = [400, 401, 403, 404, 422]; - function getRetryOptions(defaultOptions, retries = defaultMaxRetryNumber, exemptStatusCodes = defaultExemptStatusCodes) { - var _a; - if (retries <= 0) { - return [{ enabled: false }, defaultOptions.request]; + exports2.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; + var http = __importStar2(require("http")); + var https2 = __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); } - const retryOptions = { - enabled: true - }; - if (exemptStatusCodes.length > 0) { - retryOptions.doNotRetry = exemptStatusCodes; + }; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; } - const requestOptions = Object.assign(Object.assign({}, defaultOptions.request), { retries }); - core14.debug(`GitHub client configured with: (retries: ${requestOptions.retries}, retry-exempt-status-code: ${(_a = retryOptions.doNotRetry) !== null && _a !== void 0 ? _a : "octokit default: [400, 401, 403, 404, 422]"})`); - return [retryOptions, requestOptions]; + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __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", () => { + resolve2(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + })); + }); + } + }; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - } -}); - -// node_modules/@octokit/plugin-request-log/dist-node/index.js -var require_dist_node16 = __commonJS({ - "node_modules/@octokit/plugin-request-log/dist-node/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var VERSION = "1.0.4"; - function requestLog(octokit) { - octokit.hook.wrap("request", (request, options) => { - octokit.log.debug("request", options); - const start = Date.now(); - const requestOptions = octokit.request.endpoint.parse(options); - const path2 = requestOptions.url.replace(options.baseUrl, ""); - return request(options).then((response) => { - octokit.log.info(`${requestOptions.method} ${path2} - ${response.status} in ${Date.now() - start}ms`); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, 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 info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, 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; - }).catch((error4) => { - octokit.log.info(`${requestOptions.method} ${path2} - ${error4.status} in ${Date.now() - start}ms`); - throw error4; }); - }); - } - requestLog.VERSION = VERSION; - exports2.requestLog = requestLog; - } -}); - -// node_modules/@actions/artifact/node_modules/@octokit/plugin-retry/dist-node/index.js -var require_dist_node17 = __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 Bottleneck = _interopDefault(require_light()); - async function errorRequest(octokit, state, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.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(error4, retries, retryAfter); + /** + * 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(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve2(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); + } + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; + } + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info7.httpModule.request(info7.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: ${info7.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); } - throw error4; - } - async function wrapRequest(state, request, options) { - const limiter = new Bottleneck(); - limiter.on("failed", function(error4, info7) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; - options.request.retryCount = info7.retryCount + 1; - if (maxRetries > info7.retryCount) { - return after * state.retryAfterBaseValue; + getAgentDispatcher(serverUrl) { + const parsedUrl = new URL(serverUrl); + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (!useProxy) { + return; } - }); - return limiter.schedule(request, options); - } - var VERSION = "3.0.9"; - function retry3(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", errorRequest.bind(null, octokit, state)); - octokit.hook.wrap("request", wrapRequest.bind(null, state)); + return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); } - return { - retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { - retries, - retryAfter - }); - return error4; + _prepareRequest(method, requestUrl, headers) { + const info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); } } - }; - } - retry3.VERSION = VERSION; - exports2.VERSION = VERSION; - exports2.retry = retry3; - } -}); - -// 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 __createBinding4 = 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]; - } }; + return info7; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + return lowercaseKeys(headers || {}); } - return new (P || (P = Promise))(function(resolve2, 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); - } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getArtifactPublic = getArtifactPublic; - exports2.getArtifactInternal = getArtifactInternal; - var github_1 = require_github(); - var plugin_retry_1 = require_dist_node17(); - var core14 = __importStar4(require_core()); - var utils_1 = require_utils4(); - var retry_options_1 = require_retry_options(); - var plugin_request_log_1 = require_dist_node16(); - var util_1 = require_util8(); - var user_agent_1 = require_user_agent(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var generated_1 = require_generated(); - var errors_1 = require_errors2(); - function getArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) { - return __awaiter4(this, void 0, void 0, function* () { - var _a; - 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 github2 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); - const getArtifactResp = yield github2.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} (${(_a = getArtifactResp === null || getArtifactResp === void 0 ? void 0 : getArtifactResp.headers) === null || _a === void 0 ? void 0 : _a["x-github-request-id"]})`); + if (!useProxy) { + agent = this._agent; } - 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`); + if (agent) { + return agent; } - let artifact2 = getArtifactResp.data.artifacts[0]; - if (getArtifactResp.data.artifacts.length > 1) { - artifact2 = getArtifactResp.data.artifacts.sort((a, b) => b.id - a.id)[0]; - core14.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.id})`); + const usingSsl = parsedUrl.protocol === "https:"; + let maxSockets = 100; + if (this.requestOptions) { + maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; } - 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 + 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; } - }; - }); - } - function getArtifactInternal(artifactName) { - return __awaiter4(this, void 0, void 0, function* () { - var _a; - 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`); + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } - let artifact2 = res.artifacts[0]; - if (res.artifacts.length > 1) { - artifact2 = res.artifacts.sort((a, b) => Number(b.databaseId) - Number(a.databaseId))[0]; - core14.debug(`More than one artifact found for a single name, returning newest (id: ${artifact2.databaseId})`); + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); + this._agent = agent; } - 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: (_a = artifact2.digest) === null || _a === void 0 ? void 0 : _a.value - } - }; - }); - } + 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((resolve2) => setTimeout(() => resolve2(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve2(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 { + resolve2(response); + } + })); + }); + } + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// 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) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -99964,84 +104609,83 @@ var require_delete_artifact = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.deleteArtifactPublic = deleteArtifactPublic; - exports2.deleteArtifactInternal = deleteArtifactInternal; - var core_1 = require_core(); - var github_1 = require_github(); - var user_agent_1 = require_user_agent(); - var retry_options_1 = require_retry_options(); - var utils_1 = require_utils4(); - var plugin_request_log_1 = require_dist_node16(); - var plugin_retry_1 = require_dist_node17(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var util_1 = require_util8(); - var generated_1 = require_generated(); - var get_artifact_1 = require_get_artifact(); - var errors_1 = require_errors2(); - function deleteArtifactPublic(artifactName, workflowRunId, repositoryOwner, repositoryName, token) { - return __awaiter4(this, void 0, void 0, function* () { - var _a; - 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 github2 = (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 github2.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} (${(_a = deleteArtifactResp === null || deleteArtifactResp === void 0 ? void 0 : deleteArtifactResp.headers) === null || _a === void 0 ? void 0 : _a["x-github-request-id"]})`); + 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"); } - return { - id: getArtifactResp.artifact.id - }; - }); - } - function deleteArtifactInternal(artifactName) { - return __awaiter4(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}`); + 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"); } - 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})`); + 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"); } - 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) - }; - }); - } + 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/lib/internal/find/list-artifacts.js -var require_list_artifacts = __commonJS({ - "node_modules/@actions/artifact/lib/internal/find/list-artifacts.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -100069,135 +104713,77 @@ var require_list_artifacts = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.listArtifactsPublic = listArtifactsPublic; - exports2.listArtifactsInternal = listArtifactsInternal; - var core_1 = require_core(); - var github_1 = require_github(); - var user_agent_1 = require_user_agent(); - var retry_options_1 = require_retry_options(); - var utils_1 = require_utils4(); - var plugin_request_log_1 = require_dist_node16(); - var plugin_retry_1 = require_dist_node17(); - var artifact_twirp_client_1 = require_artifact_twirp_client2(); - var util_1 = require_util8(); - var config_1 = require_config(); - 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 __awaiter4(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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib4(); + 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 }; - const github2 = (0, github_1.getOctokit)(token, opts, plugin_retry_1.retry, plugin_request_log_1.requestLog); - let currentPageNumber = 1; - const { data: listArtifactResponse } = yield github2.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; + 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"); } - 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 - }); + 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"); } - currentPageNumber++; - for (currentPageNumber; currentPageNumber <= numberOfPages; currentPageNumber++) { - (0, core_1.debug)(`Fetching page ${currentPageNumber} of artifact list`); - const { data: listArtifactResponse2 } = yield github2.request("GET /repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", { - owner: repositoryOwner, - repo: repositoryName, - run_id: workflowRunId, - per_page: paginationCount, - page: currentPageNumber + return runtimeUrl; + } + static getCall(id_token_url) { + var _a; + 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}`); }); - 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 - }); + const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - } - if (latest) { - artifacts = filterLatest(artifacts); - } - (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); - return { - artifacts - }; - }); - } - function listArtifactsInternal() { - return __awaiter4(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 _a; - return { - name: artifact2.name, - id: Number(artifact2.databaseId), - size: Number(artifact2.size), - createdAt: artifact2.createdAt ? generated_1.Timestamp.toDate(artifact2.createdAt) : void 0, - digest: (_a = artifact2.digest) === null || _a === void 0 ? void 0 : _a.value - }; + return id_token; }); - if (latest) { - artifacts = filterLatest(artifacts); - } - (0, core_1.info)(`Found ${artifacts.length} artifact(s)`); - return { - artifacts - }; - }); - } - 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; - } + 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/lib/internal/client.js -var require_client2 = __commonJS({ - "node_modules/@actions/artifact/lib/internal/client.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -100224,147 +104810,274 @@ var require_client2 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __rest4 = 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_config(); - 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_errors2(); - var DefaultArtifactClient2 = class { - uploadArtifact(name, files, rootDirectory, options) { - return __awaiter4(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 (error4) { - (0, core_1.warning)(`Artifact upload failed with error: ${error4}. - -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 error4; - } - }); + 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 = ""; } - downloadArtifact(artifactId, options) { - return __awaiter4(this, void 0, void 0, function* () { + /** + * 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 { - 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 = __rest4(options, ["findBy"]); - return (0, download_artifact_1.downloadArtifactPublic)(artifactId, repositoryOwner, repositoryName, token, downloadOptions); - } - return (0, download_artifact_1.downloadArtifactInternal)(artifactId, options); - } catch (error4) { - (0, core_1.warning)(`Download Artifact failed with error: ${error4}. - -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 error4; + yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK); + } catch (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); } + this._filePath = pathFromEnv; + return this._filePath; }); } - listArtifacts(options) { - return __awaiter4(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 (error4) { - (0, core_1.warning)(`Listing Artifacts failed with error: ${error4}. - -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 error4; - } + /** + * 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(); }); } - getArtifact(artifactName, options) { - return __awaiter4(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 (error4) { - (0, core_1.warning)(`Get Artifact failed with error: ${error4}. - -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 error4; - } + /** + * 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 }); }); } - deleteArtifact(artifactName, options) { - return __awaiter4(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); + /** + * 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); } - return (0, delete_artifact_1.deleteArtifactInternal)(artifactName); - } catch (error4) { - (0, core_1.warning)(`Delete Artifact failed with error: ${error4}. - -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 error4; - } - }); + 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(); } - }; - 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 }); + /** + * 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/lib/artifact.js -var require_artifact2 = __commonJS({ - "node_modules/@actions/artifact/lib/artifact.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -100377,667 +105090,971 @@ var require_artifact2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); + 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 }); - var client_1 = require_client2(); - __exportStar4(require_interfaces2(), exports2); - __exportStar4(require_errors2(), exports2); - __exportStar4(require_client2(), exports2); - var client = new client_1.DefaultArtifactClient(); - exports2.default = client; + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path3 = __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, path3.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// 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) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkArtifactFilePath = exports2.checkArtifactName = 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 checkArtifactName(name) { - if (!name) { - throw new Error(`Artifact name: ${name}, is incorrectly provided`); + 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); } - 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.`); - } + __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(resolve2) { + resolve2(value); + }); } - (0, core_1.info)(`Artifact name is valid!`); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + 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 fs3 = __importStar2(require("fs")); + var path3 = __importStar2(require("path")); + _a = fs3.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs3.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.checkArtifactName = checkArtifactName; - function checkArtifactFilePath(path2) { - if (!path2) { - throw new Error(`Artifact path: ${path2}, is incorrectly provided`); + 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'); } - for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { - if (path2.includes(invalidCharacterKey)) { - throw new Error(`Artifact path is not valid: ${path2}. 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. - `); + 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 = path3.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 = path3.dirname(filePath); + const upperName = path3.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path3.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, "/"); } - exports2.checkArtifactFilePath = checkArtifactFilePath; + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; } }); -// 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) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUploadSpecification = void 0; - var fs2 = __importStar4(require("fs")); - var core_1 = require_core(); - 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 (!fs2.existsSync(rootDirectory)) { - throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); - } - if (!fs2.statSync(rootDirectory).isDirectory()) { - throw new Error(`Provided rootDirectory ${rootDirectory} is not a valid directory`); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - rootDirectory = (0, path_1.normalize)(rootDirectory); - rootDirectory = (0, path_1.resolve)(rootDirectory); - for (let file of artifactFiles) { - if (!fs2.existsSync(file)) { - throw new Error(`File ${file} does not exist`); - } - if (!fs2.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}`); + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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 fs2 = require("fs"); - var os = require("os"); - var path2 = require("path"); - var crypto = require("crypto"); - var _c = { fs: fs2.constants, os: os.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 = os.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 = fs2.rmdirSync.bind(fs2); - var _gracefulCleanup = false; - function rimraf(dirPath, callback) { - return fs2.rm(dirPath, { recursive: true }, callback); - } - function FN_RIMRAF_SYNC(dirPath) { - return fs2.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() { + function rejected(value) { try { - const name = _generateTmpName(sanitizedOptions); - fs2.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); + step(generator["throw"](value)); + } catch (e) { + reject(e); } - })(); + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - function tmpNameSync(options) { - const args = _parseArguments(options), opts = args[0]; - const sanitizedOptions = _assertAndSanitizeOptionsSync(opts); - let tries = sanitizedOptions.tries; - do { - const name = _generateTmpName(sanitizedOptions); - try { - fs2.statSync(name); - } catch (e) { - return name; + }; + 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 path3 = __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; } - } 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); - fs2.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { - if (err2) return cb(err2); - if (opts.discardDescriptor) { - return fs2.close(fd, function _discardCallback(possibleErr) { - return cb(possibleErr, name, void 0, _prepareTmpFileRemoveCallback(name, -1, opts, false)); - }); + const newDest = destStat && destStat.isDirectory() && copySourceDirectory ? path3.join(dest, path3.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 { - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false)); + yield cpDirRecursive(source, newDest, 0, force); } - }); + } else { + if (path3.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } }); } - function fileSync(options) { - const args = _parseArguments(options), opts = args[0]; - const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor; - const name = tmpNameSync(opts); - let fd = fs2.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); - if (opts.discardDescriptor) { - fs2.closeSync(fd); - fd = void 0; - } - return { - name, - fd, - removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true) - }; + 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 = path3.join(dest, path3.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(path3.dirname(dest)); + yield ioUtil.rename(source, dest); + }); } - 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); - fs2.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err2) { - if (err2) return cb(err2); - cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false)); - }); + 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}`); + } }); } - function dirSync(options) { - const args = _parseArguments(options), opts = args[0]; - const name = tmpNameSync(opts); - fs2.mkdirSync(name, opts.mode || DIR_MODE); - return { - name, - removeCallback: _prepareTmpDirRemoveCallback(name, opts, true) - }; + 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 }); + }); } - function _removeFileAsync(fdPath, next) { - const _handler = function(err) { - if (err && !_isENOENT(err)) { - return next(err); + exports2.mkdirP = mkdirP; + function which6(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); } - next(); - }; - if (0 <= fdPath[0]) - fs2.close(fdPath[0], function() { - fs2.unlink(fdPath[1], _handler); - }); - else fs2.unlink(fdPath[1], _handler); - } - function _removeFileSync(fdPath) { - let rethrownException = null; - try { - if (0 <= fdPath[0]) fs2.closeSync(fdPath[0]); - } catch (e) { - if (!_isEBADF(e) && !_isENOENT(e)) throw e; - } finally { - try { - fs2.unlinkSync(fdPath[1]); - } catch (e) { - if (!_isENOENT(e)) rethrownException = e; + if (check) { + const result = yield which6(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; } - } - if (rethrownException !== null) { - throw rethrownException; - } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); } - 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; + exports2.which = which6; + 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(path3.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(path3.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path3.delimiter)) { + if (p) { + directories.push(p); + } + } + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path3.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); + } + } + return matches; + }); } - function _prepareTmpDirRemoveCallback(name, opts, sync) { - const removeFunction = opts.unsafeCleanup ? rimraf : fs2.rmdir.bind(fs2); - 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; + 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 _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) { - let called = false; - return function _cleanupCallback(next) { - if (!called) { - const toRemove = cleanupCallbackSync || _cleanupCallback; - const index = _removeObjects.indexOf(toRemove); - if (index >= 0) _removeObjects.splice(index, 1); - called = true; - if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) { - return removeFunction(fileOrDirName); + 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 { - return removeFunction(fileOrDirName, next || function() { - }); + yield copyFile(srcFile, destFile, force); } } - }; + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - function _garbageCollector() { - if (!_gracefulCleanup) return; - while (_removeObjects.length) { - try { - _removeObjects[0](); - } catch (e) { + function copyFile(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); } - } + }); } - function _randomChars(howMany) { - let value = [], rnd = null; - try { - rnd = crypto.randomBytes(howMany); - } catch (e) { - rnd = crypto.pseudoRandomBytes(howMany); - } - for (let i = 0; i < howMany; i++) { - value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); + } +}); + +// 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); } - return value.join(""); - } - function _isUndefined(obj) { - return typeof obj === "undefined"; - } - function _parseArguments(options, callback) { - if (typeof options === "function") { - return [{}, options]; + __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(resolve2) { + resolve2(value); + }); } - if (_isUndefined(options)) { - return [{}, callback]; + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path3 = __importStar2(require("path")); + var io6 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - const actualOptions = {}; - for (const key of Object.getOwnPropertyNames(options)) { - actualOptions[key] = options[key]; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - return [actualOptions, callback]; - } - function _resolvePath(name, tmpDir, cb) { - const pathToResolve = path2.isAbsolute(name) ? name : path2.join(tmpDir, name); - fs2.stat(pathToResolve, function(err) { - if (err) { - fs2.realpath(path2.dirname(pathToResolve), function(err2, parentDir) { - if (err2) return cb(err2); - cb(null, path2.join(parentDir, path2.basename(pathToResolve))); - }); + _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 { - fs2.realpath(path2, cb); + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - }); - } - function _resolvePathSync(name, tmpDir) { - const pathToResolve = path2.isAbsolute(name) ? name : path2.join(tmpDir, name); - try { - fs2.statSync(pathToResolve); - return fs2.realpathSync(pathToResolve); - } catch (_err) { - const parentDir = fs2.realpathSync(path2.dirname(pathToResolve)); - return path2.join(parentDir, path2.basename(pathToResolve)); + return cmd; } - } - function _generateTmpName(opts) { - const tmpDir = opts.tmpdir; - if (!_isUndefined(opts.name)) { - return path2.join(tmpDir, opts.dir, opts.name); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (!_isUndefined(opts.template)) { - return path2.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - const name = [ - opts.prefix ? opts.prefix : "tmp", - "-", - process.pid, - "-", - _randomChars(12), - opts.postfix ? "-" + opts.postfix : "" - ].join(""); - return path2.join(tmpDir, opts.dir, name); - } - function _assertOptionsBase(options) { - if (!_isUndefined(options.name)) { - const name = options.name; - if (path2.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); - const basename = path2.basename(name); - if (basename === ".." || basename === "." || basename !== name) - throw new Error(`name option must not contain a path, found "${name}".`); + _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; } - if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) { - throw new Error(`Invalid template, found "${options.template}".`); + _endsWith(str2, end) { + return str2.endsWith(end); } - if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) { - throw new Error(`Invalid tries, found "${options.tries}".`); + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - 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) ? "" : options.prefix; - options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; - } - function _getRelativePath(option, name, tmpDir, cb) { - if (_isUndefined(name)) return cb(null); - _resolvePath(name, tmpDir, function(err, resolvedPath) { - if (err) return cb(err); - const relativePath = path2.relative(tmpDir, resolvedPath); - if (!resolvedPath.startsWith(tmpDir)) { - return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - cb(null, relativePath); - }); - } - function _getRelativePathSync(option, name, tmpDir) { - if (_isUndefined(name)) return; - const resolvedPath = _resolvePathSync(name, tmpDir); - const relativePath = path2.relative(tmpDir, resolvedPath); - if (!resolvedPath.startsWith(tmpDir)) { - throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); + 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(""); } - return relativePath; - } - 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); + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - _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(error4) { - return _isExpectedError(error4, -EBADF, "EBADF"); - } - function _isENOENT(error4) { - return _isExpectedError(error4, -ENOENT, "ENOENT"); - } - function _isExpectedError(error4, errno, code) { - return IS_WIN32 ? error4.code === code : error4.code === code && error4.errno === errno; - } - function setGracefulCleanup() { - _gracefulCleanup = true; - } - function _getTmpDir(options, cb) { - return fs2.realpath(options && options.tmpdir || os.tmpdir(), cb); - } - function _getTmpDirSync(options) { - return fs2.realpathSync(options && options.tmpdir || os.tmpdir()); - } - process.addListener(EXIT, _garbageCollector); - Object.defineProperty(module2.exports, "tmpdir", { - enumerable: true, - configurable: false, - get: function() { - return _getTmpDirSync(); + 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(""); } - }); - 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, path2, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path2, fd, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.file = async (options) => fileWithOptions(options); - module2.exports.withFile = async function withFile(fn, options) { - const { path: path2, fd, cleanup } = await module2.exports.file(options); - try { - return await fn({ path: path2, fd }); - } finally { - await cleanup(); + _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; } - }; - module2.exports.dirSync = tmp.dirSync; - var dirWithOptions = promisify( - (options, cb) => tmp.dir( - options, - (err, path2, cleanup) => err ? cb(err) : cb(void 0, { path: path2, cleanup: promisify(cleanup) }) - ) - ); - module2.exports.dir = async (options) => dirWithOptions(options); - module2.exports.withDir = async function withDir(fn, options) { - const { path: path2, cleanup } = await module2.exports.dir(options); - try { - return await fn({ path: path2 }); - } finally { - await cleanup(); + _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 = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve2, 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) + os2.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 { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - 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/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __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; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; + } + arg += c; + escaped = false; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); + } + continue; } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + if (c === "\\" && escaped) { + append(c); + continue; } - } 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; + if (c === "\\" && inQuotes) { + escaped = true; + continue; + } + if (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; + } + continue; + } + append(c); } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + if (arg.length > 0) { + args.push(arg.trim()); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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; + } } - 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; + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - 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(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + _debug(message) { + this.emit("debug", message); } - get username() { - return this._decodedUsername; + _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); } - get password() { - return this._decodedPassword; + 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/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -101065,667 +106082,937 @@ var require_lib5 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(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(userAgent, 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 = userAgent; - 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; - } + 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.`); } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + 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 _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, 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; - }); + }; + 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]; + } }; } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); - } - this._disposed = true; + 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); } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); + __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(resolve2) { + resolve2(value); }); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - const req = info7.httpModule.request(info7.options, (msg) => { - const res = new HttpClientResponse(msg); - handleResult(void 0, res); + function step(result) { + result.done ? resolve2(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 _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 }); - let socket; - req.on("socket", (sock) => { - socket = sock; + }); + } + 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(resolve2) { + resolve2(value); }); - req.setTimeout(this._socketTimeout || 3 * 6e4, () => { - if (socket) { - socket.end(); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - handleResult(new Error(`Request timeout: ${info7.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(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(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_utils8(); + var os2 = __importStar2(require("os")); + var path3 = __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 exportVariable6(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)); } - /** - * 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); + (0, command_1.issueCommand)("set-env", { name }, convertedVal); + } + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - 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); + process.env["PATH"] = `${inputPath}${path3.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); - } - } - return info7; + if (options && options.trimWhitespace === false) { + return val; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + 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; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - _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; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning10(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning10; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; + return result; + }); + } + exports2.group = group; + function saveState2(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 = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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.`); } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + } + (0, core_1.info)(`Artifact name is valid!`); + } + exports2.checkArtifactName = checkArtifactName; + function checkArtifactFilePath(path3) { + if (!path3) { + throw new Error(`Artifact path: ${path3}, is incorrectly provided`); + } + for (const [invalidCharacterKey, errorMessageForCharacter] of invalidArtifactFilePathCharacters) { + if (path3.includes(invalidCharacterKey)) { + throw new Error(`Artifact path is not valid: ${path3}. 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. + `); } - return agent; } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; - } - if (proxyAgent) { - return proxyAgent; + } + 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 fs3 = __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 (!fs3.existsSync(rootDirectory)) { + throw new Error(`Provided rootDirectory ${rootDirectory} does not exist`); + } + if (!fs3.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 (!fs3.existsSync(file)) { + throw new Error(`File ${file} does not exist`); } - 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 + if (!fs3.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 proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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 { - resolve2(response); - } - })); - }); } - }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + return specifications; + } + exports2.getUploadSpecification = getUploadSpecification; } }); -// node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js -var require_auth3 = __commonJS({ - "node_modules/@actions/artifact-legacy/node_modules/@actions/http-client/lib/auth.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { +// node_modules/tmp/lib/tmp.js +var require_tmp = __commonJS({ + "node_modules/tmp/lib/tmp.js"(exports2, module2) { + var fs3 = require("fs"); + var os2 = require("os"); + var path3 = require("path"); + var crypto2 = require("crypto"); + var _c = { fs: fs3.constants, os: os2.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 = os2.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 = fs3.rmdirSync.bind(fs3); + var _gracefulCleanup = false; + function rimraf(dirPath, callback) { + return fs3.rm(dirPath, { recursive: true }, callback); + } + function FN_RIMRAF_SYNC(dirPath) { + return fs3.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 { - step(generator.next(value)); - } catch (e) { - reject(e); + const name = _generateTmpName(sanitizedOptions); + fs3.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 { + fs3.statSync(name); + } catch (e) { + return name; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + } 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); + fs3.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err2, fd) { + if (err2) return cb(err2); + if (opts.discardDescriptor) { + return fs3.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 = fs3.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE); + if (opts.discardDescriptor) { + fs3.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); + fs3.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); + fs3.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); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + next(); + }; + if (0 <= fdPath[0]) + fs3.close(fdPath[0], function() { + fs3.unlink(fdPath[1], _handler); + }); + else fs3.unlink(fdPath[1], _handler); + } + function _removeFileSync(fdPath) { + let rethrownException = null; + try { + if (0 <= fdPath[0]) fs3.closeSync(fdPath[0]); + } catch (e) { + if (!_isEBADF(e) && !_isENOENT(e)) throw e; + } finally { + try { + fs3.unlinkSync(fdPath[1]); + } catch (e) { + if (!_isENOENT(e)) rethrownException = e; } - 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"); + 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 : fs3.rmdir.bind(fs3); + 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 index = _removeObjects.indexOf(toRemove); + if (index >= 0) _removeObjects.splice(index, 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) { } - options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + } + function _randomChars(howMany) { + let value = [], rnd = null; + try { + rnd = crypto2.randomBytes(howMany); + } catch (e) { + rnd = crypto2.pseudoRandomBytes(howMany); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + for (let i = 0; i < howMany; i++) { + value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]); } - }; - exports2.BasicCredentialHandler = BasicCredentialHandler; - var BearerCredentialHandler = class { - constructor(token) { - this.token = token; + return value.join(""); + } + function _isUndefined(obj) { + return typeof obj === "undefined"; + } + function _parseArguments(options, callback) { + if (typeof options === "function") { + return [{}, options]; } - // 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"); + 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 = path3.isAbsolute(name) ? name : path3.join(tmpDir, name); + fs3.stat(pathToResolve, function(err) { + if (err) { + fs3.realpath(path3.dirname(pathToResolve), function(err2, parentDir) { + if (err2) return cb(err2); + cb(null, path3.join(parentDir, path3.basename(pathToResolve))); + }); + } else { + fs3.realpath(path3, cb); } - options.headers["Authorization"] = `Bearer ${this.token}`; + }); + } + function _resolvePathSync(name, tmpDir) { + const pathToResolve = path3.isAbsolute(name) ? name : path3.join(tmpDir, name); + try { + fs3.statSync(pathToResolve); + return fs3.realpathSync(pathToResolve); + } catch (_err) { + const parentDir = fs3.realpathSync(path3.dirname(pathToResolve)); + return path3.join(parentDir, path3.basename(pathToResolve)); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + } + function _generateTmpName(opts) { + const tmpDir = opts.tmpdir; + if (!_isUndefined(opts.name)) { + return path3.join(tmpDir, opts.dir, opts.name); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + if (!_isUndefined(opts.template)) { + return path3.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6)); } - }; - exports2.BearerCredentialHandler = BearerCredentialHandler; - var PersonalAccessTokenCredentialHandler = class { - constructor(token) { - this.token = token; + const name = [ + opts.prefix ? opts.prefix : "tmp", + "-", + process.pid, + "-", + _randomChars(12), + opts.postfix ? "-" + opts.postfix : "" + ].join(""); + return path3.join(tmpDir, opts.dir, name); + } + function _assertOptionsBase(options) { + if (!_isUndefined(options.name)) { + const name = options.name; + if (path3.isAbsolute(name)) throw new Error(`name option must not contain an absolute path, found "${name}".`); + const basename2 = path3.basename(name); + if (basename2 === ".." || basename2 === "." || basename2 !== name) + throw new Error(`name option must not contain a path, found "${name}".`); } - // 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")}`; + if (!_isUndefined(options.template) && !options.template.match(TEMPLATE_PATTERN)) { + throw new Error(`Invalid template, found "${options.template}".`); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0) { + throw new Error(`Invalid tries, found "${options.tries}".`); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); + 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) ? "" : options.prefix; + options.postfix = _isUndefined(options.postfix) ? "" : options.postfix; + } + function _getRelativePath(option, name, tmpDir, cb) { + if (_isUndefined(name)) return cb(null); + _resolvePath(name, tmpDir, function(err, resolvedPath) { + if (err) return cb(err); + const relativePath = path3.relative(tmpDir, resolvedPath); + if (!resolvedPath.startsWith(tmpDir)) { + return cb(new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`)); + } + cb(null, relativePath); + }); + } + function _getRelativePathSync(option, name, tmpDir) { + if (_isUndefined(name)) return; + const resolvedPath = _resolvePathSync(name, tmpDir); + const relativePath = path3.relative(tmpDir, resolvedPath); + if (!resolvedPath.startsWith(tmpDir)) { + throw new Error(`${option} option must be relative to "${tmpDir}", found "${relativePath}".`); + } + return relativePath; + } + 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 fs3.realpath(options && options.tmpdir || os2.tmpdir(), cb); + } + function _getTmpDirSync(options) { + return fs3.realpathSync(options && options.tmpdir || os2.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, path3, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path3, fd, cleanup: promisify(cleanup) }) + ) + ); + module2.exports.file = async (options) => fileWithOptions(options); + module2.exports.withFile = async function withFile(fn, options) { + const { path: path3, fd, cleanup } = await module2.exports.file(options); + try { + return await fn({ path: path3, fd }); + } finally { + await cleanup(); } }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + module2.exports.dirSync = tmp.dirSync; + var dirWithOptions = promisify( + (options, cb) => tmp.dir( + options, + (err, path3, cleanup) => err ? cb(err) : cb(void 0, { path: path3, cleanup: promisify(cleanup) }) + ) + ); + module2.exports.dir = async (options) => dirWithOptions(options); + module2.exports.withDir = async function withDir(fn, options) { + const { path: path3, cleanup } = await module2.exports.dir(options); + try { + return await fn({ path: path3 }); + } finally { + await cleanup(); + } + }; + module2.exports.tmpNameSync = tmp.tmpNameSync; + module2.exports.tmpName = promisify(tmp.tmpName); + module2.exports.tmpdir = tmp.tmpdir; + module2.exports.setGracefulCleanup = tmp.setGracefulCleanup; } }); @@ -102101,10 +107388,10 @@ var require_crc64 = __commonJS({ }); // node_modules/@actions/artifact-legacy/lib/internal/utils.js -var require_utils7 = __commonJS({ +var require_utils9 = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -102131,18 +107418,18 @@ var require_utils7 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { + 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 = __importDefault4(require("crypto")); + var crypto_1 = __importDefault2(require("crypto")); var fs_1 = require("fs"); - var core_1 = require_core(); - var http_client_1 = require_lib5(); - var auth_1 = require_auth3(); + var core_1 = require_core3(); + var http_client_1 = require_lib4(); + var auth_1 = require_auth2(); var config_variables_1 = require_config_variables(); - var crc64_1 = __importDefault4(require_crc64()); + var crc64_1 = __importDefault2(require_crc64()); function getExponentialRetryTimeInMilliseconds(retryCount) { if (retryCount < 0) { throw new Error("RetryCount should not be negative"); @@ -102288,7 +107575,7 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.displayHttpDiagnostics = displayHttpDiagnostics; function createDirectoriesForArtifact(directories) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { for (const directory of directories) { yield fs_1.promises.mkdir(directory, { recursive: true @@ -102298,7 +107585,7 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.createDirectoriesForArtifact = createDirectoriesForArtifact; function createEmptyFilesForArtifact(emptyFilesToCreate) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { for (const filePath of emptyFilesToCreate) { yield (yield fs_1.promises.open(filePath, "w")).close(); } @@ -102306,7 +107593,7 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.createEmptyFilesForArtifact = createEmptyFilesForArtifact; function getFileSize(filePath) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -102314,7 +107601,7 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.getFileSize = getFileSize; function rmFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { yield fs_1.promises.unlink(filePath); }); } @@ -102335,13 +107622,13 @@ Header Information: ${JSON.stringify(response.message.headers, void 0, 2)} } exports2.getProperRetention = getProperRetention; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } exports2.sleep = sleep; function digestForStream(stream) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { const crc64 = new crc64_1.default(); const md5 = crypto_1.default.createHash("md5"); @@ -102365,7 +107652,7 @@ var require_status_reporter = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.StatusReporter = void 0; - var core_1 = require_core(); + var core_1 = require_core3(); var StatusReporter = class { constructor(displayFrequencyInMilliseconds) { this.totalNumberOfFilesToProcess = 0; @@ -102411,7 +107698,7 @@ var require_http_manager = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.HttpManager = void 0; - var utils_1 = require_utils7(); + var utils_1 = require_utils9(); var HttpManager = class { constructor(clientCount, userAgent) { if (clientCount < 1) { @@ -102443,7 +107730,7 @@ var require_http_manager = __commonJS({ var require_upload_gzip = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/upload-gzip.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -102456,21 +107743,21 @@ var require_upload_gzip = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -102497,7 +107784,7 @@ var require_upload_gzip = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = exports2 && exports2.__asyncValues || function(o) { + 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() { @@ -102518,10 +107805,10 @@ var require_upload_gzip = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createGZipFileInBuffer = exports2.createGZipFileOnDisk = void 0; - var fs2 = __importStar4(require("fs")); - var zlib = __importStar4(require("zlib")); + var fs3 = __importStar2(require("fs")); + var zlib = __importStar2(require("zlib")); var util_1 = require("util"); - var stat = (0, util_1.promisify)(fs2.stat); + var stat = (0, util_1.promisify)(fs3.stat); var gzipExemptFileExtensions = [ ".gz", ".gzip", @@ -102547,39 +107834,39 @@ var require_upload_gzip = __commonJS({ // 7ZIP ]; function createGZipFileOnDisk(originalFilePath, tempFilePath) { - return __awaiter4(this, void 0, void 0, function* () { + 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((resolve2, reject) => { - const inputStream = fs2.createReadStream(originalFilePath); + const inputStream = fs3.createReadStream(originalFilePath); const gzip = zlib.createGzip(); - const outputStream = fs2.createWriteStream(tempFilePath); + const outputStream = fs3.createWriteStream(tempFilePath); inputStream.pipe(gzip).pipe(outputStream); - outputStream.on("finish", () => __awaiter4(this, void 0, void 0, function* () { + outputStream.on("finish", () => __awaiter2(this, void 0, void 0, function* () { const size = (yield stat(tempFilePath)).size; resolve2(size); })); - outputStream.on("error", (error4) => { - console.log(error4); - reject(error4); + outputStream.on("error", (error3) => { + console.log(error3); + reject(error3); }); }); }); } exports2.createGZipFileOnDisk = createGZipFileOnDisk; function createGZipFileInBuffer(originalFilePath) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { var _a, e_1, _b, _c; - const inputStream = fs2.createReadStream(originalFilePath); + const inputStream = fs3.createReadStream(originalFilePath); const gzip = zlib.createGzip(); inputStream.pipe(gzip); const chunks = []; try { - for (var _d = true, gzip_1 = __asyncValues4(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), _a = gzip_1_1.done, !_a; ) { + for (var _d = true, gzip_1 = __asyncValues2(gzip), gzip_1_1; gzip_1_1 = yield gzip_1.next(), _a = gzip_1_1.done, !_a; ) { _c = gzip_1_1.value; _d = false; try { @@ -102610,7 +107897,7 @@ var require_upload_gzip = __commonJS({ var require_requestUtils = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -102623,21 +107910,21 @@ var require_requestUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -102666,11 +107953,11 @@ var require_requestUtils = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.retryHttpClientRequest = exports2.retry = void 0; - var utils_1 = require_utils7(); - var core14 = __importStar4(require_core()); + var utils_1 = require_utils9(); + var core14 = __importStar2(require_core3()); var config_variables_1 = require_config_variables(); function retry3(name, operation, customErrorMessages, maxAttempts) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let response = void 0; let statusCode = void 0; let isRetryable = false; @@ -102689,9 +107976,9 @@ var require_requestUtils = __commonJS({ } isRetryable = (0, utils_1.isRetryableStatusCode)(statusCode); errorMessage = `Artifact service responded with ${statusCode}`; - } catch (error4) { + } catch (error3) { isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (!isRetryable) { core14.info(`${name} - Error is not retryable`); @@ -102715,7 +108002,7 @@ var require_requestUtils = __commonJS({ } exports2.retry = retry3; function retryHttpClientRequest(name, method, customErrorMessages = /* @__PURE__ */ new Map(), maxAttempts = (0, config_variables_1.getRetryLimit)()) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield retry3(name, method, customErrorMessages, maxAttempts); }); } @@ -102727,7 +108014,7 @@ var require_requestUtils = __commonJS({ var require_upload_http_client = __commonJS({ "node_modules/@actions/artifact-legacy/lib/internal/upload-http-client.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -102740,21 +108027,21 @@ var require_upload_http_client = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -102783,21 +108070,21 @@ var require_upload_http_client = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.UploadHttpClient = void 0; - var fs2 = __importStar4(require("fs")); - var core14 = __importStar4(require_core()); - var tmp = __importStar4(require_tmp_promise()); - var stream = __importStar4(require("stream")); - var utils_1 = require_utils7(); + var fs3 = __importStar2(require("fs")); + var core14 = __importStar2(require_core3()); + var tmp = __importStar2(require_tmp_promise()); + var stream = __importStar2(require("stream")); + var utils_1 = require_utils9(); 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_client_1 = require_lib4(); var http_manager_1 = require_http_manager(); var upload_gzip_1 = require_upload_gzip(); var requestUtils_1 = require_requestUtils(); - var stat = (0, util_1.promisify)(fs2.stat); + var stat = (0, util_1.promisify)(fs3.stat); var UploadHttpClient = class { constructor() { this.uploadHttpManager = new http_manager_1.HttpManager((0, config_variables_1.getUploadFileConcurrency)(), "@actions/artifact-upload"); @@ -102809,7 +108096,7 @@ var require_upload_http_client = __commonJS({ * @returns The response from the Artifact Service if the file container was successfully created */ createArtifactInFileContainer(artifactName, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const parameters = { Type: "actions_storage", Name: artifactName @@ -102832,7 +108119,7 @@ var require_upload_http_client = __commonJS({ `The artifact name ${artifactName} is not valid. Request URL ${artifactUrl}` ] ]); - const response = yield (0, requestUtils_1.retryHttpClientRequest)("Create Artifact Container", () => __awaiter4(this, void 0, void 0, function* () { + 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(); @@ -102846,7 +108133,7 @@ var require_upload_http_client = __commonJS({ * @returns The size of all the files uploaded in bytes */ uploadArtifactToFileContainer(uploadUrl, filesToUpload, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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)(); core14.debug(`File Concurrency: ${FILE_CONCURRENCY}, and Chunk Size: ${MAX_CHUNK_SIZE}`); @@ -102876,7 +108163,7 @@ var require_upload_http_client = __commonJS({ let abortPendingFileUploads = false; this.statusReporter.setTotalNumberOfFilesToProcess(filesToUpload.length); this.statusReporter.start(); - yield Promise.all(parallelUploads.map((index) => __awaiter4(this, void 0, void 0, function* () { + yield Promise.all(parallelUploads.map((index) => __awaiter2(this, void 0, void 0, function* () { while (currentFile < filesToUpload.length) { const currentFileParameters = parameters[currentFile]; currentFile += 1; @@ -102919,7 +108206,7 @@ var require_upload_http_client = __commonJS({ * @returns The size of the file that was uploaded in bytes along with any failed uploads */ uploadFileAsync(httpClientIndex, parameters) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileStat = yield stat(parameters.file); const totalFileSize = fileStat.size; const isFIFO = fileStat.isFIFO(); @@ -102934,7 +108221,7 @@ var require_upload_http_client = __commonJS({ let openUploadStream; if (totalFileSize < buffer.byteLength) { core14.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 = () => fs2.createReadStream(parameters.file); + openUploadStream = () => fs3.createReadStream(parameters.file); isGzip = false; uploadFileSize = totalFileSize; } else { @@ -102980,7 +108267,7 @@ var require_upload_http_client = __commonJS({ failedChunkSizes += chunkSize; continue; } - const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs2.createReadStream(uploadFilePath, { + const result = yield this.uploadChunk(httpClientIndex, parameters.resourceUrl, () => fs3.createReadStream(uploadFilePath, { start: startChunkIndex, end: endChunkIndex, autoClose: false @@ -103020,10 +108307,10 @@ var require_upload_http_client = __commonJS({ * @returns if the chunk was successfully uploaded */ uploadChunk(httpClientIndex, resourceUrl, openStream, start, end, uploadFileSize, isGzip, totalFileSize) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = () => __awaiter4(this, void 0, void 0, function* () { + const uploadChunkRequest = () => __awaiter2(this, void 0, void 0, function* () { const client = this.uploadHttpManager.getClient(httpClientIndex); return yield client.sendStream("PUT", resourceUrl, openStream(), headers); }); @@ -103040,7 +108327,7 @@ var require_upload_http_client = __commonJS({ } return false; }; - const backOff = (retryAfterValue) => __awaiter4(this, void 0, void 0, function* () { + const backOff = (retryAfterValue) => __awaiter2(this, void 0, void 0, function* () { this.uploadHttpManager.disposeAndReplaceClient(httpClientIndex); if (retryAfterValue) { core14.info(`Backoff due to too many requests, retry #${retryCount}. Waiting for ${retryAfterValue} milliseconds before continuing the upload`); @@ -103057,9 +108344,9 @@ var require_upload_http_client = __commonJS({ let response; try { response = yield uploadChunkRequest(); - } catch (error4) { + } catch (error3) { core14.info(`An error has been caught http-client index ${httpClientIndex}, retrying the upload`); - console.log(error4); + console.log(error3); if (incrementAndCheckRetryLimit()) { return false; } @@ -103089,7 +108376,7 @@ var require_upload_http_client = __commonJS({ * Updating the size indicates that we are done uploading all the contents of the artifact */ patchArtifactSize(size, artifactName) { - return __awaiter4(this, void 0, void 0, function* () { + 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 }; @@ -103103,7 +108390,7 @@ var require_upload_http_client = __commonJS({ `An Artifact with the name ${artifactName} was not found` ] ]); - const response = yield (0, requestUtils_1.retryHttpClientRequest)("Finalize artifact upload", () => __awaiter4(this, void 0, void 0, function* () { + 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(); @@ -103111,2888 +108398,3717 @@ var require_upload_http_client = __commonJS({ }); } }; - exports2.UploadHttpClient = UploadHttpClient; + 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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 fs3 = __importStar2(require("fs")); + var core14 = __importStar2(require_core3()); + var zlib = __importStar2(require("zlib")); + var utils_1 = require_utils9(); + 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_requestUtils(); + 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)(); + core14.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); + const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; + let currentFile = 0; + let downloadedFiles = 0; + core14.info(`Total number of files that will be downloaded: ${downloadItems.length}`); + this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); + this.statusReporter.start(); + yield Promise.all(parallelDownloads.map((index) => __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(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); + if (core14.isDebug()) { + core14.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 = fs3.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) { + core14.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); + core14.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); + yield (0, utils_1.sleep)(backoffTime); + } + core14.info(`Finished backoff for retry #${retryCount}, continuing with download`); + } + }); + const isAllBytesReceived = (expected, received) => { + if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { + core14.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((resolve2) => { + destinationStream.on("close", resolve2); + if (destinationStream.writableFinished) { + resolve2(); + } + }); + yield (0, utils_1.rmFile)(fileDownloadPath); + destinationStream = fs3.createWriteStream(fileDownloadPath); + }); + while (retryCount <= retryLimit) { + let response; + try { + response = yield makeDownloadRequest(); + } catch (error3) { + core14.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)) { + core14.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((resolve2, reject) => { + if (isGzip) { + const gunzip = zlib.createGunzip(); + response.message.on("error", (error3) => { + core14.info(`An error occurred while attempting to read the response stream`); + gunzip.close(); + destinationStream.close(); + reject(error3); + }).pipe(gunzip).on("error", (error3) => { + core14.info(`An error occurred while attempting to decompress the response stream`); + destinationStream.close(); + reject(error3); + }).pipe(destinationStream).on("close", () => { + resolve2(); + }).on("error", (error3) => { + core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); + reject(error3); + }); + } else { + response.message.on("error", (error3) => { + core14.info(`An error occurred while attempting to read the response stream`); + destinationStream.close(); + reject(error3); + }).pipe(destinationStream).on("close", () => { + resolve2(); + }).on("error", (error3) => { + core14.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 path3 = __importStar2(require("path")); + function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { + const directories = /* @__PURE__ */ new Set(); + const specifications = { + rootDownloadLocation: includeRootDirectory ? path3.join(downloadPath, artifactName) : downloadPath, + directoryStructure: [], + emptyFilesToCreate: [], + filesToDownload: [] + }; + for (const entry of artifactEntries) { + if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { + const normalizedPathEntry = path3.normalize(entry.path); + const filePath = path3.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); + if (entry.itemType === "file") { + directories.add(path3.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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 core14 = __importStar2(require_core3()); + var upload_specification_1 = require_upload_specification(); + var upload_http_client_1 = require_upload_http_client(); + var utils_1 = require_utils9(); + 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* () { + core14.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) { + core14.warning(`No files found that can be uploaded`); + } else { + const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); + if (!response.fileContainerResourceUrl) { + core14.debug(response.toString()); + throw new Error("No URL provided by the Artifact Service to upload an artifact to"); + } + core14.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); + core14.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); + const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); + core14.info(`File upload process has finished. Finalizing the artifact upload`); + yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); + if (uploadResult.failedItems.length > 0) { + core14.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); + } else { + core14.info(`Artifact has been finalized. All files have been successfully uploaded!`); + } + core14.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, path3, 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 (!path3) { + path3 = (0, config_variables_1.getWorkSpaceDirectory)(); + } + path3 = (0, path_1.normalize)(path3); + path3 = (0, path_1.resolve)(path3); + const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path3, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); + if (downloadSpecification.filesToDownload.length === 0) { + core14.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); + } else { + yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); + core14.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(path3) { + 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) { + core14.info("Unable to find any artifacts for the associated workflow"); + return response; + } + if (!path3) { + path3 = (0, config_variables_1.getWorkSpaceDirectory)(); + } + path3 = (0, path_1.normalize)(path3); + path3 = (0, path_1.resolve)(path3); + let downloadedArtifacts = 0; + while (downloadedArtifacts < artifacts.count) { + const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; + downloadedArtifacts += 1; + core14.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, path3, true); + if (downloadSpecification.filesToDownload.length === 0) { + core14.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/internal/download-http-client.js -var require_download_http_client = __commonJS({ - "node_modules/@actions/artifact-legacy/lib/internal/download-http-client.js"(exports2) { +// 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"; - var __createBinding4 = 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(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/jsonschema/lib/helpers.js +var require_helpers3 = __commonJS({ + "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { + "use strict"; + var uri = require("url"); + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path3, name, argument) { + if (Array.isArray(path3)) { + this.path = path3; + this.property = path3.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else if (path3 !== void 0) { + this.property = path3; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + if (message) { + this.message = message; } - __setModuleDefault4(result, mod); - return result; + if (schema2) { + var id = schema2.$id || schema2.id; + this.schema = id || schema2; + } + if (instance !== void 0) { + this.instance = instance; + } + this.name = name; + this.argument = argument; + this.stack = this.toString(); }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + ValidationError.prototype.toString = function toString2() { + return this.property + " " + this.message; + }; + var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema2, options, ctx) { + this.instance = instance; + this.schema = schema2; + 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); } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + 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 (Error.captureStackTrace) { + 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, schema2) { + this.message = msg; + this.schema = schema2; + Error.call(this, msg); + 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(schema2, options, path3, base, schemas) { + this.schema = schema2; + this.options = options; + if (Array.isArray(path3)) { + this.path = path3; + this.propertyPath = path3.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else { + this.propertyPath = path3; + } + this.base = base; + this.schemas = schemas; + }; + SchemaContext.prototype.resolve = function resolve2(target) { + return uri.resolve(this.base, target); + }; + SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { + var path3 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var id = schema2.$id || schema2.id; + var base = uri.resolve(this.base, id || ""); + var ctx = new SchemaContext(schema2, this.options, path3, base, Object.create(this.schemas)); + if (id && !ctx.schemas[base]) { + ctx.schemas[base] = schema2; + } + 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; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + 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); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + if (typeof FORMAT_REGEXPS[format] === "function") { + return FORMAT_REGEXPS[format](input); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + } else if (validator && validator.customFormats && typeof validator.customFormats[format] === "function") { + return validator.customFormats[format](input); + } + return true; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DownloadHttpClient = void 0; - var fs2 = __importStar4(require("fs")); - var core14 = __importStar4(require_core()); - var zlib = __importStar4(require("zlib")); - var utils_1 = require_utils7(); - 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_requestUtils(); - 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); + var makeSuffix = exports2.makeSuffix = function makeSuffix2(key) { + key = key.toString(); + if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { + return "." + key; } - /** - * Gets a list of all artifacts that are in a specific container - */ - listArtifacts() { - return __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return client.get(artifactUrl, headers); - })); - const body = yield response.readBody(); - return JSON.parse(body); - }); + if (key.match(/^\d+$/)) { + return "[" + key + "]"; } - /** - * 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 __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return client.get(resourceUrl.toString(), headers); - })); - const body = yield response.readBody(); - return JSON.parse(body); - }); + return "[" + JSON.stringify(key) + "]"; + }; + exports2.deepCompareStrict = function deepCompareStrict(a, b) { + if (typeof a !== typeof b) { + return false; } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - const DOWNLOAD_CONCURRENCY = (0, config_variables_1.getDownloadFileConcurrency)(); - core14.debug(`Download file concurrency is set to ${DOWNLOAD_CONCURRENCY}`); - const parallelDownloads = [...new Array(DOWNLOAD_CONCURRENCY).keys()]; - let currentFile = 0; - let downloadedFiles = 0; - core14.info(`Total number of files that will be downloaded: ${downloadItems.length}`); - this.statusReporter.setTotalNumberOfFilesToProcess(downloadItems.length); - this.statusReporter.start(); - yield Promise.all(parallelDownloads.map((index) => __awaiter4(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(index, currentFileToDownload.sourceLocation, currentFileToDownload.targetPath); - if (core14.isDebug()) { - core14.debug(`File: ${++downloadedFiles}/${downloadItems.length}. ${currentFileToDownload.targetPath} took ${(perf_hooks_1.performance.now() - startTime).toFixed(3)} milliseconds to finish downloading`); - } - this.statusReporter.incrementProcessedCount(); - } - }))).catch((error4) => { - throw new Error(`Unable to download the artifact: ${error4}`); - }).finally(() => { - this.statusReporter.stop(); - this.downloadHttpManager.disposeAndReplaceAllClients(); - }); + 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]); }); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - let retryCount = 0; - const retryLimit = (0, config_variables_1.getRetryLimit)(); - let destinationStream = fs2.createWriteStream(downloadPath); - const headers = (0, utils_1.getDownloadHeaders)("application/json", true, true); - const makeDownloadRequest = () => __awaiter4(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) => __awaiter4(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) { - core14.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); - core14.info(`Exponential backoff for retry #${retryCount}. Waiting for ${backoffTime} milliseconds before continuing the download`); - yield (0, utils_1.sleep)(backoffTime); - } - core14.info(`Finished backoff for retry #${retryCount}, continuing with download`); - } - }); - const isAllBytesReceived = (expected, received) => { - if (!expected || !received || process.env["ACTIONS_ARTIFACT_SKIP_DOWNLOAD_VALIDATION"]) { - core14.info("Skipping download validation."); - return true; - } - return parseInt(expected) === received; - }; - const resetDestinationStream = (fileDownloadPath) => __awaiter4(this, void 0, void 0, function* () { - destinationStream.close(); - yield new Promise((resolve2) => { - destinationStream.on("close", resolve2); - if (destinationStream.writableFinished) { - resolve2(); - } - }); - yield (0, utils_1.rmFile)(fileDownloadPath); - destinationStream = fs2.createWriteStream(fileDownloadPath); - }); - while (retryCount <= retryLimit) { - let response; - try { - response = yield makeDownloadRequest(); - } catch (error4) { - core14.info("An error occurred while attempting to download a file"); - console.log(error4); - 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 (error4) { - forceRetry = true; - } - } - if (forceRetry || (0, utils_1.isRetryableStatusCode)(response.message.statusCode)) { - core14.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}`)); - } - } + 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]); }); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - yield new Promise((resolve2, reject) => { - if (isGzip) { - const gunzip = zlib.createGunzip(); - response.message.on("error", (error4) => { - core14.info(`An error occurred while attempting to read the response stream`); - gunzip.close(); - destinationStream.close(); - reject(error4); - }).pipe(gunzip).on("error", (error4) => { - core14.info(`An error occurred while attempting to decompress the response stream`); - destinationStream.close(); - reject(error4); - }).pipe(destinationStream).on("close", () => { - resolve2(); - }).on("error", (error4) => { - core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error4); - }); - } else { - response.message.on("error", (error4) => { - core14.info(`An error occurred while attempting to read the response stream`); - destinationStream.close(); - reject(error4); - }).pipe(destinationStream).on("close", () => { - resolve2(); - }).on("error", (error4) => { - core14.info(`An error occurred while writing a downloaded file to ${destinationStream.path}`); - reject(error4); - }); - } - }); - return; - }); + 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 array = Array.isArray(src); + var dst = array && [] || {}; + if (array) { + 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(number) { + var decimalPlaces = 0; + if (isNaN(number)) return decimalPlaces; + if (typeof number !== "number") { + number = Number(number); } + var parts = number.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"; }; - 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) { +// node_modules/jsonschema/lib/attribute.js +var require_attribute = __commonJS({ + "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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]; - } }; + var helpers = require_helpers3(); + 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, schema2, options, ctx) { + if (instance === void 0) { + return null; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var result = new ValidatorResult(instance, schema2, options, ctx); + var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; + if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { + var list = types.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 + }); } - __setModuleDefault4(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getDownloadSpecification = void 0; - var path2 = __importStar4(require("path")); - function getDownloadSpecification(artifactName, artifactEntries, downloadPath, includeRootDirectory) { - const directories = /* @__PURE__ */ new Set(); - const specifications = { - rootDownloadLocation: includeRootDirectory ? path2.join(downloadPath, artifactName) : downloadPath, - directoryStructure: [], - emptyFilesToCreate: [], - filesToDownload: [] - }; - for (const entry of artifactEntries) { - if (entry.path.startsWith(`${artifactName}/`) || entry.path.startsWith(`${artifactName}\\`)) { - const normalizedPathEntry = path2.normalize(entry.path); - const filePath = path2.join(downloadPath, includeRootDirectory ? normalizedPathEntry : normalizedPathEntry.replace(artifactName, "")); - if (entry.itemType === "file") { - directories.add(path2.dirname(filePath)); - if (entry.fileLength === 0) { - specifications.emptyFilesToCreate.push(filePath); - } else { - specifications.filesToDownload.push({ - sourceLocation: entry.contentLocation, - targetPath: filePath - }); - } + function testSchemaNoThrow(instance, options, ctx, callback, schema2) { + var throwError2 = options.throwError; + var throwAll = options.throwAll; + options.throwError = false; + options.throwAll = false; + var res = this.validateSchema(instance, schema2, options, ctx); + options.throwError = throwError2; + options.throwAll = throwAll; + if (!res.valid && callback instanceof Function) { + callback(res); + } + return res.valid; + } + validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + if (!Array.isArray(schema2.anyOf)) { + throw new SchemaError("anyOf must be an array"); + } + if (!schema2.anyOf.some( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); } + ) + )) { + var list = schema2.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(",") + }); } - 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 __createBinding4 = 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]; - } }; + return result; + }; + validators.allOf = function validateAllOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + if (!Array.isArray(schema2.allOf)) { + throw new SchemaError("allOf must be an array"); } - __setModuleDefault4(result, mod); + var result = new ValidatorResult(instance, schema2, options, ctx); + var self2 = this; + schema2.allOf.forEach(function(v, i) { + var valid3 = self2.validateSchema(instance, v, options, ctx); + if (!valid3.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: valid3.errors.length, valid: valid3 }, + message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" + }); + result.importErrors(valid3); + } + }); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + if (!Array.isArray(schema2.oneOf)) { + throw new SchemaError("oneOf must be an array"); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + var count = schema2.oneOf.filter( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); } + ) + ).length; + var list = schema2.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); } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + result.addError({ + name: "oneOf", + argument: list, + message: "is not exactly one from " + list.join(",") + }); + } + return result; + }; + validators.if = function validateIf(instance, schema2, options, ctx) { + if (instance === void 0) return null; + if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); + var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); + var result = new ValidatorResult(instance, schema2, options, ctx); + var res; + if (ifValid) { + if (schema2.then === void 0) return; + if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); + res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); + result.importErrors(res); + } else { + if (schema2.else === void 0) return; + if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); + res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); + result.importErrors(res); + } + return result; + }; + function getEnumerableProperty(object, key) { + if (Object.hasOwnProperty.call(object, key)) return object[key]; + if (!(key in object)) return; + while (object = Object.getPrototypeOf(object)) { + if (Object.propertyIsEnumerable.call(object, key)) return object[key]; + } + } + validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var subschema = schema2.propertyNames !== void 0 ? schema2.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); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + return result; + }; + validators.properties = function validateProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var properties = schema2.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"'); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultArtifactClient = void 0; - var core14 = __importStar4(require_core()); - var upload_specification_1 = require_upload_specification(); - var upload_http_client_1 = require_upload_http_client(); - var utils_1 = require_utils7(); - 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(); + function testAdditionalProperty(instance, schema2, options, ctx, property, result) { + if (!this.types.object(instance)) return; + if (schema2.properties && schema2.properties[property] !== void 0) { + return; } - /** - * Uploads an artifact - */ - uploadArtifact(name, files, rootDirectory, options) { - return __awaiter4(this, void 0, void 0, function* () { - core14.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) { - core14.warning(`No files found that can be uploaded`); - } else { - const response = yield uploadHttpClient.createArtifactInFileContainer(name, options); - if (!response.fileContainerResourceUrl) { - core14.debug(response.toString()); - throw new Error("No URL provided by the Artifact Service to upload an artifact to"); - } - core14.debug(`Upload Resource URL: ${response.fileContainerResourceUrl}`); - core14.info(`Container for artifact "${name}" successfully created. Starting upload of file(s)`); - const uploadResult = yield uploadHttpClient.uploadArtifactToFileContainer(response.fileContainerResourceUrl, uploadSpecification, options); - core14.info(`File upload process has finished. Finalizing the artifact upload`); - yield uploadHttpClient.patchArtifactSize(uploadResult.totalSize, name); - if (uploadResult.failedItems.length > 0) { - core14.info(`Upload finished. There were ${uploadResult.failedItems.length} items that failed to upload`); - } else { - core14.info(`Artifact has been finalized. All files have been successfully uploaded!`); - } - core14.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; + if (schema2.additionalProperties === false) { + result.addError({ + name: "additionalProperties", + argument: property, + message: "is not allowed to have the additional property " + JSON.stringify(property) }); + } else { + var additionalProperties = schema2.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); } - downloadArtifact(name, path2, options) { - return __awaiter4(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 (!path2) { - path2 = (0, config_variables_1.getWorkSpaceDirectory)(); - } - path2 = (0, path_1.normalize)(path2); - path2 = (0, path_1.resolve)(path2); - const downloadSpecification = (0, download_specification_1.getDownloadSpecification)(name, items.value, path2, (options === null || options === void 0 ? void 0 : options.createArtifactFolder) || false); - if (downloadSpecification.filesToDownload.length === 0) { - core14.info(`No downloadable files were found for the artifact: ${artifactToDownload.name}`); - } else { - yield (0, utils_1.createDirectoriesForArtifact)(downloadSpecification.directoryStructure); - core14.info("Directory structure has been set up for the artifact"); - yield (0, utils_1.createEmptyFilesForArtifact)(downloadSpecification.emptyFilesToCreate); - yield downloadHttpClient.downloadSingleArtifact(downloadSpecification.filesToDownload); + } + validators.patternProperties = function validatePatternProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var patternProperties = schema2.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"'); } - return { - artifactName: name, - downloadPath: downloadSpecification.rootDownloadLocation - }; - }); - } - downloadAllArtifacts(path2) { - return __awaiter4(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) { - core14.info("Unable to find any artifacts for the associated workflow"); - return response; + try { + var regexp = new RegExp(pattern, "u"); + } catch (_e) { + regexp = new RegExp(pattern); } - if (!path2) { - path2 = (0, config_variables_1.getWorkSpaceDirectory)(); + if (!regexp.test(property)) { + continue; } - path2 = (0, path_1.normalize)(path2); - path2 = (0, path_1.resolve)(path2); - let downloadedArtifacts = 0; - while (downloadedArtifacts < artifacts.count) { - const currentArtifactToDownload = artifacts.value[downloadedArtifacts]; - downloadedArtifacts += 1; - core14.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, path2, true); - if (downloadSpecification.filesToDownload.length === 0) { - core14.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 - }); + test = false; + if (typeof options.preValidateProperty == "function") { + options.preValidateProperty(instance, property, subschema, options, ctx); } - return response; - }); + 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, schema2, options, ctx, property, result); + } } + return result; }; - 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/jsonschema/lib/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { - "use strict"; - var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path2, name, argument) { - if (Array.isArray(path2)) { - this.path = path2; - this.property = path2.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else if (path2 !== void 0) { - this.property = path2; + validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + if (schema2.patternProperties) { + return null; } - if (message) { - this.message = message; + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in instance) { + testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); } - if (schema2) { - var id = schema2.$id || schema2.id; - this.schema = id || schema2; + return result; + }; + validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length >= schema2.minProperties)) { + result.addError({ + name: "minProperties", + argument: schema2.minProperties, + message: "does not meet minimum property length of " + schema2.minProperties + }); } - if (instance !== void 0) { - this.instance = instance; + return result; + }; + validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length <= schema2.maxProperties)) { + result.addError({ + name: "maxProperties", + argument: schema2.maxProperties, + message: "does not meet maximum property length of " + schema2.maxProperties + }); } - this.name = name; - this.argument = argument; - this.stack = this.toString(); + return result; }; - ValidationError.prototype.toString = function toString2() { - return this.property + " " + this.message; + validators.items = function validateItems(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.items === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + instance.every(function(value, i) { + if (Array.isArray(schema2.items)) { + var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; + } else { + var items = schema2.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; }; - var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema2, options, ctx) { - this.instance = instance; - this.schema = schema2; - 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; + validators.contains = function validateContains(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.contains === void 0) return; + if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); + var result = new ValidatorResult(instance, schema2, options, ctx); + var count = instance.some(function(value, i) { + var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); + return res.errors.length === 0; + }); + if (count === false) { + result.addError({ + name: "contains", + argument: schema2.contains, + message: "must contain an item matching given schema" + }); + } + return result; }; - ValidatorResult.prototype.addError = function addError(detail) { - var err; - if (typeof detail == "string") { - err = new ValidationError(detail, this.instance, this.schema, this.path); + validators.minimum = function validateMinimum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { + if (!(instance > schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than " + schema2.minimum + }); + } } 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; + if (!(instance >= schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than or equal to " + schema2.minimum + }); + } } - return err; + return result; }; - 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); + validators.maximum = function validateMaximum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { + if (!(instance < schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than " + schema2.maximum + }); + } + } else { + if (!(instance <= schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than or equal to " + schema2.maximum + }); + } } + return result; }; - function stringizer(v, i) { - return i + ": " + v.toString() + "\n"; - } - ValidatorResult.prototype.toString = function toString2(res) { - return this.errors.map(stringizer).join(""); + validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMinimum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid3 = instance > schema2.exclusiveMinimum; + if (!valid3) { + result.addError({ + name: "exclusiveMinimum", + argument: schema2.exclusiveMinimum, + message: "must be strictly greater than " + schema2.exclusiveMinimum + }); + } + return result; }; - Object.defineProperty(ValidatorResult.prototype, "valid", { get: function() { - return !this.errors.length; - } }); - module2.exports.ValidatorResultError = ValidatorResultError; - function ValidatorResultError(result) { - if (Error.captureStackTrace) { - Error.captureStackTrace(this, ValidatorResultError); + validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMaximum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid3 = instance < schema2.exclusiveMaximum; + if (!valid3) { + result.addError({ + name: "exclusiveMaximum", + argument: schema2.exclusiveMaximum, + message: "must be strictly less than " + schema2.exclusiveMaximum + }); } - 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, schema2) { - this.message = msg; - this.schema = schema2; - Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); + return result; }; - SchemaError.prototype = Object.create( - Error.prototype, - { - constructor: { value: SchemaError, enumerable: false }, - name: { value: "SchemaError", enumerable: false } + var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { + if (!this.types.number(instance)) return; + var validationArgument = schema2[validationType]; + if (validationArgument == 0) { + throw new SchemaError(validationType + " cannot be zero"); } - ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path2, base, schemas) { - this.schema = schema2; - this.options = options; - if (Array.isArray(path2)) { - this.path = path2; - this.propertyPath = path2.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else { - this.propertyPath = path2; + var result = new ValidatorResult(instance, schema2, 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) + }); } - this.base = base; - this.schemas = schemas; - }; - SchemaContext.prototype.resolve = function resolve2(target) { - return uri.resolve(this.base, target); + return result; }; - SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path2 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); - var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path2, base, Object.create(this.schemas)); - if (id && !ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - return ctx; + validators.multipleOf = function validateMultipleOf(instance, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); }; - 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]+$/ + validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); }; - 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); + validators.required = function validateRequired(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (instance === void 0 && schema2.required === true) { + result.addError({ + name: "required", + message: "is required" + }); + } else if (this.types.object(instance) && Array.isArray(schema2.required)) { + schema2.required.forEach(function(n) { + if (getEnumerableProperty(instance, n) === void 0) { + result.addError({ + name: "required", + argument: n, + message: "requires property " + JSON.stringify(n) + }); + } + }); } - return true; + return result; }; - var makeSuffix = exports2.makeSuffix = function makeSuffix2(key) { - key = key.toString(); - if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { - return "." + key; + validators.pattern = function validatePattern(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var pattern = schema2.pattern; + try { + var regexp = new RegExp(pattern, "u"); + } catch (_e) { + regexp = new RegExp(pattern); } - if (key.match(/^\d+$/)) { - return "[" + key + "]"; + if (!instance.match(regexp)) { + result.addError({ + name: "pattern", + argument: schema2.pattern, + message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) + }); } - return "[" + JSON.stringify(key) + "]"; + return result; }; - exports2.deepCompareStrict = function deepCompareStrict(a, b) { - if (typeof a !== typeof b) { - return false; + validators.format = function validateFormat(instance, schema2, options, ctx) { + if (instance === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { + result.addError({ + name: "format", + argument: schema2.format, + message: "does not conform to the " + JSON.stringify(schema2.format) + " format" + }); } - 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]); + return result; + }; + validators.minLength = function validateMinLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length >= schema2.minLength)) { + result.addError({ + name: "minLength", + argument: schema2.minLength, + message: "does not meet minimum length of " + schema2.minLength }); } - 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 result; + }; + validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length <= schema2.maxLength)) { + result.addError({ + name: "maxLength", + argument: schema2.maxLength, + message: "does not meet maximum length of " + schema2.maxLength }); } - return a === b; + return result; }; - 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); - } + validators.minItems = function validateMinItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length >= schema2.minItems)) { + result.addError({ + name: "minItems", + argument: schema2.minItems, + message: "does not meet minimum length of " + schema2.minItems + }); } - } - 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]); - } + return result; + }; + validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length <= schema2.maxItems)) { + result.addError({ + name: "maxItems", + argument: schema2.maxItems, + message: "does not meet maximum length of " + schema2.maxItems + }); } - } - function deepMerge(target, src) { - var array = Array.isArray(src); - var dst = array && [] || {}; - if (array) { - 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)); + 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; } - Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); } - return dst; + return true; } - 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]; + validators.uniqueItems = function validateUniqueItems(instance, schema2, options, ctx) { + if (schema2.uniqueItems !== true) return; + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!instance.every(testArrays)) { + result.addError({ + name: "uniqueItems", + message: "contains duplicate item" + }); } - return o; - }; - function pathEncoder(v) { - return "/" + encodeURIComponent(v).replace(/~/g, "%7E"); - } - exports2.encodePath = function encodePointer(a) { - return a.map(pathEncoder).join(""); + return result; }; - exports2.getDecimalPlaces = function getDecimalPlaces(number) { - var decimalPlaces = 0; - if (isNaN(number)) return decimalPlaces; - if (typeof number !== "number") { - number = Number(number); - } - var parts = number.toString().split("e"); - if (parts.length === 2) { - if (parts[1][0] !== "-") { - return decimalPlaces; + validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in schema2.dependencies) { + if (instance[property] === void 0) { + continue; + } + var dep = schema2.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 { - decimalPlaces = Number(parts[1].slice(1)); + 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); + } } } - var decimalParts = parts[0].split("."); - if (decimalParts.length === 2) { - decimalPlaces += decimalParts[1].length; - } - return decimalPlaces; - }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; - }; - } -}); - -// node_modules/jsonschema/lib/attribute.js -var require_attribute = __commonJS({ - "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { - "use strict"; - var helpers = require_helpers3(); - 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 + return result; }; - var validators = attribute.validators = {}; - validators.type = function validateType(instance, schema2, options, ctx) { + validators["enum"] = function validateEnum(instance, schema2, options, ctx) { if (instance === void 0) { return null; } + if (!Array.isArray(schema2["enum"])) { + throw new SchemaError("enum expects an array", schema2); + } var result = new ValidatorResult(instance, schema2, options, ctx); - var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; - if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { - var list = types.map(function(v) { - if (!v) return; - var id = v.$id || v.id; - return id ? "<" + id + ">" : v + ""; - }); + if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { result.addError({ - name: "type", - argument: list, - message: "is not of a type(s) " + list + name: "enum", + argument: schema2["enum"], + message: "is not one of enum values: " + schema2["enum"].map(String).join(",") }); } return result; }; - function testSchemaNoThrow(instance, options, ctx, callback, schema2) { - var throwError2 = options.throwError; - var throwAll = options.throwAll; - options.throwError = false; - options.throwAll = false; - var res = this.validateSchema(instance, schema2, options, ctx); - options.throwError = throwError2; - options.throwAll = throwAll; - if (!res.valid && callback instanceof Function) { - callback(res); - } - return res.valid; - } - validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { + validators["const"] = function validateEnum(instance, schema2, options, ctx) { if (instance === void 0) { return null; } var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - if (!Array.isArray(schema2.anyOf)) { - throw new SchemaError("anyOf must be an array"); - } - if (!schema2.anyOf.some( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - )) { - var list = schema2.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); - } + if (!helpers.deepCompareStrict(schema2["const"], instance)) { result.addError({ - name: "anyOf", - argument: list, - message: "is not any of " + list.join(",") + name: "const", + argument: schema2["const"], + message: "does not exactly match expected constant: " + schema2["const"] }); } return result; }; - validators.allOf = function validateAllOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - if (!Array.isArray(schema2.allOf)) { - throw new SchemaError("allOf must be an array"); - } - var result = new ValidatorResult(instance, schema2, options, ctx); + validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { var self2 = this; - schema2.allOf.forEach(function(v, i) { - var valid3 = self2.validateSchema(instance, v, options, ctx); - if (!valid3.valid) { - var id = v.$id || v.id; - var msg = id || v.title && JSON.stringify(v.title) || v["$ref"] && "<" + v["$ref"] + ">" || "[subschema " + i + "]"; + if (instance === void 0) return null; + var result = new ValidatorResult(instance, schema2, options, ctx); + var notTypes = schema2.not || schema2.disallow; + if (!notTypes) return null; + if (!Array.isArray(notTypes)) notTypes = [notTypes]; + notTypes.forEach(function(type2) { + if (self2.testType(instance, schema2, options, ctx, type2)) { + var id = type2 && (type2.$id || type2.id); + var schemaId = id || type2; result.addError({ - name: "allOf", - argument: { id: msg, length: valid3.errors.length, valid: valid3 }, - message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" + name: "not", + argument: schemaId, + message: "is of prohibited type " + schemaId }); - result.importErrors(valid3); } }); return result; }; - validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { - if (instance === void 0) { + module2.exports = attribute; + } +}); + +// node_modules/jsonschema/lib/scan.js +var require_scan = __commonJS({ + "node_modules/jsonschema/lib/scan.js"(exports2, module2) { + "use strict"; + var urilib = require("url"); + var helpers = require_helpers3(); + module2.exports.SchemaScanResult = SchemaScanResult; + function SchemaScanResult(found, ref) { + this.id = found; + this.ref = ref; + } + module2.exports.scan = function scan(base, schema2) { + function scanSchema(baseuri, schema3) { + if (!schema3 || typeof schema3 != "object") return; + if (schema3.$ref) { + var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; + return; + } + var id = schema3.$id || schema3.id; + var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + if (ourBase) { + if (ourBase.indexOf("#") < 0) ourBase += "#"; + if (found[ourBase]) { + if (!helpers.deepCompareStrict(found[ourBase], schema3)) { + throw new Error("Schema <" + ourBase + "> already exists with different definition"); + } + return found[ourBase]; + } + found[ourBase] = schema3; + if (ourBase[ourBase.length - 1] == "#") { + found[ourBase.substring(0, ourBase.length - 1)] = schema3; + } + } + scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); + scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); + scanSchema(ourBase + "/additionalItems", schema3.additionalItems); + scanObject(ourBase + "/properties", schema3.properties); + scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); + scanObject(ourBase + "/definitions", schema3.definitions); + scanObject(ourBase + "/patternProperties", schema3.patternProperties); + scanObject(ourBase + "/dependencies", schema3.dependencies); + scanArray(ourBase + "/disallow", schema3.disallow); + scanArray(ourBase + "/allOf", schema3.allOf); + scanArray(ourBase + "/anyOf", schema3.anyOf); + scanArray(ourBase + "/oneOf", schema3.oneOf); + scanSchema(ourBase + "/not", schema3.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, schema2); + 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 urilib = require("url"); + var attribute = require_attribute(); + var helpers = require_helpers3(); + var scanSchema = require_scan().scan; + var ValidatorResult = helpers.ValidatorResult; + var ValidatorResultError = helpers.ValidatorResultError; + var SchemaError = helpers.SchemaError; + var SchemaContext = helpers.SchemaContext; + var anonymousBase = "/"; + var Validator2 = function Validator3() { + this.customFormats = Object.create(Validator3.prototype.customFormats); + this.schemas = {}; + this.unresolvedRefs = []; + this.types = Object.create(types); + this.attributes = Object.create(attribute.validators); + }; + Validator2.prototype.customFormats = {}; + Validator2.prototype.schemas = null; + Validator2.prototype.types = null; + Validator2.prototype.attributes = null; + Validator2.prototype.unresolvedRefs = null; + Validator2.prototype.addSchema = function addSchema(schema2, base) { + var self2 = this; + if (!schema2) { return null; } - if (!Array.isArray(schema2.oneOf)) { - throw new SchemaError("oneOf must be an array"); + var scan = scanSchema(base || anonymousBase, schema2); + var ourUri = base || schema2.$id || schema2.id; + for (var uri in scan.id) { + this.schemas[uri] = scan.id[uri]; } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - var count = schema2.oneOf.filter( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - ).length; - var list = schema2.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 + "]"; + for (var uri in scan.ref) { + this.unresolvedRefs.push(uri); + } + this.unresolvedRefs = this.unresolvedRefs.filter(function(uri2) { + return typeof self2.schemas[uri2] === "undefined"; }); - if (count !== 1) { - if (options.nestedErrors) { - result.importErrors(inner); + return this.schemas[ourUri]; + }; + Validator2.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { + if (!Array.isArray(schemas)) return; + for (var i = 0; i < schemas.length; i++) { + this.addSubSchema(baseuri, schemas[i]); + } + }; + Validator2.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { + if (!schemas || typeof schemas != "object") return; + for (var p in schemas) { + this.addSubSchema(baseuri, schemas[p]); + } + }; + Validator2.prototype.setSchemas = function setSchemas(schemas) { + this.schemas = schemas; + }; + Validator2.prototype.getSchema = function getSchema(urn) { + return this.schemas[urn]; + }; + Validator2.prototype.validate = function validate(instance, schema2, options, ctx) { + if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { + throw new SchemaError("Expected `schema` to be an object or boolean"); + } + if (!options) { + options = {}; + } + var id = schema2.$id || schema2.id; + var base = urilib.resolve(options.base || anonymousBase, id || ""); + if (!ctx) { + ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); + if (!ctx.schemas[base]) { + ctx.schemas[base] = schema2; } - result.addError({ - name: "oneOf", - argument: list, - message: "is not exactly one from " + list.join(",") - }); + var found = scanSchema(base, schema2); + 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, schema2, options, ctx); + result.addError("is required, but is undefined"); + return result; + } + var result = this.validateSchema(instance, schema2, options, ctx); + if (!result) { + throw new Error("Result undefined"); + } else if (options.throwAll && result.errors.length) { + throw new ValidatorResultError(result); } return result; }; - validators.if = function validateIf(instance, schema2, options, ctx) { - if (instance === void 0) return null; - if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); - var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); + function shouldResolve(schema2) { + var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; + if (typeof ref == "string") return ref; + return false; + } + Validator2.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { var result = new ValidatorResult(instance, schema2, options, ctx); - var res; - if (ifValid) { - if (schema2.then === void 0) return; - if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); - res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); - result.importErrors(res); - } else { - if (schema2.else === void 0) return; - if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); - res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); - result.importErrors(res); + if (typeof schema2 === "boolean") { + if (schema2 === true) { + schema2 = {}; + } else if (schema2 === false) { + schema2 = { type: [] }; + } + } else if (!schema2) { + throw new Error("schema is undefined"); + } + if (schema2["extends"]) { + if (Array.isArray(schema2["extends"])) { + var schemaobj = { schema: schema2, ctx }; + schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); + schema2 = schemaobj.schema; + schemaobj.schema = null; + schemaobj.ctx = null; + schemaobj = null; + } else { + schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); + } + } + var switchSchema = shouldResolve(schema2); + if (switchSchema) { + var resolved = this.resolve(schema2, 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 schema2) { + if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { + var validatorErr = null; + var validator = this.attributes[key]; + if (validator) { + validatorErr = validator.call(this, instance, schema2, options, ctx); + } else if (options.allowUnknownAttributes === false) { + throw new SchemaError("Unsupported attribute: " + key, schema2); + } + if (validatorErr) { + result.importErrors(validatorErr); + } + } + } + if (typeof options.rewrite == "function") { + var value = options.rewrite.call(this, instance, schema2, options, ctx); + result.instance = value; } return result; }; - function getEnumerableProperty(object, key) { - if (Object.hasOwnProperty.call(object, key)) return object[key]; - if (!(key in object)) return; - while (object = Object.getPrototypeOf(object)) { - if (Object.propertyIsEnumerable.call(object, key)) return object[key]; + Validator2.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { + schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); + }; + Validator2.prototype.superResolve = function superResolve(schema2, ctx) { + var ref = shouldResolve(schema2); + if (ref) { + return this.resolve(schema2, ref, ctx).subschema; + } + return schema2; + }; + Validator2.prototype.resolve = function resolve2(schema2, switchSchema, ctx) { + switchSchema = ctx.resolve(switchSchema); + if (ctx.schemas[switchSchema]) { + return { subschema: ctx.schemas[switchSchema], switchSchema }; + } + var parsed = urilib.parse(switchSchema); + var fragment = parsed && 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 + ">", schema2); + } + var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); + if (subschema === void 0) { + throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); + } + return { subschema, switchSchema }; + }; + Validator2.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { + if (type2 === void 0) { + return; + } else if (type2 === null) { + throw new SchemaError('Unexpected null in "type" keyword'); + } + if (typeof this.types[type2] == "function") { + return this.types[type2].call(this, instance); + } + if (type2 && typeof type2 == "object") { + var res = this.validateSchema(instance, type2, options, ctx); + return res === void 0 || !(res && res.errors.length); + } + return true; + }; + var types = Validator2.prototype.types = {}; + types.string = function testString(instance) { + return typeof instance == "string"; + }; + types.number = function testNumber(instance) { + return typeof instance == "number" && isFinite(instance); + }; + types.integer = function testInteger(instance) { + return typeof instance == "number" && instance % 1 === 0; + }; + types.boolean = function testBoolean(instance) { + return typeof instance == "boolean"; + }; + types.array = function testArray(instance) { + return Array.isArray(instance); + }; + types["null"] = function testNull(instance) { + return instance === null; + }; + types.date = function testDate(instance) { + return instance instanceof Date; + }; + types.any = function testAny(instance) { + return true; + }; + types.object = function testObject(instance) { + return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); + }; + module2.exports = Validator2; + } +}); + +// node_modules/jsonschema/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/jsonschema/lib/index.js"(exports2, module2) { + "use strict"; + var Validator2 = module2.exports.Validator = require_validator(); + module2.exports.ValidatorResult = require_helpers3().ValidatorResult; + module2.exports.ValidatorResultError = require_helpers3().ValidatorResultError; + module2.exports.ValidationError = require_helpers3().ValidationError; + module2.exports.SchemaError = require_helpers3().SchemaError; + module2.exports.SchemaScanResult = require_scan().SchemaScanResult; + module2.exports.scan = require_scan().scan; + module2.exports.validate = function(instance, schema2, options) { + var v = new Validator2(); + return v.validate(instance, schema2, options); + }; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils10 = __commonJS({ + "node_modules/@actions/glob/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); } - validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var subschema = schema2.propertyNames !== void 0 ? schema2.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); - } + 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/glob/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - return result; - }; - validators.properties = function validateProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var properties = schema2.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); + 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; }; - function testAdditionalProperty(instance, schema2, options, ctx, property, result) { - if (!this.types.object(instance)) return; - if (schema2.properties && schema2.properties[property] !== void 0) { - return; - } - if (schema2.additionalProperties === false) { - result.addError({ - name: "additionalProperties", - argument: property, - message: "is not allowed to have the additional property " + JSON.stringify(property) - }); - } else { - var additionalProperties = schema2.additionalProperties || {}; - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, additionalProperties, options, ctx); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __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() + os2.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"; } - 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); + this.command = command; + this.properties = properties; + this.message = message; } - } - validators.patternProperties = function validatePatternProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var patternProperties = schema2.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); + 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)}`; + } + } } - 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, schema2, options, ctx, property, result); } + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - return result; }; - validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - if (schema2.patternProperties) { - return null; + 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/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in instance) { - testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + 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; }; - validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length >= schema2.minProperties)) { - result.addError({ - name: "minProperties", - argument: schema2.minProperties, - message: "does not meet minimum property length of " + schema2.minProperties - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs3 = __importStar2(require("fs")); + var os2 = __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}`); } - return result; - }; - validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length <= schema2.maxProperties)) { - result.addError({ - name: "maxProperties", - argument: schema2.maxProperties, - message: "does not meet maximum property length of " + schema2.maxProperties - }); + if (!fs3.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; - }; - validators.items = function validateItems(instance, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.items === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - instance.every(function(value, i) { - if (Array.isArray(schema2.items)) { - var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; - } else { - var items = schema2.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, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.contains === void 0) return; - if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); - var result = new ValidatorResult(instance, schema2, options, ctx); - var count = instance.some(function(value, i) { - var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); - return res.errors.length === 0; + fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" }); - if (count === false) { - result.addError({ - name: "contains", - argument: schema2.contains, - message: "must contain an item matching given schema" - }); + } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - return result; - }; - validators.minimum = function validateMinimum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { - if (!(instance > schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than " + schema2.minimum - }); - } - } else { - if (!(instance >= schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than or equal to " + schema2.minimum - }); - } + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return result; - }; - validators.maximum = function validateMaximum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { - if (!(instance < schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than " + schema2.maximum - }); + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; + } + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/glob/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"]; } - } else { - if (!(instance <= schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than or equal to " + schema2.maximum - }); + })(); + if (proxyVar) { + try { + return new DecodedURL(proxyVar); + } catch (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); } + } else { + return void 0; } - return result; - }; - validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMinimum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid3 = instance > schema2.exclusiveMinimum; - if (!valid3) { - result.addError({ - name: "exclusiveMinimum", - argument: schema2.exclusiveMinimum, - message: "must be strictly greater than " + schema2.exclusiveMinimum - }); - } - return result; - }; - validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMaximum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid3 = instance < schema2.exclusiveMaximum; - if (!valid3) { - result.addError({ - name: "exclusiveMaximum", - argument: schema2.exclusiveMaximum, - message: "must be strictly less than " + schema2.exclusiveMaximum - }); + } + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return result; - }; - var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { - if (!this.types.number(instance)) return; - var validationArgument = schema2[validationType]; - if (validationArgument == 0) { - throw new SchemaError(validationType + " cannot be zero"); + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - var result = new ValidatorResult(instance, schema2, 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) - }); + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - return result; - }; - validators.multipleOf = function validateMultipleOf(instance, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); - }; - validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); - }; - validators.required = function validateRequired(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (instance === void 0 && schema2.required === true) { - result.addError({ - name: "required", - message: "is required" - }); - } else if (this.types.object(instance) && Array.isArray(schema2.required)) { - schema2.required.forEach(function(n) { - if (getEnumerableProperty(instance, n) === void 0) { - result.addError({ - name: "required", - argument: n, - message: "requires property " + JSON.stringify(n) - }); - } - }); + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - return result; - }; - validators.pattern = function validatePattern(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var pattern = schema2.pattern; - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - if (!instance.match(regexp)) { - result.addError({ - name: "pattern", - argument: schema2.pattern, - message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) - }); + 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 result; - }; - validators.format = function validateFormat(instance, schema2, options, ctx) { - if (instance === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { - result.addError({ - name: "format", - argument: schema2.format, - message: "does not conform to the " + JSON.stringify(schema2.format) + " format" - }); + 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(url, base) { + super(url, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); } - return result; - }; - validators.minLength = function validateMinLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length >= schema2.minLength)) { - result.addError({ - name: "minLength", - argument: schema2.minLength, - message: "does not meet minimum length of " + schema2.minLength - }); + get username() { + return this._decodedUsername; } - return result; - }; - validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length <= schema2.maxLength)) { - result.addError({ - name: "maxLength", - argument: schema2.maxLength, - message: "does not meet maximum length of " + schema2.maxLength - }); + get password() { + return this._decodedPassword; } - return result; }; - validators.minItems = function validateMinItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length >= schema2.minItems)) { - result.addError({ - name: "minItems", - argument: schema2.minItems, - message: "does not meet minimum length of " + schema2.minItems - }); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib6 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - return result; - }; - validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length <= schema2.maxItems)) { - result.addError({ - name: "maxItems", - argument: schema2.maxItems, - message: "does not meet maximum length of " + schema2.maxItems - }); + 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; }; - 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, schema2, options, ctx) { - if (schema2.uniqueItems !== true) return; - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!instance.every(testArrays)) { - result.addError({ - name: "uniqueItems", - message: "contains duplicate item" + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); } - return result; - }; - validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in schema2.dependencies) { - if (instance[property] === void 0) { - continue; - } - var dep = schema2.dependencies[property]; - var childContext = ctx.makeChild(dep, property); - if (typeof dep == "string") { - dep = [dep]; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - } - return result; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - validators["enum"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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); } - if (!Array.isArray(schema2["enum"])) { - throw new SchemaError("enum expects an array", schema2); + }; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { - result.addError({ - name: "enum", - argument: schema2["enum"], - message: "is not one of enum values: " + schema2["enum"].map(String).join(",") + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __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", () => { + resolve2(output.toString()); + }); + })); }); } - return result; - }; - validators["const"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; - } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!helpers.deepCompareStrict(schema2["const"], instance)) { - result.addError({ - name: "const", - argument: schema2["const"], - message: "does not exactly match expected constant: " + schema2["const"] + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve2(Buffer.concat(chunks)); + }); + })); }); } - return result; - }; - validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { - var self2 = this; - if (instance === void 0) return null; - var result = new ValidatorResult(instance, schema2, options, ctx); - var notTypes = schema2.not || schema2.disallow; - if (!notTypes) return null; - if (!Array.isArray(notTypes)) notTypes = [notTypes]; - notTypes.forEach(function(type2) { - if (self2.testType(instance, schema2, options, ctx, type2)) { - var id = type2 && (type2.$id || type2.id); - var schemaId = id || type2; - 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 urilib = require("url"); - var helpers = require_helpers3(); - module2.exports.SchemaScanResult = SchemaScanResult; - function SchemaScanResult(found, ref) { - this.id = found; - this.ref = ref; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - module2.exports.scan = function scan(base, schema2) { - function scanSchema(baseuri, schema3) { - if (!schema3 || typeof schema3 != "object") return; - if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); - ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; - return; - } - var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; - if (ourBase) { - if (ourBase.indexOf("#") < 0) ourBase += "#"; - if (found[ourBase]) { - if (!helpers.deepCompareStrict(found[ourBase], schema3)) { - throw new Error("Schema <" + ourBase + "> already exists with different definition"); - } - return found[ourBase]; + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + this.handlers = handlers || []; + this.requestOptions = requestOptions; + if (requestOptions) { + if (requestOptions.ignoreSslError != null) { + this._ignoreSslError = requestOptions.ignoreSslError; } - found[ourBase] = schema3; - if (ourBase[ourBase.length - 1] == "#") { - found[ourBase.substring(0, ourBase.length - 1)] = schema3; + 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; } } - scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); - scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); - scanSchema(ourBase + "/additionalItems", schema3.additionalItems); - scanObject(ourBase + "/properties", schema3.properties); - scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); - scanObject(ourBase + "/definitions", schema3.definitions); - scanObject(ourBase + "/patternProperties", schema3.patternProperties); - scanObject(ourBase + "/dependencies", schema3.dependencies); - scanArray(ourBase + "/disallow", schema3.disallow); - scanArray(ourBase + "/allOf", schema3.allOf); - scanArray(ourBase + "/anyOf", schema3.anyOf); - scanArray(ourBase + "/oneOf", schema3.oneOf); - scanSchema(ourBase + "/not", schema3.not); } - function scanArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - scanSchema(baseuri + "/" + i, schemas[i]); - } + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - function scanObject(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - scanSchema(baseuri + "/" + p, schemas[p]); - } + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var found = {}; - var ref = {}; - scanSchema(base, schema2); - return new SchemaScanResult(found, ref); - }; - } -}); - -// node_modules/jsonschema/lib/validator.js -var require_validator2 = __commonJS({ - "node_modules/jsonschema/lib/validator.js"(exports2, module2) { - "use strict"; - var urilib = require("url"); - var attribute = require_attribute(); - var helpers = require_helpers3(); - var scanSchema = require_scan().scan; - var ValidatorResult = helpers.ValidatorResult; - var ValidatorResultError = helpers.ValidatorResultError; - var SchemaError = helpers.SchemaError; - var SchemaContext = helpers.SchemaContext; - var anonymousBase = "/"; - var Validator2 = function Validator3() { - this.customFormats = Object.create(Validator3.prototype.customFormats); - this.schemas = {}; - this.unresolvedRefs = []; - this.types = Object.create(types); - this.attributes = Object.create(attribute.validators); - }; - Validator2.prototype.customFormats = {}; - Validator2.prototype.schemas = null; - Validator2.prototype.types = null; - Validator2.prototype.attributes = null; - Validator2.prototype.unresolvedRefs = null; - Validator2.prototype.addSchema = function addSchema(schema2, base) { - var self2 = this; - if (!schema2) { - return null; + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var scan = scanSchema(base || anonymousBase, schema2); - var ourUri = base || schema2.$id || schema2.id; - for (var uri in scan.id) { - this.schemas[uri] = scan.id[uri]; + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); + }); } - for (var uri in scan.ref) { - this.unresolvedRefs.push(uri); + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - this.unresolvedRefs = this.unresolvedRefs.filter(function(uri2) { - return typeof self2.schemas[uri2] === "undefined"; - }); - return this.schemas[ourUri]; - }; - Validator2.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - this.addSubSchema(baseuri, schemas[i]); + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - }; - Validator2.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - this.addSubSchema(baseuri, schemas[p]); + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - }; - Validator2.prototype.setSchemas = function setSchemas(schemas) { - this.schemas = schemas; - }; - Validator2.prototype.getSchema = function getSchema(urn) { - return this.schemas[urn]; - }; - Validator2.prototype.validate = function validate(instance, schema2, options, ctx) { - if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { - throw new SchemaError("Expected `schema` to be an object or boolean"); + sendStream(verb, requestUrl, stream, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream, additionalHeaders); + }); } - if (!options) { - options = {}; + /** + * 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); + }); } - var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); - if (!ctx) { - ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); - if (!ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - var found = scanSchema(base, schema2); - for (var n in found.id) { - var sch = found.id[n]; - ctx.schemas[n] = sch; - } + 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); + }); } - if (options.required && instance === void 0) { - var result = new ValidatorResult(instance, schema2, options, ctx); - result.addError("is required, but is undefined"); - return result; + 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); + }); } - var result = this.validateSchema(instance, schema2, options, ctx); - if (!result) { - throw new Error("Result undefined"); - } else if (options.throwAll && result.errors.length) { - throw new ValidatorResultError(result); + 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); + }); } - return result; - }; - function shouldResolve(schema2) { - var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; - if (typeof ref == "string") return ref; - return false; - } - Validator2.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (typeof schema2 === "boolean") { - if (schema2 === true) { - schema2 = {}; - } else if (schema2 === false) { - schema2 = { type: [] }; - } - } else if (!schema2) { - throw new Error("schema is undefined"); + /** + * 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 info7 = 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(info7, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info7, 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]; + } + } + } + info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info7, 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; + }); } - if (schema2["extends"]) { - if (Array.isArray(schema2["extends"])) { - var schemaobj = { schema: schema2, ctx }; - schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); - schema2 = schemaobj.schema; - schemaobj.schema = null; - schemaobj.ctx = null; - schemaobj = null; - } else { - schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - var switchSchema = shouldResolve(schema2); - if (switchSchema) { - var resolved = this.resolve(schema2, switchSchema, ctx); - var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas); - return this.validateSchema(instance, resolved.subschema, options, subctx); + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info7, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve2(res); + } + } + this.requestRawWithCallback(info7, data, callbackForResult); + }); + }); } - var skipAttributes = options && options.skipAttributes || []; - for (var key in schema2) { - if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { - var validatorErr = null; - var validator = this.attributes[key]; - if (validator) { - validatorErr = validator.call(this, instance, schema2, options, ctx); - } else if (options.allowUnknownAttributes === false) { - throw new SchemaError("Unsupported attribute: " + key, schema2); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info7, data, onResult) { + if (typeof data === "string") { + if (!info7.options.headers) { + info7.options.headers = {}; } - if (validatorErr) { - result.importErrors(validatorErr); + info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); } } + const req = info7.httpModule.request(info7.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: ${info7.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(); + } } - if (typeof options.rewrite == "function") { - var value = options.rewrite.call(this, instance, schema2, options, ctx); - result.instance = value; - } - return result; - }; - Validator2.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { - schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); - }; - Validator2.prototype.superResolve = function superResolve(schema2, ctx) { - var ref = shouldResolve(schema2); - if (ref) { - return this.resolve(schema2, ref, ctx).subschema; - } - return schema2; - }; - Validator2.prototype.resolve = function resolve2(schema2, switchSchema, ctx) { - switchSchema = ctx.resolve(switchSchema); - if (ctx.schemas[switchSchema]) { - return { subschema: ctx.schemas[switchSchema], switchSchema }; - } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && 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 + ">", schema2); - } - var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); - if (subschema === void 0) { - throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); + /** + * 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); } - return { subschema, switchSchema }; - }; - Validator2.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { - if (type2 === void 0) { - return; - } else if (type2 === null) { - throw new SchemaError('Unexpected null in "type" keyword'); + 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); } - if (typeof this.types[type2] == "function") { - return this.types[type2].call(this, instance); + _prepareRequest(method, requestUrl, headers) { + const info7 = {}; + info7.parsedUrl = requestUrl; + const usingSsl = info7.parsedUrl.protocol === "https:"; + info7.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info7.options = {}; + info7.options.host = info7.parsedUrl.hostname; + info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; + info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); + info7.options.method = method; + info7.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info7.options.headers["user-agent"] = this.userAgent; + } + info7.options.agent = this._getAgent(info7.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info7.options); + } + } + return info7; } - if (type2 && typeof type2 == "object") { - var res = this.validateSchema(instance, type2, options, ctx); - return res === void 0 || !(res && res.errors.length); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - return true; - }; - var types = Validator2.prototype.types = {}; - types.string = function testString(instance) { - return typeof instance == "string"; - }; - types.number = function testNumber(instance) { - return typeof instance == "number" && isFinite(instance); - }; - types.integer = function testInteger(instance) { - return typeof instance == "number" && instance % 1 === 0; - }; - types.boolean = function testBoolean(instance) { - return typeof instance == "boolean"; - }; - types.array = function testArray(instance) { - return Array.isArray(instance); - }; - types["null"] = function testNull(instance) { - return instance === null; - }; - types.date = function testDate(instance) { - return instance instanceof Date; - }; - types.any = function testAny(instance) { - return true; - }; - types.object = function testObject(instance) { - return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); - }; - module2.exports = Validator2; - } -}); - -// node_modules/jsonschema/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/jsonschema/lib/index.js"(exports2, module2) { - "use strict"; - var Validator2 = module2.exports.Validator = require_validator2(); - module2.exports.ValidatorResult = require_helpers3().ValidatorResult; - module2.exports.ValidatorResultError = require_helpers3().ValidatorResultError; - module2.exports.ValidationError = require_helpers3().ValidationError; - module2.exports.SchemaError = require_helpers3().SchemaError; - module2.exports.SchemaScanResult = require_scan().SchemaScanResult; - module2.exports.scan = require_scan().scan; - module2.exports.validate = function(instance, schema2, options) { - var v = new Validator2(); - return v.validate(instance, schema2, options); - }; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + if (!useProxy) { + agent = this._agent; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + if (agent) { + return agent; } - } - return result; - } - exports2.getOptions = getOptions; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path2 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - let result = path2.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); - } - return result; - } - exports2.dirname = dirname; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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)}`; - } + 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 { - return `${itemPath[0]}:\\${itemPath.substr(2)}`; + tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; } - } else if (normalizeSeparators(itemPath).match(/^\\$|^\\[^\\]/)) { - const cwd = process.cwd(); - 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)}`; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false + }); + } + return agent; } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path2.sep; - } - return root + itemPath; - } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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("/"); - } - exports2.hasRoot = hasRoot; - 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, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; - } - p = normalizeSeparators(p); - if (!p.endsWith(path2.sep)) { - return p; + _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; } - if (p === path2.sep) { - return p; + _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((resolve2) => setTimeout(() => resolve2(), ms)); + }); } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve2(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 { + resolve2(response); + } + })); + }); } - return p.substr(0, p.length - 1); - } - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - const result = []; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - if (searchPathMap[key] === "included") { - continue; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; - break; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function step(result) { + result.done ? resolve2(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; } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); - } - exports2.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - return res; - }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; - }; - } -}); - -// node_modules/brace-expansion/index.js -var require_brace_expansion3 = __commonJS({ - "node_modules/brace-expansion/index.js"(exports2, module2) { - var concatMap = require_concat_map(); - var balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length - 1] += postParts.shift(); - p.push.apply(p, postParts); + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - parts.push.apply(parts, p); - return parts; - } - function expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + }; + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); + // 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"); } - return [str2]; + options.headers["Authorization"] = `Bearer ${this.token}`; } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch2 = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path2 = (function() { - try { - return require("path"); - } catch (e) { - } - })() || { - sep: "/" - }; - minimatch.sep = path2.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion3(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + // 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")}`; } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path2.sep !== "/") { - pattern = pattern.split(path2.sep).join("/"); + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { }; - Minimatch.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; + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug4() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.prototype.parseNegate = parseNegate; - function parseNegate() { - var pattern = this.pattern; - var negate = 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++) { - negate = !negate; - negateOffset++; - } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.OidcClient = void 0; + var http_client_1 = require_lib6(); + var auth_1 = require_auth3(); + var core_1 = require_core4(); + 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; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + 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; } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); + } + return id_token; + }); } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + 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}`); + } + }); } }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/glob/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(resolve2) { + resolve2(value); + }); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + function step(result) { + result.done ? resolve2(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; } - 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; - } - 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 (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; - } - re += c; + 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 (_a) { + 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}`; } - if (inClass) { - cs = pattern.substr(classStart + 1); - sp = this.parse(cs, SUBPARSE); - re = re.substr(0, reClassStart) + "\\[" + sp[0]; - hasMagic = hasMagic || sp[1]; + /** + * 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(); + }); } - 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 + "|"; + /** + * 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 }); }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - 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; + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + /** + * 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; } - if (addPatternStart) { - re = patternStart + re; + /** + * 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(); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + /** + * 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(); } - if (!hasMagic) { - return globUnescape(pattern); + }; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + 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); } - regExp._glob = pattern; - regExp._src = re; - return regExp; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path3 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path3.sep); + } + exports2.toPlatformPath = toPlatformPath; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util3 = __commonJS({ + "node_modules/@actions/glob/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; }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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 new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var _a; + 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 fs3 = __importStar2(require("fs")); + var path3 = __importStar2(require("path")); + _a = fs3.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs3.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'); } - return this.regexp; + if (exports2.IS_WINDOWS) { + return p.startsWith("\\") || /^[A-Z]:/i.test(p); + } + return p.startsWith("/"); } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); + 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 = path3.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 = path3.dirname(filePath); + const upperName = path3.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path3.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 ""; }); - if (mm.options.nonull && !list.length) { - list.push(pattern); + } + exports2.tryGetExecutablePath = tryGetExecutablePath; + function normalizeSeparators(p) { + p = p || ""; + if (exports2.IS_WINDOWS) { + p = p.replace(/\//g, "\\"); + return p.replace(/\\\\+/g, "\\"); } - return list; - }; - Minimatch.prototype.match = function match(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 (path2.sep !== "/") { - f = f.split(path2.sep).join("/"); + 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 _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io3 = __commonJS({ + "node_modules/@actions/glob/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); } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; + __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(resolve2) { + resolve2(value); + }); } - for (i = 0; i < set2.length; i++) { - var pattern = set2[i]; - var file = f; - if (options.matchBase && pattern.length === 1) { - file = [filename]; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - var hit = this.matchOne(file, pattern, partial); - if (hit) { - if (options.flipNegate) return true; - return !this.negate; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - if (options.flipNegate) return false; - return this.negate; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; + 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 path3 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); + 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 ? path3.join(dest, path3.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 (path3.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(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 = path3.join(dest, path3.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"); } - return true; } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; + } + yield mkdirP(path3.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 which6(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + if (check) { + const result = yield which6(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 { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; + 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.`); } } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); + } + exports2.which = which6; + 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(path3.delimiter)) { + if (extension) { + extensions.push(extension); + } } - 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 (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; + } + return []; } - 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"); + if (tool.includes(path3.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path3.delimiter)) { + if (p) { + directories.push(p); + } + } + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path3.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 copyFile(srcFile, destFile, force); + } + } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); + function copyFile(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/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -106001,312 +112117,482 @@ var require_internal_path = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(require("assert")); + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path3 = __importStar2(require("path")); + var io6 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); 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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path2.sep); + var ToolRunner5 = 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 { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path2.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - this.segments.unshift(remaining); } } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path2.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; } } + return cmd; } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path2.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path2.sep; + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); } - result += this.segments[i]; + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - return result; } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os = __importStar4(require("os")); - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(require("assert")); - var minimatch_1 = require_minimatch2(); - 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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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}`; + _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]; } } - while (pattern.startsWith("!")) { - this.negate = !this.negate; - pattern = pattern.substr(1).trim(); + return this.args; + } + _endsWith(str2, end) { + return str2.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); } - pattern = _Pattern.fixupPattern(pattern, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path2.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 + 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 }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + 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; } /** - * Matches the pattern against the specified path + * 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 */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path2.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path2.sep}`; + exec() { + return __awaiter2(this, void 0, void 0, function* () { + if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { + this.toolPath = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - } else { - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve2, 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) + os2.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 { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); + } + }; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } - if (this.minimatch.match(itemPath)) { - return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All; + 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; } - return internal_match_kind_1.MatchKind.None; + 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); } - /** - * 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); + 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; } - 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, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path2.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path2.sep}`)) { - homedir = homedir || os.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } - 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } - } + _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`); } - literal += c; } - return literal; - } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; + } + this.done = true; + this.emit("done", error3, this.processExitCode); } - }; - exports2.Pattern = Pattern; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path2, level) { - this.path = path2; - this.level = level; + 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(); } }; - exports2.SearchState = SearchState; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -106315,21 +112601,21 @@ var require_internal_globber = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -106356,286 +112642,91 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; - } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); - } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; - } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await4 ? 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 core14 = __importStar4(require_core()); - var fs2 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path2 = __importStar4(require("path")); - var patternHelper = __importStar4(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() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); - } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs2.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs2.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path2.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); - } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs2.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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 fs2.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs2.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.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/cache/node_modules/@actions/glob/lib/glob.js -var require_glob2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + 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.`); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create3(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); + } + exports2.exec = exec3; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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.create = create3; + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -106662,153 +112753,99 @@ var require_io_util3 = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var _a; + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; + }; 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 fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs2.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - try { - yield exports2.stat(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; - } - throw err; - } - return 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_exec3()); + 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 }); - } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); - return stats.isDirectory(); + const { stdout: name } = yield exec3.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true }); - } - 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 __awaiter4(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 = path2.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 = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path2.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 ""; + return { + name: name.trim(), + version: version.trim() + }; + }); + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } - exports2.getCmdPath = getCmdPath; + exports2.getDetails = getDetails; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core4 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/core.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -106836,1393 +112873,1818 @@ var require_io3 = __commonJS({ }); }; 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 path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); - function cp(source, dest, options = {}) { - return __awaiter4(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 ? path2.join(dest, path2.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 (path2.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); + 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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils10(); + var os2 = __importStar2(require("os")); + var path3 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.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(path2.dirname(dest)); - yield ioUtil.rename(source, dest); - }); + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.mv = mv; - function rmRF(inputPath) { - return __awaiter4(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.setSecret = setSecret; + function addPath(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}${path3.delimiter}${process.env["PATH"]}`; } - exports2.rmRF = rmRF; - function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); + exports2.addPath = addPath; + 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.mkdirP = mkdirP; - function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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.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.which = which6; - function findInPath(tool) { - return __awaiter4(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(path2.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(path2.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.join(directory, tool), extensions); - if (filePath) { - matches.push(filePath); - } - } - return matches; - }); + 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.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 }; + exports2.getBooleanInput = getBooleanInput; + function setOutput(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(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(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 copyFile(srcFile, destFile, force); - } + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning10(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning10; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + return result; }); } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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); - } + exports2.group = group; + function saveState2(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 = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// 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 debug4; - if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { - debug4 = function() { - var args = Array.prototype.slice.call(arguments, 0); - args.unshift("SEMVER"); - console.log.apply(console, args); - }; - } else { - debug4 = 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++) { - debug4(i, src[i]); - if (!re[i]) { - re[i] = new RegExp(src[i]); - safeRe[i] = new RegExp(makeSafeRe(src[i])); +// 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]; + } }; } - } - var i; - exports2.parse = parse; - function parse(version, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + 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); } - if (version instanceof SemVer) { - return version; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core14 = __importStar2(require_core4()); + 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; + core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + } + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core14.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + } } - if (typeof version !== "string") { - return null; + return result; + } + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (version.length > MAX_LENGTH) { - return null; + 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); } - var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version)) { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path3 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname2(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - try { - return new SemVer(version, options); - } catch (er) { - return null; + let result = path3.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); } + return result; } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + exports2.dirname = dirname2; + 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 (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; - } else { - version = version.version; + 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)}`; } - } 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"); + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path3.sep; } - if (!(this instanceof SemVer)) { - return new SemVer(version, options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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); } - debug4("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); + return itemPath.startsWith("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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); } - 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"); + return itemPath.startsWith("/"); + } + exports2.hasRoot = hasRoot; + function normalizeSeparators(p) { + p = p || ""; + if (IS_WINDOWS) { + p = p.replace(/\//g, "\\"); + const isUnc = /^\\\\+[^\\]/.test(p); + return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + return p.replace(/\/\/+/g, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + p = normalizeSeparators(p); + if (!p.endsWith(path3.sep)) { + return p; } - 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; - }); + if (p === path3.sep) { + return p; } - 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("."); + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; } - return this.version; - }; - SemVer.prototype.toString = function() { - return this.version; - }; - SemVer.prototype.compare = function(other) { - debug4("SemVer.compare", this.version, this.options, other); - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + return p.substr(0, p.length - 1); + } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; + } +}); + +// 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]; + } }; } - return this.compareMain(other) || this.comparePre(other); - }; - SemVer.prototype.compareMain = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + 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); } - return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch); + __setModuleDefault2(result, mod); + return result; }; - 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; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - var i2 = 0; - do { - var a = this.prerelease[i2]; - var b = other.prerelease[i2]; - debug4("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) { + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { continue; - } else { - return compareIdentifiers(a, b); } - } while (++i2); - }; - SemVer.prototype.compareBuild = function(other) { - if (!(other instanceof SemVer)) { - other = new SemVer(other, this.options); + 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"; + } } - var i2 = 0; - do { - var a = this.build[i2]; - var b = other.build[i2]; - debug4("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; + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(patterns, itemPath) { + let result = internal_match_kind_1.MatchKind.None; + for (const pattern of patterns) { + if (pattern.negate) { + result &= ~pattern.match(itemPath); } else { - return compareIdentifiers(a, b); + result |= pattern.match(itemPath); } - } while (++i2); - }; - SemVer.prototype.inc = function(release, identifier) { - switch (release) { - 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: " + release); } - this.format(); - this.raw = this.version; - return this; + return result; + } + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + } + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; }; - exports2.inc = inc; - function inc(version, release, loose, identifier) { - if (typeof loose === "string") { - identifier = loose; - loose = void 0; + var isArray = Array.isArray || function(xs) { + return Object.prototype.toString.call(xs) === "[object Array]"; + }; + } +}); + +// node_modules/brace-expansion/index.js +var require_brace_expansion2 = __commonJS({ + "node_modules/brace-expansion/index.js"(exports2, module2) { + var concatMap = require_concat_map(); + var balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); + } + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); + } + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); + } + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - try { - return new SemVer(version, loose).inc(release, identifier).version; - } catch (er) { - return null; + parts.push.apply(parts, p); + return parts; + } + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; + } + var n; + if (isSequence) { + n = m.body.split(/\.\./); } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } } } + N.push(c); } - return defaultResult; + } else { + N = concatMap(n, function(el) { + return expand(el, false); + }); } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.test(b); - if (anum && bnum) { - a = +a; - b = +b; + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } - 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 = compare2; - function compare2(a, b, loose) { - return new SemVer(a, loose).compare(new SemVer(b, loose)); - } - exports2.compareLoose = compareLoose; - function compareLoose(a, b) { - return compare2(a, b, true); + return expansions; } - 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); + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch2 = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path3 = (function() { + try { + return require("path"); + } catch (e) { + } + })() || { + sep: "/" + }; + minimatch.sep = path3.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion2(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); } - exports2.rcompare = rcompare; - function rcompare(a, b, loose) { - return compare2(b, a, loose); + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; } - exports2.sort = sort; - function sort(list, loose) { - return list.sort(function(a, b) { - return exports2.compareBuild(a, b, loose); + function ext(a, b) { + b = b || {}; + var t = {}; + Object.keys(a).forEach(function(k) { + t[k] = a[k]; }); - } - exports2.rsort = rsort; - function rsort(list, loose) { - return list.sort(function(a, b) { - return exports2.compareBuild(b, a, loose); + Object.keys(b).forEach(function(k) { + t[k] = b[k]; }); + return t; } - exports2.gt = gt; - function gt(a, b, loose) { - return compare2(a, b, loose) > 0; - } - exports2.lt = lt; - function lt(a, b, loose) { - return compare2(a, b, loose) < 0; - } - exports2.eq = eq; - function eq(a, b, loose) { - return compare2(a, b, loose) === 0; - } - exports2.neq = neq; - function neq(a, b, loose) { - return compare2(a, b, loose) !== 0; - } - exports2.gte = gte5; - function gte5(a, b, loose) { - return compare2(a, b, loose) >= 0; + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; + } + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { + return false; + } + return new Minimatch(pattern, options).match(p); } - exports2.lte = lte; - function lte(a, b, loose) { - return compare2(a, b, loose) <= 0; + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); + } + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path3.sep !== "/") { + pattern = pattern.split(path3.sep).join("/"); + } + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - 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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + Minimatch.prototype.debug = function() { + }; + Minimatch.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 set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug4() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + Minimatch.prototype.parseNegate = parseNegate; + function parseNegate() { + var pattern = this.pattern; + var negate = 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++) { + negate = !negate; + negateOffset++; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; + if (negateOffset) this.pattern = pattern.substr(negateOffset); + this.negate = negate; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); + }; + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; } else { - comp = comp.value; + options = {}; } } - if (!(this instanceof Comparator)) { - return new Comparator(comp, options); - } - comp = comp.trim().split(/\s+/).join(" "); - debug4("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; + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; } - debug4("comp", this); + return expand(pattern); } - 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); + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); } - this.operator = m[1] !== void 0 ? m[1] : ""; - if (this.operator === "=") { - this.operator = ""; + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); } - if (!m[2]) { - this.semver = ANY; - } else { - this.semver = new SemVer(m[2], this.options.loose); + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + 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 && reSpecials[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; + } + 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 (reSpecials[c] && !(c === "^" && inClass)) { + re += "\\"; + } + re += c; + } } - }; - Comparator.prototype.toString = function() { - return this.value; - }; - Comparator.prototype.test = function(version) { - debug4("Comparator.test", version, this.options.loose); - if (this.semver === ANY || version === ANY) { - return true; + if (inClass) { + cs = pattern.substr(classStart + 1); + sp = this.parse(cs, SUBPARSE); + re = re.substr(0, reClassStart) + "\\[" + sp[0]; + hasMagic = hasMagic || sp[1]; } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; - } + 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 === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; } - 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"); + clearStateChar(); + if (escaping) { + re += "\\\\"; } - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = true; } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return 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(/\)[+*?]?/, ""); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + nlAfter = cleanAfter; + var dollar = ""; + if (nlAfter === "" && isSub !== SUBPARSE) { + dollar = "$"; } - rangeTmp = new Range2(this.value, options); - return satisfies2(comp.semver, rangeTmp, options); + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; + re = newRe; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (re !== "" && hasMagic) { + re = "(?=.)" + re; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); - } + if (addPatternStart) { + re = patternStart + re; } - if (range instanceof Comparator) { - return new Range2(range.value, options); + if (isSub === SUBPARSE) { + return [re, hasMagic]; } - if (!(this instanceof Range2)) { - return new Range2(range, options); + if (!hasMagic) { + return globUnescape(pattern); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + var flags = options.nocase ? "i" : ""; + try { + var regExp = new RegExp("^" + re + "$", flags); + } catch (er) { + return new RegExp("$."); } - this.format(); + regExp._glob = pattern; + regExp._src = re; + return regExp; } - 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; + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug4("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); - }); + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return this.regexp; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; }; - 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(); + Minimatch.prototype.match = function match(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 (path3.sep !== "/") { + f = f.split(path3.sep).join("/"); } - return result; - } - exports2.toComparators = toComparators; - function toComparators(range, options) { - return new Range2(range, options).set.map(function(comp) { - return comp.map(function(c) { - return c.value; - }).join(" ").trim().split(" "); - }); - } - function parseComparator(comp, options) { - debug4("comp", comp, options); - comp = replaceCarets(comp, options); - debug4("caret", comp); - comp = replaceTildes(comp, options); - debug4("tildes", comp); - comp = replaceXRanges(comp, options); - debug4("xrange", comp); - comp = replaceStars(comp, options); - debug4("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) { - debug4("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) { - debug4("replaceTilde pr", pr); - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; - } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[i]; + var file = f; + if (options.matchBase && pattern.length === 1) { + file = [filename]; } - debug4("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) { - debug4("caret", comp, options); - var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; - return comp.replace(r, function(_2, M, m, p, pr) { - debug4("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) { - debug4("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"; + 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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; } - } else { - ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; + return true; } - } else { - debug4("no pr"); - if (M === "0") { - if (m === "0") { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1); + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; } else { - ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; } - } else { - ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + return false; } - debug4("caret return", ret); - return ret; - }); + 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 replaceXRanges(comp, options) { - debug4("replaceXRanges", comp, options); - return comp.split(/\s+/).map(function(comp2) { - return replaceXRange(comp2, options); - }).join(" "); + function regExpEscape(s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); } - 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) { - debug4("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"; + } +}); + +// 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 || 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.Path = void 0; + var path3 = __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(path3.sep); } 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; + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename2 = path3.basename(remaining); + this.segments.unshift(basename2); + remaining = dir; + dir = pathHelper.dirname(remaining); } - } else if (gtlt === "<=") { - gtlt = "<"; - if (xm) { - M = +M + 1; + 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 { - m = +m + 1; + (0, assert_1.default)(!segment.includes(path3.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); } } - 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; } - debug4("xRange return", ret); - return ret; - }); - } - function replaceStars(comp, options) { - debug4("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; + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path3.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path3.sep; + } + result += this.segments[i]; + } + return result; } - return (from + " " + to).trim(); - } - Range2.prototype.test = function(version) { - if (!version) { - return false; + }; + 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]; + } }; } - if (typeof version === "string") { - try { - version = new SemVer(version, this.options); - } catch (er) { - return false; + 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.Pattern = void 0; + var os2 = __importStar2(require("os")); + var path3 = __importStar2(require("path")); + var pathHelper = __importStar2(require_internal_path_helper()); + var assert_1 = __importDefault2(require("assert")); + var minimatch_1 = require_minimatch2(); + 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, homedir) { + 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, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path3.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); } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; + /** + * Matches the pattern against the specified path + */ + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path3.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path3.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; } - return false; - }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; + /** + * 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); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug4(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + /** + * 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, homedir) { + (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(`.${path3.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path3.sep}`)) { + homedir = homedir || os2.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 += "\\"; } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; + 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; + } else { + set2 += c2; + } + } + if (closed >= 0) { + if (set2.length > 1) { + return ""; + } + if (set2) { + literal += set2; + i = closed; + continue; + } } } + literal += c; } - return false; + return literal; } - return true; - } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + /** + * Escapes regexp special characters + * https://javascript.info/regexp-escaping + */ + static regExpEscape(s) { + return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); } - return range.test(version); - } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + }; + 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(path3, level) { + this.path = path3; + this.level = level; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); + }; + 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 || 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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - }); - return max; - } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, 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); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - return min; - } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + }; + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); + }); + }; } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d }); + }, reject); } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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); + }; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; + } + 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 core14 = __importStar2(require_core4()); + var fs3 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path3 = __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() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_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)) { + core14.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs3.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } - compver.raw = compver.format(); - /* fallthrough */ - case "": - case ">=": - if (!minver || gt(minver, compver)) { - minver = compver; + throw err; + } + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !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 && path3.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { + yield yield __await2(item.path); + } else if (!partialMatch) { + continue; } - break; - case "<": - case "<=": - break; - /* istanbul ignore next */ - default: - throw new Error("Unexpected operation: " + comparator.operator); + const childLevel = item.level + 1; + const childItems = (yield __await2(fs3.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path3.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & internal_match_kind_1.MatchKind.File) { + yield yield __await2(item.path); + } } }); } - if (minver && range.test(minver)) { - return minver; - } - return null; - } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; - } - } - exports2.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); - } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); - } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); - } - if (satisfies2(version, range, options)) { - return false; - } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.set[i2]; - var high = null; - var low = null; - comparators.forEach(function(comparator) { - if (comparator.semver === ANY) { - comparator = new Comparator(">=0.0.0"); + /** + * 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"); } - 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; + 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; }); - 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 = parse(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 match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + static stat(item, options, traversalChain) { + return __awaiter2(this, void 0, void 0, function* () { + let stats; + if (options.followSymbolicLinks) { + try { + stats = yield fs3.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core14.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 fs3.promises.lstat(item.path); } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; - } - safeRe[t.COERCERTL].lastIndex = -1; - } - if (match === null) { - return null; + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs3.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); + } + if (traversalChain.some((x) => x === realPath)) { + core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; + }); } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); - } - } -}); - -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants10 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - 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.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@actions/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -108235,21 +114697,21 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -108276,7 +114738,7 @@ var require_cacheUtils = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = exports2 && exports2.__asyncValues || function(o) { + 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() { @@ -108296,65 +114758,43 @@ var require_cacheUtils = __commonJS({ } }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob2 = __importStar4(require_glob2()); - var io6 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants10(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path2.join(baseLocation, "actions", "temp"); - } - const dest = path2.join(tempDirectory, crypto.randomUUID()); - yield io6.mkdirP(dest); - return dest; - }); - } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs2.statSync(filePath).size; - } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core14 = __importStar2(require_core4()); + var fs3 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path3 = __importStar2(require("path")); + function hashFiles2(globber, currentWorkspace, verbose = false) { var _a, e_1, _b, _c; var _d; - return __awaiter4(this, void 0, void 0, function* () { - 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 - }); + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core14.info : core14.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { _c = _g.value; _e = false; const file = _c; - const relativeFile = path2.relative(workspace, file).replace(new RegExp(`\\${path2.sep}`, "g"), "/"); - core14.debug(`Matched: ${relativeFile}`); - if (relativeFile === "") { - paths.push("."); - } else { - paths.push(`${relativeFile}`); + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path3.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs3.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream.pipeline); + yield pipeline(fs3.createReadStream(file), hash); + result.write(hash.digest()); + count++; + if (!hasMatch) { + hasMatch = true; } } } catch (e_1_1) { @@ -108366,801 +114806,1306 @@ var require_cacheUtils = __commonJS({ if (e_1) throw e_1.error; } } - return paths; - }); - } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs2.unlink)(filePath); + result.end(); + if (hasMatch) { + writeDelegate(`Found ${count} files to hash.`); + return result.digest("hex"); + } else { + writeDelegate(`No matches found for glob`); + return ""; + } }); } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() - } - }); - } catch (err) { - core14.debug(err.message); + exports2.hashFiles = hashFiles2; + } +}); + +// node_modules/@actions/glob/lib/glob.js +var require_glob2 = __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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - versionOutput = versionOutput.trim(); - core14.debug(versionOutput); - return versionOutput; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = exports2.create = void 0; + 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 getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core14.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + exports2.create = create3; + function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + 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); }); } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + exports2.hashFiles = hashFiles2; + } +}); + +// 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 debug4; + if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) { + debug4 = function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift("SEMVER"); + console.log.apply(console, args); + }; + } else { + debug4 = function() { + }; } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs2.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; - }); + 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++; } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); + 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++) { + debug4(i, src[i]); + if (!re[i]) { + re[i] = new RegExp(src[i]); + safeRe[i] = new RegExp(makeSafeRe(src[i])); + } + } + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - return value; - } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); + if (version instanceof SemVer) { + return version; } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + if (typeof version !== "string") { + return null; } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); - } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + 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; } - return token; } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy5 = __commonJS({ - "node_modules/@actions/cache/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; + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; + } + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(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 + }; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; + if (version instanceof SemVer) { + if (version.loose === options.loose) { + return version; } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; - } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + version = version.version; } - } else { - return void 0; + } else if (typeof version !== "string") { + throw new TypeError("Invalid Version: " + version); } - } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + if (version.length > MAX_LENGTH) { + throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + if (!(this instanceof SemVer)) { + return new SemVer(version, options); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + debug4("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); } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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"); } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError("Invalid minor version"); } - 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; - } + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError("Invalid patch version"); } - 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]"); + 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(); } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + SemVer.prototype.format = function() { + this.version = this.major + "." + this.minor + "." + this.patch; + if (this.prerelease.length) { + this.version += "-" + this.prerelease.join("."); } - get username() { - return this._decodedUsername; + return this.version; + }; + SemVer.prototype.toString = function() { + return this.version; + }; + SemVer.prototype.compare = function(other) { + debug4("SemVer.compare", this.version, this.options, other); + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - get password() { - return this._decodedPassword; + 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); }; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib7 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + SemVer.prototype.comparePre = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; + var i2 = 0; + do { + var a = this.prerelease[i2]; + var b = other.prerelease[i2]; + debug4("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); }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + SemVer.prototype.compareBuild = function(other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options); } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + var i2 = 0; + do { + var a = this.build[i2]; + var b = other.build[i2]; + debug4("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); } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + } while (++i2); + }; + SemVer.prototype.inc = function(release, identifier) { + switch (release) { + 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: " + release); + } + this.format(); + this.raw = this.version; + return this; + }; + exports2.inc = inc; + function inc(version, release, loose, identifier) { + if (typeof loose === "string") { + identifier = loose; + loose = void 0; + } + try { + return new SemVer(version, loose).inc(release, identifier).version; + } catch (er) { + return null; + } + } + exports2.diff = diff; + function diff(version1, version2) { + if (eq(version1, version2)) { + return null; + } else { + var v1 = parse(version1); + var v2 = parse(version2); + var prefix = ""; + if (v1.prerelease.length || v2.prerelease.length) { + prefix = "pre"; + var defaultResult = "prerelease"; } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + for (var key in v1) { + if (key === "major" || key === "minor" || key === "patch") { + if (v1[key] !== v2[key]) { + return prefix + key; + } + } } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + return defaultResult; + } + } + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.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 = compare2; + function compare2(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); + } + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare2(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 = rcompare; + function rcompare(a, b, loose) { + return compare2(b, a, loose); + } + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); }); - }; - 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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.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 compare2(a, b, loose) > 0; + } + exports2.lt = lt; + function lt(a, b, loose) { + return compare2(a, b, loose) < 0; + } + exports2.eq = eq; + function eq(a, b, loose) { + return compare2(a, b, loose) === 0; + } + exports2.neq = neq; + function neq(a, b, loose) { + return compare2(a, b, loose) !== 0; + } + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare2(a, b, loose) >= 0; + } + exports2.lte = lte; + function lte(a, b, loose) { + return compare2(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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(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 + }; } - }; - exports2.HttpClientError = HttpClientError; - var HttpClientResponse = class { - constructor(message) { - this.message = message; + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; + } } - readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); + comp = comp.trim().split(/\s+/).join(" "); + debug4("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; } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + debug4("comp", this); } - exports2.isHttps = isHttps; - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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; - } + 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) { + debug4("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; } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + 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"); } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + 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); } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); + 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(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); + } } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); + if (range instanceof Comparator) { + return new Range2(range.value, options); } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + if (!(this instanceof Range2)) { + return new Range2(range, options); } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, additionalHeaders); - }); + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); } - /** - * 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 __awaiter4(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); + 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(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug4("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug4("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); }); } - postJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; + }; + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { + return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, options); + }); + }); }); - } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); + }); + }; + 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(); } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + return result; + } + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); + } + function parseComparator(comp, options) { + debug4("comp", comp, options); + comp = replaceCarets(comp, options); + debug4("caret", comp); + comp = replaceTildes(comp, options); + debug4("tildes", comp); + comp = replaceXRanges(comp, options); + debug4("xrange", comp); + comp = replaceStars(comp, options); + debug4("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) { + debug4("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) { + debug4("replaceTilde pr", pr); + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0"; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0"; + } + debug4("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) { + debug4("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_2, M, m, p, pr) { + debug4("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"; } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, data); - } else { - return response; - } + } else if (pr) { + debug4("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"; } - 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, data); - redirectsRemaining--; + } else { + ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0"; + } + } else { + debug4("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"; } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + } else { + ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0"; + } + } + debug4("caret return", ret); + return ret; + }); + } + function replaceXRanges(comp, options) { + debug4("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) { + debug4("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; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else if (gtlt === "<=") { + gtlt = "<"; + if (xm) { + M = +M + 1; + } else { + m = +m + 1; } - } while (numTries < maxTries); - return response; - }); + } + 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; + } + debug4("xRange return", ret); + return ret; + }); + } + function replaceStars(comp, options) { + debug4("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; } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); + 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; } - this._disposed = true; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + for (var i2 = 0; i2 < this.set.length; i2++) { + if (testSet(this.set[i2], version, this.options)) { + return true; + } } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; - } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + return false; + }; + function testSet(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug4(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; } - } - const req = info7.httpModule.request(info7.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(); + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; + } } - handleResult(new Error(`Request timeout: ${info7.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(); } + return false; } - /** - * 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); + return true; + } + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - 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); + return range.test(version); + } + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, options); + } catch (er) { + return null; } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); + versions.forEach(function(v) { + if (rangeObj.test(v)) { + if (!max || maxSV.compare(v) === -1) { + max = v; + maxSV = new SemVer(max, options); } } - return info7; + }); + return max; + } + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, options); + } catch (er) { + return null; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + versions.forEach(function(v) { + if (rangeObj.test(v)) { + if (!min || minSV.compare(v) === 1) { + min = v; + minSV = new SemVer(min, options); + } } - return lowercaseKeys(headers || {}); + }); + return min; + } + exports2.minVersion = minVersion; + function minVersion(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; } - _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; + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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); } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.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; + if (minver && range.test(minver)) { + return minver; + } + return null; + } + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; + } + } + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); + } + if (satisfies2(version, range, options)) { + return false; + } + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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; } - 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 - }); + if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { + return false; + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); + return true; + } + exports2.prerelease = prerelease; + function prerelease(version, options) { + var parsed = parse(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; } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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 { - resolve2(response); - } - })); - }); + if (typeof version === "number") { + version = String(version); } - }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + if (typeof version !== "string") { + return null; + } + options = options || {}; + var match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; + } + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } + safeRe[t.COERCERTL].lastIndex = -1; + } + if (match === null) { + return null; + } + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + } } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth4 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// node_modules/@actions/cache/lib/internal/constants.js +var require_constants14 = __commonJS({ + "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + 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); + } +}); + +// node_modules/@actions/cache/lib/internal/cacheUtils.js +var require_cacheUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -109187,76 +116132,181 @@ var require_auth4 = __commonJS({ 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; + 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(resolve2, reject) { + v = o[n](v), settle(resolve2, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve2, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve2({ value: v2, done: d }); + }, reject); } }; - 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"); + 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 core14 = __importStar2(require_core()); + var exec3 = __importStar2(require_exec()); + var glob2 = __importStar2(require_glob2()); + var io6 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs3 = __importStar2(require("fs")); + var path3 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __importStar2(require("util")); + var constants_1 = require_constants14(); + 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 = path3.join(baseLocation, "actions", "temp"); } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); + const dest = path3.join(tempDirectory, crypto2.randomUUID()); + yield io6.mkdirP(dest); + return dest; + }); + } + function getArchiveFileSizeInBytes(filePath) { + return fs3.statSync(filePath).size; + } + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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 }); - } - }; - 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"); + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path3.relative(workspace, file).replace(new RegExp(`\\${path3.sep}`, "g"), "/"); + core14.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 && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; + } } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; + return paths; + }); + } + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs3.unlink)(filePath); + }); + } + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core14.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) { + core14.debug(err.message); + } + versionOutput = versionOutput.trim(); + core14.debug(versionOutput); + return versionOutput; + }); + } + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core14.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 (fs3.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; + } + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + components.push(versionSalt); + return crypto2.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; + } } }); @@ -109341,7 +116391,7 @@ More info on storage limits: https://docs.github.com/en/billing/managing-billing var require_uploadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -109354,21 +116404,31 @@ var require_uploadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -109396,9 +116456,10 @@ var require_uploadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core14 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); + exports2.UploadProgress = void 0; + exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; + var core14 = __importStar2(require_core()); + var storage_blob_1 = require_commonjs17(); var errors_1 = require_errors4(); var UploadProgress = class { constructor(contentLength) { @@ -109481,15 +116542,17 @@ var require_uploadUtils = __commonJS({ }; exports2.UploadProgress = UploadProgress; function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const blobClient = new storage_blob_1.BlobClient(signedUploadURL); const blockBlobClient = blobClient.getBlockBlobClient(); const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { @@ -109500,15 +116563,14 @@ var require_uploadUtils = __commonJS({ throw new errors_1.InvalidResponseError(`uploadCacheArchiveSDK: upload failed with status code ${response._response.status}`); } return response; - } catch (error4) { - core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; + } catch (error3) { + core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error3.message}`); + throw error3; } finally { uploadProgress.stopDisplayTimer(); } }); } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; } }); @@ -109516,7 +116578,7 @@ var require_uploadUtils = __commonJS({ var require_requestUtils2 = __commonJS({ "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -109529,21 +116591,31 @@ var require_requestUtils2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -109571,24 +116643,27 @@ var require_requestUtils2 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib7(); - var constants_1 = require_constants10(); + exports2.isSuccessStatusCode = isSuccessStatusCode; + exports2.isServerErrorStatusCode = isServerErrorStatusCode; + exports2.isRetryableStatusCode = isRetryableStatusCode; + exports2.retry = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var constants_1 = require_constants14(); function isSuccessStatusCode(statusCode) { if (!statusCode) { return false; } return statusCode >= 200 && statusCode < 300; } - exports2.isSuccessStatusCode = isSuccessStatusCode; function isServerErrorStatusCode(statusCode) { if (!statusCode) { return true; } return statusCode >= 500; } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; function isRetryableStatusCode(statusCode) { if (!statusCode) { return false; @@ -109600,14 +116675,13 @@ var require_requestUtils2 = __commonJS({ ]; return retryableStatusCodes.includes(statusCode); } - exports2.isRetryableStatusCode = isRetryableStatusCode; function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { + function retry3(name_1, method_1, getStatusCode_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = void 0) { let errorMessage = ""; let attempt = 1; while (attempt <= maxAttempts) { @@ -109616,12 +116690,12 @@ var require_requestUtils2 = __commonJS({ let isRetryable = false; try { response = yield method(); - } catch (error4) { + } catch (error3) { if (onError) { - response = onError(error4); + response = onError(error3); } isRetryable = true; - errorMessage = error4.message; + errorMessage = error3.message; } if (response) { statusCode = getStatusCode(response); @@ -109644,9 +116718,8 @@ var require_requestUtils2 = __commonJS({ throw Error(`${name} failed: ${errorMessage}`); }); } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + function retryTypedResponse(name_1, method_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return yield retry3( name, method, @@ -109655,13 +116728,13 @@ var require_requestUtils2 = __commonJS({ delay, // If the error object contains the statusCode property, extract it and return // an TypedResponse so it can be processed by the retry logic. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { + (error3) => { + if (error3 instanceof http_client_1.HttpClientError) { return { - statusCode: error4.statusCode, + statusCode: error3.statusCode, result: null, headers: {}, - error: error4 + error: error3 }; } else { return void 0; @@ -109670,13 +116743,155 @@ var require_requestUtils2 = __commonJS({ ); }); } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { + function retryHttpClientResponse(name_1, method_1) { + return __awaiter2(this, arguments, void 0, function* (name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) { return yield retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay); }); } - exports2.retryHttpClientResponse = retryHttpClientResponse; + } +}); + +// 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 index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 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; } }); @@ -109684,7 +116899,7 @@ var require_requestUtils2 = __commonJS({ var require_downloadUtils = __commonJS({ "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -109697,21 +116912,31 @@ var require_downloadUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -109739,20 +116964,23 @@ var require_downloadUtils = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib7(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs2 = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants10(); + exports2.DownloadProgress = void 0; + exports2.downloadCacheHttpClient = downloadCacheHttpClient; + exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; + exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs17(); + var buffer = __importStar2(require("buffer")); + var fs3 = __importStar2(require("fs")); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); + var constants_1 = require_constants14(); var requestUtils_1 = require_requestUtils2(); var abort_controller_1 = require_dist5(); function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const pipeline = util.promisify(stream.pipeline); yield pipeline(response.message, output); }); @@ -109854,10 +117082,10 @@ var require_downloadUtils = __commonJS({ }; exports2.DownloadProgress = DownloadProgress; function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { - const writeStream = fs2.createWriteStream(archivePath); + return __awaiter2(this, void 0, void 0, function* () { + const writeStream = fs3.createWriteStream(archivePath); const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { + 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, () => { @@ -109877,17 +117105,16 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs2.promises.open(archivePath, "w"); + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const archiveDescriptor = yield fs3.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", () => __awaiter4(this, void 0, void 0, function* () { + 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"]; @@ -109904,7 +117131,7 @@ var require_downloadUtils = __commonJS({ const count = Math.min(blockSize, length - offset); downloads.push({ offset, - promiseGetter: () => __awaiter4(this, void 0, void 0, function* () { + promiseGetter: () => __awaiter2(this, void 0, void 0, function* () { return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count); }) }); @@ -109917,7 +117144,7 @@ var require_downloadUtils = __commonJS({ const progressFn = progress.onProgress(); const activeDownloads = []; let nextDownload; - const waitAndWrite = () => __awaiter4(this, void 0, void 0, function* () { + 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--; @@ -109941,9 +117168,8 @@ var require_downloadUtils = __commonJS({ } }); } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const retries = 5; let failures = 0; while (true) { @@ -109964,8 +117190,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadSegment(httpClient, archiveLocation, offset, count) { - return __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(this, void 0, void 0, function* () { + 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}` }); @@ -109981,8 +117207,8 @@ var require_downloadUtils = __commonJS({ }); } function downloadCacheStorageSDK(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const client = new storage_blob_1.BlockBlobClient(archiveLocation, void 0, { retryOptions: { // Override the timeout used when downloading each 4 MB chunk @@ -109998,7 +117224,7 @@ var require_downloadUtils = __commonJS({ } else { const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH); const downloadProgress = new DownloadProgress(contentLength); - const fd = fs2.openSync(archivePath, "w"); + const fd = fs3.openSync(archivePath, "w"); try { downloadProgress.startDisplayTimer(); const controller = new abort_controller_1.AbortController(); @@ -110016,18 +117242,17 @@ var require_downloadUtils = __commonJS({ controller.abort(); throw new Error("Aborting cache download as the download time exceeded the timeout."); } else if (Buffer.isBuffer(result)) { - fs2.writeFileSync(fd, result); + fs3.writeFileSync(fd, result); } } } finally { downloadProgress.stopDisplayTimer(); - fs2.closeSync(fd); + fs3.closeSync(fd); } } }); } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { let timeoutHandle; const timeoutPromise = new Promise((resolve2) => { timeoutHandle = setTimeout(() => resolve2("timeout"), timeoutMs); @@ -110044,7 +117269,7 @@ var require_downloadUtils = __commonJS({ var require_options = __commonJS({ "node_modules/@actions/cache/lib/options.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -110057,23 +117282,34 @@ var require_options = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.getDownloadOptions = exports2.getUploadOptions = void 0; - var core14 = __importStar4(require_core()); + exports2.getUploadOptions = getUploadOptions; + exports2.getDownloadOptions = getDownloadOptions; + var core14 = __importStar2(require_core()); function getUploadOptions(copy) { const result = { useAzureSdk: false, @@ -110098,7 +117334,6 @@ var require_options = __commonJS({ core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); return result; } - exports2.getUploadOptions = getUploadOptions; function getDownloadOptions(copy) { const result = { useAzureSdk: false, @@ -110140,7 +117375,6 @@ var require_options = __commonJS({ core14.debug(`Lookup only: ${result.lookupOnly}`); return result; } - exports2.getDownloadOptions = getDownloadOptions; } }); @@ -110149,7 +117383,9 @@ var require_config2 = __commonJS({ "node_modules/@actions/cache/lib/internal/config.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; + exports2.isGhes = isGhes; + exports2.getCacheServiceVersion = getCacheServiceVersion; + exports2.getCacheServiceURL = getCacheServiceURL; function isGhes() { const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com"); const hostname = ghUrl.hostname.trimEnd().toUpperCase(); @@ -110158,13 +117394,11 @@ var require_config2 = __commonJS({ const isLocalHost = hostname.endsWith(".LOCALHOST"); return !isGitHubHost && !isGheHost && !isLocalHost; } - exports2.isGhes = isGhes; function getCacheServiceVersion() { if (isGhes()) return "v1"; return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } - exports2.getCacheServiceVersion = getCacheServiceVersion; function getCacheServiceURL() { const version = getCacheServiceVersion(); switch (version) { @@ -110176,7 +117410,6 @@ var require_config2 = __commonJS({ throw new Error(`Unsupported cache service version: ${version}`); } } - exports2.getCacheServiceURL = getCacheServiceURL; } }); @@ -110185,7 +117418,7 @@ var require_package3 = __commonJS({ "node_modules/@actions/cache/package.json"(exports2, module2) { module2.exports = { name: "@actions/cache", - version: "4.1.0", + version: "5.0.1", preview: true, description: "Actions cache lib", keywords: [ @@ -110222,22 +117455,26 @@ var require_package3 = __commonJS({ url: "https://github.com/actions/toolkit/issues" }, dependencies: { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", + "@azure/core-rest-pipeline": "^1.22.0", + "@azure/storage-blob": "^12.29.1", semver: "^6.3.1" }, devDependencies: { - "@types/node": "^22.13.9", + "@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" } }; } @@ -110248,12 +117485,11 @@ var require_user_agent2 = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/user-agent.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getUserAgentString = void 0; + exports2.getUserAgentString = getUserAgentString; var packageJson = require_package3(); function getUserAgentString() { return `@actions/cache-${packageJson.version}`; } - exports2.getUserAgentString = getUserAgentString; } }); @@ -110261,7 +117497,7 @@ var require_user_agent2 = __commonJS({ var require_cacheHttpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -110274,21 +117510,31 @@ var require_cacheHttpClient = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -110316,13 +117562,16 @@ var require_cacheHttpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib7(); - var auth_1 = require_auth4(); - var fs2 = __importStar4(require("fs")); + exports2.getCacheEntry = getCacheEntry; + exports2.downloadCache = downloadCache; + exports2.reserveCache = reserveCache; + exports2.saveCache = saveCache4; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs3 = __importStar2(require("fs")); var url_1 = require("url"); - var utils = __importStar4(require_cacheUtils()); + var utils = __importStar2(require_cacheUtils()); var uploadUtils_1 = require_uploadUtils(); var downloadUtils_1 = require_downloadUtils(); var options_1 = require_options(); @@ -110355,11 +117604,11 @@ var require_cacheHttpClient = __commonJS({ return new http_client_1.HttpClient((0, user_agent_1.getUserAgentString)(), [bearerCredentialHandler], getRequestOptions()); } function getCacheEntry(keys, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { @@ -110382,11 +117631,10 @@ var require_cacheHttpClient = __commonJS({ return cacheResult; }); } - exports2.getCacheEntry = getCacheEntry; function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 200) { @@ -110403,7 +117651,7 @@ Other caches with similar key:`); }); } function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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")) { @@ -110419,9 +117667,8 @@ Other caches with similar key:`); } }); } - exports2.downloadCache = downloadCache; function reserveCache(key, paths, options) { - return __awaiter4(this, void 0, void 0, function* () { + 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 = { @@ -110429,24 +117676,23 @@ Other caches with similar key:`); version, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; - const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter4(this, void 0, void 0, function* () { + const response = yield (0, requestUtils_1.retryTypedResponse)("reserveCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); })); return response; }); } - exports2.reserveCache = reserveCache; function getContentRange(start, end) { return `bytes ${start}-${end}/*`; } function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { core14.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})`, () => __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -110455,10 +117701,10 @@ Other caches with similar key:`); }); } function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const fileSize = utils.getArchiveFileSizeInBytes(archivePath); const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs2.openSync(archivePath, "r"); + const fd = fs3.openSync(archivePath, "r"); const uploadOptions = (0, options_1.getUploadOptions)(options); const concurrency = utils.assertDefined("uploadConcurrency", uploadOptions.uploadConcurrency); const maxChunkSize = utils.assertDefined("uploadChunkSize", uploadOptions.uploadChunkSize); @@ -110466,38 +117712,38 @@ Other caches with similar key:`); core14.debug("Awaiting all uploads"); let offset = 0; try { - yield Promise.all(parallelUploads.map(() => __awaiter4(this, void 0, void 0, function* () { + 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, () => fs2.createReadStream(archivePath, { + yield uploadChunk(httpClient, resourceUrl, () => fs3.createReadStream(archivePath, { fd, start, end, autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); + }).on("error", (error3) => { + throw new Error(`Cache upload failed because file read failed with ${error3.message}`); }), start, end); } }))); } finally { - fs2.closeSync(fd); + fs3.closeSync(fd); } return; }); } function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { + return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter2(this, void 0, void 0, function* () { return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); })); }); } function saveCache4(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const uploadOptions = (0, options_1.getUploadOptions)(options); if (uploadOptions.useAzureSdk) { if (!signedUploadURL) { @@ -110519,7 +117765,6 @@ Other caches with similar key:`); } }); } - exports2.saveCache = saveCache4; } }); @@ -110671,7 +117916,7 @@ var require_cachemetadata = __commonJS({ }); // node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __commonJS({ +var require_cache3 = __commonJS({ "node_modules/@actions/cache/lib/generated/results/api/v1/cache.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -111156,7 +118401,7 @@ var require_cache_twirp_client = __commonJS({ "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.CacheServiceClientProtobuf = exports2.CacheServiceClientJSON = void 0; - var cache_1 = require_cache2(); + var cache_1 = require_cache3(); var CacheServiceClientJSON = class { constructor(rpc) { this.rpc = rpc; @@ -111224,11 +118469,12 @@ var require_cache_twirp_client = __commonJS({ }); // node_modules/@actions/cache/lib/internal/shared/util.js -var require_util15 = __commonJS({ +var require_util14 = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.maskSecretUrls = exports2.maskSigUrl = void 0; + exports2.maskSigUrl = maskSigUrl; + exports2.maskSecretUrls = maskSecretUrls; var core_1 = require_core(); function maskSigUrl(url) { if (!url) @@ -111240,11 +118486,10 @@ var require_util15 = __commonJS({ (0, core_1.setSecret)(signature); (0, core_1.setSecret)(encodeURIComponent(signature)); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url} ${error4 instanceof Error ? error4.message : String(error4)}`); + } catch (error3) { + (0, core_1.debug)(`Failed to parse URL: ${url} ${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"); @@ -111257,7 +118502,6 @@ var require_util15 = __commonJS({ maskSigUrl(body.signed_download_url); } } - exports2.maskSecretUrls = maskSecretUrls; } }); @@ -111265,7 +118509,7 @@ var require_util15 = __commonJS({ var require_cacheTwirpClient = __commonJS({ "node_modules/@actions/cache/lib/internal/shared/cacheTwirpClient.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -111293,16 +118537,16 @@ var require_cacheTwirpClient = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; + exports2.internalCacheTwirpClient = internalCacheTwirpClient; var core_1 = require_core(); var user_agent_1 = require_user_agent2(); var errors_1 = require_errors4(); var config_1 = require_config2(); var cacheUtils_1 = require_cacheUtils(); - var auth_1 = require_auth4(); - var http_client_1 = require_lib7(); + var auth_1 = require_auth(); + var http_client_1 = require_lib(); var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util15(); + var util_1 = require_util14(); var CacheServiceClient = class { constructor(userAgent, maxAttempts, baseRetryIntervalMilliseconds, retryMultiplier) { this.maxAttempts = 5; @@ -111326,24 +118570,24 @@ var require_cacheTwirpClient = __commonJS({ // This function satisfies the Rpc interface. It is compatible with the JSON // JSON generated client. request(service, method, contentType, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const url = new URL(`/twirp/${service}/${method}`, this.baseUrl).href; (0, core_1.debug)(`[Request] ${method} ${url}`); const headers = { "Content-Type": contentType }; try { - const { body } = yield this.retryableRequest(() => __awaiter4(this, void 0, void 0, function* () { + const { body } = yield this.retryableRequest(() => __awaiter2(this, void 0, void 0, function* () { return this.httpClient.post(url, JSON.stringify(data), headers); })); return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); + } catch (error3) { + throw new Error(`Failed to ${method}: ${error3.message}`); } }); } retryableRequest(operation) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let attempt = 0; let errorMessage = ""; let rawBody = ""; @@ -111369,18 +118613,18 @@ var require_cacheTwirpClient = __commonJS({ } errorMessage = `${errorMessage}: ${body.msg}`; } - } catch (error4) { - if (error4 instanceof SyntaxError) { + } catch (error3) { + if (error3 instanceof SyntaxError) { (0, core_1.debug)(`Raw Body: ${rawBody}`); } - if (error4 instanceof errors_1.UsageError) { - throw error4; + if (error3 instanceof errors_1.UsageError) { + throw error3; } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); + 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 = error4.message; + errorMessage = error3.message; } if (!isRetryable) { throw new Error(`Received non-retryable error: ${errorMessage}`); @@ -111414,7 +118658,7 @@ var require_cacheTwirpClient = __commonJS({ return retryableStatusCodes.includes(statusCode); } sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2) => setTimeout(resolve2, milliseconds)); }); } @@ -111434,7 +118678,6 @@ var require_cacheTwirpClient = __commonJS({ 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); } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; } }); @@ -111442,7 +118685,7 @@ var require_cacheTwirpClient = __commonJS({ var require_tar2 = __commonJS({ "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111455,21 +118698,31 @@ var require_tar2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -111497,16 +118750,18 @@ var require_tar2 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; + exports2.listTar = listTar; + exports2.extractTar = extractTar2; + exports2.createTar = createTar; var exec_1 = require_exec(); - var io6 = __importStar4(require_io3()); + var io6 = __importStar2(require_io()); var fs_1 = require("fs"); - var path2 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants10(); + var path3 = __importStar2(require("path")); + var utils = __importStar2(require_cacheUtils()); + var constants_1 = require_constants14(); var IS_WINDOWS = process.platform === "win32"; function getTarPath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { switch (process.platform) { case "win32": { const gnuTar = yield utils.getGnuTarPathOnWindows(); @@ -111538,8 +118793,8 @@ var require_tar2 = __commonJS({ }; }); } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getTarArgs(tarPath_1, compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (tarPath, compressionMethod, type2, archivePath = "") { const args = [`"${tarPath.path}"`]; const cacheFileName = utils.getCacheFileName(compressionMethod); const tarFile = "cache.tar"; @@ -111547,13 +118802,13 @@ var require_tar2 = __commonJS({ const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD && compressionMethod !== constants_1.CompressionMethod.Gzip && IS_WINDOWS; switch (type2) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path2.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path3.sep}`, "g"), "/")); break; case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), "-P"); + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), "-P"); break; } if (tarPath.type === constants_1.ArchiveToolType.GNU) { @@ -111569,8 +118824,8 @@ var require_tar2 = __commonJS({ return args; }); } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { let args; const tarPath = yield getTarPath(); const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); @@ -111592,14 +118847,14 @@ var require_tar2 = __commonJS({ return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); } function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { + 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(`\\${path2.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path3.sep}`, "g"), "/") ] : [ "--use-compress-program", IS_WINDOWS ? '"zstd -d --long=30"' : "unzstd --long=30" @@ -111608,7 +118863,7 @@ var require_tar2 = __commonJS({ return BSD_TAR_ZSTD ? [ "zstd -d --force -o", constants_1.TarFilename, - archivePath.replace(new RegExp(`\\${path2.sep}`, "g"), "/") + archivePath.replace(new RegExp(`\\${path3.sep}`, "g"), "/") ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; default: return ["-z"]; @@ -111616,14 +118871,14 @@ var require_tar2 = __commonJS({ }); } function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + 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(`\\${path2.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), constants_1.TarFilename ] : [ "--use-compress-program", @@ -111632,7 +118887,7 @@ var require_tar2 = __commonJS({ case constants_1.CompressionMethod.ZstdWithoutLong: return BSD_TAR_ZSTD ? [ "zstd -T0 --force -o", - cacheFileName.replace(new RegExp(`\\${path2.sep}`, "g"), "/"), + cacheFileName.replace(new RegExp(`\\${path3.sep}`, "g"), "/"), constants_1.TarFilename ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; default: @@ -111641,51 +118896,48 @@ var require_tar2 = __commonJS({ }); } function execCommands(commands, cwd) { - return __awaiter4(this, void 0, void 0, function* () { + 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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + } 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 __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const commands = yield getCommands(compressionMethod, "list", archivePath); yield execCommands(commands); }); } - exports2.listTar = listTar; function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const workingDirectory = getWorkingDirectory(); yield io6.mkdirP(workingDirectory); const commands = yield getCommands(compressionMethod, "extract", archivePath); yield execCommands(commands); }); } - exports2.extractTar = extractTar2; function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path2.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + return __awaiter2(this, void 0, void 0, function* () { + (0, fs_1.writeFileSync)(path3.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); const commands = yield getCommands(compressionMethod, "create"); yield execCommands(commands, archiveFolder); }); } - exports2.createTar = createTar; } }); // node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ +var require_cache4 = __commonJS({ "node_modules/@actions/cache/lib/cache.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -111698,21 +118950,31 @@ var require_cache3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -111740,15 +119002,18 @@ var require_cache3 = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core14 = __importStar4(require_core()); - var path2 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache4; + exports2.saveCache = saveCache4; + var core14 = __importStar2(require_core()); + var path3 = __importStar2(require("path")); + var utils = __importStar2(require_cacheUtils()); + var cacheHttpClient = __importStar2(require_cacheHttpClient()); + var cacheTwirpClient = __importStar2(require_cacheTwirpClient()); var config_1 = require_config2(); var tar_1 = require_tar2(); - var http_client_1 = require_lib7(); + var http_client_1 = require_lib(); var ValidationError = class _ValidationError extends Error { constructor(message) { super(message); @@ -111797,9 +119062,8 @@ var require_cache3 = __commonJS({ return !!process.env["ACTIONS_CACHE_URL"]; } } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache4(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCache4(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)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -111812,9 +119076,8 @@ var require_cache3 = __commonJS({ } }); } - exports2.restoreCache = restoreCache4; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; core14.debug("Resolved Keys:"); @@ -111839,7 +119102,7 @@ var require_cache3 = __commonJS({ core14.info("Lookup only - skipping download"); return cacheEntry.cacheKey; } - archivePath = path2.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path3.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core14.debug(`Archive Path: ${archivePath}`); yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); if (core14.isDebug()) { @@ -111850,29 +119113,29 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core14.info("Cache restored successfully"); return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); + core14.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error4.message}`); + core14.warning(`Failed to restore: ${error3.message}`); } } } finally { try { yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); restoreKeys = restoreKeys || []; const keys = [primaryKey, ...restoreKeys]; @@ -111908,7 +119171,7 @@ var require_cache3 = __commonJS({ core14.info("Lookup only - skipping download"); return response.matchedKey; } - archivePath = path2.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + archivePath = path3.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); core14.debug(`Archive path: ${archivePath}`); core14.debug(`Starting download of archive to: ${archivePath}`); yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); @@ -111920,15 +119183,15 @@ var require_cache3 = __commonJS({ yield (0, tar_1.extractTar)(archivePath, compressionMethod); core14.info("Cache restored successfully"); return response.matchedKey; - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else { if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); + core14.error(`Failed to restore: ${error3.message}`); } else { - core14.warning(`Failed to restore: ${error4.message}`); + core14.warning(`Failed to restore: ${error3.message}`); } } } finally { @@ -111936,15 +119199,15 @@ var require_cache3 = __commonJS({ if (archivePath) { yield utils.unlinkFile(archivePath); } - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } return void 0; }); } - function saveCache4(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { + function saveCache4(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); core14.debug(`Cache service version: ${cacheServiceVersion}`); checkPaths(paths); @@ -111958,10 +119221,9 @@ var require_cache3 = __commonJS({ } }); } - exports2.saveCache = saveCache4; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { + function saveCacheV1(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + var _a, _b, _c, _d, _e; const compressionMethod = yield utils.getCompressionMethod(); let cacheId = -1; const cachePaths = yield utils.resolvePaths(paths); @@ -111971,7 +119233,7 @@ var require_cache3 = __commonJS({ 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 = path2.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + const archivePath = path3.join(archiveFolder, utils.getCacheFileName(compressionMethod)); core14.debug(`Archive Path: ${archivePath}`); try { yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); @@ -111999,10 +119261,10 @@ var require_cache3 = __commonJS({ } core14.debug(`Saving Cache (ID: ${cacheId})`); yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; + } catch (error3) { + const typedError = error3; if (typedError.name === ValidationError.name) { - throw error4; + throw error3; } else if (typedError.name === ReserveCacheError2.name) { core14.info(`Failed to save: ${typedError.message}`); } else { @@ -112014,527 +119276,224 @@ var require_cache3 = __commonJS({ } } finally { try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); - } - } - return cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core14.debug("Cache Paths:"); - core14.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 = path2.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core14.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; - try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core14.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core14.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); - } - core14.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); - core14.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 (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError2.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core14.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); - } - } - return cacheId; - }); - } - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var _a; - 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 fs2 = __importStar4(require("fs")); - var path2 = __importStar4(require("path")); - _a = fs2.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs2.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - try { - yield exports2.stat(fsPath); - } catch (err) { - if (err.code === "ENOENT") { - return false; + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } - throw err; } - return true; - }); - } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); - return stats.isDirectory(); + return cacheId; }); } - 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 __awaiter4(this, void 0, void 0, function* () { - let stats = void 0; + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + 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); + core14.debug("Cache Paths:"); + core14.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 = path3.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); 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}`); + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - const upperExt = path2.extname(filePath).toUpperCase(); - if (extensions.some((validExt) => validExt.toUpperCase() === upperExt)) { - return filePath; - } - } else { - if (isUnixExecutable(stats)) { - return filePath; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core14.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core14.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core14.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError2(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); } - } - 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}`); + core14.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); + core14.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.`); } - if (stats && stats.isFile()) { - if (exports2.IS_WINDOWS) { - try { - const directory = path2.dirname(filePath); - const upperName = path2.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path2.join(directory, actualName); - break; - } - } - } catch (err) { - console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`); - } - return filePath; + cacheId = parseInt(finalizeResponse.entryId); + } catch (error3) { + const typedError = error3; + if (typedError.name === ValidationError.name) { + throw error3; + } else if (typedError.name === ReserveCacheError2.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core14.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); } else { - if (isUnixExecutable(stats)) { - return filePath; - } + core14.warning(`Failed to save: ${typedError.message}`); } } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); + } } - return ""; + return cacheId; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; - function normalizeSeparators(p) { - p = p || ""; - if (exports2.IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - return p.replace(/\\\\+/g, "\\"); + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils11 = __commonJS({ + "node_modules/@actions/tool-cache/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 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(); + return JSON.stringify(input); } - function getCmdPath() { - var _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + 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.getCmdPath = getCmdPath; + exports2.toCommandProperties = toCommandProperties; } }); -// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/command.js +var require_command4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 path2 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); - function cp(source, dest, options = {}) { - return __awaiter4(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 ? path2.join(dest, path2.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 (path2.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path2.join(dest, path2.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(path2.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - exports2.mv = mv; - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); + exports2.issue = exports2.issueCommand = void 0; + var os2 = __importStar2(require("os")); + var utils_1 = require_utils11(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os2.EOL); } - exports2.mkdirP = mkdirP; - function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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.issueCommand = issueCommand; + function issue(name, message = "") { + issueCommand(name, {}, message); } - exports2.which = which6; - function findInPath(tool) { - return __awaiter4(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(path2.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(path2.sep)) { - return []; + exports2.issue = issue; + var CMD_STRING = "::"; + var Command = class { + constructor(command, properties, message) { + if (!command) { + command = "missing.command"; } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path2.delimiter)) { - if (p) { - directories.push(p); + 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)}`; + } } } } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path2.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); + 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 copyFile(srcFile, destFile, force) { - return __awaiter4(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); - } - }); + 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/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -112547,130 +119506,56 @@ var require_manifest = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); - } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os = require("os"); - var cp = require("child_process"); - var fs2 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs3 = __importStar2(require("fs")); + var os2 = __importStar2(require("os")); + var utils_1 = require_utils11(); + 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 (!fs3.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); + } + fs3.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os2.EOL}`, { + encoding: "utf8" }); } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os.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; - } - } - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - return version; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs2.existsSync(lsbReleaseFile)) { - contents = fs2.readFileSync(lsbReleaseFile).toString(); - } else if (fs2.existsSync(osReleaseFile)) { - contents = fs2.readFileSync(osReleaseFile).toString(); + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return contents; + return `${key}<<${delimiter}${os2.EOL}${convertedValue}${os2.EOL}${delimiter}`; } - exports2._readLinuxVersionFile = _readLinuxVersionFile; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); // node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy6 = __commonJS({ +var require_proxy5 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); @@ -112752,10 +119637,10 @@ var require_proxy6 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib8 = __commonJS({ +var require_lib7 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -112768,21 +119653,21 @@ var require_lib8 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -112811,10 +119696,10 @@ var require_lib8 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy6()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy5()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -112889,8 +119774,8 @@ var require_lib8 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -112902,8 +119787,8 @@ var require_lib8 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -112960,42 +119845,42 @@ var require_lib8 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream, additionalHeaders); }); } @@ -113004,14 +119889,14 @@ var require_lib8 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -113020,7 +119905,7 @@ var require_lib8 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -113029,7 +119914,7 @@ var require_lib8 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -113043,7 +119928,7 @@ var require_lib8 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -113117,7 +120002,7 @@ var require_lib8 = __commonJS({ * @param data */ requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve2, reject) => { function callbackForResult(err, res) { if (err) { @@ -113304,15 +120189,15 @@ var require_lib8 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve2, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -113370,38 +120255,115 @@ var require_lib8 = __commonJS({ } }); -// node_modules/@actions/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __createBinding4 = 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]; - } }; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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"); + }); } - __setModuleDefault4(result, mod); - return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils4 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve2) { resolve2(value); @@ -113429,85 +120391,443 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core14 = __importStar4(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"); + exports2.OidcClient = void 0; + var http_client_1 = require_lib7(); + var auth_1 = require_auth4(); + var core_1 = require_core5(); + 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"); } - 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"); + 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; } - execute(action, isRetryable) { - return __awaiter4(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; - } - core14.info(err.message); + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.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}`; } - const seconds = this.getSleepAmount(); - core14.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + (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}`); } - return yield action(); }); } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; + }; + exports2.OidcClient = OidcClient; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary4 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve2) { + resolve2(value); + }); } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => setTimeout(resolve2, seconds * 1e3)); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 (_a) { + 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(); + } }; - exports2.RetryHelper = RetryHelper; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils4 = __commonJS({ + "node_modules/@actions/tool-cache/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 path3 = __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, path3.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js +var require_io_util4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve2) { resolve2(value); @@ -113534,650 +120854,153 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; + var _a; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core14 = __importStar4(require_core()); - var io6 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs2 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os = __importStar4(require("os")); - var path2 = __importStar4(require("path")); - var httpm = __importStar4(require_lib8()); - var semver8 = __importStar4(require_semver2()); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var assert_1 = require("assert"); - var exec_1 = require_exec(); - var retry_helper_1 = require_retry_helper(); - var HTTPError = class extends Error { - constructor(httpStatusCode) { - super(`Unexpected HTTP response: ${httpStatusCode}`); - this.httpStatusCode = httpStatusCode; - Object.setPrototypeOf(this, new.target.prototype); - } - }; - exports2.HTTPError = HTTPError; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path2.join(_getTempDirectory(), crypto.randomUUID()); - yield io6.mkdirP(path2.dirname(dest)); - core14.debug(`Downloading ${url}`); - core14.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs2.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core14.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError(response.message.statusCode); - core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs2.createWriteStream(dest)); - core14.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core14.debug("download failed"); - try { - yield io6.rmRF(dest); - } catch (err) { - core14.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core14.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path2.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 io6.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core14.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() - } - }); - core14.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core14.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core14.isDebug()) { - args.push("-v"); - } - const xarPath = yield io6.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io6.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 - ]; - core14.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 io6.which("powershell", true); - core14.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io6.which("unzip", true); - const args = [file]; - if (!core14.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch}`); - core14.debug(`source dir: ${sourceDir}`); - if (!fs2.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch); - for (const itemName of fs2.readdirSync(sourceDir)) { - const s = path2.join(sourceDir, itemName); - yield io6.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch); - return destPath; - }); - } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch = arch || os.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch}`); - core14.debug(`source file: ${sourceFile}`); - if (!fs2.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch); - const destPath = path2.join(destFolder, targetFile); - core14.debug(`destination file ${destPath}`); - yield io6.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch); - return destFolder; - }); - } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch = arch || os.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path2.join(_getCacheDirectory(), toolName, versionSpec, arch); - core14.debug(`checking cache: ${cachePath}`); - if (fs2.existsSync(cachePath) && fs2.existsSync(`${cachePath}.complete`)) { - core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); - toolPath = cachePath; - } else { - core14.debug("not found"); - } - } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch) { - const versions = []; - arch = arch || os.arch(); - const toolPath = path2.join(_getCacheDirectory(), toolName); - if (fs2.existsSync(toolPath)) { - const children = fs2.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path2.join(toolPath, child, arch || ""); - if (fs2.existsSync(fullPath) && fs2.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } - } - return versions; - } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core14.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core14.debug("Invalid json"); - } - } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path2.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io6.mkdirP(dest); - return dest; - }); - } - function _createToolPath(tool, version, arch) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path2.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - core14.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io6.rmRF(folderPath); - yield io6.rmRF(markerPath); - yield io6.mkdirP(folderPath); - return folderPath; - }); - } - function _completeToolPath(tool, version, arch) { - const folderPath = path2.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch || ""); - const markerPath = `${folderPath}.complete`; - fs2.writeFileSync(markerPath, ""); - core14.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core14.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core14.debug(`explicit? ${valid3}`); - return valid3; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core14.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; - } - return -1; - }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core14.debug(`matched: ${version}`); - } else { - core14.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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/@actions/http-client/lib/proxy.js -var require_proxy7 = __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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + 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 fs3 = __importStar2(require("fs")); + var path3 = __importStar2(require("path")); + _a = fs3.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + exports2.IS_WINDOWS = process.platform === "win32"; + exports2.UV_FS_O_EXLOCK = 268435456; + exports2.READONLY = fs3.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; } - } else { - return void 0; - } - } - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; - } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { 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'); } - 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}`); + if (exports2.IS_WINDOWS) { + return p.startsWith("\\") || /^[A-Z]:/i.test(p); } - 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 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 = path3.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 = path3.dirname(filePath); + const upperName = path3.basename(filePath).toUpperCase(); + for (const actualName of yield exports2.readdir(directory)) { + if (upperName === actualName.toUpperCase()) { + filePath = path3.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 false; + return p.replace(/\/\/+/g, "/"); } - 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]"); + function isUnixExecutable(stats) { + return (stats.mode & 1) > 0 || (stats.mode & 8) > 0 && stats.gid === process.getgid() || (stats.mode & 64) > 0 && stats.uid === process.getuid(); } - var DecodedURL = class extends URL { - constructor(url, base) { - super(url, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); - } - get username() { - return this._decodedUsername; - } - get password() { - return this._decodedPassword; - } - }; + function getCmdPath() { + var _a2; + return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; + } + exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib9 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js +var require_io4 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve2) { resolve2(value); @@ -114205,1140 +121028,1282 @@ var require_lib9 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy7()); - var tunnel = __importStar4(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.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + var assert_1 = require("assert"); + var path3 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util4()); + 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 ? path3.join(dest, path3.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 (path3.relative(source, newDest) === "") { + throw new Error(`'${newDest}' and '${source}' are the same file`); + } + yield copyFile(source, newDest, force); + } + }); } - 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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(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", () => { - resolve2(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve2(Buffer.concat(chunks)); - }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; + 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 = path3.join(dest, path3.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(path3.dirname(dest)); + yield ioUtil.rename(source, dest); + }); } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - this.handlers = handlers || []; - this.requestOptions = requestOptions; - if (requestOptions) { - if (requestOptions.ignoreSslError != null) { - this._ignoreSslError = requestOptions.ignoreSslError; + 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'); } - this._socketTimeout = requestOptions.socketTimeout; - if (requestOptions.allowRedirects != null) { - this._allowRedirects = requestOptions.allowRedirects; + } + 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 which6(tool, check) { + return __awaiter2(this, void 0, void 0, function* () { + if (!tool) { + throw new Error("parameter 'tool' is required"); + } + if (check) { + const result = yield which6(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.`); + } } - if (requestOptions.allowRedirectDowngrade != null) { - this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade; + return result; + } + const matches = yield findInPath(tool); + if (matches && matches.length > 0) { + return matches[0]; + } + return ""; + }); + } + exports2.which = which6; + 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(path3.delimiter)) { + if (extension) { + extensions.push(extension); + } } - if (requestOptions.maxRedirects != null) { - this._maxRedirects = Math.max(requestOptions.maxRedirects, 0); + } + if (ioUtil.isRooted(tool)) { + const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions); + if (filePath) { + return [filePath]; } - if (requestOptions.keepAlive != null) { - this._keepAlive = requestOptions.keepAlive; + return []; + } + if (tool.includes(path3.sep)) { + return []; + } + const directories = []; + if (process.env.PATH) { + for (const p of process.env.PATH.split(path3.delimiter)) { + if (p) { + directories.push(p); + } } - if (requestOptions.allowRetries != null) { - this._allowRetries = requestOptions.allowRetries; + } + const matches = []; + for (const directory of directories) { + const filePath = yield ioUtil.tryGetExecutablePath(path3.join(directory, tool), extensions); + if (filePath) { + matches.push(filePath); } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + 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 copyFile(srcFile, destFile, force); } } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); + } + function copyFile(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/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner4 = __commonJS({ + "node_modules/@actions/tool-cache/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); } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream, 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 __awaiter4(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 __awaiter4(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); + __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(resolve2) { + resolve2(value); }); } - putJson(requestUrl_1, obj_1) { - return __awaiter4(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); - }); + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(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 os2 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path3 = __importStar2(require("path")); + var io6 = __importStar2(require_io4()); + var ioUtil = __importStar2(require_io_util4()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner5 = 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 || {}; } - patchJson(requestUrl_1, obj_1) { - return __awaiter4(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); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info7 = 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(info7, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info7, 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]; - } - } - } - info7 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info7, data); - redirectsRemaining--; + _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}`; } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - } while (numTries < maxTries); - return response; - }); + } + } else { + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } + } + return cmd; } - /** - * Needs to be called if keepAlive is set to true in request options. - */ - dispose() { - if (this._agent) { - this._agent.destroy(); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os2.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os2.EOL.length); + n = s.indexOf(os2.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - this._disposed = true; } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info7, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve2(res); - } - } - this.requestRawWithCallback(info7, data, callbackForResult); - }); - }); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info7, data, onResult) { - if (typeof data === "string") { - if (!info7.options.headers) { - info7.options.headers = {}; + _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]; } - info7.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + return this.args; + } + _endsWith(str2, end) { + return str2.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; } } - const req = info7.httpModule.request(info7.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(); + 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; } - handleResult(new Error(`Request timeout: ${info7.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(); + 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(""); } - /** - * 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); + _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; } - getAgentDispatcher(serverUrl) { - const parsedUrl = new URL(serverUrl); - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (!useProxy) { - return; + _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 this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + return result; } - _prepareRequest(method, requestUrl, headers) { - const info7 = {}; - info7.parsedUrl = requestUrl; - const usingSsl = info7.parsedUrl.protocol === "https:"; - info7.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info7.options = {}; - info7.options.host = info7.parsedUrl.hostname; - info7.options.port = info7.parsedUrl.port ? parseInt(info7.parsedUrl.port) : defaultPort; - info7.options.path = (info7.parsedUrl.pathname || "") + (info7.parsedUrl.search || ""); - info7.options.method = method; - info7.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info7.options.headers["user-agent"] = this.userAgent; - } - info7.options.agent = this._getAgent(info7.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info7.options); + /** + * 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 = path3.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } - } - return info7; + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve2, 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) + os2.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 { + resolve2(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + }; + exports2.ToolRunner = ToolRunner5; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } - return lowercaseKeys(headers || {}); + arg += c; + escaped = false; } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; - if (headerValue) { - clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + for (let i = 0; i < argString.length; i++) { + const c = argString.charAt(i); + if (c === '"') { + if (!escaped) { + inQuotes = !inQuotes; + } else { + append(c); } + continue; } - const additionalValue = additionalHeaders[header]; - if (additionalValue !== void 0) { - return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; - } - if (clientHeader !== void 0) { - return clientHeader; + if (c === "\\" && escaped) { + append(c); + continue; } - return _default2; - } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; - } - } + if (c === "\\" && inQuotes) { + escaped = true; + continue; } - 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 (c === " " && !inQuotes) { + if (arg.length > 0) { + args.push(arg); + arg = ""; } + continue; } - if (clientHeader !== void 0) { - return clientHeader; - } - return _default2; + append(c); } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + 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"); } - if (!useProxy) { - agent = this._agent; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - if (agent) { - return agent; + } + CheckComplete() { + if (this.done) { + return; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } - 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; + } + _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`); } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; - } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + if (this.timeout) { + clearTimeout(this.timeout); + this.timeout = null; } - return agent; + this.done = true; + this.emit("done", error3, this.processExitCode); } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; - } - if (proxyAgent) { - return proxyAgent; + static HandleTimeout(state) { + if (state.done) { + return; } - 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 - }); + 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); } - return proxyAgent; - } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve2) => setTimeout(() => resolve2(), ms)); - }); - } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve2, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve2(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 { - resolve2(response); - } - })); - }); + state._setResult(); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); -// node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ - "node_modules/follow-redirects/debug.js"(exports2, module2) { - var debug4; - module2.exports = function() { - if (!debug4) { - try { - debug4 = require_src()("follow-redirects"); - } catch (error4) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec4 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (typeof debug4 !== "function") { - debug4 = function() { - }; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - debug4.apply(null, arguments); + function step(result) { + result.done ? resolve2(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_toolrunner4()); + 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 _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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/follow-redirects/index.js -var require_follow_redirects = __commonJS({ - "node_modules/follow-redirects/index.js"(exports2, module2) { - var url = require("url"); - var URL2 = url.URL; - var http = require("http"); - var https2 = require("https"); - var Writable = require("stream").Writable; - var assert = require("assert"); - var debug4 = require_debug2(); - (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."); +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform4 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - })(); - var useNativeURL = false; - try { - assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; - } - 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); - }; + 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 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 || noop; - 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._performRequest(); - } - RedirectableRequest.prototype = Object.create(Writable.prototype); - RedirectableRequest.prototype.abort = function() { - destroyRequest(this._currentRequest); - this._currentRequest.abort(); - this.emit("abort"); - }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); - return this; - }; - RedirectableRequest.prototype.write = function(data, encoding, callback) { - if (this._ending) { - throw new WriteAfterEndError(); - } - if (!isString(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); + 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); } - function startTimer(socket) { - if (self2._timeout) { - clearTimeout(self2._timeout); - } - self2._timeout = setTimeout(function() { - self2.emit("timeout"); - clearTimer(); - }, msecs); - destroyOnTimeout(socket); + __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(resolve2) { + resolve2(value); + }); } - function clearTimer() { - if (self2._timeout) { - clearTimeout(self2._timeout); - self2._timeout = null; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - self2.removeListener("abort", clearTimer); - self2.removeListener("error", clearTimer); - self2.removeListener("response", clearTimer); - self2.removeListener("close", clearTimer); - if (callback) { - self2.removeListener("timeout", callback); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (!self2.socket) { - self2._currentRequest.removeListener("socket", startTimer); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - 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; + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - [ - "flushHeaders", - "getHeader", - "setNoDelay", - "setSocketKeepAlive" - ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a, b) { - return this._currentRequest[method](a, b); + 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_exec4()); + 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() }; }); - ["aborted", "connection", "socket"].forEach(function(property) { - Object.defineProperty(RedirectableRequest.prototype, property, { - get: function() { - return this._currentRequest[property]; - } + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec3.getExecOutput("sw_vers", void 0, { + silent: true }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 + }; }); - RedirectableRequest.prototype._sanitizeOptions = function(options) { - if (!options.headers) { - options.headers = {}; - } - 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 request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); - request._redirectable = this; - for (var event of events) { - request.on(event, eventHandlers[event]); + 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/tool-cache/node_modules/@actions/core/lib/core.js +var require_core5 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - this._currentUrl = /^\//.test(this._options.path) ? url.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(error4) { - if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); - } else if (i < buffers.length) { - var buffer = buffers[i++]; - if (!request.finished) { - request.write(buffer.data, buffer.encoding, writeNext); - } - } else if (self2._ended) { - request.end(); - } - } - })(); + 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; }; - RedirectableRequest.prototype._processResponse = function(response) { - var statusCode = response.statusCode; - if (this._options.trackRedirects) { - this._redirects.push({ - url: this._currentUrl, - headers: response.headers, - statusCode + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); }); } - 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 = parseUrl(this._currentUrl); - var currentHost = currentHostHeader || currentUrlParts.host; - var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); - var redirectUrl = resolveUrl(location, currentUrl); - debug4("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(/^(?:(?:proxy-)?authorization|cookie)$/i, 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 request(input, options, callback) { - if (isURL(input)) { - input = spreadUrlObject(input); - } else if (isString(input)) { - input = spreadUrlObject(parseUrl(input)); - } else { - callback = options; - options = validateUrl(input); - input = { protocol }; - } - if (isFunction(options)) { - callback = options; - options = null; + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - options = Object.assign({ - maxRedirects: exports3.maxRedirects, - maxBodyLength: exports3.maxBodyLength - }, input, options); - options.nativeProtocols = nativeProtocols; - if (!isString(options.host) && !isString(options.hostname)) { - options.hostname = "::1"; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - assert.equal(options.protocol, protocol, "protocol mismatch"); - debug4("options", options); - return new RedirectableRequest(options, callback); } - function get(input, options, callback) { - var wrappedRequest = wrappedProtocol.request(input, options, callback); - wrappedRequest.end(); - return wrappedRequest; + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - Object.defineProperties(wrappedProtocol, { - request: { value: request, configurable: true, enumerable: true, writable: true }, - get: { value: get, configurable: true, enumerable: true, writable: true } - }); + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - return exports3; + }; + 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_command4(); + var file_command_1 = require_file_command4(); + var utils_1 = require_utils11(); + var os2 = __importStar2(require("os")); + var path3 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils4(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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 noop() { + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); } - function parseUrl(input) { - var parsed; - if (useNativeURL) { - parsed = new URL2(input); + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); } else { - parsed = validateUrl(url.parse(input)); - if (!isString(parsed.protocol)) { - throw new InvalidUrlError({ input }); - } + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return parsed; - } - function resolveUrl(relative, base) { - return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative)); + process.env["PATH"] = `${inputPath}${path3.delimiter}${process.env["PATH"]}`; } - function validateUrl(input) { - if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { - throw new InvalidUrlError({ input: input.href || input }); + exports2.addPath = addPath; + 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 (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { - throw new InvalidUrlError({ input: input.href || input }); + if (options && options.trimWhitespace === false) { + return val; } - return input; + return val.trim(); } - 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); + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - if (spread.port !== "") { - spread.port = Number(spread.port); + 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 setOutput(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; - return spread; + process.stdout.write(os2.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - function removeMatchingHeaders(regex, headers) { - var lastValue; - for (var header in headers) { - if (regex.test(header)) { - lastValue = headers[header]; - delete headers[header]; + exports2.setOutput = setOutput; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + function debug4(message) { + (0, command_1.issueCommand)("debug", {}, message); + } + exports2.debug = debug4; + function error3(message, properties = {}) { + (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.error = error3; + function warning10(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning10; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info7(message) { + process.stdout.write(message + os2.EOL); + } + exports2.info = info7; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } + return result; + }); + } + exports2.group = group; + function saveState2(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 = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; + } + exports2.getState = getState2; + 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_summary4(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary4(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils4(); + 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_platform4()); + } +}); + +// 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 || 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(resolve2) { + resolve2(value); + }); } - 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); + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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 + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core5(); + var os2 = require("os"); + var cp = require("child_process"); + var fs3 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os2.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; + }); + if (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } + } + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; }); - return CustomError; } - function destroyRequest(request, error4) { - for (var event of events) { - request.removeListener(event, eventHandlers[event]); + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os2.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; + } + } + } } - request.on("error", noop); - request.destroy(error4); - } - function isSubdomain(subdomain, domain) { - assert(isString(subdomain) && isString(domain)); - var dot = subdomain.length - domain.length - 1; - return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); - } - function isString(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; + return version; } - function isURL(value) { - return URL2 && value instanceof URL2; + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs3.existsSync(lsbReleaseFile)) { + contents = fs3.readFileSync(lsbReleaseFile).toString(); + } else if (fs3.existsSync(osReleaseFile)) { + contents = fs3.readFileSync(osReleaseFile).toString(); + } + return contents; } - module2.exports = wrap({ http, https: https2 }); - module2.exports.wrap = wrap; + exports2._readLinuxVersionFile = _readLinuxVersionFile; } }); -// node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115351,64 +122316,100 @@ var require_internal_glob_options_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(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; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (typeof copy.matchDirectories === "boolean") { - result.matchDirectories = copy.matchDirectories; - core14.debug(`matchDirectories '${result.matchDirectories}'`); + function step(result) { + result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.RetryHelper = void 0; + var core14 = __importStar2(require_core5()); + var RetryHelper = class { + constructor(maxAttempts, minSeconds, maxSeconds) { + if (maxAttempts < 1) { + throw new Error("max attempts should be greater than or equal to 1"); } - if (typeof copy.excludeHiddenFiles === "boolean") { - result.excludeHiddenFiles = copy.excludeHiddenFiles; - core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); + 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"); } } - return result; - } - exports2.getOptions = getOptions; + 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; + } + core14.info(err.message); + } + const seconds = this.getSleepAmount(); + core14.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((resolve2) => setTimeout(resolve2, seconds * 1e3)); + }); + } + }; + exports2.RetryHelper = RetryHelper; } }); -// node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -115421,1013 +122422,1081 @@ var require_internal_path_helper2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve2) { + resolve2(value); + }); + } + return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path2 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; - } - let result = path2.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core14 = __importStar2(require_core5()); + var io6 = __importStar2(require_io4()); + var crypto2 = __importStar2(require("crypto")); + var fs3 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os2 = __importStar2(require("os")); + var path3 = __importStar2(require("path")); + var httpm = __importStar2(require_lib7()); + var semver9 = __importStar2(require_semver2()); + var stream = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec4(); + var retry_helper_1 = require_retry_helper(); + var HTTPError = class extends Error { + constructor(httpStatusCode) { + super(`Unexpected HTTP response: ${httpStatusCode}`); + this.httpStatusCode = httpStatusCode; + Object.setPrototypeOf(this, new.target.prototype); } - return result; + }; + exports2.HTTPError = HTTPError; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path3.join(_getTempDirectory(), crypto2.randomUUID()); + yield io6.mkdirP(path3.dirname(dest)); + core14.debug(`Downloading ${url}`); + core14.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(url, dest || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; + }); + }); } - exports2.dirname = dirname; - 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)}`; + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs3.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false + }); + if (auth) { + core14.debug("set auth"); + if (headers === void 0) { + headers = {}; + } + headers.authorization = auth; + } + const response = yield http.get(url, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError(response.message.statusCode); + core14.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs3.createWriteStream(dest)); + core14.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core14.debug("download failed"); + try { + yield io6.rmRF(dest); + } catch (err) { + core14.debug(`Failed to delete '${dest}'. ${err.message}`); } - } 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 += path2.sep; - } - return root + itemPath; + }); + } + 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 = core14.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } + } else { + const escapedScript = path3.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 io6.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } + } + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core14.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() + } + }); + core14.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; + } + if (core14.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 (core14.isDebug()) { + args.push("-v"); + } + const xarPath = yield io6.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io6.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 + ]; + core14.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 io6.which("powershell", true); + core14.debug(`Using powershell at path: ${powershellPath}`); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); + } + }); } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - 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 extractZipNix(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + const unzipPath = yield io6.which("unzip", true); + const args = [file]; + if (!core14.isDebug()) { + args.unshift("-q"); + } + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - 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 cacheDir(sourceDir, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os2.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch}`); + core14.debug(`source dir: ${sourceDir}`); + if (!fs3.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); + } + const destPath = yield _createToolPath(tool, version, arch); + for (const itemName of fs3.readdirSync(sourceDir)) { + const s = path3.join(sourceDir, itemName); + yield io6.cp(s, destPath, { recursive: true }); + } + _completeToolPath(tool, version, arch); + return destPath; + }); } - exports2.hasRoot = hasRoot; - 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, "/"); + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch = arch || os2.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch}`); + core14.debug(`source file: ${sourceFile}`); + if (!fs3.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); + } + const destFolder = yield _createToolPath(tool, version, arch); + const destPath = path3.join(destFolder, targetFile); + core14.debug(`destination file ${destPath}`); + yield io6.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch); + return destFolder; + }); } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - p = normalizeSeparators(p); - if (!p.endsWith(path2.sep)) { - return p; + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); } - if (p === path2.sep) { - return p; + arch = arch || os2.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path3.join(_getCacheDirectory(), toolName, versionSpec, arch); + core14.debug(`checking cache: ${cachePath}`); + if (fs3.existsSync(cachePath) && fs3.existsSync(`${cachePath}.complete`)) { + core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`); + toolPath = cachePath; + } else { + core14.debug("not found"); + } } - return p.substr(0, p.length - 1); + return toolPath; } - exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind2 = __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_helper2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(require_internal_path_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - 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"; + exports2.find = find2; + function findAllVersions2(toolName, arch) { + const versions = []; + arch = arch || os2.arch(); + const toolPath = path3.join(_getCacheDirectory(), toolName); + if (fs3.existsSync(toolPath)) { + const children = fs3.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path3.join(toolPath, child, arch || ""); + if (fs3.existsSync(fullPath) && fs3.existsSync(`${fullPath}.complete`)) { + versions.push(child); + } + } + } } - const result = []; - for (const pattern of patterns) { - const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; - if (searchPathMap[key] === "included") { - continue; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core14.debug("set auth"); + headers.authorization = auth; } - let foundAncestor = false; - let tempKey = key; - let parent = pathHelper.dirname(tempKey); - while (parent !== tempKey) { - if (searchPathMap[parent]) { - foundAncestor = true; + 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; } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + 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 (_a) { + core14.debug("Invalid json"); + } } - } - return result; + return releases; + }); } - exports2.getSearchPaths = getSearchPaths; - function match(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); + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os2.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path3.join(_getTempDirectory(), crypto2.randomUUID()); } - } - return result; + yield io6.mkdirP(dest); + return dest; + }); } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + function _createToolPath(tool, version, arch) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path3.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + core14.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io6.rmRF(folderPath); + yield io6.rmRF(markerPath); + yield io6.mkdirP(folderPath); + return folderPath; + }); } - exports2.partialMatch = partialMatch; - } -}); - -// node_modules/@actions/glob/lib/internal-path.js -var require_internal_path2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-path.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(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(path2.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path2.basename(remaining); - this.segments.unshift(basename); - 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(path2.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } - } + function _completeToolPath(tool, version, arch) { + const folderPath = path3.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch || ""); + const markerPath = `${folderPath}.complete`; + fs3.writeFileSync(markerPath, ""); + core14.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core14.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core14.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core14.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path2.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path2.sep; - } - result += this.segments[i]; + return -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return result; } - }; - exports2.Path = Path; + if (version) { + core14.debug(`matched: ${version}`); + } else { + core14.debug("match not found"); + } + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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/@actions/glob/lib/internal-pattern.js -var require_internal_pattern2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { +// node_modules/fast-deep-equal/index.js +var require_fast_deep_equal = __commonJS({ + "node_modules/fast-deep-equal/index.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os = __importStar4(require("os")); - var path2 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper2()); - var assert_1 = __importDefault4(require("assert")); - var minimatch_1 = require_minimatch2(); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_path_1 = require_internal_path2(); - var IS_WINDOWS = process.platform === "win32"; - var Pattern = class _Pattern { - constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) { - 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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path2.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(path2.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path2.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, homedir) { - (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(`.${path2.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path2.sep}`)) { - homedir = homedir || os.homedir(); - (0, assert_1.default)(homedir, "Unable to determine HOME directory"); - (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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); + 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; } - 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } - } - } - literal += c; + 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 literal; - } - /** - * Escapes regexp special characters - * https://javascript.info/regexp-escaping - */ - static regExpEscape(s) { - return s.replace(/[[\\^$.|?*+()]/g, "\\$&"); + return true; } + return a !== a && b !== b; }; - exports2.Pattern = Pattern; } }); -// node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state2 = __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(path2, level) { - this.path = path2; - this.level = level; +// node_modules/follow-redirects/debug.js +var require_debug3 = __commonJS({ + "node_modules/follow-redirects/debug.js"(exports2, module2) { + var debug4; + module2.exports = function() { + if (!debug4) { + try { + debug4 = require_src()("follow-redirects"); + } catch (error3) { + } + if (typeof debug4 !== "function") { + debug4 = function() { + }; + } } + debug4.apply(null, arguments); }; - exports2.SearchState = SearchState; } }); -// node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber2 = __commonJS({ - "node_modules/@actions/glob/lib/internal-globber.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; +// node_modules/follow-redirects/index.js +var require_follow_redirects = __commonJS({ + "node_modules/follow-redirects/index.js"(exports2, module2) { + var url = require("url"); + var URL2 = url.URL; + var http = require("http"); + var https2 = require("https"); + var Writable = require("stream").Writable; + var assert = require("assert"); + var debug4 = 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."); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; + })(); + var useNativeURL = false; + try { + assert(new URL2("")); + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; + } + 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 __importStar4 = 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)) __createBinding4(result, mod, k); + 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 || noop; + 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); } - __setModuleDefault4(result, mod); - return result; + var self2 = this; + this._onNativeResponse = function(response) { + try { + self2._processResponse(response); + } catch (cause) { + self2.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause })); + } + }; + this._performRequest(); + } + RedirectableRequest.prototype = Object.create(Writable.prototype); + RedirectableRequest.prototype.abort = function() { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + 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(); } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!isString(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(); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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(); + } }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; + RedirectableRequest.prototype.end = function(data, encoding, callback) { + if (isFunction(data)) { + callback = data; + data = encoding = null; + } else if (isFunction(encoding)) { + callback = encoding; + encoding = null; } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); + 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; } }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); + RedirectableRequest.prototype.setHeader = function(name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + 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 resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + function startTimer(socket) { + if (self2._timeout) { + clearTimeout(self2._timeout); } + self2._timeout = setTimeout(function() { + self2.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); - } - function fulfill(value) { - resume("next", value); + 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); + } } - function reject(value) { - resume("throw", value); + if (callback) { + this.on("timeout", callback); } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + 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; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core14 = __importStar4(require_core()); - var fs2 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper2()); - var path2 = __importStar4(require("path")); - var patternHelper = __importStar4(require_internal_pattern_helper2()); - var internal_match_kind_1 = require_internal_match_kind2(); - var internal_pattern_1 = require_internal_pattern2(); - var internal_search_state_1 = require_internal_search_state2(); - var IS_WINDOWS = process.platform === "win32"; - var DefaultGlobber = class _DefaultGlobber { - constructor(options) { - this.patterns = []; - this.searchPaths = []; - this.options = globOptionsHelper.getOptions(options); + [ + "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 = {}; } - getSearchPaths() { - return this.searchPaths.slice(); + if (options.host) { + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; } - glob() { - var _a, e_1, _b, _c; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _d = true, _e = __asyncValues4(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + 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); + } } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs2.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (options.excludeHiddenFiles && path2.basename(item.path).match(/^\./)) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory && options.matchDirectories) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs2.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path2.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + }; + RedirectableRequest.prototype._performRequest = function() { + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + throw new TypeError("Unsupported protocol " + protocol); } - /** - * Constructs a DefaultGlobber - */ - static create(patterns, options) { - return __awaiter4(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; - }); + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs2.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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.`); + var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } + this._currentUrl = /^\//.test(this._options.path) ? url.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 (request === self2._currentRequest) { + if (error3) { + self2.emit("error", error3); + } else if (i < buffers.length) { + var buffer = buffers[i++]; + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); } - throw err; - } - } else { - stats = yield fs2.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs2.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + } else if (self2._ended) { + request.end(); } - 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 __createBinding4 = 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]; - } }; + RedirectableRequest.prototype._processResponse = function(response) { + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode + }); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + destroyRequest(this._currentRequest); + response.destroy(); + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); } - return new (P || (P = Promise))(function(resolve2, 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 ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve2, reject) { - v = o[n](v), settle(resolve2, reject, v.done, v.value); - }); - }; + 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); } - function settle(resolve2, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve2({ value: v2, done: d }); - }, reject); + 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 = parseUrl(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost })); + var redirectUrl = resolveUrl(location, currentUrl); + debug4("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(/^(?:(?:proxy-)?authorization|cookie)$/i, 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(); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = void 0; - var crypto = __importStar4(require("crypto")); - var core14 = __importStar4(require_core()); - var fs2 = __importStar4(require("fs")); - var stream = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var path2 = __importStar4(require("path")); - function hashFiles2(globber, currentWorkspace, verbose = false) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const writeDelegate = verbose ? core14.info : core14.debug; - let hasMatch = false; - const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const result = crypto.createHash("sha256"); - let count = 0; - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - writeDelegate(file); - if (!file.startsWith(`${githubWorkspace}${path2.sep}`)) { - writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); - continue; - } - if (fs2.statSync(file).isDirectory()) { - writeDelegate(`Skip directory '${file}'.`); - continue; - } - const hash = crypto.createHash("sha256"); - const pipeline = util.promisify(stream.pipeline); - yield pipeline(fs2.createReadStream(file), hash); - result.write(hash.digest()); - count++; - if (!hasMatch) { - hasMatch = true; - } + 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 request(input, options, callback) { + if (isURL(input)) { + input = spreadUrlObject(input); + } else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } else { + callback = options; + options = validateUrl(input); + input = { protocol }; } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; + if (isFunction(options)) { + callback = options; + options = null; + } + options = Object.assign({ + maxRedirects: exports3.maxRedirects, + maxBodyLength: exports3.maxBodyLength + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; } + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug4("options", options); + return new RedirectableRequest(options, callback); } - result.end(); - if (hasMatch) { - writeDelegate(`Found ${count} files to hash.`); - return result.digest("hex"); - } else { - writeDelegate(`No matches found for glob`); - return ""; + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; } + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true } + }); }); + return exports3; } - exports2.hashFiles = hashFiles2; - } -}); - -// node_modules/@actions/glob/lib/glob.js -var require_glob3 = __commonJS({ - "node_modules/@actions/glob/lib/glob.js"(exports2) { - "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve2) { - resolve2(value); - }); + function noop() { + } + function parseUrl(input) { + var parsed; + if (useNativeURL) { + parsed = new URL2(input); + } else { + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } } - return new (P || (P = Promise))(function(resolve2, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + return parsed; + } + function resolveUrl(relative, base) { + return useNativeURL ? new URL2(relative, base) : parseUrl(url.resolve(base, relative)); + } + 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]; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + } + 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); } - function step(result) { - result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected); + 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 } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.hashFiles = exports2.create = void 0; - var internal_globber_1 = require_internal_globber2(); - var internal_hash_files_1 = require_internal_hash_files(); - function create3(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); }); + return CustomError; } - exports2.create = create3; - function hashFiles2(patterns, currentWorkspace = "", options, verbose = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - }); + function destroyRequest(request, error3) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error3); } - exports2.hashFiles = hashFiles2; + function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); + } + function isString(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; + } + module2.exports = wrap({ http, https: https2 }); + module2.exports.wrap = wrap; } }); @@ -116438,12 +123507,11 @@ var core13 = __toESM(require_core()); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -116453,21 +123521,21 @@ async function getFolderSize(itemPath, options) { 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 fs2 = options.fs || await import("node:fs/promises"); + const fs3 = 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 fs2.lstat(itemPath, { bigint: true }) : await fs2.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs3.lstat(itemPath, { bigint: true }) : await fs3.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 fs2.readdir(itemPath) : await fs2.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs3.readdir(itemPath) : await fs3.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -116478,13 +123546,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -117364,6 +124432,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -117483,7 +124563,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -117523,16 +124603,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -119087,7 +126158,7 @@ var safeDump = renamed("safeDump", "dump"); var semver = __toESM(require_semver2()); // src/api-compatibility.json -var maximumVersion = "3.19"; +var maximumVersion = "3.20"; var minimumVersion = "3.14"; // src/util.ts @@ -119124,7 +126195,7 @@ function parseGitHubUrl(inputUrl) { var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION"; var hasBeenWarnedAboutVersion = false; function checkGitHubVersionInRange(version, logger) { - if (hasBeenWarnedAboutVersion || version.type !== 1 /* GHES */) { + if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) { return; } const disallowedAPIVersionReason = apiVersionInRange( @@ -119166,8 +126237,11 @@ var ConfigurationError = class extends Error { super(message); } }; -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function isInTestMode() { + return process.env["CODEQL_ACTION_TEST_MODE" /* TEST_MODE */] === "true"; +} +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } // src/actions-util.ts @@ -119234,17 +126308,17 @@ function getApiClient() { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -119257,15 +126331,15 @@ async function getGitHubVersion() { } // src/debug-artifacts.ts -var fs = __toESM(require("fs")); -var path = __toESM(require("path")); +var fs2 = __toESM(require("fs")); +var path2 = __toESM(require("path")); var artifact = __toESM(require_artifact2()); var artifactLegacy = __toESM(require_artifact_client2()); var core12 = __toESM(require_core()); var import_archiver = __toESM(require_archiver()); // src/analyze.ts -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); // src/analyses.ts var AnalysisKind = /* @__PURE__ */ ((AnalysisKind2) => { @@ -119422,7 +126496,7 @@ var cliErrorsConfig = { var core6 = __toESM(require_core()); // src/config/db-config.ts -var jsonschema = __toESM(require_lib6()); +var jsonschema = __toESM(require_lib5()); var semver2 = __toESM(require_semver2()); var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; @@ -119431,49 +126505,50 @@ var PACK_IDENTIFIER_PATTERN = (function() { return new RegExp(`^${component}/${component}$`); })(); -// src/feature-flags.ts -var semver4 = __toESM(require_semver2()); - -// src/overlay-database-utils.ts -var actionsCache = __toESM(require_cache3()); - -// src/git-utils.ts -var core7 = __toESM(require_core()); -var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); - // src/logging.ts -var core8 = __toESM(require_core()); +var core7 = __toESM(require_core()); function getActionsLogger() { return { - debug: core8.debug, - info: core8.info, - warning: core8.warning, - error: core8.error, - isDebug: core8.isDebug, - startGroup: core8.startGroup, - endGroup: core8.endGroup + debug: core7.debug, + info: core7.info, + warning: core7.warning, + error: core7.error, + isDebug: core7.isDebug, + startGroup: core7.startGroup, + endGroup: core7.endGroup }; } function withGroup(groupName, f) { - core8.startGroup(groupName); + core7.startGroup(groupName); try { return f(); } finally { - core8.endGroup(); + core7.endGroup(); } } +// src/feature-flags.ts +var semver5 = __toESM(require_semver2()); + +// src/overlay-database-utils.ts +var actionsCache = __toESM(require_cache4()); + +// src/git-utils.ts +var core8 = __toESM(require_core()); +var toolrunner2 = __toESM(require_toolrunner()); +var io3 = __toESM(require_io()); +var semver3 = __toESM(require_semver2()); + // src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; // src/tools-features.ts -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); var SafeArtifactUploadVersion = "2.20.3"; function isSafeArtifactUpload(codeQlVersion) { - return !codeQlVersion ? true : semver3.gte(codeQlVersion, SafeArtifactUploadVersion); + return !codeQlVersion ? true : semver4.gte(codeQlVersion, SafeArtifactUploadVersion); } // src/feature-flags.ts @@ -119483,11 +126558,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -119499,6 +126569,16 @@ var featureConfig = { 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", @@ -119527,12 +126607,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -119633,6 +126707,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -119644,21 +126723,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -119668,9 +126748,12 @@ var featureConfig = { }; // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -119699,25 +126782,264 @@ var OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES = { // src/setup-codeql.ts var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // src/tar.ts var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); // src/tools-download.ts var core9 = __toESM(require_core()); -var import_http_client = __toESM(require_lib9()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // src/dependency-caching.ts -var actionsCache3 = __toESM(require_cache3()); -var glob = __toESM(require_glob3()); +var actionsCache3 = __toESM(require_cache4()); +var glob = __toESM(require_glob2()); + +// src/artifact-scanner.ts +var fs = __toESM(require("fs")); +var os = __toESM(require("os")); +var path = __toESM(require("path")); +var exec = __toESM(require_exec()); +var GITHUB_TOKEN_PATTERNS = [ + { + name: "Personal Access Token", + pattern: /\bghp_[a-zA-Z0-9]{36}\b/g + }, + { + name: "OAuth Access Token", + pattern: /\bgho_[a-zA-Z0-9]{36}\b/g + }, + { + name: "User-to-Server Token", + pattern: /\bghu_[a-zA-Z0-9]{36}\b/g + }, + { + name: "Server-to-Server Token", + pattern: /\bghs_[a-zA-Z0-9]{36}\b/g + }, + { + name: "Refresh Token", + pattern: /\bghr_[a-zA-Z0-9]{36}\b/g + }, + { + name: "App Installation Access Token", + pattern: /\bghs_[a-zA-Z0-9]{255}\b/g + } +]; +function scanFileForTokens(filePath, relativePath, logger) { + const findings = []; + try { + const content = fs.readFileSync(filePath, "utf8"); + for (const { name, pattern } of GITHUB_TOKEN_PATTERNS) { + const matches = content.match(pattern); + if (matches) { + for (let i = 0; i < matches.length; i++) { + findings.push({ tokenType: name, filePath: relativePath }); + } + logger.debug(`Found ${matches.length} ${name}(s) in ${relativePath}`); + } + } + 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}` + ); + } + const result = { + scannedFiles: 0, + findings: [] + }; + try { + const tempExtractDir = fs.mkdtempSync( + path.join(extractDir, `extract-${depth}-`) + ); + const fileName = path.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 = path.join( + tempExtractDir, + path.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 = path.join( + tempExtractDir, + path.basename(archivePath, ".gz") + ); + await exec.exec("gunzip", ["-c", archivePath], { + outStream: fs.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); + fs.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, relativePath, extractDir, logger, depth = 0) { + const result = { + scannedFiles: 1, + findings: [] + }; + 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); + } + const fileFindings = scanFileForTokens(fullPath, relativePath, logger); + result.findings.push(...fileFindings); + return result; +} +async function scanDirectory(dirPath, baseRelativePath, logger, depth = 0) { + const result = { + 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; +} +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 = 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); + } + } + 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(([type2, count]) => `${count} ${type2}${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 { + fs.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) { @@ -119730,14 +127052,14 @@ async function uploadCombinedSarifArtifacts(logger, gitHubVariant, codeQlVersion logger.info( "Uploading available combined SARIF files as Actions debugging artifact..." ); - const baseTempDir = path.resolve(tempDir, "combined-sarif"); + const baseTempDir = path2.resolve(tempDir, "combined-sarif"); const toUpload = []; - if (fs.existsSync(baseTempDir)) { - const outputDirs = fs.readdirSync(baseTempDir); + if (fs2.existsSync(baseTempDir)) { + const outputDirs = fs2.readdirSync(baseTempDir); for (const outputDir of outputDirs) { - const sarifFiles = fs.readdirSync(path.resolve(baseTempDir, outputDir)).filter((f) => path.extname(f) === ".sarif"); + const sarifFiles = fs2.readdirSync(path2.resolve(baseTempDir, outputDir)).filter((f) => path2.extname(f) === ".sarif"); for (const sarifFile of sarifFiles) { - toUpload.push(path.resolve(baseTempDir, outputDir, sarifFile)); + toUpload.push(path2.resolve(baseTempDir, outputDir, sarifFile)); } } } @@ -119771,6 +127093,10 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV ); return "upload-not-supported"; } + if (isInTestMode()) { + await scanArtifactsForTokens(toUpload, logger); + core12.exportVariable("CODEQL_ACTION_ARTIFACT_SCAN_FINISHED", "true"); + } let suffix = ""; const matrix = getOptionalInput("matrix"); if (matrix) { @@ -119789,8 +127115,8 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV try { await artifactUploader.uploadArtifact( sanitizeArtifactName(`${artifactName}${suffix}`), - toUpload.map((file) => path.normalize(file)), - path.normalize(rootDir), + toUpload.map((file) => path2.normalize(file)), + path2.normalize(rootDir), { // ensure we don't keep the debug artifacts around for too long since they can be large. retentionDays: 7 @@ -119803,7 +127129,7 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV } } async function getArtifactUploaderClient(logger, ghVariant) { - if (ghVariant === 1 /* GHES */) { + 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." ); @@ -119841,9 +127167,9 @@ async function runWrapper() { ) ); } - } catch (error4) { + } catch (error3) { core13.setFailed( - `upload-sarif post-action step failed: ${getErrorMessage(error4)}` + `upload-sarif post-action step failed: ${getErrorMessage(error3)}` ); } } @@ -119932,5 +127258,5 @@ tmp/lib/tmp.js: *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) */ diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index db4a464eb1..0338819813 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -38,7 +38,8 @@ var require_utils = __commonJS({ "node_modules/@actions/core/lib/utils.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.toCommandProperties = exports2.toCommandValue = void 0; + exports2.toCommandValue = toCommandValue; + exports2.toCommandProperties = toCommandProperties; function toCommandValue(input) { if (input === null || input === void 0) { return ""; @@ -47,7 +48,6 @@ var require_utils = __commonJS({ } return JSON.stringify(input); } - exports2.toCommandValue = toCommandValue; function toCommandProperties(annotationProperties) { if (!Object.keys(annotationProperties).length) { return {}; @@ -61,7 +61,6 @@ var require_utils = __commonJS({ endColumn: annotationProperties.endColumn }; } - exports2.toCommandProperties = toCommandProperties; } }); @@ -69,7 +68,7 @@ var require_utils = __commonJS({ var require_command = __commonJS({ "node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -82,33 +81,42 @@ var require_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.issue = exports2.issueCommand = void 0; - var os3 = __importStar4(require("os")); + exports2.issueCommand = issueCommand; + exports2.issue = issue; + var os3 = __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() + os3.EOL); } - exports2.issueCommand = issueCommand; function issue(name, message = "") { issueCommand(name, {}, message); } - exports2.issue = issue; var CMD_STRING = "::"; var Command = class { constructor(command, properties, message) { @@ -126,14 +134,14 @@ var require_command = __commonJS({ let first = true; for (const key in this.properties) { if (this.properties.hasOwnProperty(key)) { - const val2 = this.properties[key]; - if (val2) { + const val = this.properties[key]; + if (val) { if (first) { first = false; } else { cmdStr += ","; } - cmdStr += `${key}=${escapeProperty(val2)}`; + cmdStr += `${key}=${escapeProperty(val)}`; } } } @@ -155,7 +163,7 @@ var require_command = __commonJS({ var require_file_command = __commonJS({ "node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -168,25 +176,36 @@ var require_file_command = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.prepareKeyValueMessage = exports2.issueFileCommand = void 0; - var crypto = __importStar4(require("crypto")); - var fs13 = __importStar4(require("fs")); - var os3 = __importStar4(require("os")); + exports2.issueFileCommand = issueFileCommand; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + var crypto2 = __importStar2(require("crypto")); + var fs13 = __importStar2(require("fs")); + var os3 = __importStar2(require("os")); var utils_1 = require_utils(); function issueFileCommand(command, message) { const filePath = process.env[`GITHUB_${command}`]; @@ -200,9 +219,8 @@ var require_file_command = __commonJS({ encoding: "utf8" }); } - exports2.issueFileCommand = issueFileCommand; function prepareKeyValueMessage(key, value) { - const delimiter = `ghadelimiter_${crypto.randomUUID()}`; + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; const convertedValue = (0, utils_1.toCommandValue)(value); if (key.includes(delimiter)) { throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); @@ -212,16 +230,16 @@ var require_file_command = __commonJS({ } return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; } - exports2.prepareKeyValueMessage = prepareKeyValueMessage; } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js +// node_modules/@actions/http-client/lib/proxy.js var require_proxy = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/proxy.js"(exports2) { + "node_modules/@actions/http-client/lib/proxy.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.checkBypass = exports2.getProxyUrl = void 0; + exports2.getProxyUrl = getProxyUrl; + exports2.checkBypass = checkBypass; function getProxyUrl(reqUrl) { const usingSsl = reqUrl.protocol === "https:"; if (checkBypass(reqUrl)) { @@ -245,7 +263,6 @@ var require_proxy = __commonJS({ return void 0; } } - exports2.getProxyUrl = getProxyUrl; function checkBypass(reqUrl) { if (!reqUrl.hostname) { return false; @@ -277,7 +294,6 @@ var require_proxy = __commonJS({ } 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]"); @@ -426,18 +442,18 @@ var require_tunnel = __commonJS({ res.statusCode ); socket.destroy(); - var error4 = new Error("tunneling socket could not be established, statusCode=" + res.statusCode); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + 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 error4 = new Error("got illegal response body from proxy"); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("got illegal response body from proxy"); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); return; } @@ -452,9 +468,9 @@ var require_tunnel = __commonJS({ cause.message, cause.stack ); - var error4 = new Error("tunneling socket could not be established, cause=" + cause.message); - error4.code = "ECONNRESET"; - options.request.emit("error", error4); + var error3 = new Error("tunneling socket could not be established, cause=" + cause.message); + error3.code = "ECONNRESET"; + options.request.emit("error", error3); self2.removeSocket(placeholder); } }; @@ -539,67 +555,67 @@ var require_tunnel2 = __commonJS({ var require_symbols = __commonJS({ "node_modules/undici/lib/core/symbols.js"(exports2, module2) { module2.exports = { - kClose: Symbol("close"), - kDestroy: Symbol("destroy"), - kDispatch: Symbol("dispatch"), - kUrl: Symbol("url"), - kWriting: Symbol("writing"), - kResuming: Symbol("resuming"), - kQueue: Symbol("queue"), - kConnect: Symbol("connect"), - kConnecting: Symbol("connecting"), - kHeadersList: Symbol("headers list"), - kKeepAliveDefaultTimeout: Symbol("default keep alive timeout"), - kKeepAliveMaxTimeout: Symbol("max keep alive timeout"), - kKeepAliveTimeoutThreshold: Symbol("keep alive timeout threshold"), - kKeepAliveTimeoutValue: Symbol("keep alive timeout"), - kKeepAlive: Symbol("keep alive"), - kHeadersTimeout: Symbol("headers timeout"), - kBodyTimeout: Symbol("body timeout"), - kServerName: Symbol("server name"), - kLocalAddress: Symbol("local address"), - kHost: Symbol("host"), - kNoRef: Symbol("no ref"), - kBodyUsed: Symbol("used"), - kRunning: Symbol("running"), - kBlocking: Symbol("blocking"), - kPending: Symbol("pending"), - kSize: Symbol("size"), - kBusy: Symbol("busy"), - kQueued: Symbol("queued"), - kFree: Symbol("free"), - kConnected: Symbol("connected"), - kClosed: Symbol("closed"), - kNeedDrain: Symbol("need drain"), - kReset: Symbol("reset"), - kDestroyed: Symbol.for("nodejs.stream.destroyed"), - kMaxHeadersSize: Symbol("max headers size"), - kRunningIdx: Symbol("running index"), - kPendingIdx: Symbol("pending index"), - kError: Symbol("error"), - kClients: Symbol("clients"), - kClient: Symbol("client"), - kParser: Symbol("parser"), - kOnDestroyed: Symbol("destroy callbacks"), - kPipelining: Symbol("pipelining"), - kSocket: Symbol("socket"), - kHostHeader: Symbol("host header"), - kConnector: Symbol("connector"), - kStrictContentLength: Symbol("strict content length"), - kMaxRedirections: Symbol("maxRedirections"), - kMaxRequests: Symbol("maxRequestsPerClient"), - kProxy: Symbol("proxy agent options"), - kCounter: Symbol("socket request counter"), - kInterceptors: Symbol("dispatch interceptors"), - kMaxResponseSize: Symbol("max response size"), - kHTTP2Session: Symbol("http2Session"), - kHTTP2SessionState: Symbol("http2Session state"), - kHTTP2BuildRequest: Symbol("http2 build request"), - kHTTP1BuildRequest: Symbol("http1 build request"), - kHTTP2CopyHeaders: Symbol("http2 copy headers"), - kHTTPConnVersion: Symbol("http connection version"), - kRetryHandlerDefaultRetry: Symbol("retry agent default retry"), - kConstruct: Symbol("constructable") + 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"), + kHeadersList: /* @__PURE__ */ Symbol("headers list"), + 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"), + 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"), + 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"), + kHTTP2BuildRequest: /* @__PURE__ */ Symbol("http2 build request"), + kHTTP1BuildRequest: /* @__PURE__ */ Symbol("http1 build request"), + kHTTP2CopyHeaders: /* @__PURE__ */ Symbol("http2 copy headers"), + kHTTPConnVersion: /* @__PURE__ */ Symbol("http connection version"), + kRetryHandlerDefaultRetry: /* @__PURE__ */ Symbol("retry agent default retry"), + kConstruct: /* @__PURE__ */ Symbol("constructable") }; } }); @@ -1086,8 +1102,8 @@ var require_util = __commonJS({ } } var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/; - function parseKeepAliveTimeout(val2) { - const m = val2.toString().match(KEEPALIVE_TIMEOUT_EXPR); + function parseKeepAliveTimeout(val) { + const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR); return m ? parseInt(m[1], 10) * 1e3 : null; } function headerNameToString(value) { @@ -1097,19 +1113,19 @@ var require_util = __commonJS({ if (!Array.isArray(headers)) return headers; for (let i = 0; i < headers.length; i += 2) { const key = headers[i].toString().toLowerCase(); - let val2 = obj[key]; - if (!val2) { + let val = obj[key]; + if (!val) { if (Array.isArray(headers[i + 1])) { obj[key] = headers[i + 1].map((x) => x.toString("utf8")); } else { obj[key] = headers[i + 1].toString("utf8"); } } else { - if (!Array.isArray(val2)) { - val2 = [val2]; - obj[key] = val2; + if (!Array.isArray(val)) { + val = [val]; + obj[key] = val; } - val2.push(headers[i + 1].toString("utf8")); + val.push(headers[i + 1].toString("utf8")); } } if ("content-length" in obj && "content-disposition" in obj) { @@ -1123,14 +1139,14 @@ var require_util = __commonJS({ let contentDispositionIdx = -1; for (let n = 0; n < headers.length; n += 2) { const key = headers[n + 0].toString(); - const val2 = headers[n + 1].toString("utf8"); + const val = headers[n + 1].toString("utf8"); if (key.length === 14 && (key === "content-length" || key.toLowerCase() === "content-length")) { - ret.push(key, val2); + ret.push(key, val); hasContentLength = true; } else if (key.length === 19 && (key === "content-disposition" || key.toLowerCase() === "content-disposition")) { - contentDispositionIdx = ret.push(key, val2) - 1; + contentDispositionIdx = ret.push(key, val) - 1; } else { - ret.push(key, val2); + ret.push(key, val); } } if (hasContentLength && contentDispositionIdx !== -1) { @@ -1259,13 +1275,13 @@ var require_util = __commonJS({ return () => signal.removeListener("abort", listener); } var hasToWellFormed = !!String.prototype.toWellFormed; - function toUSVString(val2) { + function toUSVString(val) { if (hasToWellFormed) { - return `${val2}`.toWellFormed(); + return `${val}`.toWellFormed(); } else if (nodeUtil.toUSVString) { - return nodeUtil.toUSVString(val2); + return nodeUtil.toUSVString(val); } - return `${val2}`; + return `${val}`; } function parseRangeHeader(range) { if (range == null || range === "") return { start: 0, end: null, size: null }; @@ -3594,7 +3610,7 @@ var require_constants2 = __commonJS({ var require_global = __commonJS({ "node_modules/undici/lib/fetch/global.js"(exports2, module2) { "use strict"; - var globalOrigin = Symbol.for("undici.globalOrigin.1"); + var globalOrigin = /* @__PURE__ */ Symbol.for("undici.globalOrigin.1"); function getGlobalOrigin() { return globalThis[globalOrigin]; } @@ -3637,11 +3653,11 @@ var require_util2 = __commonJS({ var assert = require("assert"); var { isUint8Array } = require("util/types"); var supportedHashes = []; - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); const possibleRelevantHashes = ["sha256", "sha384", "sha512"]; - supportedHashes = crypto.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); + supportedHashes = crypto2.getHashes().filter((hash2) => possibleRelevantHashes.includes(hash2)); } catch { } function responseURL(response) { @@ -3918,7 +3934,7 @@ var require_util2 = __commonJS({ } } function bytesMatch(bytes, metadataList) { - if (crypto === void 0) { + if (crypto2 === void 0) { return true; } const parsedMetadata = parseMetadata(metadataList); @@ -3933,7 +3949,7 @@ var require_util2 = __commonJS({ for (const item of metadata) { const algorithm = item.algo; const expectedValue = item.hash; - let actualValue = crypto.createHash(algorithm).update(bytes).digest("base64"); + let actualValue = crypto2.createHash(algorithm).update(bytes).digest("base64"); if (actualValue[actualValue.length - 1] === "=") { if (actualValue[actualValue.length - 2] === "=") { actualValue = actualValue.slice(0, -2); @@ -4246,12 +4262,12 @@ var require_symbols2 = __commonJS({ "node_modules/undici/lib/fetch/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kUrl: Symbol("url"), - kHeaders: Symbol("headers"), - kSignal: Symbol("signal"), - kState: Symbol("state"), - kGuard: Symbol("guard"), - kRealm: Symbol("realm") + kUrl: /* @__PURE__ */ Symbol("url"), + kHeaders: /* @__PURE__ */ Symbol("headers"), + kSignal: /* @__PURE__ */ Symbol("signal"), + kState: /* @__PURE__ */ Symbol("state"), + kGuard: /* @__PURE__ */ Symbol("guard"), + kRealm: /* @__PURE__ */ Symbol("realm") }; } }); @@ -5279,8 +5295,8 @@ var require_body = __commonJS({ var { parseMIMEType, serializeAMimeType } = require_dataURL(); var random; try { - const crypto = require("node:crypto"); - random = (max) => crypto.randomInt(0, max); + const crypto2 = require("node:crypto"); + random = (max) => crypto2.randomInt(0, max); } catch { random = (max) => Math.floor(Math.random(max)); } @@ -5582,7 +5598,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r throw new TypeError("Body is unusable"); } const promise = createDeferredPromise(); - const errorSteps = (error4) => promise.reject(error4); + const errorSteps = (error3) => promise.reject(error3); const successSteps = (data) => { try { promise.resolve(convertBytesToJSValue(data)); @@ -5644,7 +5660,7 @@ var require_request = __commonJS({ var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/; var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/; var invalidPathRegex = /[^\u0021-\u00ff]/; - var kHandler = Symbol("handler"); + var kHandler = /* @__PURE__ */ Symbol("handler"); var channels = {}; var extractBody; try { @@ -5868,16 +5884,16 @@ var require_request = __commonJS({ this.onError(err); } } - onError(error4) { + onError(error3) { this.onFinally(); if (channels.error.hasSubscribers) { - channels.error.publish({ request: this, error: error4 }); + channels.error.publish({ request: this, error: error3 }); } if (this.aborted) { return; } this.aborted = true; - return this[kHandler].onError(error4); + return this[kHandler].onError(error3); } onFinally() { if (this.errorHandler) { @@ -5932,41 +5948,41 @@ var require_request = __commonJS({ return headers; } }; - function processHeaderValue(key, val2, skipAppend) { - if (val2 && typeof val2 === "object") { + function processHeaderValue(key, val, skipAppend) { + if (val && typeof val === "object") { throw new InvalidArgumentError(`invalid ${key} header`); } - val2 = val2 != null ? `${val2}` : ""; - if (headerCharRegex.exec(val2) !== null) { + val = val != null ? `${val}` : ""; + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - return skipAppend ? val2 : `${key}: ${val2}\r + return skipAppend ? val : `${key}: ${val}\r `; } - function processHeader(request, key, val2, skipAppend = false) { - if (val2 && (typeof val2 === "object" && !Array.isArray(val2))) { + function processHeader(request, key, val, skipAppend = false) { + if (val && (typeof val === "object" && !Array.isArray(val))) { throw new InvalidArgumentError(`invalid ${key} header`); - } else if (val2 === void 0) { + } else if (val === void 0) { return; } if (request.host === null && key.length === 4 && key.toLowerCase() === "host") { - if (headerCharRegex.exec(val2) !== null) { + if (headerCharRegex.exec(val) !== null) { throw new InvalidArgumentError(`invalid ${key} header`); } - request.host = val2; + request.host = val; } else if (request.contentLength === null && key.length === 14 && key.toLowerCase() === "content-length") { - request.contentLength = parseInt(val2, 10); + request.contentLength = parseInt(val, 10); if (!Number.isFinite(request.contentLength)) { throw new InvalidArgumentError("invalid content-length header"); } } else if (request.contentType === null && key.length === 12 && key.toLowerCase() === "content-type") { - request.contentType = val2; - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + request.contentType = val; + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } else if (key.length === 17 && key.toLowerCase() === "transfer-encoding") { throw new InvalidArgumentError("invalid transfer-encoding header"); } else if (key.length === 10 && key.toLowerCase() === "connection") { - const value = typeof val2 === "string" ? val2.toLowerCase() : null; + const value = typeof val === "string" ? val.toLowerCase() : null; if (value !== "close" && value !== "keep-alive") { throw new InvalidArgumentError("invalid connection header"); } else if (value === "close") { @@ -5981,18 +5997,18 @@ var require_request = __commonJS({ } else if (tokenRegExp.exec(key) === null) { throw new InvalidArgumentError("invalid header key"); } else { - if (Array.isArray(val2)) { - for (let i = 0; i < val2.length; i++) { + if (Array.isArray(val)) { + for (let i = 0; i < val.length; i++) { if (skipAppend) { - if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val2[i], skipAppend)}`; - else request.headers[key] = processHeaderValue(key, val2[i], skipAppend); + if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`; + else request.headers[key] = processHeaderValue(key, val[i], skipAppend); } else { - request.headers += processHeaderValue(key, val2[i]); + request.headers += processHeaderValue(key, val[i]); } } } else { - if (skipAppend) request.headers[key] = processHeaderValue(key, val2, skipAppend); - else request.headers += processHeaderValue(key, val2); + if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend); + else request.headers += processHeaderValue(key, val); } } } @@ -6031,11 +6047,11 @@ var require_dispatcher_base = __commonJS({ InvalidArgumentError } = require_errors(); var { kDestroy, kClose, kDispatch, kInterceptors } = require_symbols(); - var kDestroyed = Symbol("destroyed"); - var kClosed = Symbol("closed"); - var kOnDestroyed = Symbol("onDestroyed"); - var kOnClosed = Symbol("onClosed"); - var kInterceptedDispatch = Symbol("Intercepted Dispatch"); + var kDestroyed = /* @__PURE__ */ Symbol("destroyed"); + var kClosed = /* @__PURE__ */ Symbol("closed"); + var kOnDestroyed = /* @__PURE__ */ Symbol("onDestroyed"); + var kOnClosed = /* @__PURE__ */ Symbol("onClosed"); + var kInterceptedDispatch = /* @__PURE__ */ Symbol("Intercepted Dispatch"); var DispatcherBase = class extends Dispatcher { constructor() { super(); @@ -6690,7 +6706,7 @@ var require_RedirectHandler = __commonJS({ var { InvalidArgumentError } = require_errors(); var EE = require("events"); var redirectableStatusCodes = [300, 301, 302, 303, 307, 308]; - var kBody = Symbol("body"); + var kBody = /* @__PURE__ */ Symbol("body"); var BodyAsyncIterable = class { constructor(body) { this[kBody] = body; @@ -6740,8 +6756,8 @@ var require_RedirectHandler = __commonJS({ onUpgrade(statusCode, headers, socket) { this.handler.onUpgrade(statusCode, headers, socket); } - onError(error4) { - this.handler.onError(error4); + onError(error3) { + this.handler.onError(error3); } onHeaders(statusCode, headers, resume, statusText) { this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers); @@ -6964,7 +6980,7 @@ var require_client = __commonJS({ } = http2; var h2ExperimentalWarned = false; var FastBuffer = Buffer[Symbol.species]; - var kClosedResolve = Symbol("kClosedResolve"); + var kClosedResolve = /* @__PURE__ */ Symbol("kClosedResolve"); var channels = {}; try { const diagnosticsChannel = require("diagnostics_channel"); @@ -8634,7 +8650,7 @@ var require_fixed_queue = __commonJS({ var require_pool_stats = __commonJS({ "node_modules/undici/lib/pool-stats.js"(exports2, module2) { var { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require_symbols(); - var kPool = Symbol("pool"); + var kPool = /* @__PURE__ */ Symbol("pool"); var PoolStats = class { constructor(pool) { this[kPool] = pool; @@ -8670,18 +8686,18 @@ var require_pool_base = __commonJS({ 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 = Symbol("clients"); - var kNeedDrain = Symbol("needDrain"); - var kQueue = Symbol("queue"); - var kClosedResolve = Symbol("closed resolve"); - var kOnDrain = Symbol("onDrain"); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kGetDispatcher = Symbol("get dispatcher"); - var kAddClient = Symbol("add client"); - var kRemoveClient = Symbol("remove client"); - var kStats = Symbol("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() { super(); @@ -8835,9 +8851,9 @@ var require_pool = __commonJS({ var util = require_util(); var { kUrl, kInterceptors } = require_symbols(); var buildConnector = require_connect(); - var kOptions = Symbol("options"); - var kConnections = Symbol("connections"); - var kFactory = Symbol("factory"); + var kOptions = /* @__PURE__ */ Symbol("options"); + var kConnections = /* @__PURE__ */ Symbol("connections"); + var kFactory = /* @__PURE__ */ Symbol("factory"); function defaultFactory(origin, opts) { return new Client(origin, opts); } @@ -8882,7 +8898,7 @@ var require_pool = __commonJS({ this[kOptions] = { ...util.deepClone(options), connect, allowH2 }; this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : void 0; this[kFactory] = factory; - this.on("connectionError", (origin2, targets, error4) => { + this.on("connectionError", (origin2, targets, error3) => { for (const target of targets) { const idx = this[kClients].indexOf(target); if (idx !== -1) { @@ -8926,14 +8942,14 @@ var require_balanced_pool = __commonJS({ var Pool = require_pool(); var { kUrl, kInterceptors } = require_symbols(); var { parseOrigin } = require_util(); - var kFactory = Symbol("factory"); - var kOptions = Symbol("options"); - var kGreatestCommonDivisor = Symbol("kGreatestCommonDivisor"); - var kCurrentWeight = Symbol("kCurrentWeight"); - var kIndex = Symbol("kIndex"); - var kWeight = Symbol("kWeight"); - var kMaxWeightPerServer = Symbol("kMaxWeightPerServer"); - var kErrorPenalty = Symbol("kErrorPenalty"); + 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 (b === 0) return a; return getGreatestCommonDivisor(b, a % b); @@ -9096,14 +9112,14 @@ var require_agent = __commonJS({ var util = require_util(); var createRedirectInterceptor = require_redirectInterceptor(); var { WeakRef: WeakRef2, FinalizationRegistry } = require_dispatcher_weakref()(); - var kOnConnect = Symbol("onConnect"); - var kOnDisconnect = Symbol("onDisconnect"); - var kOnConnectionError = Symbol("onConnectionError"); - var kMaxRedirections = Symbol("maxRedirections"); - var kOnDrain = Symbol("onDrain"); - var kFactory = Symbol("factory"); - var kFinalizer = Symbol("finalizer"); - var kOptions = Symbol("options"); + 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 kFinalizer = /* @__PURE__ */ Symbol("finalizer"); + var kOptions = /* @__PURE__ */ Symbol("options"); function defaultFactory(origin, opts) { return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts); } @@ -9212,11 +9228,11 @@ var require_readable = __commonJS({ var util = require_util(); var { ReadableStreamFrom, toUSVString } = require_util(); var Blob2; - var kConsume = Symbol("kConsume"); - var kReading = Symbol("kReading"); - var kBody = Symbol("kBody"); - var kAbort = Symbol("abort"); - var kContentType = Symbol("kContentType"); + var kConsume = /* @__PURE__ */ Symbol("kConsume"); + var kReading = /* @__PURE__ */ Symbol("kReading"); + var kBody = /* @__PURE__ */ Symbol("kBody"); + var kAbort = /* @__PURE__ */ Symbol("abort"); + var kContentType = /* @__PURE__ */ Symbol("kContentType"); var noop = () => { }; module2.exports = class BodyReadable extends Readable2 { @@ -9502,8 +9518,8 @@ 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 = Symbol("kListener"); - var kSignal = Symbol("kSignal"); + var kListener = /* @__PURE__ */ Symbol("kListener"); + var kSignal = /* @__PURE__ */ Symbol("kSignal"); function abort(self2) { if (self2.abort) { self2.abort(); @@ -9892,7 +9908,7 @@ var require_api_pipeline = __commonJS({ var { AsyncResource } = require("async_hooks"); var { addSignal, removeSignal } = require_abort_signal(); var assert = require("assert"); - var kResume = Symbol("resume"); + var kResume = /* @__PURE__ */ Symbol("resume"); var PipelineRequest = class extends Readable2 { constructor() { super({ autoDestroy: true }); @@ -10286,25 +10302,25 @@ var require_mock_symbols = __commonJS({ "node_modules/undici/lib/mock/mock-symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kAgent: Symbol("agent"), - kOptions: Symbol("options"), - kFactory: Symbol("factory"), - kDispatches: Symbol("dispatches"), - kDispatchKey: Symbol("dispatch key"), - kDefaultHeaders: Symbol("default headers"), - kDefaultTrailers: Symbol("default trailers"), - kContentLength: Symbol("content length"), - kMockAgent: Symbol("mock agent"), - kMockAgentSet: Symbol("mock agent set"), - kMockAgentGet: Symbol("mock agent get"), - kMockDispatch: Symbol("mock dispatch"), - kClose: Symbol("close"), - kOriginalClose: Symbol("original agent close"), - kOrigin: Symbol("origin"), - kIsMockActive: Symbol("is mock active"), - kNetConnect: Symbol("net connect"), - kGetNetConnect: Symbol("get net connect"), - kConnected: Symbol("connected") + 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") }; } }); @@ -10491,13 +10507,13 @@ var require_mock_utils = __commonJS({ if (mockDispatch2.data.callback) { mockDispatch2.data = { ...mockDispatch2.data, ...mockDispatch2.data.callback(opts) }; } - const { data: { statusCode, data, headers, trailers, error: error4 }, delay: delay2, persist } = mockDispatch2; + 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 (error4 !== null) { + if (error3 !== null) { deleteMockDispatch(this[kDispatches], key); - handler.onError(error4); + handler.onError(error3); return true; } if (typeof delay2 === "number" && delay2 > 0) { @@ -10535,19 +10551,19 @@ var require_mock_utils = __commonJS({ if (agent.isMockActive) { try { mockDispatch.call(this, opts, handler); - } catch (error4) { - if (error4 instanceof MockNotMatchedError) { + } catch (error3) { + if (error3 instanceof MockNotMatchedError) { const netConnect = agent[kGetNetConnect](); if (netConnect === false) { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`); } if (checkNetConnect(netConnect, origin)) { originalDispatch.call(this, opts, handler); } else { - throw new MockNotMatchedError(`${error4.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); + throw new MockNotMatchedError(`${error3.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`); } } else { - throw error4; + throw error3; } } } else { @@ -10710,11 +10726,11 @@ var require_mock_interceptor = __commonJS({ /** * Mock an undici request with a defined error. */ - replyWithError(error4) { - if (typeof error4 === "undefined") { + replyWithError(error3) { + if (typeof error3 === "undefined") { throw new InvalidArgumentError("error must be defined"); } - const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error4 }); + const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error: error3 }); return new MockScope(newMockDispatch); } /** @@ -11076,12 +11092,12 @@ var require_proxy_agent = __commonJS({ var DispatcherBase = require_dispatcher_base(); var { InvalidArgumentError, RequestAbortedError } = require_errors(); var buildConnector = require_connect(); - var kAgent = Symbol("proxy agent"); - var kClient = Symbol("proxy client"); - var kProxyHeaders = Symbol("proxy headers"); - var kRequestTls = Symbol("request tls settings"); - var kProxyTls = Symbol("proxy tls settings"); - var kConnectEndpoint = Symbol("connect endpoint function"); + 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"); function defaultProtocolPort(protocol) { return protocol === "https:" ? 443 : 80; } @@ -11488,7 +11504,7 @@ var require_RetryHandler = __commonJS({ var require_global2 = __commonJS({ "node_modules/undici/lib/global.js"(exports2, module2) { "use strict"; - var globalDispatcher = Symbol.for("undici.globalDispatcher.1"); + var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1"); var { InvalidArgumentError } = require_errors(); var Agent = require_agent(); if (getGlobalDispatcher() === void 0) { @@ -11563,8 +11579,8 @@ var require_headers = __commonJS({ var util = require("util"); var { webidl } = require_webidl(); var assert = require("assert"); - var kHeadersMap = Symbol("headers map"); - var kHeadersSortedMap = Symbol("headers map sorted"); + 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; } @@ -11891,7 +11907,7 @@ var require_headers = __commonJS({ callbackFn.apply(thisArg, [value, key, this]); } } - [Symbol.for("nodejs.util.inspect.custom")]() { + [/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")]() { webidl.brandCheck(this, _Headers); return this[kHeadersList]; } @@ -12351,7 +12367,7 @@ var require_request2 = __commonJS({ var assert = require("assert"); var { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require("events"); var TransformStream = globalThis.TransformStream; - var kAbortController = Symbol("abortController"); + var kAbortController = /* @__PURE__ */ Symbol("abortController"); var requestFinalizer = new FinalizationRegistry(({ signal, abort }) => { signal.removeEventListener("abort", abort); }); @@ -12583,8 +12599,8 @@ var require_request2 = __commonJS({ const headers = init.headers !== void 0 ? init.headers : new HeadersList(headersList); headersList.clear(); if (headers instanceof HeadersList) { - for (const [key, val2] of headers) { - headersList.append(key, val2); + for (const [key, val] of headers) { + headersList.append(key, val); } headersList.cookies = headers.cookies; } else { @@ -13041,17 +13057,17 @@ var require_fetch = __commonJS({ this.emit("terminated", reason); } // https://fetch.spec.whatwg.org/#fetch-controller-abort - abort(error4) { + abort(error3) { if (this.state !== "ongoing") { return; } this.state = "aborted"; - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - this.serializedAbortReason = error4; - this.connection?.destroy(error4); - this.emit("terminated", error4); + this.serializedAbortReason = error3; + this.connection?.destroy(error3); + this.emit("terminated", error3); } }; function fetch(input, init = {}) { @@ -13155,13 +13171,13 @@ var require_fetch = __commonJS({ performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis2, cacheState); } } - function abortFetch(p, request, responseObject, error4) { - if (!error4) { - error4 = new DOMException2("The operation was aborted.", "AbortError"); + function abortFetch(p, request, responseObject, error3) { + if (!error3) { + error3 = new DOMException2("The operation was aborted.", "AbortError"); } - p.reject(error4); + p.reject(error3); if (request.body != null && isReadable(request.body?.stream)) { - request.body.stream.cancel(error4).catch((err) => { + request.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13173,7 +13189,7 @@ var require_fetch = __commonJS({ } const response = responseObject[kState]; if (response.body != null && isReadable(response.body?.stream)) { - response.body.stream.cancel(error4).catch((err) => { + response.body.stream.cancel(error3).catch((err) => { if (err.code === "ERR_INVALID_STATE") { return; } @@ -13884,24 +13900,24 @@ var require_fetch = __commonJS({ if (Array.isArray(headersList)) { for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); + const val = headersList[n + 1].toString("latin1"); if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()); + codings = val.toLowerCase().split(",").map((x) => x.trim()); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } else { const keys = Object.keys(headersList); for (const key of keys) { - const val2 = headersList[key]; + const val = headersList[key]; if (key.toLowerCase() === "content-encoding") { - codings = val2.toLowerCase().split(",").map((x) => x.trim()).reverse(); + codings = val.toLowerCase().split(",").map((x) => x.trim()).reverse(); } else if (key.toLowerCase() === "location") { - location = val2; + location = val; } - headers[kHeadersList].append(key, val2); + headers[kHeadersList].append(key, val); } } this.body = new Readable2({ read: resume }); @@ -13953,13 +13969,13 @@ var require_fetch = __commonJS({ fetchParams.controller.ended = true; this.body.push(null); }, - onError(error4) { + onError(error3) { if (this.abort) { fetchParams.controller.off("terminated", this.abort); } - this.body?.destroy(error4); - fetchParams.controller.terminate(error4); - reject(error4); + this.body?.destroy(error3); + fetchParams.controller.terminate(error3); + reject(error3); }, onUpgrade(status, headersList, socket) { if (status !== 101) { @@ -13968,8 +13984,8 @@ var require_fetch = __commonJS({ const headers = new Headers(); for (let n = 0; n < headersList.length; n += 2) { const key = headersList[n + 0].toString("latin1"); - const val2 = headersList[n + 1].toString("latin1"); - headers[kHeadersList].append(key, val2); + const val = headersList[n + 1].toString("latin1"); + headers[kHeadersList].append(key, val); } resolve6({ status, @@ -13997,12 +14013,12 @@ var require_symbols3 = __commonJS({ "node_modules/undici/lib/fileapi/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kState: Symbol("FileReader state"), - kResult: Symbol("FileReader result"), - kError: Symbol("FileReader error"), - kLastProgressEventFired: Symbol("FileReader last progress event fired timestamp"), - kEvents: Symbol("FileReader events"), - kAborted: Symbol("FileReader aborted") + 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") }; } }); @@ -14012,7 +14028,7 @@ var require_progressevent = __commonJS({ "node_modules/undici/lib/fileapi/progressevent.js"(exports2, module2) { "use strict"; var { webidl } = require_webidl(); - var kState = Symbol("ProgressEvent state"); + var kState = /* @__PURE__ */ Symbol("ProgressEvent state"); var ProgressEvent = class _ProgressEvent extends Event { constructor(type2, eventInitDict = {}) { type2 = webidl.converters.DOMString(type2); @@ -14425,8 +14441,8 @@ var require_util4 = __commonJS({ } fr[kResult] = result; fireAProgressEvent("load", fr); - } catch (error4) { - fr[kError] = error4; + } catch (error3) { + fr[kError] = error3; fireAProgressEvent("error", fr); } if (fr[kState] !== "loading") { @@ -14435,13 +14451,13 @@ var require_util4 = __commonJS({ }); break; } - } catch (error4) { + } catch (error3) { if (fr[kAborted]) { return; } queueMicrotask(() => { fr[kState] = "done"; - fr[kError] = error4; + fr[kError] = error3; fireAProgressEvent("error", fr); if (fr[kState] !== "loading") { fireAProgressEvent("loadend", fr); @@ -15962,14 +15978,14 @@ var require_symbols5 = __commonJS({ "node_modules/undici/lib/websocket/symbols.js"(exports2, module2) { "use strict"; module2.exports = { - kWebSocketURL: Symbol("url"), - kReadyState: Symbol("ready state"), - kController: Symbol("controller"), - kResponse: Symbol("response"), - kBinaryType: Symbol("binary type"), - kSentClose: Symbol("sent close"), - kReceivedClose: Symbol("received close"), - kByteParser: Symbol("byte parser") + 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") }; } }); @@ -16330,9 +16346,9 @@ var require_connection = __commonJS({ channels.open = diagnosticsChannel.channel("undici:websocket:open"); channels.close = diagnosticsChannel.channel("undici:websocket:close"); channels.socketError = diagnosticsChannel.channel("undici:websocket:socket_error"); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } function establishWebSocketConnection(url2, protocols, ws, onEstablish, options) { @@ -16351,7 +16367,7 @@ var require_connection = __commonJS({ const headersList = new Headers(options.headers)[kHeadersList]; request.headersList = headersList; } - const keyValue = crypto.randomBytes(16).toString("base64"); + const keyValue = crypto2.randomBytes(16).toString("base64"); request.headersList.append("sec-websocket-key", keyValue); request.headersList.append("sec-websocket-version", "13"); for (const protocol of protocols) { @@ -16380,7 +16396,7 @@ var require_connection = __commonJS({ return; } const secWSAccept = response.headersList.get("Sec-WebSocket-Accept"); - const digest = crypto.createHash("sha1").update(keyValue + uid).digest("base64"); + const digest = crypto2.createHash("sha1").update(keyValue + uid).digest("base64"); if (secWSAccept !== digest) { failWebsocketConnection(ws, "Incorrect hash received in Sec-WebSocket-Accept header."); return; @@ -16441,11 +16457,11 @@ var require_connection = __commonJS({ }); } } - function onSocketError(error4) { + function onSocketError(error3) { const { ws } = this; ws[kReadyState] = states.CLOSING; if (channels.socketError.hasSubscribers) { - channels.socketError.publish(error4); + channels.socketError.publish(error3); } this.destroy(); } @@ -16460,9 +16476,9 @@ var require_frame = __commonJS({ "node_modules/undici/lib/websocket/frame.js"(exports2, module2) { "use strict"; var { maxUnsigned16Bit } = require_constants5(); - var crypto; + var crypto2; try { - crypto = require("crypto"); + crypto2 = require("crypto"); } catch { } var WebsocketFrameSend = class { @@ -16471,7 +16487,7 @@ var require_frame = __commonJS({ */ constructor(data) { this.frameData = data; - this.maskKey = crypto.randomBytes(4); + this.maskKey = crypto2.randomBytes(4); } createFrame(opcode) { const bodyLength = this.frameData?.byteLength ?? 0; @@ -17292,11 +17308,11 @@ var require_undici = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js +// node_modules/@actions/http-client/lib/index.js var require_lib = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/index.js"(exports2) { + "node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -17309,21 +17325,31 @@ var require_lib = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -17351,11 +17377,13 @@ var require_lib = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy()); - var tunnel = __importStar4(require_tunnel2()); + 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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -17400,7 +17428,6 @@ var require_lib = __commonJS({ const proxyUrl = pm.getProxyUrl(new URL(serverUrl)); return proxyUrl ? proxyUrl.href : ""; } - exports2.getProxyUrl = getProxyUrl; var HttpRedirectCodes = [ HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, @@ -17430,8 +17457,8 @@ var require_lib = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -17443,8 +17470,8 @@ var require_lib = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -17461,7 +17488,6 @@ var require_lib = __commonJS({ const parsedUrl = new URL(requestUrl); return parsedUrl.protocol === "https:"; } - exports2.isHttps = isHttps; var HttpClient2 = class { constructor(userAgent, handlers, requestOptions) { this._ignoreSslError = false; @@ -17501,42 +17527,42 @@ var require_lib = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -17544,36 +17570,36 @@ var require_lib = __commonJS({ * 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 __awaiter4(this, void 0, void 0, function* () { + 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, 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, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson); + additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultContentTypeHeader(additionalHeaders, MediaTypes.ApplicationJson); const res = yield this.patch(requestUrl, data, additionalHeaders); return this._processResponse(res, this.requestOptions); }); @@ -17584,7 +17610,7 @@ var require_lib = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -17658,7 +17684,7 @@ var require_lib = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve6, reject) => { function callbackForResult(err, res) { if (err) { @@ -17769,12 +17795,65 @@ var require_lib = __commonJS({ } return lowercaseKeys(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, _default2) { let clientHeader; if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + const headerValue = lowercaseKeys(this.requestOptions.headers)[header]; + if (headerValue) { + clientHeader = typeof headerValue === "number" ? headerValue.toString() : headerValue; + } } - return additionalHeaders[header] || clientHeader || _default2; + const additionalValue = additionalHeaders[header]; + if (additionalValue !== void 0) { + return typeof additionalValue === "number" ? additionalValue.toString() : additionalValue; + } + if (clientHeader !== void 0) { + return clientHeader; + } + return _default2; + } + /** + * 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, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + const headerValue = lowercaseKeys(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 _default2; } _getAgent(parsedUrl) { let agent; @@ -17845,15 +17924,15 @@ var require_lib = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -17911,11 +17990,11 @@ var require_lib = __commonJS({ } }); -// node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js +// node_modules/@actions/http-client/lib/auth.js var require_auth = __commonJS({ - "node_modules/@actions/core/node_modules/@actions/http-client/lib/auth.js"(exports2) { + "node_modules/@actions/http-client/lib/auth.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -17960,7 +18039,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -17983,7 +18062,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18006,7 +18085,7 @@ var require_auth = __commonJS({ return false; } handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { throw new Error("not implemented"); }); } @@ -18019,7 +18098,7 @@ var require_auth = __commonJS({ var require_oidc_utils = __commonJS({ "node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -18074,15 +18153,15 @@ var require_oidc_utils = __commonJS({ return runtimeUrl; } static getCall(id_token_url) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + var _a; const httpclient = _OidcClient.createHttpClient(); - const res = yield httpclient.getJson(id_token_url).catch((error4) => { + const res = yield httpclient.getJson(id_token_url).catch((error3) => { throw new Error(`Failed to get ID Token. - Error Code : ${error4.statusCode} + Error Code : ${error3.statusCode} - Error Message: ${error4.message}`); + Error Message: ${error3.message}`); }); const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; if (!id_token) { @@ -18092,7 +18171,7 @@ var require_oidc_utils = __commonJS({ }); } static getIDToken(audience) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { let id_token_url = _OidcClient.getIDTokenUrl(); if (audience) { @@ -18103,8 +18182,8 @@ var require_oidc_utils = __commonJS({ const id_token = yield _OidcClient.getCall(id_token_url); (0, core_1.setSecret)(id_token); return id_token; - } catch (error4) { - throw new Error(`Error message: ${error4.message}`); + } catch (error3) { + throw new Error(`Error message: ${error3.message}`); } }); } @@ -18117,7 +18196,7 @@ var require_oidc_utils = __commonJS({ var require_summary = __commonJS({ "node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -18162,7 +18241,7 @@ var require_summary = __commonJS({ * @returns step summary file path */ filePath() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._filePath) { return this._filePath; } @@ -18203,7 +18282,7 @@ var require_summary = __commonJS({ * @returns {Promise} summary instance */ write(options) { - return __awaiter4(this, void 0, void 0, function* () { + 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; @@ -18217,7 +18296,7 @@ var require_summary = __commonJS({ * @returns {Summary} summary instance */ clear() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.emptyBuffer().write({ overwrite: true }); }); } @@ -18411,7 +18490,7 @@ var require_summary = __commonJS({ var require_path_utils = __commonJS({ "node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -18424,66 +18503,89 @@ var require_path_utils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; + 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.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; - var path12 = __importStar4(require("path")); + exports2.toPosixPath = toPosixPath; + exports2.toWin32Path = toWin32Path; + exports2.toPlatformPath = toPlatformPath; + var path12 = __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, path12.sep); } - exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js +// node_modules/@actions/io/lib/io-util.js var require_io_util = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io-util.js"(exports2) { + "node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -18512,17 +18614,32 @@ var require_io_util = __commonJS({ }; var _a; 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 fs13 = __importStar4(require("fs")); - var path12 = __importStar4(require("path")); - _a = fs13.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; + 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 fs13 = __importStar2(require("fs")); + var path12 = __importStar2(require("path")); + _a = fs13.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; + function readlink(fsPath) { + return __awaiter2(this, void 0, void 0, function* () { + const result = yield fs13.promises.readlink(fsPath); + if (exports2.IS_WINDOWS && !result.endsWith("\\")) { + return `${result}\\`; + } + return result; + }); + } exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs13.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { - yield exports2.stat(fsPath); + yield (0, exports2.stat)(fsPath); } catch (err) { if (err.code === "ENOENT") { return false; @@ -18532,14 +18649,12 @@ var require_io_util = __commonJS({ return true; }); } - exports2.exists = exists; - function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { - const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); + 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(); }); } - exports2.isDirectory = isDirectory; function isRooted(p) { p = normalizeSeparators(p); if (!p) { @@ -18550,12 +18665,11 @@ var require_io_util = __commonJS({ } return p.startsWith("/"); } - exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18578,7 +18692,7 @@ var require_io_util = __commonJS({ filePath = originalFilePath + extension; stats = void 0; try { - stats = yield exports2.stat(filePath); + 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}`); @@ -18589,7 +18703,7 @@ var require_io_util = __commonJS({ try { const directory = path12.dirname(filePath); const upperName = path12.basename(filePath).toUpperCase(); - for (const actualName of yield exports2.readdir(directory)) { + for (const actualName of yield (0, exports2.readdir)(directory)) { if (upperName === actualName.toUpperCase()) { filePath = path12.join(directory, actualName); break; @@ -18609,7 +18723,6 @@ var require_io_util = __commonJS({ return ""; }); } - exports2.tryGetExecutablePath = tryGetExecutablePath; function normalizeSeparators(p) { p = p || ""; if (exports2.IS_WINDOWS) { @@ -18619,44 +18732,57 @@ var require_io_util = __commonJS({ 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(); + 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 _a2; return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; } - exports2.getCmdPath = getCmdPath; } }); -// node_modules/@actions/exec/node_modules/@actions/io/lib/io.js +// node_modules/@actions/io/lib/io.js var require_io = __commonJS({ - "node_modules/@actions/exec/node_modules/@actions/io/lib/io.js"(exports2) { + "node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -18684,12 +18810,17 @@ var require_io = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.findInPath = exports2.which = exports2.mkdirP = exports2.rmRF = exports2.mv = exports2.cp = void 0; + exports2.cp = cp; + exports2.mv = mv; + exports2.rmRF = rmRF; + exports2.mkdirP = mkdirP; + exports2.which = which6; + exports2.findInPath = findInPath; var assert_1 = require("assert"); - var path12 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util()); - function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + var path12 = __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) { @@ -18714,9 +18845,8 @@ var require_io = __commonJS({ } }); } - exports2.cp = cp; - function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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)) { @@ -18735,9 +18865,8 @@ var require_io = __commonJS({ yield ioUtil.rename(source, dest); }); } - exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -18755,16 +18884,14 @@ var require_io = __commonJS({ } }); } - exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - assert_1.ok(fsPath, "a path argument must be provided"); + 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 }); }); } - exports2.mkdirP = mkdirP; function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18786,9 +18913,8 @@ var require_io = __commonJS({ return ""; }); } - exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -18828,7 +18954,6 @@ var require_io = __commonJS({ return matches; }); } - exports2.findInPath = findInPath; function readCopyOptions(options) { const force = options.force == null ? true : options.force; const recursive = Boolean(options.recursive); @@ -18836,7 +18961,7 @@ var require_io = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -18856,7 +18981,7 @@ var require_io = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -18881,30 +19006,44 @@ var require_io = __commonJS({ var require_toolrunner = __commonJS({ "node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -18932,13 +19071,14 @@ var require_toolrunner = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.argStringToArray = exports2.ToolRunner = void 0; - var os3 = __importStar4(require("os")); - var events = __importStar4(require("events")); - var child = __importStar4(require("child_process")); - var path12 = __importStar4(require("path")); - var io6 = __importStar4(require_io()); - var ioUtil = __importStar4(require_io_util()); + exports2.ToolRunner = void 0; + exports2.argStringToArray = argStringToArray; + var os3 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path12 = __importStar2(require("path")); + var io6 = __importStar2(require_io()); + var ioUtil = __importStar2(require_io_util()); var timers_1 = require("timers"); var IS_WINDOWS = process.platform === "win32"; var ToolRunner6 = class extends events.EventEmitter { @@ -19149,12 +19289,12 @@ var require_toolrunner = __commonJS({ * @returns number */ exec() { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!ioUtil.isRooted(this.toolPath) && (this.toolPath.includes("/") || IS_WINDOWS && this.toolPath.includes("\\"))) { this.toolPath = path12.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); } this.toolPath = yield io6.which(this.toolPath, true); - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { this._debug(`exec tool: ${this.toolPath}`); this._debug("arguments:"); for (const arg of this.args) { @@ -19226,7 +19366,7 @@ var require_toolrunner = __commonJS({ this._debug(`STDIO streams have closed for tool '${this.toolPath}'`); state.CheckComplete(); }); - state.on("done", (error4, exitCode) => { + state.on("done", (error3, exitCode) => { if (stdbuffer.length > 0) { this.emit("stdline", stdbuffer); } @@ -19234,8 +19374,8 @@ var require_toolrunner = __commonJS({ this.emit("errline", errbuffer); } cp.removeAllListeners(); - if (error4) { - reject(error4); + if (error3) { + reject(error3); } else { resolve6(exitCode); } @@ -19295,7 +19435,6 @@ var require_toolrunner = __commonJS({ } return args; } - exports2.argStringToArray = argStringToArray; var ExecState = class _ExecState extends events.EventEmitter { constructor(options, toolPath) { super(); @@ -19323,21 +19462,21 @@ var require_toolrunner = __commonJS({ if (this.processClosed) { this._setResult(); } else if (this.processExited) { - this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); + this.timeout = (0, timers_1.setTimeout)(_ExecState.HandleTimeout, this.delay, this); } } _debug(message) { this.emit("debug", message); } _setResult() { - let error4; + let error3; if (this.processExited) { if (this.processError) { - error4 = 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}`); + 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) { - error4 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); + error3 = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`); } else if (this.processStderr && this.options.failOnStdErr) { - error4 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); + error3 = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`); } } if (this.timeout) { @@ -19345,7 +19484,7 @@ var require_toolrunner = __commonJS({ this.timeout = null; } this.done = true; - this.emit("done", error4, this.processExitCode); + this.emit("done", error3, this.processExitCode); } static HandleTimeout(state) { if (state.done) { @@ -19365,114 +19504,7 @@ var require_toolrunner = __commonJS({ var require_exec = __commonJS({ "node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 = __importStar4(require_toolrunner()); - function exec2(commandLine, args, options) { - return __awaiter4(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 = exec2; - function getExecOutput2(commandLine, args, options) { - var _a, _b; - return __awaiter4(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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec2(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); - stdout += stdoutDecoder.end(); - stderr += stderrDecoder.end(); - return { - exitCode, - stdout, - stderr - }; - }); - } - exports2.getExecOutput = getExecOutput2; - } -}); - -// node_modules/@actions/core/lib/platform.js -var require_platform = __commonJS({ - "node_modules/@actions/core/lib/platform.js"(exports2) { - "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19485,140 +19517,31 @@ var require_platform = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __importDefault4 = 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 = __importDefault4(require("os")); - var exec2 = __importStar4(require_exec()); - var getWindowsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout: version } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { - silent: true - }); - const { stdout: name } = yield exec2.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { - silent: true - }); - return { - name: name.trim(), - version: version.trim() - }; - }); - var getMacOsInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - var _a, _b, _c, _d; - const { stdout } = yield exec2.getExecOutput("sw_vers", void 0, { - silent: true - }); - const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 __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); }; - }); - var getLinuxInfo = () => __awaiter4(void 0, void 0, void 0, function* () { - const { stdout } = yield exec2.getExecOutput("lsb_release", ["-i", "-r", "-s"], { - silent: true - }); - const [name, version] = stdout.trim().split("\n"); - return { - name, - version + 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; }; - }); - 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 __awaiter4(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/core/lib/core.js -var require_core = __commonJS({ - "node_modules/@actions/core/lib/core.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + })(); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -19646,32 +19569,300 @@ var require_core = __commonJS({ }); }; 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; + exports2.exec = exec; + exports2.getExecOutput = getExecOutput; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner()); + function exec(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 _a, _b; + let stdout = ""; + let stderr = ""; + const stdoutDecoder = new string_decoder_1.StringDecoder("utf8"); + const stderrDecoder = new string_decoder_1.StringDecoder("utf8"); + const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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 exec(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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 exec = __importStar2(require_exec()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 = exportVariable6; + exports2.setSecret = setSecret; + exports2.addPath = addPath; + exports2.getInput = getInput2; + exports2.getMultilineInput = getMultilineInput; + exports2.getBooleanInput = getBooleanInput; + exports2.setOutput = setOutput2; + exports2.setCommandEcho = setCommandEcho; + exports2.setFailed = setFailed2; + exports2.isDebug = isDebug2; + exports2.debug = debug6; + exports2.error = error3; + exports2.warning = warning10; + exports2.notice = notice; + exports2.info = info6; + exports2.startGroup = startGroup3; + exports2.endGroup = endGroup3; + exports2.group = group; + exports2.saveState = saveState2; + exports2.getState = getState2; + exports2.getIDToken = getIDToken; var command_1 = require_command(); var file_command_1 = require_file_command(); var utils_1 = require_utils(); - var os3 = __importStar4(require("os")); - var path12 = __importStar4(require("path")); + var os3 = __importStar2(require("os")); + var path12 = __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 exportVariable6(name, val2) { - const convertedVal = (0, utils_1.toCommandValue)(val2); + function exportVariable6(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, val2)); + return (0, file_command_1.issueFileCommand)("ENV", (0, file_command_1.prepareKeyValueMessage)(name, val)); } (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.exportVariable = exportVariable6; function setSecret(secret) { (0, command_1.issueCommand)("add-mask", {}, secret); } - exports2.setSecret = setSecret; function addPath(inputPath) { const filePath = process.env["GITHUB_PATH"] || ""; if (filePath) { @@ -19681,18 +19872,16 @@ var require_core = __commonJS({ } process.env["PATH"] = `${inputPath}${path12.delimiter}${process.env["PATH"]}`; } - exports2.addPath = addPath; function getInput2(name, options) { - const val2 = process.env[`INPUT_${name.replace(/ /g, "_").toUpperCase()}`] || ""; - if (options && options.required && !val2) { + 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 val2; + return val; } - return val2.trim(); + 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) { @@ -19700,19 +19889,17 @@ var require_core = __commonJS({ } return inputs.map((input) => input.trim()); } - exports2.getMultilineInput = getMultilineInput; function getBooleanInput(name, options) { const trueValue = ["true", "True", "TRUE"]; const falseValue = ["false", "False", "FALSE"]; - const val2 = getInput2(name, options); - if (trueValue.includes(val2)) + const val = getInput2(name, options); + if (trueValue.includes(val)) return true; - if (falseValue.includes(val2)) + 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 setOutput2(name, value) { const filePath = process.env["GITHUB_OUTPUT"] || ""; if (filePath) { @@ -19721,50 +19908,39 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); process.stdout.write(os3.EOL); (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.setOutput = setOutput2; function setCommandEcho(enabled) { (0, command_1.issue)("echo", enabled ? "on" : "off"); } - exports2.setCommandEcho = setCommandEcho; function setFailed2(message) { process.exitCode = ExitCode.Failure; - error4(message); + error3(message); } - exports2.setFailed = setFailed2; function isDebug2() { return process.env["RUNNER_DEBUG"] === "1"; } - exports2.isDebug = isDebug2; function debug6(message) { (0, command_1.issueCommand)("debug", {}, message); } - exports2.debug = debug6; - function error4(message, properties = {}) { + function error3(message, properties = {}) { (0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.error = error4; - function warning9(message, properties = {}) { + function warning10(message, properties = {}) { (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.warning = warning9; function notice(message, properties = {}) { (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); } - exports2.notice = notice; function info6(message) { process.stdout.write(message + os3.EOL); } - exports2.info = info6; function startGroup3(name) { (0, command_1.issue)("group", name); } - exports2.startGroup = startGroup3; function endGroup3() { (0, command_1.issue)("endgroup"); } - exports2.endGroup = endGroup3; function group(name, fn) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { startGroup3(name); let result; try { @@ -19775,7 +19951,6 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); return result; }); } - exports2.group = group; function saveState2(name, value) { const filePath = process.env["GITHUB_STATE"] || ""; if (filePath) { @@ -19783,17 +19958,14 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); } (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.saveState = saveState2; function getState2(name) { return process.env[`STATE_${name}`] || ""; } - exports2.getState = getState2; function getIDToken(aud) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return yield oidc_utils_1.OidcClient.getIDToken(aud); }); } - exports2.getIDToken = getIDToken; var summary_1 = require_summary(); Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { return summary_1.summary; @@ -19812,7 +19984,7 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``); Object.defineProperty(exports2, "toPlatformPath", { enumerable: true, get: function() { return path_utils_1.toPlatformPath; } }); - exports2.platform = __importStar4(require_platform()); + exports2.platform = __importStar2(require_platform()); } }); @@ -19961,7 +20133,7 @@ var require_proxy2 = __commonJS({ var require_lib2 = __commonJS({ "node_modules/@actions/github/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -19974,21 +20146,21 @@ var require_lib2 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -20017,10 +20189,10 @@ var require_lib2 = __commonJS({ }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy2()); - var tunnel = __importStar4(require_tunnel2()); + var http = __importStar2(require("http")); + var https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy2()); + var tunnel = __importStar2(require_tunnel2()); var undici_1 = require_undici(); var HttpCodes; (function(HttpCodes2) { @@ -20095,8 +20267,8 @@ var require_lib2 = __commonJS({ this.message = message; } readBody() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { let output = Buffer.alloc(0); this.message.on("data", (chunk) => { output = Buffer.concat([output, chunk]); @@ -20108,8 +20280,8 @@ var require_lib2 = __commonJS({ }); } readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { const chunks = []; this.message.on("data", (chunk) => { chunks.push(chunk); @@ -20166,42 +20338,42 @@ var require_lib2 = __commonJS({ } } options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); }); } get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("GET", requestUrl, null, additionalHeaders || {}); }); } del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("DELETE", requestUrl, null, additionalHeaders || {}); }); } post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PATCH", requestUrl, data, additionalHeaders || {}); }); } put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("PUT", requestUrl, data, additionalHeaders || {}); }); } head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request("HEAD", requestUrl, null, additionalHeaders || {}); }); } sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return this.request(verb, requestUrl, stream2, additionalHeaders); }); } @@ -20210,14 +20382,14 @@ var require_lib2 = __commonJS({ * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise */ getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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 __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20226,7 +20398,7 @@ var require_lib2 = __commonJS({ }); } putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20235,7 +20407,7 @@ var require_lib2 = __commonJS({ }); } patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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); @@ -20249,7 +20421,7 @@ var require_lib2 = __commonJS({ * Prefer get, del, post and patch */ request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (this._disposed) { throw new Error("Client has already been disposed."); } @@ -20323,7 +20495,7 @@ var require_lib2 = __commonJS({ * @param data */ requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { return new Promise((resolve6, reject) => { function callbackForResult(err, res) { if (err) { @@ -20510,15 +20682,15 @@ var require_lib2 = __commonJS({ return proxyAgent; } _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); }); } _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { const statusCode = res.message.statusCode || 0; const response = { statusCode, @@ -20580,7 +20752,7 @@ var require_lib2 = __commonJS({ var require_utils3 = __commonJS({ "node_modules/@actions/github/lib/internal/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -20593,21 +20765,21 @@ var require_utils3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -20636,7 +20808,7 @@ var require_utils3 = __commonJS({ }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getApiBaseUrl = exports2.getProxyFetch = exports2.getProxyAgentDispatcher = exports2.getProxyAgent = exports2.getAuthString = void 0; - var httpClient = __importStar4(require_lib2()); + var httpClient = __importStar2(require_lib2()); var undici_1 = require_undici(); function getAuthString(token, options) { if (!token && !options.auth) { @@ -20659,7 +20831,7 @@ var require_utils3 = __commonJS({ exports2.getProxyAgentDispatcher = getProxyAgentDispatcher; function getProxyFetch(destinationUrl) { const httpDispatcher = getProxyAgentDispatcher(destinationUrl); - const proxyFetch = (url2, opts) => __awaiter4(this, void 0, void 0, function* () { + 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; @@ -20745,8 +20917,8 @@ var require_add = __commonJS({ } if (kind === "error") { hook = function(method, options) { - return Promise.resolve().then(method.bind(null, options)).catch(function(error4) { - return orig(error4, options); + return Promise.resolve().then(method.bind(null, options)).catch(function(error3) { + return orig(error3, options); }); }; } @@ -21478,7 +21650,7 @@ var require_dist_node5 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url: url2, status, @@ -21487,7 +21659,7 @@ var require_dist_node5 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -21497,17 +21669,17 @@ var require_dist_node5 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -22126,7 +22298,7 @@ var require_dist_node8 = __commonJS({ } if (status >= 400) { const data = await getResponseData(response); - const error4 = new import_request_error.RequestError(toErrorMessage(data), status, { + const error3 = new import_request_error.RequestError(toErrorMessage(data), status, { response: { url: url2, status, @@ -22135,7 +22307,7 @@ var require_dist_node8 = __commonJS({ }, request: requestOptions }); - throw error4; + throw error3; } return parseSuccessResponseBody ? await getResponseData(response) : response.body; }).then((data) => { @@ -22145,17 +22317,17 @@ var require_dist_node8 = __commonJS({ headers, data }; - }).catch((error4) => { - if (error4 instanceof import_request_error.RequestError) - throw error4; - else if (error4.name === "AbortError") - throw error4; - let message = error4.message; - if (error4.name === "TypeError" && "cause" in error4) { - if (error4.cause instanceof Error) { - message = error4.cause.message; - } else if (typeof error4.cause === "string") { - message = error4.cause; + }).catch((error3) => { + if (error3 instanceof import_request_error.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_error.RequestError(message, 500, { @@ -24827,9 +24999,9 @@ var require_dist_node13 = __commonJS({ /<([^<>]+)>;\s*rel="next"/ ) || [])[1]; return { value: normalizedResponse }; - } catch (error4) { - if (error4.status !== 409) - throw error4; + } catch (error3) { + if (error3.status !== 409) + throw error3; url2 = ""; return { value: { @@ -25134,7 +25306,7 @@ var require_dist_node13 = __commonJS({ var require_utils4 = __commonJS({ "node_modules/@actions/github/lib/utils.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25147,24 +25319,24 @@ var require_utils4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokitOptions = exports2.GitHub = exports2.defaults = exports2.context = void 0; - var Context = __importStar4(require_context()); - var Utils = __importStar4(require_utils3()); + var Context = __importStar2(require_context()); + var Utils = __importStar2(require_utils3()); var core_1 = require_dist_node11(); var plugin_rest_endpoint_methods_1 = require_dist_node12(); var plugin_paginate_rest_1 = require_dist_node13(); @@ -25194,7 +25366,7 @@ var require_utils4 = __commonJS({ var require_github = __commonJS({ "node_modules/@actions/github/lib/github.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -25207,23 +25379,23 @@ var require_github = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.getOctokit = exports2.context = void 0; - var Context = __importStar4(require_context()); + var Context = __importStar2(require_context()); var utils_1 = require_utils4(); exports2.context = new Context.Context(); function getOctokit(token, options, ...additionalPlugins) { @@ -25234,532 +25406,74 @@ var require_github = __commonJS({ } }); -// node_modules/@actions/io/lib/io-util.js -var require_io_util2 = __commonJS({ - "node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/semver/internal/constants.js +var require_constants6 = __commonJS({ + "node_modules/semver/internal/constants.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 }; - var _a; - 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 fs13 = __importStar4(require("fs")); - var path12 = __importStar4(require("path")); - _a = fs13.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; - exports2.IS_WINDOWS = process.platform === "win32"; - function readlink(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { - const result = yield fs13.promises.readlink(fsPath); - if (exports2.IS_WINDOWS && !result.endsWith("\\")) { - return `${result}\\`; - } - return result; - }); - } - exports2.UV_FS_O_EXLOCK = 268435456; - exports2.READONLY = fs13.constants.O_RDONLY; - function exists(fsPath) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 = path12.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 = path12.dirname(filePath); - const upperName = path12.basename(filePath).toUpperCase(); - for (const actualName of yield (0, exports2.readdir)(directory)) { - if (upperName === actualName.toUpperCase()) { - filePath = path12.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 _a2; - return (_a2 = process.env["COMSPEC"]) !== null && _a2 !== void 0 ? _a2 : `cmd.exe`; - } } }); -// node_modules/@actions/io/lib/io.js -var require_io2 = __commonJS({ - "node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/semver/internal/debug.js +var require_debug = __commonJS({ + "node_modules/semver/internal/debug.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 = which6; - exports2.findInPath = findInPath; - var assert_1 = require("assert"); - var path12 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util2()); - function cp(source_1, dest_1) { - return __awaiter4(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 ? path12.join(dest, path12.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 (path12.relative(source, newDest) === "") { - throw new Error(`'${newDest}' and '${source}' are the same file`); - } - yield copyFile(source, newDest, force); - } - }); - } - function mv(source_1, dest_1) { - return __awaiter4(this, arguments, void 0, function* (source, dest, options = {}) { - if (yield ioUtil.exists(dest)) { - let destExists = true; - if (yield ioUtil.isDirectory(dest)) { - dest = path12.join(dest, path12.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(path12.dirname(dest)); - yield ioUtil.rename(source, dest); - }); - } - function rmRF(inputPath) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - (0, assert_1.ok)(fsPath, "a path argument must be provided"); - yield ioUtil.mkdir(fsPath, { recursive: true }); - }); - } - function which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { - if (!tool) { - throw new Error("parameter 'tool' is required"); - } - if (check) { - const result = yield which6(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 __awaiter4(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(path12.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(path12.sep)) { - return []; - } - const directories = []; - if (process.env.PATH) { - for (const p of process.env.PATH.split(path12.delimiter)) { - if (p) { - directories.push(p); - } - } - } - const matches = []; - for (const directory of directories) { - const filePath = yield ioUtil.tryGetExecutablePath(path12.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 __awaiter4(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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/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}}`); + 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; }; @@ -26413,8 +26127,8 @@ var require_gte = __commonJS({ "node_modules/semver/functions/gte.js"(exports2, module2) { "use strict"; var compare3 = require_compare(); - var gte5 = (a, b, loose) => compare3(a, b, loose) >= 0; - module2.exports = gte5; + var gte6 = (a, b, loose) => compare3(a, b, loose) >= 0; + module2.exports = gte6; } }); @@ -26435,7 +26149,7 @@ var require_cmp = __commonJS({ var eq = require_eq(); var neq = require_neq(); var gt = require_gt(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lt = require_lt(); var lte = require_lte(); var cmp = (a, op, b, loose) => { @@ -26465,7 +26179,7 @@ var require_cmp = __commonJS({ case ">": return gt(a, b, loose); case ">=": - return gte5(a, b, loose); + return gte6(a, b, loose); case "<": return lt(a, b, loose); case "<=": @@ -26943,7 +26657,7 @@ var require_range = __commonJS({ var require_comparator = __commonJS({ "node_modules/semver/classes/comparator.js"(exports2, module2) { "use strict"; - var ANY = Symbol("SemVer ANY"); + var ANY = /* @__PURE__ */ Symbol("SemVer ANY"); var Comparator = class _Comparator { static get ANY() { return ANY; @@ -27224,7 +26938,7 @@ var require_outside = __commonJS({ var gt = require_gt(); var lt = require_lt(); var lte = require_lte(); - var gte5 = require_gte(); + var gte6 = require_gte(); var outside = (version, range, hilo, options) => { version = new SemVer(version, options); range = new Range2(range, options); @@ -27239,7 +26953,7 @@ var require_outside = __commonJS({ break; case "<": gtfn = lt; - ltefn = gte5; + ltefn = gte6; ltfn = gt; comp = "<"; ecomp = "<="; @@ -27554,7 +27268,7 @@ var require_semver2 = __commonJS({ var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); - var gte5 = require_gte(); + var gte6 = require_gte(); var lte = require_lte(); var cmp = require_cmp(); var coerce3 = require_coerce(); @@ -27592,7 +27306,7 @@ var require_semver2 = __commonJS({ lt, eq, neq, - gte: gte5, + gte: gte6, lte, cmp, coerce: coerce3, @@ -27627,7 +27341,7 @@ var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "codeql", - version: "4.31.3", + version: "4.31.10", private: true, description: "CodeQL action", scripts: { @@ -27651,56 +27365,55 @@ var require_package = __commonJS({ }, license: "MIT", dependencies: { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", archiver: "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", jsonschema: "1.4.1", long: "^5.3.2", - "node-forge": "^1.3.1", - octokit: "^5.0.5", + "node-forge": "^1.3.3", semver: "^7.7.3", uuid: "^13.0.0" }, devDependencies: { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", ava: "^6.4.1", - esbuild: "^0.25.12", + esbuild: "^0.27.1", eslint: "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - glob: "^11.0.3", + glob: "^11.1.0", nock: "^14.0.10", sinon: "^21.0.0", typescript: "^5.9.3" @@ -27724,7 +27437,8 @@ var require_package = __commonJS({ "eslint-plugin-jsx-a11y": { semver: ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + glob: "^11.1.0" } }; } @@ -27910,8 +27624,8 @@ var require_light = __commonJS({ } else { return returned; } - } catch (error4) { - e2 = error4; + } catch (error3) { + e2 = error3; { this.trigger("error", e2); } @@ -27921,8 +27635,8 @@ var require_light = __commonJS({ return (await Promise.all(promises3)).find(function(x) { return x != null; }); - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; { this.trigger("error", e); } @@ -28034,10 +27748,10 @@ var require_light = __commonJS({ _randomIndex() { return Math.random().toString(36).slice(2); } - doDrop({ error: error4, message = "This job has been dropped by Bottleneck" } = {}) { + doDrop({ error: error3, message = "This job has been dropped by Bottleneck" } = {}) { if (this._states.remove(this.options.id)) { if (this.rejectOnDrop) { - this._reject(error4 != null ? error4 : new BottleneckError$1(message)); + 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; @@ -28071,7 +27785,7 @@ var require_light = __commonJS({ return this.Events.trigger("scheduled", { args: this.args, options: this.options }); } async doExecute(chained, clearGlobalState, run2, free) { - var error4, eventInfo, passed; + var error3, eventInfo, passed; if (this.retryCount === 0) { this._assertStatus("RUNNING"); this._states.next(this.options.id); @@ -28089,24 +27803,24 @@ var require_light = __commonJS({ return this._resolve(passed); } } catch (error1) { - error4 = error1; - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = error1; + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } } doExpire(clearGlobalState, run2, free) { - var error4, eventInfo; + 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 }; - error4 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); - return this._onFailure(error4, eventInfo, clearGlobalState, run2, free); + error3 = new BottleneckError$1(`This job timed out after ${this.options.expiration} ms.`); + return this._onFailure(error3, eventInfo, clearGlobalState, run2, free); } - async _onFailure(error4, eventInfo, clearGlobalState, run2, free) { + async _onFailure(error3, eventInfo, clearGlobalState, run2, free) { var retry3, retryAfter; if (clearGlobalState()) { - retry3 = await this.Events.trigger("failed", error4, eventInfo); + retry3 = await this.Events.trigger("failed", error3, eventInfo); if (retry3 != null) { retryAfter = ~~retry3; this.Events.trigger("retry", `Retrying ${this.options.id} after ${retryAfter} ms`, eventInfo); @@ -28116,7 +27830,7 @@ var require_light = __commonJS({ this.doDone(eventInfo); await free(this.options, eventInfo); this._assertStatus("DONE"); - return this._reject(error4); + return this._reject(error3); } } } @@ -28395,7 +28109,7 @@ var require_light = __commonJS({ return this._queue.length === 0; } async _tryToRun() { - var args, cb, error4, reject, resolve6, returned, task; + var args, cb, error3, reject, resolve6, returned, task; if (this._running < 1 && this._queue.length > 0) { this._running++; ({ task, args, resolve: resolve6, reject } = this._queue.shift()); @@ -28406,9 +28120,9 @@ var require_light = __commonJS({ return resolve6(returned); }; } catch (error1) { - error4 = error1; + error3 = error1; return function() { - return reject(error4); + return reject(error3); }; } })(); @@ -28542,8 +28256,8 @@ var require_light = __commonJS({ } else { results.push(void 0); } - } catch (error4) { - e = error4; + } catch (error3) { + e = error3; results.push(v.Events.trigger("error", e)); } } @@ -28876,14 +28590,14 @@ var require_light = __commonJS({ return done; } async _addToQueue(job) { - var args, blocked, error4, options, reachedHWM, shifted, strategy; + 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) { - error4 = error1; - this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error4 }); - job.doDrop({ error: error4 }); + error3 = error1; + this.Events.trigger("debug", `Could not queue ${options.id}`, { args, options, error: error3 }); + job.doDrop({ error: error3 }); return false; } if (blocked) { @@ -29179,24 +28893,24 @@ var require_dist_node15 = __commonJS({ }); module2.exports = __toCommonJS2(dist_src_exports); var import_core = require_dist_node11(); - async function errorRequest(state, octokit, error4, options) { - if (!error4.request || !error4.request.request) { - throw error4; + async function errorRequest(state, octokit, error3, options) { + if (!error3.request || !error3.request.request) { + throw error3; } - if (error4.status >= 400 && !state.doNotRetry.includes(error4.status)) { + 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(error4, retries, retryAfter); + throw octokit.retry.retryRequest(error3, retries, retryAfter); } - throw error4; + throw error3; } var import_light = __toESM2(require_light()); var import_request_error = require_dist_node14(); async function wrapRequest(state, octokit, request, options) { const limiter = new import_light.default(); - limiter.on("failed", function(error4, info6) { - const maxRetries = ~~error4.request.request.retries; - const after = ~~error4.request.request.retryAfter; + limiter.on("failed", function(error3, info6) { + const maxRetries = ~~error3.request.request.retries; + const after = ~~error3.request.request.retryAfter; options.request.retryCount = info6.retryCount + 1; if (maxRetries > info6.retryCount) { return after * state.retryAfterBaseValue; @@ -29212,11 +28926,11 @@ var require_dist_node15 = __commonJS({ 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 error4 = new import_request_error.RequestError(response.data.errors[0].message, 500, { + const error3 = new import_request_error.RequestError(response.data.errors[0].message, 500, { request: options, response }); - return errorRequest(state, octokit, error4, options); + return errorRequest(state, octokit, error3, options); } return response; } @@ -29237,12 +28951,12 @@ var require_dist_node15 = __commonJS({ } return { retry: { - retryRequest: (error4, retries, retryAfter) => { - error4.request.request = Object.assign({}, error4.request.request, { + retryRequest: (error3, retries, retryAfter) => { + error3.request.request = Object.assign({}, error3.request.request, { retries, retryAfter }); - return error4; + return error3; } } }; @@ -29251,1424 +28965,1097 @@ var require_dist_node15 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js -var require_internal_glob_options_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-glob-options-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/utils.js +var require_utils5 = __commonJS({ + "node_modules/@actions/glob/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/glob/node_modules/@actions/core/lib/command.js +var require_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getOptions = void 0; - var core14 = __importStar4(require_core()); - function getOptions(copy) { - const result = { - followSymbolicLinks: true, - implicitDescendants: true, - omitBrokenSymbolicLinks: true - }; - if (copy) { - if (typeof copy.followSymbolicLinks === "boolean") { - result.followSymbolicLinks = copy.followSymbolicLinks; - core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); - } - if (typeof copy.implicitDescendants === "boolean") { - result.implicitDescendants = copy.implicitDescendants; - core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + exports2.issue = exports2.issueCommand = void 0; + var os3 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os3.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"; } - if (typeof copy.omitBrokenSymbolicLinks === "boolean") { - result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; - core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + 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; } - return result; + }; + 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"); } - exports2.getOptions = getOptions; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js -var require_internal_path_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js +var require_file_command2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/file-command.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; - var path12 = __importStar4(require("path")); - var assert_1 = __importDefault4(require("assert")); - var IS_WINDOWS = process.platform === "win32"; - function dirname3(p) { - p = safeTrimTrailingSeparator(p); - if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { - return p; + exports2.prepareKeyValueMessage = exports2.issueFileCommand = void 0; + var crypto2 = __importStar2(require("crypto")); + var fs13 = __importStar2(require("fs")); + var os3 = __importStar2(require("os")); + var utils_1 = require_utils5(); + function issueFileCommand(command, message) { + const filePath = process.env[`GITHUB_${command}`]; + if (!filePath) { + throw new Error(`Unable to find environment variable for file command ${command}`); } - let result = path12.dirname(p); - if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { - result = safeTrimTrailingSeparator(result); + if (!fs13.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } - return result; + fs13.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { + encoding: "utf8" + }); } - exports2.dirname = dirname3; - function ensureAbsoluteRoot(root, itemPath) { - assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`); - 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(); - 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(); - 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)}`; - } + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.randomUUID()}`; + const convertedValue = (0, utils_1.toCommandValue)(value); + if (key.includes(delimiter)) { + throw new Error(`Unexpected input: name should not contain the delimiter "${delimiter}"`); } - assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); - if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { - } else { - root += path12.sep; + if (convertedValue.includes(delimiter)) { + throw new Error(`Unexpected input: value should not contain the delimiter "${delimiter}"`); } - return root + itemPath; + return `${key}<<${delimiter}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; } - exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; - function hasAbsoluteRoot(itemPath) { - 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); + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/proxy.js +var require_proxy3 = __commonJS({ + "node_modules/@actions/glob/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; } - return itemPath.startsWith("/"); - } - exports2.hasAbsoluteRoot = hasAbsoluteRoot; - function hasRoot(itemPath) { - 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); + 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 (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); + } + } else { + return void 0; } - return itemPath.startsWith("/"); } - exports2.hasRoot = hasRoot; - function normalizeSeparators(p) { - p = p || ""; - if (IS_WINDOWS) { - p = p.replace(/\//g, "\\"); - const isUnc = /^\\\\+[^\\]/.test(p); - return (isUnc ? "\\" : "") + p.replace(/\\\\+/g, "\\"); + exports2.getProxyUrl = getProxyUrl; + function checkBypass(reqUrl) { + if (!reqUrl.hostname) { + return false; } - return p.replace(/\/\/+/g, "/"); - } - exports2.normalizeSeparators = normalizeSeparators; - function safeTrimTrailingSeparator(p) { - if (!p) { - return ""; + const reqHost = reqUrl.hostname; + if (isLoopbackAddress(reqHost)) { + return true; } - p = normalizeSeparators(p); - if (!p.endsWith(path12.sep)) { - return p; + const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; + if (!noProxy) { + return false; } - if (p === path12.sep) { - return p; + let reqPort; + if (reqUrl.port) { + reqPort = Number(reqUrl.port); + } else if (reqUrl.protocol === "http:") { + reqPort = 80; + } else if (reqUrl.protocol === "https:") { + reqPort = 443; } - if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { - return p; + const upperReqHosts = [reqUrl.hostname.toUpperCase()]; + if (typeof reqPort === "number") { + upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); } - return p.substr(0, p.length - 1); + 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.safeTrimTrailingSeparator = safeTrimTrailingSeparator; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-match-kind.js -var require_internal_match_kind = __commonJS({ - "node_modules/@actions/cache/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 || (exports2.MatchKind = {})); + 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/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js -var require_internal_pattern_helper = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern-helper.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; - } }); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; - var pathHelper = __importStar4(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"; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - 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; + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - tempKey = parent; - parent = pathHelper.dirname(tempKey); } - if (!foundAncestor) { - result.push(pattern.searchPath); - searchPathMap[key] = "included"; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } - return result; - } - exports2.getSearchPaths = getSearchPaths; - function match(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); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } - } - return result; - } - exports2.match = match; - function partialMatch(patterns, itemPath) { - return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); + 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 https2 = __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.partialMatch = partialMatch; - } -}); - -// 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 (isArray(x)) res.push.apply(res, x); - else res.push(x); + 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); } - return res; }; - var isArray = Array.isArray || function(xs) { - return Object.prototype.toString.call(xs) === "[object Array]"; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; + } + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __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", () => { + resolve6(output.toString()); + }); + })); + }); + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve6(Buffer.concat(chunks)); + }); + })); + }); + } }; - } -}); - -// node_modules/balanced-match/index.js -var require_balanced_match = __commonJS({ - "node_modules/balanced-match/index.js"(exports2, module2) { - "use strict"; - module2.exports = balanced; - function balanced(a, b, str2) { - if (a instanceof RegExp) a = maybeMatch(a, str2); - if (b instanceof RegExp) b = maybeMatch(b, str2); - var r = range(a, b, str2); - return r && { - start: r[0], - end: r[1], - pre: str2.slice(0, r[0]), - body: str2.slice(r[0] + a.length, r[1]), - post: str2.slice(r[1] + b.length) - }; - } - function maybeMatch(reg, str2) { - var m = str2.match(reg); - return m ? m[0] : null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; } - balanced.range = range; - function range(a, b, str2) { - var begs, beg, left, right, result; - var ai = str2.indexOf(a); - var bi = str2.indexOf(b, ai + 1); - var i = ai; - if (ai >= 0 && bi > 0) { - begs = []; - left = str2.length; - while (i >= 0 && !result) { - if (i == ai) { - begs.push(i); - ai = str2.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 = str2.indexOf(b, i + 1); + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; } - 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 balanced = require_balanced_match(); - module2.exports = expandTop; - 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"; - function numeric(str2) { - return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); - } - function escapeBraces(str2) { - return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); - } - function unescapeBraces(str2) { - return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); - } - function parseCommaParts(str2) { - if (!str2) - return [""]; - var parts = []; - var m = balanced("{", "}", str2); - if (!m) - return str2.split(","); - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(","); - p[p.length - 1] += "{" + body + "}"; - var 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 expandTop(str2) { - if (!str2) - return []; - if (str2.substr(0, 2) === "{}") { - str2 = "\\{\\}" + str2.substr(2); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - return expand(escapeBraces(str2), true).map(unescapeBraces); - } - function embrace(str2) { - return "{" + str2 + "}"; - } - function isPadded(el) { - return /^-?0\d/.test(el); - } - function lte(i, y) { - return i <= y; - } - function gte5(i, y) { - return i >= y; - } - function expand(str2, isTop) { - var expansions = []; - var m = balanced("{", "}", str2); - if (!m || /\$$/.test(m.pre)) return [str2]; - 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(/,(?!,).*\}/)) { - str2 = m.pre + "{" + m.body + escClose + m.post; - return expand(str2); - } - return [str2]; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length ? expand(m.post, false) : [""]; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var pre = m.pre; - var post = m.post.length ? expand(m.post, false) : [""]; - var N; - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length); - var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte5; - } - var pad = n.some(isPadded); - N = []; - for (var i = x; test(i, y); 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; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { - return expand(el, false); + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return expansions; - } - } -}); - -// node_modules/minimatch/minimatch.js -var require_minimatch = __commonJS({ - "node_modules/minimatch/minimatch.js"(exports2, module2) { - module2.exports = minimatch; - minimatch.Minimatch = Minimatch; - var path12 = (function() { - try { - return require("path"); - } catch (e) { + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - })() || { - sep: "/" - }; - minimatch.sep = path12.sep; - var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; - var expand = require_brace_expansion(); - var plTypes = { - "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, - "?": { open: "(?:", close: ")?" }, - "+": { open: "(?:", close: ")+" }, - "*": { open: "(?:", close: ")*" }, - "@": { open: "(?:", close: ")" } - }; - var qmark = "[^/]"; - var star = qmark + "*?"; - var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; - var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; - var reSpecials = charSet("().*{}+?[]^$\\!"); - function charSet(s) { - return s.split("").reduce(function(set2, c) { - set2[c] = true; - return set2; - }, {}); - } - var slashSplit = /\/+/; - minimatch.filter = filter; - function filter(pattern, options) { - options = options || {}; - return function(p, i, list) { - return minimatch(p, pattern, options); - }; - } - function ext(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; - } - minimatch.defaults = function(def) { - if (!def || typeof def !== "object" || !Object.keys(def).length) { - return minimatch; + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - var orig = minimatch; - var m = function minimatch2(p, pattern, options) { - return orig(p, pattern, ext(def, options)); - }; - m.Minimatch = function Minimatch2(pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)); - }; - m.Minimatch.defaults = function defaults(options) { - return orig.defaults(ext(def, options)).Minimatch; - }; - m.filter = function filter2(pattern, options) { - return orig.filter(pattern, ext(def, options)); - }; - m.defaults = function defaults(options) { - return orig.defaults(ext(def, options)); - }; - m.makeRe = function makeRe2(pattern, options) { - return orig.makeRe(pattern, ext(def, options)); - }; - m.braceExpand = function braceExpand2(pattern, options) { - return orig.braceExpand(pattern, ext(def, options)); - }; - m.match = function(list, pattern, options) { - return orig.match(list, pattern, ext(def, options)); - }; - return m; - }; - Minimatch.defaults = function(def) { - return minimatch.defaults(def).Minimatch; - }; - function minimatch(p, pattern, options) { - assertValidPattern(pattern); - if (!options) options = {}; - if (!options.nocomment && pattern.charAt(0) === "#") { - return false; + sendStream(verb, requestUrl, stream2, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request(verb, requestUrl, stream2, additionalHeaders); + }); } - return new Minimatch(pattern, options).match(p); - } - function Minimatch(pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options); + /** + * 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); + }); } - assertValidPattern(pattern); - if (!options) options = {}; - pattern = pattern.trim(); - if (!options.allowWindowsEscape && path12.sep !== "/") { - pattern = pattern.split(path12.sep).join("/"); + 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); + }); } - this.options = options; - this.set = []; - this.pattern = pattern; - this.regexp = null; - this.negate = false; - this.comment = false; - this.empty = false; - this.partial = !!options.partial; - this.make(); - } - Minimatch.prototype.debug = function() { - }; - Minimatch.prototype.make = make; - function make() { - var pattern = this.pattern; - var options = this.options; - if (!options.nocomment && pattern.charAt(0) === "#") { - this.comment = true; - return; + 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); + }); } - if (!pattern) { - this.empty = true; - return; + 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); + }); } - this.parseNegate(); - var set2 = this.globSet = this.braceExpand(); - if (options.debug) this.debug = function debug6() { - console.error.apply(console, arguments); - }; - this.debug(this.pattern, set2); - set2 = this.globParts = set2.map(function(s) { - return s.split(slashSplit); - }); - this.debug(this.pattern, set2); - set2 = set2.map(function(s, si, set3) { - return s.map(this.parse, this); - }, this); - this.debug(this.pattern, set2); - set2 = set2.filter(function(s) { - return s.indexOf(false) === -1; - }); - this.debug(this.pattern, set2); - this.set = set2; - } - Minimatch.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++; + /** + * 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - if (negateOffset) this.pattern = pattern.substr(negateOffset); - this.negate = negate2; - } - minimatch.braceExpand = function(pattern, options) { - return braceExpand(pattern, options); - }; - Minimatch.prototype.braceExpand = braceExpand; - function braceExpand(pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options; - } else { - options = {}; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); } + this._disposed = true; } - pattern = typeof pattern === "undefined" ? this.pattern : pattern; - assertValidPattern(pattern); - if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { - return [pattern]; + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve6(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); + }); } - return expand(pattern); - } - var MAX_PATTERN_LENGTH = 1024 * 64; - var assertValidPattern = function(pattern) { - if (typeof pattern !== "string") { - throw new TypeError("invalid pattern"); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; + } + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); + } + } + const req = info6.httpModule.request(info6.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: ${info6.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(); + } } - if (pattern.length > MAX_PATTERN_LENGTH) { - throw new TypeError("pattern is too long"); + /** + * 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); } - }; - Minimatch.prototype.parse = parse; - var SUBPARSE = {}; - function parse(pattern, isSub) { - assertValidPattern(pattern); - var options = this.options; - if (pattern === "**") { - if (!options.noglobstar) - return GLOBSTAR; - else - pattern = "*"; + 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); } - 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 += star; - hasMagic = true; - break; - case "?": - re += qmark; - hasMagic = true; - break; - default: - re += "\\" + stateChar; - break; + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); } - self2.debug("clearStateChar %j %j", stateChar, re); - stateChar = false; } + return info6; } - 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 && reSpecials[c]) { - re += "\\" + c; - escaping = false; - continue; + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); } - switch (c) { - /* istanbul ignore next */ - case "/": { - return false; + return lowercaseKeys(headers || {}); + } + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + } + return additionalHeaders[header] || clientHeader || _default2; + } + _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; } - 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; - } - 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; + agent = tunnelAgent(agentOptions); + this._proxyAgent = agent; + } + if (!agent) { + const options = { keepAlive: this._keepAlive, maxSockets }; + agent = usingSsl ? new https2.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((resolve6) => setTimeout(() => resolve6(), ms)); + }); + } + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve6(response); } - inClass = true; - classStart = i; - reClassStart = re.length; - re += c; - continue; - case "]": - if (i === classStart + 1 || !inClass) { - re += "\\" + c; - escaping = false; - continue; + function dateTimeDeserializer(key, value) { + if (typeof value === "string") { + const a = new Date(value); + if (!isNaN(a.valueOf())) { + return a; + } + } + return value; } - var cs = pattern.substring(classStart + 1, i); + let obj; + let contents; 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; + 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) { } - hasMagic = true; - inClass = false; - re += c; - continue; - default: - clearStateChar(); - if (escaping) { - escaping = false; - } else if (reSpecials[c] && !(c === "^" && inClass)) { - re += "\\"; + 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 { + resolve6(response); } - 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]; + }; + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/glob/node_modules/@actions/http-client/lib/auth.js +var require_auth2 = __commonJS({ + "node_modules/@actions/glob/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(resolve6) { + resolve6(value); + }); } - 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(_, $1, $2) { - if (!$2) { - $2 = "\\"; + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - return $1 + $1 + $2 + "|"; - }); - this.debug("tail=%j\n %s", tail, tail, pl, re); - var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; - hasMagic = true; - re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve6(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; } - clearStateChar(); - if (escaping) { - re += "\\\\"; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); + } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - var addPatternStart = false; - switch (re.charAt(0)) { - case "[": - case ".": - case "(": - addPatternStart = true; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - 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 = "$"; + 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"); } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast; - re = newRe; + options.headers["Authorization"] = `Bearer ${this.token}`; } - if (re !== "" && hasMagic) { - re = "(?=.)" + re; + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - if (addPatternStart) { - re = patternStart + re; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - if (isSub === SUBPARSE) { - return [re, hasMagic]; + }; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - if (!hasMagic) { - return globUnescape(pattern); + // 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")}`; } - var flags = options.nocase ? "i" : ""; - try { - var regExp = new RegExp("^" + re + "$", flags); - } catch (er) { - return new RegExp("$."); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - regExp._glob = pattern; - regExp._src = re; - return regExp; - } - minimatch.makeRe = function(pattern, options) { - return new Minimatch(pattern, options || {}).makeRe(); - }; - Minimatch.prototype.makeRe = makeRe; - function makeRe() { - if (this.regexp || this.regexp === false) return this.regexp; - var set2 = this.set; - if (!set2.length) { - this.regexp = false; - return this.regexp; - } - var options = this.options; - var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; - var flags = options.nocase ? "i" : ""; - var re = set2.map(function(pattern) { - return pattern.map(function(p) { - return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; - } - minimatch.match = function(list, pattern, options) { - options = options || {}; - var mm = new Minimatch(pattern, options); - list = list.filter(function(f) { - return mm.match(f); - }); - if (mm.options.nonull && !list.length) { - list.push(pattern); - } - return list; - }; - Minimatch.prototype.match = function match(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 (path12.sep !== "/") { - f = f.split(path12.sep).join("/"); - } - f = f.split(slashSplit); - this.debug(this.pattern, "split", f); - var set2 = this.set; - this.debug(this.pattern, "set", set2); - var filename; - var i; - for (i = f.length - 1; i >= 0; i--) { - filename = f[i]; - if (filename) break; - } - for (i = 0; i < set2.length; i++) { - var pattern = set2[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; - }; - Minimatch.prototype.matchOne = function(file, pattern, partial) { - var options = this.options; - this.debug( - "matchOne", - { "this": this, file, pattern } - ); - this.debug("matchOne", file.length, pattern.length); - for (var fi = 0, pi = 0, 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) return false; - if (p === GLOBSTAR) { - this.debug("GLOBSTAR", [pattern, p, f]); - var fr = fi; - var pr = pi + 1; - if (pr === pl) { - this.debug("** at the end"); - for (; fi < fl; fi++) { - if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; - } - return true; - } - while (fr < fl) { - var swallowee = file[fr]; - this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug("globstar found match!", fr, fl, swallowee); - return true; - } else { - if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { - this.debug("dot detected!", file, fr, pattern, pr); - break; - } - this.debug("globstar swallow a segment, and continue"); - fr++; - } - } - if (partial) { - this.debug("\n>>> no match, partial?", file, fr, pattern, pr); - if (fr === fl) return true; - } - 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] === ""; + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); + }); } - throw new Error("wtf?"); }; - function globUnescape(s) { - return s.replace(/\\(.)/g, "$1"); - } - function regExpEscape(s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); - } + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js -var require_internal_path = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-path.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Path = void 0; - var path12 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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") { - assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`); - itemPath = pathHelper.safeTrimTrailingSeparator(itemPath); - if (!pathHelper.hasRoot(itemPath)) { - this.segments = itemPath.split(path12.sep); - } else { - let remaining = itemPath; - let dir = pathHelper.dirname(remaining); - while (dir !== remaining) { - const basename = path12.basename(remaining); - this.segments.unshift(basename); - remaining = dir; - dir = pathHelper.dirname(remaining); - } - this.segments.unshift(remaining); - } - } else { - 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]; - 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); - assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`); - this.segments.push(segment); - } else { - assert_1.default(!segment.includes(path12.sep), `Parameter 'itemPath' contains unexpected path separators`); - this.segments.push(segment); - } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - } - /** - * Converts the path to it's string representation - */ - toString() { - let result = this.segments[0]; - let skipSlash = result.endsWith(path12.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); - for (let i = 1; i < this.segments.length; i++) { - if (skipSlash) { - skipSlash = false; - } else { - result += path12.sep; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - result += this.segments[i]; } - return result; - } - }; - exports2.Path = Path; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js -var require_internal_pattern = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-pattern.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Pattern = void 0; - var os3 = __importStar4(require("os")); - var path12 = __importStar4(require("path")); - var pathHelper = __importStar4(require_internal_path_helper()); - var assert_1 = __importDefault4(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, homedir) { - this.negate = false; - let pattern; - if (typeof patternOrNegate === "string") { - pattern = patternOrNegate.trim(); - } else { - segments = segments || []; - assert_1.default(segments.length, `Parameter 'segments' must not empty`); - const root = _Pattern.getLiteral(segments[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, homedir); - this.segments = new internal_path_1.Path(pattern).segments; - this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path12.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 + exports2.OidcClient = void 0; + var http_client_1 = require_lib3(); + var auth_1 = require_auth2(); + var core_1 = require_core2(); + var OidcClient = class _OidcClient { + static createHttpClient(allowRetry = true, maxRetry = 10) { + const requestOptions = { + allowRetries: allowRetry, + maxRetries: maxRetry }; - pattern = IS_WINDOWS ? pattern.replace(/\\/g, "/") : pattern; - this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions); + return new http_client_1.HttpClient("actions/oidc-client", [new auth_1.BearerCredentialHandler(_OidcClient.getRequestToken())], requestOptions); } - /** - * Matches the pattern against the specified path - */ - match(itemPath) { - if (this.segments[this.segments.length - 1] === "**") { - itemPath = pathHelper.normalizeSeparators(itemPath); - if (!itemPath.endsWith(path12.sep) && this.isImplicitPattern === false) { - itemPath = `${itemPath}${path12.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; + 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 internal_match_kind_1.MatchKind.None; + return token; } - /** - * 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); + 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 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, "[*]"); + return runtimeUrl; } - /** - * Normalizes slashes and ensures absolute root - */ - static fixupPattern(pattern, homedir) { - assert_1.default(pattern, "pattern cannot be empty"); - const literalSegments = new internal_path_1.Path(pattern).segments.map((x) => _Pattern.getLiteral(x)); - assert_1.default(literalSegments.every((x, i) => (x !== "." || i === 0) && x !== ".."), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`); - 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(`.${path12.sep}`)) { - pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); - } else if (pattern === "~" || pattern.startsWith(`~${path12.sep}`)) { - homedir = homedir || os3.homedir(); - assert_1.default(homedir, "Unable to determine HOME directory"); - assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); - pattern = _Pattern.globEscape(homedir) + 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 += "\\"; + static getCall(id_token_url) { + var _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value; + if (!id_token) { + throw new Error("Response json body do not have ID Token field"); } - pattern = _Pattern.globEscape(root) + pattern.substr(1); - } else { - pattern = pathHelper.ensureAbsoluteRoot(_Pattern.globEscape(process.cwd()), pattern); - } - return pathHelper.normalizeSeparators(pattern); + return id_token; + }); } - /** - * 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 set2 = ""; - let closed = -1; - for (let i2 = i + 1; i2 < segment.length; i2++) { - const c2 = segment[i2]; - if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { - set2 += segment[++i2]; - continue; - } else if (c2 === "]") { - closed = i2; - break; - } else { - set2 += c2; - } - } - if (closed >= 0) { - if (set2.length > 1) { - return ""; - } - if (set2) { - literal += set2; - i = closed; - continue; - } + 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}`); } - 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/cache/node_modules/@actions/glob/lib/internal-search-state.js -var require_internal_search_state = __commonJS({ - "node_modules/@actions/cache/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(path12, level) { - this.path = path12; - this.level = level; + }); } }; - exports2.SearchState = SearchState; + exports2.OidcClient = OidcClient; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js -var require_internal_globber = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/internal-globber.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js +var require_summary2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -30695,263 +30082,323 @@ var require_internal_globber = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - var __asyncValues4 = 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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); - }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); - }, reject); + 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 = ""; } - }; - var __await4 = exports2 && exports2.__await || function(v) { - return this instanceof __await4 ? (this.v = v, this) : new __await4(v); - }; - var __asyncGenerator4 = 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { - return this; - }, i; - function verb(n) { - if (g[n]) i[n] = function(v) { - return new Promise(function(a, b) { - q.push([n, v, a, b]) > 1 || resume(n, v); - }); - }; + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - function resume(n, v) { - try { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); + /** + * 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}`; } - function step(r) { - r.value instanceof __await4 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); + /** + * 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(); + }); } - function fulfill(value) { - resume("next", value); + /** + * 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 }); + }); } - function reject(value) { - resume("throw", value); + /** + * Returns the current summary buffer as a string + * + * @returns {string} string of summary buffer + */ + stringify() { + return this._buffer; } - function settle(f, v) { - if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); + /** + * If the summary buffer is empty + * + * @returns {boolen} true if the buffer is empty + */ + isEmptyBuffer() { + return this._buffer.length === 0; } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DefaultGlobber = void 0; - var core14 = __importStar4(require_core()); - var fs13 = __importStar4(require("fs")); - var globOptionsHelper = __importStar4(require_internal_glob_options_helper()); - var path12 = __importStar4(require("path")); - var patternHelper = __importStar4(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); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - getSearchPaths() { - return this.searchPaths.slice(); + /** + * 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; } - glob() { - var e_1, _a; - return __awaiter4(this, void 0, void 0, function* () { - const result = []; - try { - for (var _b = __asyncValues4(this.globGenerator()), _c; _c = yield _b.next(), !_c.done; ) { - const itemPath = _c.value; - result.push(itemPath); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b); - } finally { - if (e_1) throw e_1.error; - } - } - return result; - }); + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - globGenerator() { - return __asyncGenerator4(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)) { - core14.debug(`Search path '${searchPath}'`); - try { - yield __await4(fs13.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 match = patternHelper.match(patterns, item.path); - const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); - if (!match && !partialMatch) { - continue; - } - const stats = yield __await4( - _DefaultGlobber.stat(item, options, traversalChain) - // Broken symlink, or symlink cycle detected, or no longer exists - ); - if (!stats) { - continue; - } - if (stats.isDirectory()) { - if (match & internal_match_kind_1.MatchKind.Directory) { - yield yield __await4(item.path); - } else if (!partialMatch) { - continue; - } - const childLevel = item.level + 1; - const childItems = (yield __await4(fs13.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path12.join(item.path, x), childLevel)); - stack.push(...childItems.reverse()); - } else if (match & internal_match_kind_1.MatchKind.File) { - yield yield __await4(item.path); - } - } - }); + /** + * 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(); } /** - * Constructs a DefaultGlobber + * 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 */ - static create(patterns, options) { - return __awaiter4(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; - }); + 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(); } - static stat(item, options, traversalChain) { - return __awaiter4(this, void 0, void 0, function* () { - let stats; - if (options.followSymbolicLinks) { - try { - stats = yield fs13.promises.stat(item.path); - } catch (err) { - if (err.code === "ENOENT") { - if (options.omitBrokenSymbolicLinks) { - core14.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 fs13.promises.lstat(item.path); - } - if (stats.isDirectory() && options.followSymbolicLinks) { - const realPath = yield fs13.promises.realpath(item.path); - while (traversalChain.length >= item.level) { - traversalChain.pop(); - } - if (traversalChain.some((x) => x === realPath)) { - core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); - return void 0; + /** + * 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); } - traversalChain.push(realPath); - } - return stats; - }); + 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(); } }; - exports2.DefaultGlobber = DefaultGlobber; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js -var require_glob = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/glob/lib/glob.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js +var require_path_utils2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + 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]; + } }; } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.create = void 0; - var internal_globber_1 = require_internal_globber(); - function create(patterns, options) { - return __awaiter4(this, void 0, void 0, function* () { - return yield internal_globber_1.DefaultGlobber.create(patterns, options); - }); + exports2.toPlatformPath = exports2.toWin32Path = exports2.toPosixPath = void 0; + var path12 = __importStar2(require("path")); + function toPosixPath(pth) { + return pth.replace(/[\\]/g, "/"); } - exports2.create = create; + exports2.toPosixPath = toPosixPath; + function toWin32Path(pth) { + return pth.replace(/[/]/g, "\\"); + } + exports2.toWin32Path = toWin32Path; + function toPlatformPath(pth) { + return pth.replace(/[/\\]/g, path12.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js -var require_io_util3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io-util.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js +var require_io_util2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -30960,21 +30407,21 @@ var require_io_util3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -31004,14 +30451,14 @@ var require_io_util3 = __commonJS({ var _a; 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 fs13 = __importStar4(require("fs")); - var path12 = __importStar4(require("path")); + var fs13 = __importStar2(require("fs")); + var path12 = __importStar2(require("path")); _a = fs13.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs13.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -31025,7 +30472,7 @@ var require_io_util3 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -31043,7 +30490,7 @@ var require_io_util3 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -31120,11 +30567,11 @@ var require_io_util3 = __commonJS({ } }); -// node_modules/@actions/cache/node_modules/@actions/io/lib/io.js -var require_io3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/io/lib/io.js"(exports2) { +// node_modules/@actions/glob/node_modules/@actions/io/lib/io.js +var require_io2 = __commonJS({ + "node_modules/@actions/glob/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -31133,21 +30580,21 @@ var require_io3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -31177,10 +30624,10 @@ var require_io3 = __commonJS({ 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 path12 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util3()); + var path12 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util2()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -31207,7 +30654,7 @@ var require_io3 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -31228,7 +30675,7 @@ var require_io3 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -31248,14 +30695,14 @@ var require_io3 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -31279,7 +30726,7 @@ var require_io3 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -31327,7 +30774,7 @@ var require_io3 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -31347,7 +30794,7 @@ var require_io3 = __commonJS({ }); } function copyFile(srcFile, destFile, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) { try { yield ioUtil.lstat(destFile); @@ -31368,1200 +30815,1171 @@ var require_io3 = __commonJS({ } }); -// 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 + "}"); +// node_modules/@actions/glob/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner2 = __commonJS({ + "node_modules/@actions/glob/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); } - 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 = parse; - function parse(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; + __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(resolve6) { + resolve6(value); + }); } - try { - return new SemVer(version, options); - } catch (er) { - return null; + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 os3 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path12 = __importStar2(require("path")); + var io6 = __importStar2(require_io2()); + var ioUtil = __importStar2(require_io_util2()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - } - exports2.valid = valid3; - function valid3(version, options) { - var v = parse(version, options); - return v ? v.version : null; - } - exports2.clean = clean3; - function clean3(version, options) { - var s = parse(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 - }; + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - if (version instanceof SemVer) { - if (version.loose === options.loose) { - return version; + _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 { - version = version.version; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - } 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"); + return cmd; } - if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { - throw new TypeError("Invalid minor version"); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os3.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os3.EOL.length); + n = s.indexOf(os3.EOL); + } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; + } } - if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { - throw new TypeError("Invalid patch version"); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } + } + return this.toolPath; } - 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; + _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 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 this.args; } - 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); + _endsWith(str2, end) { + return str2.endsWith(end); } - 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; + _isCmdFile() { + const upperToolPath = this.toolPath.toUpperCase(); + return this._endsWith(upperToolPath, ".CMD") || this._endsWith(upperToolPath, ".BAT"); } - 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); + _windowsQuoteCmdArg(arg) { + if (!this._isCmdFile()) { + return this._uvQuoteCmdArg(arg); } - } 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); + if (!arg) { + return '""'; } - } 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++; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; } - 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]; + } + 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 { - 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]; - } + quoteHit = false; } - 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; + } + reverse += '"'; + return reverse.split("").reverse().join(""); } - } - exports2.diff = diff; - function diff(version1, version2) { - if (eq(version1, version2)) { - return null; - } else { - var v1 = parse(version1); - var v2 = parse(version2); - var prefix = ""; - if (v1.prerelease.length || v2.prerelease.length) { - prefix = "pre"; - var defaultResult = "prerelease"; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - for (var key in v1) { - if (key === "major" || key === "minor" || key === "patch") { - if (v1[key] !== v2[key]) { - return prefix + key; - } - } + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - return defaultResult; - } - } - exports2.compareIdentifiers = compareIdentifiers; - var numeric = /^[0-9]+$/; - function compareIdentifiers(a, b) { - var anum = numeric.test(a); - var bnum = numeric.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 = rcompare; - function rcompare(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 = lt; - function lt(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 = gte5; - function gte5(a, b, loose) { - return compare3(a, b, loose) >= 0; - } - exports2.lte = lte; - function lte(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 gte5(a, b, loose); - case "<": - return lt(a, b, loose); - case "<=": - return lte(a, b, loose); - default: - throw new TypeError("Invalid operator: " + op); + 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(""); } - } - exports2.Comparator = Comparator; - function Comparator(comp, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false + _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; } - if (comp instanceof Comparator) { - if (comp.loose === !!options.loose) { - return comp; - } else { - comp = comp.value; + _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; } - 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); + /** + * 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 = path12.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve6, 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) + os3.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 { + resolve6(exitCode); + } + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); + } + })); + }); } }; - 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; + exports2.ToolRunner = ToolRunner6; + function argStringToArray(argString) { + const args = []; + let inQuotes = false; + let escaped = false; + let arg = ""; + function append(c) { + if (escaped && c !== '"') { + arg += "\\"; } + arg += c; + escaped = 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"); + 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 (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; + if (arg.length > 0) { + args.push(arg.trim()); } - var rangeTmp; - if (this.operator === "") { - if (this.value === "") { - return true; + 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"); } - rangeTmp = new Range2(comp.value, options); - return satisfies2(this.value, rangeTmp, options); - } else if (comp.operator === "") { - if (comp.value === "") { - return true; + this.options = options; + this.toolPath = toolPath; + if (options.delay) { + this.delay = options.delay; } - 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(range, options) { - if (!options || typeof options !== "object") { - options = { - loose: !!options, - includePrerelease: false - }; } - if (range instanceof Range2) { - if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { - return range; - } else { - return new Range2(range.raw, options); + CheckComplete() { + if (this.done) { + return; + } + if (this.processClosed) { + this._setResult(); + } else if (this.processExited) { + this.timeout = timers_1.setTimeout(_ExecState.HandleTimeout, this.delay, this); } } - if (range instanceof Comparator) { - return new Range2(range.value, options); + _debug(message) { + this.emit("debug", message); } - if (!(this instanceof Range2)) { - return new Range2(range, options); + _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); } - this.options = options; - this.loose = !!options.loose; - this.includePrerelease = !!options.includePrerelease; - this.raw = range.trim().split(/\s+/).join(" "); - this.set = this.raw.split("||").map(function(range2) { - return this.parseRange(range2.trim()); - }, this).filter(function(c) { - return c.length; - }); - if (!this.set.length) { - throw new TypeError("Invalid SemVer Range: " + this.raw); + 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(); } - 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; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/exec/lib/exec.js +var require_exec2 = __commonJS({ + "node_modules/@actions/glob/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; }; - Range2.prototype.parseRange = function(range) { - var loose = this.options.loose; - var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; - range = range.replace(hr, hyphenReplace); - debug6("hyphen replace", range); - range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); - debug6("comparator trim", range, safeRe[t.COMPARATORTRIM]); - range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); - range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); - range = range.split(/\s+/).join(" "); - var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; - var set2 = range.split(" ").map(function(comp) { - return parseComparator(comp, this.options); - }, this).join(" ").split(/\s+/); - if (this.options.loose) { - set2 = set2.filter(function(comp) { - return !!comp.match(compRe); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); }); } - set2 = set2.map(function(comp) { - return new Comparator(comp, this.options); - }, this); - return set2; - }; - Range2.prototype.intersects = function(range, options) { - if (!(range instanceof Range2)) { - throw new TypeError("a Range is required"); - } - return this.set.some(function(thisComparators) { - return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { - return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { - return rangeComparators.every(function(rangeComparator) { - return thisComparator.intersects(rangeComparator, options); - }); - }); - }); + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - 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(range, options) { - return new Range2(range, 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(_, M, m, p, pr) { - debug6("tilde", comp, _, 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"; + 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 exec(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.`); } - debug6("tilde return", ret); - return ret; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); }); } - 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(_, M, m, p, pr) { - debug6("caret", comp, _, 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"; + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - } 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"; + }; + const stdOutListener = (data) => { + stdout += stdoutDecoder.write(data); + if (originalStdoutListener) { + originalStdoutListener(data); } - } - debug6("caret return", ret); - return ret; + }; + const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener }); + const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; }); } - 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; + exports2.getExecOutput = getExecOutput; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/platform.js +var require_platform2 = __commonJS({ + "node_modules/@actions/glob/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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - 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 step(result) { + result.done ? resolve6(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 exec = __importStar2(require_exec2()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true + }); + const { stdout: name } = yield exec.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 _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true + }); + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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 + }); }); } - 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; - } + exports2.getDetails = getDetails; + } +}); + +// node_modules/@actions/glob/node_modules/@actions/core/lib/core.js +var require_core2 = __commonJS({ + "node_modules/@actions/glob/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]; + } }; } - for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version, this.options)) { - return true; - } + 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); } - return false; + __setModuleDefault2(result, mod); + return result; }; - function testSet(set2, version, options) { - for (var i2 = 0; i2 < set2.length; i2++) { - if (!set2[i2].test(version)) { - return false; - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - if (version.prerelease.length && !options.includePrerelease) { - for (i2 = 0; i2 < set2.length; i2++) { - debug6(set2[i2].semver); - if (set2[i2].semver === ANY) { - continue; + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - if (set2[i2].semver.prerelease.length > 0) { - var allowed = set2[i2].semver; - if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { - return true; - } + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - return false; + function step(result) { + result.done ? resolve6(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_utils5(); + var os3 = __importStar2(require("os")); + var path12 = __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 exportVariable6(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)); } - return true; + (0, command_1.issueCommand)("set-env", { name }, convertedVal); } - exports2.satisfies = satisfies2; - function satisfies2(version, range, options) { - try { - range = new Range2(range, options); - } catch (er) { - return false; + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - return range.test(version); + process.env["PATH"] = `${inputPath}${path12.delimiter}${process.env["PATH"]}`; } - exports2.maxSatisfying = maxSatisfying; - function maxSatisfying(versions, range, options) { - var max = null; - var maxSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.addPath = addPath; + 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}`); } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!max || maxSV.compare(v) === -1) { - max = v; - maxSV = new SemVer(max, options); - } - } - }); - return max; + if (options && options.trimWhitespace === false) { + return val; + } + return val.trim(); } - exports2.minSatisfying = minSatisfying; - function minSatisfying(versions, range, options) { - var min = null; - var minSV = null; - try { - var rangeObj = new Range2(range, options); - } catch (er) { - return null; + exports2.getInput = getInput2; + function getMultilineInput(name, options) { + const inputs = getInput2(name, options).split("\n").filter((x) => x !== ""); + if (options && options.trimWhitespace === false) { + return inputs; } - versions.forEach(function(v) { - if (rangeObj.test(v)) { - if (!min || minSV.compare(v) === 1) { - min = v; - minSV = new SemVer(min, options); - } - } - }); - return min; + return inputs.map((input) => input.trim()); } - exports2.minVersion = minVersion; - function minVersion(range, loose) { - range = new Range2(range, loose); - var minver = new SemVer("0.0.0"); - if (range.test(minver)) { - return minver; + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - minver = new SemVer("0.0.0-0"); - if (range.test(minver)) { - return minver; - } - minver = null; - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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 && range.test(minver)) { - return minver; - } - return null; + process.stdout.write(os3.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); } - exports2.validRange = validRange; - function validRange(range, options) { - try { - return new Range2(range, options).range || "*"; - } catch (er) { - return null; + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + 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 warning10(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning10; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os3.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); + } + return result; + }); + } + exports2.group = group; + function saveState2(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.ltr = ltr; - function ltr(version, range, options) { - return outside(version, range, "<", options); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - exports2.gtr = gtr; - function gtr(version, range, options) { - return outside(version, range, ">", options); + exports2.getState = getState2; + function getIDToken(aud) { + return __awaiter2(this, void 0, void 0, function* () { + return yield oidc_utils_1.OidcClient.getIDToken(aud); + }); } - exports2.outside = outside; - function outside(version, range, hilo, options) { - version = new SemVer(version, options); - range = new Range2(range, options); - var gtfn, ltefn, ltfn, comp, ecomp; - switch (hilo) { - case ">": - gtfn = gt; - ltefn = lte; - ltfn = lt; - comp = ">"; - ecomp = ">="; - break; - case "<": - gtfn = lt; - ltefn = gte5; - ltfn = gt; - comp = "<"; - ecomp = "<="; - break; - default: - throw new TypeError('Must provide a hilo val of "<" or ">"'); + 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/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]; + } }; } - if (satisfies2(version, range, options)) { - return false; + 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); } - for (var i2 = 0; i2 < range.set.length; ++i2) { - var comparators = range.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; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.getOptions = void 0; + var core14 = __importStar2(require_core2()); + 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; + core14.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`); } - if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) { - return false; - } else if (low.operator === ecomp && ltfn(version, low.semver)) { - return false; + if (typeof copy.implicitDescendants === "boolean") { + result.implicitDescendants = copy.implicitDescendants; + core14.debug(`implicitDescendants '${result.implicitDescendants}'`); + } + if (typeof copy.matchDirectories === "boolean") { + result.matchDirectories = copy.matchDirectories; + core14.debug(`matchDirectories '${result.matchDirectories}'`); + } + if (typeof copy.omitBrokenSymbolicLinks === "boolean") { + result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks; + core14.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`); + } + if (typeof copy.excludeHiddenFiles === "boolean") { + result.excludeHiddenFiles = copy.excludeHiddenFiles; + core14.debug(`excludeHiddenFiles '${result.excludeHiddenFiles}'`); } } - return true; - } - exports2.prerelease = prerelease; - function prerelease(version, options) { - var parsed = parse(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); + return result; } - exports2.coerce = coerce3; - function coerce3(version, options) { - if (version instanceof SemVer) { - return version; + exports2.getOptions = getOptions; + } +}); + +// 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]; + } }; } - if (typeof version === "number") { - version = String(version); + 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); } - if (typeof version !== "string") { - return null; + __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.safeTrimTrailingSeparator = exports2.normalizeSeparators = exports2.hasRoot = exports2.hasAbsoluteRoot = exports2.ensureAbsoluteRoot = exports2.dirname = void 0; + var path12 = __importStar2(require("path")); + var assert_1 = __importDefault2(require("assert")); + var IS_WINDOWS = process.platform === "win32"; + function dirname3(p) { + p = safeTrimTrailingSeparator(p); + if (IS_WINDOWS && /^\\\\[^\\]+(\\[^\\]+)?$/.test(p)) { + return p; } - options = options || {}; - var match = null; - if (!options.rtl) { - match = version.match(safeRe[t.COERCE]); - } else { - var next; - while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { - if (!match || next.index + next[0].length !== match.index + match[0].length) { - match = next; + let result = path12.dirname(p); + if (IS_WINDOWS && /^\\\\[^\\]+\\[^\\]+\\$/.test(result)) { + result = safeTrimTrailingSeparator(result); + } + return result; + } + exports2.dirname = dirname3; + 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)}`; } - safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; + } 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)}`; } - safeRe[t.COERCERTL].lastIndex = -1; } - if (match === null) { - return null; + (0, assert_1.default)(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`); + if (root.endsWith("/") || IS_WINDOWS && root.endsWith("\\")) { + } else { + root += path12.sep; } - return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); + return root + itemPath; + } + exports2.ensureAbsoluteRoot = ensureAbsoluteRoot; + 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("/"); + } + exports2.hasAbsoluteRoot = hasAbsoluteRoot; + 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("/"); + } + exports2.hasRoot = hasRoot; + 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, "/"); + } + exports2.normalizeSeparators = normalizeSeparators; + function safeTrimTrailingSeparator(p) { + if (!p) { + return ""; + } + p = normalizeSeparators(p); + if (!p.endsWith(path12.sep)) { + return p; + } + if (p === path12.sep) { + return p; + } + if (IS_WINDOWS && /^[A-Z]:\\$/i.test(p)) { + return p; + } + return p.substr(0, p.length - 1); } + exports2.safeTrimTrailingSeparator = safeTrimTrailingSeparator; } }); -// node_modules/@actions/cache/lib/internal/constants.js -var require_constants7 = __commonJS({ - "node_modules/@actions/cache/lib/internal/constants.js"(exports2) { +// 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.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.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/cache/lib/internal/cacheUtils.js -var require_cacheUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheUtils.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -32574,313 +31992,871 @@ var require_cacheUtils = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.partialMatch = exports2.match = exports2.getSearchPaths = void 0; + 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"; } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + const result = []; + for (const pattern of patterns) { + const key = IS_WINDOWS ? pattern.searchPath.toUpperCase() : pattern.searchPath; + if (searchPathMap[key] === "included") { + continue; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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); } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + if (!foundAncestor) { + result.push(pattern.searchPath); + searchPathMap[key] = "included"; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - var __asyncValues4 = 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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); - }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); - }, reject); } - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getRuntimeToken = exports2.getCacheVersion = exports2.assertDefined = exports2.getGnuTarPathOnWindows = exports2.getCacheFileName = exports2.getCompressionMethod = exports2.unlinkFile = exports2.resolvePaths = exports2.getArchiveFileSizeInBytes = exports2.createTempDirectory = void 0; - var core14 = __importStar4(require_core()); - var exec2 = __importStar4(require_exec()); - var glob = __importStar4(require_glob()); - var io6 = __importStar4(require_io3()); - var crypto = __importStar4(require("crypto")); - var fs13 = __importStar4(require("fs")); - var path12 = __importStar4(require("path")); - var semver8 = __importStar4(require_semver3()); - var util = __importStar4(require("util")); - var constants_1 = require_constants7(); - var versionSalt = "1.0"; - function createTempDirectory() { - return __awaiter4(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 = path12.join(baseLocation, "actions", "temp"); + return result; + } + exports2.getSearchPaths = getSearchPaths; + function match(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); } - const dest = path12.join(tempDirectory, crypto.randomUUID()); - yield io6.mkdirP(dest); - return dest; - }); + } + return result; } - exports2.createTempDirectory = createTempDirectory; - function getArchiveFileSizeInBytes(filePath) { - return fs13.statSync(filePath).size; + exports2.match = match; + function partialMatch(patterns, itemPath) { + return patterns.some((x) => !x.negate && x.partialMatch(itemPath)); } - exports2.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes; - function resolvePaths(patterns) { - var _a, e_1, _b, _c; - var _d; - return __awaiter4(this, void 0, void 0, function* () { - const paths = []; - const workspace = (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); - const globber = yield glob.create(patterns.join("\n"), { - implicitDescendants: false - }); - try { - for (var _e = true, _f = __asyncValues4(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { - _c = _g.value; - _e = false; - const file = _c; - const relativeFile = path12.relative(workspace, file).replace(new RegExp(`\\${path12.sep}`, "g"), "/"); - core14.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 && !_a && (_b = _f.return)) yield _b.call(_f); - } finally { - if (e_1) throw e_1.error; - } - } - return paths; - }); + exports2.partialMatch = partialMatch; + } +}); + +// 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 (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; + }; + var isArray = 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 = balanced; + function balanced(a, b, str2) { + if (a instanceof RegExp) a = maybeMatch(a, str2); + if (b instanceof RegExp) b = maybeMatch(b, str2); + var r = range(a, b, str2); + return r && { + start: r[0], + end: r[1], + pre: str2.slice(0, r[0]), + body: str2.slice(r[0] + a.length, r[1]), + post: str2.slice(r[1] + b.length) + }; } - exports2.resolvePaths = resolvePaths; - function unlinkFile(filePath) { - return __awaiter4(this, void 0, void 0, function* () { - return util.promisify(fs13.unlink)(filePath); - }); + function maybeMatch(reg, str2) { + var m = str2.match(reg); + return m ? m[0] : null; } - exports2.unlinkFile = unlinkFile; - function getVersion(app, additionalArgs = []) { - return __awaiter4(this, void 0, void 0, function* () { - let versionOutput = ""; - additionalArgs.push("--version"); - core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); - try { - yield exec2.exec(`${app}`, additionalArgs, { - ignoreReturnCode: true, - silent: true, - listeners: { - stdout: (data) => versionOutput += data.toString(), - stderr: (data) => versionOutput += data.toString() + balanced.range = range; + function range(a, b, str2) { + var begs, beg, left, right, result; + var ai = str2.indexOf(a); + var bi = str2.indexOf(b, ai + 1); + var i = ai; + if (ai >= 0 && bi > 0) { + begs = []; + left = str2.length; + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str2.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [begs.pop(), bi]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; } - }); - } catch (err) { - core14.debug(err.message); + bi = str2.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; } - versionOutput = versionOutput.trim(); - core14.debug(versionOutput); - return versionOutput; - }); - } - function getCompressionMethod() { - return __awaiter4(this, void 0, void 0, function* () { - const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version = semver8.clean(versionOutput); - core14.debug(`zstd version: ${version}`); - if (versionOutput === "") { - return constants_1.CompressionMethod.Gzip; - } else { - return constants_1.CompressionMethod.ZstdWithoutLong; + if (begs.length) { + result = [left, right]; } - }); + } + return result; } - exports2.getCompressionMethod = getCompressionMethod; - function getCacheFileName(compressionMethod) { - return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; + } +}); + +// 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 balanced = require_balanced_match(); + module2.exports = expandTop; + 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"; + function numeric(str2) { + return parseInt(str2, 10) == str2 ? parseInt(str2, 10) : str2.charCodeAt(0); } - exports2.getCacheFileName = getCacheFileName; - function getGnuTarPathOnWindows() { - return __awaiter4(this, void 0, void 0, function* () { - if (fs13.existsSync(constants_1.GnuTarPathOnWindows)) { - return constants_1.GnuTarPathOnWindows; - } - const versionOutput = yield getVersion("tar"); - return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; - }); + function escapeBraces(str2) { + return str2.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod); } - exports2.getGnuTarPathOnWindows = getGnuTarPathOnWindows; - function assertDefined(name, value) { - if (value === void 0) { - throw Error(`Expected ${name} but value was undefiend`); - } - return value; + function unescapeBraces(str2) { + return str2.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join("."); } - exports2.assertDefined = assertDefined; - function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { - const components = paths.slice(); - if (compressionMethod) { - components.push(compressionMethod); - } - if (process.platform === "win32" && !enableCrossOsArchive) { - components.push("windows-only"); + function parseCommaParts(str2) { + if (!str2) + return [""]; + var parts = []; + var m = balanced("{", "}", str2); + if (!m) + return str2.split(","); + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(","); + p[p.length - 1] += "{" + body + "}"; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); } - components.push(versionSalt); - return crypto.createHash("sha256").update(components.join("|")).digest("hex"); + parts.push.apply(parts, p); + return parts; } - exports2.getCacheVersion = getCacheVersion; - function getRuntimeToken() { - const token = process.env["ACTIONS_RUNTIME_TOKEN"]; - if (!token) { - throw new Error("Unable to get the ACTIONS_RUNTIME_TOKEN env variable"); + function expandTop(str2) { + if (!str2) + return []; + if (str2.substr(0, 2) === "{}") { + str2 = "\\{\\}" + str2.substr(2); } - return token; + return expand(escapeBraces(str2), true).map(unescapeBraces); } - exports2.getRuntimeToken = getRuntimeToken; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy3 = __commonJS({ - "node_modules/@actions/cache/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; + function embrace(str2) { + return "{" + str2 + "}"; + } + function isPadded(el) { + return /^-?0\d/.test(el); + } + function lte(i, y) { + return i <= y; + } + function gte6(i, y) { + return i >= y; + } + function expand(str2, isTop) { + var expansions = []; + var m = balanced("{", "}", str2); + if (!m || /\$$/.test(m.pre)) return [str2]; + 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(/,(?!,).*\}/)) { + str2 = m.pre + "{" + m.body + escClose + m.post; + return expand(str2); + } + return [str2]; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length ? expand(m.post, false) : [""]; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + } + var pre = m.pre; + var post = m.post.length ? expand(m.post, false) : [""]; + var N; + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte6; + } + var pad = n.some(isPadded); + N = []; + for (var i = x; test(i, y); 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; + } + } + } + N.push(c); } } else { - return void 0; + N = concatMap(n, function(el) { + return expand(el, false); + }); + } + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } } + return expansions; } - exports2.getProxyUrl = getProxyUrl; - function checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + } +}); + +// node_modules/minimatch/minimatch.js +var require_minimatch = __commonJS({ + "node_modules/minimatch/minimatch.js"(exports2, module2) { + module2.exports = minimatch; + minimatch.Minimatch = Minimatch; + var path12 = (function() { + try { + return require("path"); + } catch (e) { } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + })() || { + sep: "/" + }; + minimatch.sep = path12.sep; + var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}; + var expand = require_brace_expansion(); + var plTypes = { + "!": { open: "(?:(?!(?:", close: "))[^/]*?)" }, + "?": { open: "(?:", close: ")?" }, + "+": { open: "(?:", close: ")+" }, + "*": { open: "(?:", close: ")*" }, + "@": { open: "(?:", close: ")" } + }; + var qmark = "[^/]"; + var star = qmark + "*?"; + var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?"; + var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?"; + var reSpecials = charSet("().*{}+?[]^$\\!"); + function charSet(s) { + return s.split("").reduce(function(set2, c) { + set2[c] = true; + return set2; + }, {}); + } + var slashSplit = /\/+/; + minimatch.filter = filter; + function filter(pattern, options) { + options = options || {}; + return function(p, i, list) { + return minimatch(p, pattern, options); + }; + } + function ext(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; + } + minimatch.defaults = function(def) { + if (!def || typeof def !== "object" || !Object.keys(def).length) { + return minimatch; } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { + var orig = minimatch; + var m = function minimatch2(p, pattern, options) { + return orig(p, pattern, ext(def, options)); + }; + m.Minimatch = function Minimatch2(pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)); + }; + m.Minimatch.defaults = function defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + }; + m.filter = function filter2(pattern, options) { + return orig.filter(pattern, ext(def, options)); + }; + m.defaults = function defaults(options) { + return orig.defaults(ext(def, options)); + }; + m.makeRe = function makeRe2(pattern, options) { + return orig.makeRe(pattern, ext(def, options)); + }; + m.braceExpand = function braceExpand2(pattern, options) { + return orig.braceExpand(pattern, ext(def, options)); + }; + m.match = function(list, pattern, options) { + return orig.match(list, pattern, ext(def, options)); + }; + return m; + }; + Minimatch.defaults = function(def) { + return minimatch.defaults(def).Minimatch; + }; + function minimatch(p, pattern, options) { + assertValidPattern(pattern); + if (!options) options = {}; + if (!options.nocomment && pattern.charAt(0) === "#") { 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}`); + return new Minimatch(pattern, options).match(p); + } + function Minimatch(pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options); } - 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; - } + assertValidPattern(pattern); + if (!options) options = {}; + pattern = pattern.trim(); + if (!options.allowWindowsEscape && path12.sep !== "/") { + pattern = pattern.split(path12.sep).join("/"); } - 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]"); + this.options = options; + this.set = []; + this.pattern = pattern; + this.regexp = null; + this.negate = false; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.make(); } - var DecodedURL = class extends URL { - constructor(url2, base) { - super(url2, base); - this._decodedUsername = decodeURIComponent(super.username); - this._decodedPassword = decodeURIComponent(super.password); + Minimatch.prototype.debug = function() { + }; + Minimatch.prototype.make = make; + function make() { + var pattern = this.pattern; + var options = this.options; + if (!options.nocomment && pattern.charAt(0) === "#") { + this.comment = true; + return; } - get username() { - return this._decodedUsername; + if (!pattern) { + this.empty = true; + return; } - get password() { - return this._decodedPassword; + this.parseNegate(); + var set2 = this.globSet = this.braceExpand(); + if (options.debug) this.debug = function debug6() { + console.error.apply(console, arguments); + }; + this.debug(this.pattern, set2); + set2 = this.globParts = set2.map(function(s) { + return s.split(slashSplit); + }); + this.debug(this.pattern, set2); + set2 = set2.map(function(s, si, set3) { + return s.map(this.parse, this); + }, this); + this.debug(this.pattern, set2); + set2 = set2.filter(function(s) { + return s.indexOf(false) === -1; + }); + this.debug(this.pattern, set2); + this.set = set2; + } + Minimatch.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; + } + minimatch.braceExpand = function(pattern, options) { + return braceExpand(pattern, options); }; - } -}); - -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js -var require_lib3 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/index.js"(exports2) { + Minimatch.prototype.braceExpand = braceExpand; + function braceExpand(pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options; + } else { + options = {}; + } + } + pattern = typeof pattern === "undefined" ? this.pattern : pattern; + assertValidPattern(pattern); + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + return [pattern]; + } + return expand(pattern); + } + var MAX_PATTERN_LENGTH = 1024 * 64; + var assertValidPattern = function(pattern) { + if (typeof pattern !== "string") { + throw new TypeError("invalid pattern"); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError("pattern is too long"); + } + }; + Minimatch.prototype.parse = parse; + var SUBPARSE = {}; + function parse(pattern, isSub) { + assertValidPattern(pattern); + var options = this.options; + if (pattern === "**") { + if (!options.noglobstar) + return GLOBSTAR; + 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 += star; + hasMagic = true; + break; + case "?": + re += qmark; + 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 && reSpecials[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; + } + 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 (reSpecials[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(_, $1, $2) { + if (!$2) { + $2 = "\\"; + } + return $1 + $1 + $2 + "|"; + }); + this.debug("tail=%j\n %s", tail, tail, pl, re); + var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type; + hasMagic = true; + re = re.slice(0, pl.reStart) + t + "\\(" + tail; + } + clearStateChar(); + if (escaping) { + re += "\\\\"; + } + var addPatternStart = false; + switch (re.charAt(0)) { + case "[": + case ".": + case "(": + addPatternStart = 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 (addPatternStart) { + 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; + } + minimatch.makeRe = function(pattern, options) { + return new Minimatch(pattern, options || {}).makeRe(); + }; + Minimatch.prototype.makeRe = makeRe; + function makeRe() { + if (this.regexp || this.regexp === false) return this.regexp; + var set2 = this.set; + if (!set2.length) { + this.regexp = false; + return this.regexp; + } + var options = this.options; + var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot; + var flags = options.nocase ? "i" : ""; + var re = set2.map(function(pattern) { + return pattern.map(function(p) { + return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(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; + } + minimatch.match = function(list, pattern, options) { + options = options || {}; + var mm = new Minimatch(pattern, options); + list = list.filter(function(f) { + return mm.match(f); + }); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; + }; + Minimatch.prototype.match = function match(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 (path12.sep !== "/") { + f = f.split(path12.sep).join("/"); + } + f = f.split(slashSplit); + this.debug(this.pattern, "split", f); + var set2 = this.set; + this.debug(this.pattern, "set", set2); + var filename; + var i; + for (i = f.length - 1; i >= 0; i--) { + filename = f[i]; + if (filename) break; + } + for (i = 0; i < set2.length; i++) { + var pattern = set2[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; + }; + Minimatch.prototype.matchOne = function(file, pattern, partial) { + var options = this.options; + this.debug( + "matchOne", + { "this": this, file, pattern } + ); + this.debug("matchOne", file.length, pattern.length); + for (var fi = 0, pi = 0, 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) return false; + if (p === GLOBSTAR) { + this.debug("GLOBSTAR", [pattern, p, f]); + var fr = fi; + var pr = pi + 1; + if (pr === pl) { + this.debug("** at the end"); + for (; fi < fl; fi++) { + if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".") return false; + } + return true; + } + while (fr < fl) { + var swallowee = file[fr]; + this.debug("\nglobstar while", file, fr, pattern, pr, swallowee); + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug("globstar found match!", fr, fl, swallowee); + return true; + } else { + if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") { + this.debug("dot detected!", file, fr, pattern, pr); + break; + } + this.debug("globstar swallow a segment, and continue"); + fr++; + } + } + if (partial) { + this.debug("\n>>> no match, partial?", file, fr, pattern, pr); + if (fr === fl) return true; + } + 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 regExpEscape(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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -32893,613 +32869,615 @@ var require_lib3 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + 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 path12 = __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(path12.sep); + } else { + let remaining = itemPath; + let dir = pathHelper.dirname(remaining); + while (dir !== remaining) { + const basename = path12.basename(remaining); + this.segments.unshift(basename); + remaining = dir; + dir = pathHelper.dirname(remaining); + } + this.segments.unshift(remaining); } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + } 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(path12.sep), `Parameter 'itemPath' contains unexpected path separators`); + this.segments.push(segment); + } } } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + /** + * Converts the path to it's string representation + */ + toString() { + let result = this.segments[0]; + let skipSlash = result.endsWith(path12.sep) || IS_WINDOWS && /^[A-Z]:$/i.test(result); + for (let i = 1; i < this.segments.length; i++) { + if (skipSlash) { + skipSlash = false; + } else { + result += path12.sep; + } + result += this.segments[i]; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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 || 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.HttpClient = exports2.isHttps = exports2.HttpClientResponse = exports2.HttpClientError = exports2.getProxyUrl = exports2.MediaTypes = exports2.Headers = exports2.HttpCodes = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy3()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(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", () => { - resolve6(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve6(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(userAgent, 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 = userAgent; - 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; + exports2.Pattern = void 0; + var os3 = __importStar2(require("os")); + var path12 = __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, homedir) { + 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}`; } } - } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + while (pattern.startsWith("!")) { + this.negate = !this.negate; + pattern = pattern.substr(1).trim(); + } + pattern = _Pattern.fixupPattern(pattern, homedir); + this.segments = new internal_path_1.Path(pattern).segments; + this.trailingSeparator = pathHelper.normalizeSeparators(pattern).endsWith(path12.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); } /** - * Gets a typed object from an endpoint - * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise + * Matches the pattern against the specified path */ - getJson(requestUrl, additionalHeaders = {}) { - return __awaiter4(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 __awaiter4(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); - }); + match(itemPath) { + if (this.segments[this.segments.length - 1] === "**") { + itemPath = pathHelper.normalizeSeparators(itemPath); + if (!itemPath.endsWith(path12.sep) && this.isImplicitPattern === false) { + itemPath = `${itemPath}${path12.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; } - putJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * 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); } - patchJson(requestUrl, obj, additionalHeaders = {}) { - return __awaiter4(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); - }); + /** + * Escapes glob patterns within a path + */ + static globEscape(s) { + return (IS_WINDOWS ? s : s.replace(/\\/g, "\\\\")).replace(/(\[)(?=[^/]+\])/g, "[[]").replace(/\?/g, "[?]").replace(/\*/g, "[*]"); } /** - * Makes a raw http request. - * All other methods such as get, post, patch, and request ultimately call this. - * Prefer get, del, post and patch + * Normalizes slashes and ensures absolute root */ - request(verb, requestUrl, data, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + static fixupPattern(pattern, homedir) { + (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(`.${path12.sep}`)) { + pattern = _Pattern.globEscape(process.cwd()) + pattern.substr(1); + } else if (pattern === "~" || pattern.startsWith(`~${path12.sep}`)) { + homedir = homedir || os3.homedir(); + (0, assert_1.default)(homedir, "Unable to determine HOME directory"); + (0, assert_1.default)(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`); + pattern = _Pattern.globEscape(homedir) + 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 += "\\"; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, data); + 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 set2 = ""; + let closed = -1; + for (let i2 = i + 1; i2 < segment.length; i2++) { + const c2 = segment[i2]; + if (c2 === "\\" && !IS_WINDOWS && i2 + 1 < segment.length) { + set2 += segment[++i2]; + continue; + } else if (c2 === "]") { + closed = i2; + break; } else { - return response; + set2 += c2; } } - 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."); + if (closed >= 0) { + if (set2.length > 1) { + return ""; } - yield response.readBody(); - if (parsedRedirectUrl.hostname !== parsedUrl.hostname) { - for (const header in headers) { - if (header.toLowerCase() === "authorization") { - delete headers[header]; - } - } + if (set2) { + literal += set2; + i = closed; + continue; } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + } + literal += c; } - this._disposed = true; + return literal; } /** - * Raw request. - * @param info - * @param data + * Escapes regexp special characters + * https://javascript.info/regexp-escaping */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve6(res); - } - } - this.requestRawWithCallback(info6, data, callbackForResult); - }); + 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(path12, level) { + this.path = path12; + 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 || 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(resolve6) { + resolve6(value); }); } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - const req = info6.httpModule.request(info6.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(); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - handleResult(new Error(`Request timeout: ${info6.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(); + function step(result) { + result.done ? resolve6(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(resolve6, reject) { + v = o[n](v), settle(resolve6, reject, v.done, v.value); + }); + }; } - /** - * 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); + function settle(resolve6, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve6({ value: v2, done: d }); + }, reject); } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } - } - return info6; + }; + 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 = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { + return this; + }, i; + function verb(n) { + if (g[n]) i[n] = function(v) { + return new Promise(function(a, b) { + q.push([n, v, a, b]) > 1 || resume(n, v); + }); + }; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + function resume(n, v) { + try { + step(g[n](v)); + } catch (e) { + settle(q[0][3], e); } - return lowercaseKeys(headers || {}); } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; - } - return additionalHeaders[header] || clientHeader || _default2; + function step(r) { + r.value instanceof __await2 ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - _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 https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + function fulfill(value) { + resume("next", value); } - _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; + function reject(value) { + resume("throw", value); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); + 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 core14 = __importStar2(require_core2()); + var fs13 = __importStar2(require("fs")); + var globOptionsHelper = __importStar2(require_internal_glob_options_helper()); + var path12 = __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() { + var _a, e_1, _b, _c; + return __awaiter2(this, void 0, void 0, function* () { + const result = []; + try { + for (var _d = true, _e = __asyncValues2(this.globGenerator()), _f; _f = yield _e.next(), _a = _f.done, !_a; _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 && !_a && (_b = _e.return)) yield _b.call(_e); + } finally { + if (e_1) throw e_1.error; + } + } + return result; }); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve6(response); + 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("**"))); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; - } + } + const stack = []; + for (const searchPath of patternHelper.getSearchPaths(patterns)) { + core14.debug(`Search path '${searchPath}'`); + try { + yield __await2(fs13.promises.lstat(searchPath)); + } catch (err) { + if (err.code === "ENOENT") { + continue; } - return value; + throw err; } - let obj; - let contents; + stack.unshift(new internal_search_state_1.SearchState(searchPath, 1)); + } + const traversalChain = []; + while (stack.length) { + const item = stack.pop(); + const match = patternHelper.match(patterns, item.path); + const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path); + if (!match && !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 && path12.basename(item.path).match(/^\./)) { + continue; + } + if (stats.isDirectory()) { + if (match & 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(fs13.promises.readdir(item.path))).map((x) => new internal_search_state_1.SearchState(path12.join(item.path, x), childLevel)); + stack.push(...childItems.reverse()); + } else if (match & 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 { - contents = yield res.readBody(); - if (contents && contents.length > 0) { - if (options && options.deserializeDates) { - obj = JSON.parse(contents, dateTimeDeserializer); - } else { - obj = JSON.parse(contents); + stats = yield fs13.promises.stat(item.path); + } catch (err) { + if (err.code === "ENOENT") { + if (options.omitBrokenSymbolicLinks) { + core14.debug(`Broken symlink '${item.path}'`); + return void 0; } - response.result = obj; + throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`); } - response.headers = res.message.headers; - } catch (err) { + throw 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 { - resolve6(response); + } else { + stats = yield fs13.promises.lstat(item.path); + } + if (stats.isDirectory() && options.followSymbolicLinks) { + const realPath = yield fs13.promises.realpath(item.path); + while (traversalChain.length >= item.level) { + traversalChain.pop(); } - })); + if (traversalChain.some((x) => x === realPath)) { + core14.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`); + return void 0; + } + traversalChain.push(realPath); + } + return stats; }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.DefaultGlobber = DefaultGlobber; } }); -// node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js -var require_auth2 = __commonJS({ - "node_modules/@actions/cache/node_modules/@actions/http-client/lib/auth.js"(exports2) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -33526,4390 +33504,3087 @@ var require_auth2 = __commonJS({ 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; + 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(resolve6, reject) { + v = o[n](v), settle(resolve6, reject, v.done, v.value); + }); + }; } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); + function settle(resolve6, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve6({ value: v2, done: d }); + }, reject); } }; - 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"); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = void 0; + var crypto2 = __importStar2(require("crypto")); + var core14 = __importStar2(require_core2()); + var fs13 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var path12 = __importStar2(require("path")); + function hashFiles(globber, currentWorkspace, verbose = false) { + var _a, e_1, _b, _c; + var _d; + return __awaiter2(this, void 0, void 0, function* () { + const writeDelegate = verbose ? core14.info : core14.debug; + let hasMatch = false; + const githubWorkspace = currentWorkspace ? currentWorkspace : (_d = process.env["GITHUB_WORKSPACE"]) !== null && _d !== void 0 ? _d : process.cwd(); + const result = crypto2.createHash("sha256"); + let count = 0; + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + writeDelegate(file); + if (!file.startsWith(`${githubWorkspace}${path12.sep}`)) { + writeDelegate(`Ignore '${file}' since it is not under GITHUB_WORKSPACE.`); + continue; + } + if (fs13.statSync(file).isDirectory()) { + writeDelegate(`Skip directory '${file}'.`); + continue; + } + const hash2 = crypto2.createHash("sha256"); + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(fs13.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 && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; + } } - options.headers["Authorization"] = `Bearer ${this.token}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(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"); + result.end(); + if (hasMatch) { + writeDelegate(`Found ${count} files to hash.`); + return result.digest("hex"); + } else { + writeDelegate(`No matches found for glob`); + return ""; } - options.headers["Authorization"] = `Basic ${Buffer.from(`PAT:${this.token}`).toString("base64")}`; - } - // This handler cannot handle 401 - canHandleAuthentication() { - return false; - } - handleAuthentication() { - return __awaiter4(this, void 0, void 0, function* () { - throw new Error("not implemented"); - }); - } - }; - exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; + }); + } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js -var require_pipeline = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipeline.js"(exports2) { +// node_modules/@actions/glob/lib/glob.js +var require_glob = __commonJS({ + "node_modules/@actions/glob/lib/glob.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 { - constructor(policies) { - var _a; - this._policies = []; - this._policies = (_a = policies === null || policies === void 0 ? void 0 : policies.slice(0)) !== null && _a !== void 0 ? _a : []; - this._orderedPolicies = void 0; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - addPolicy(policy, options = {}) { - if (options.phase && options.afterPhase) { - throw new Error("Policies inside a phase cannot specify afterPhase."); + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - if (options.phase && !ValidPhaseNames.has(options.phase)) { - throw new Error(`Invalid phase name: ${options.phase}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { - throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } - 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, request) { - const policies = this.getOrderedPolicies(); - const pipeline = policies.reduceRight((next, policy) => { - return (req) => { - return policy.sendRequest(req, next); - }; - }, (req) => httpClient.sendRequest(req)); - return pipeline(request); - } - 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; - } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - function createEmptyPipeline() { - return HttpPipeline.create(); + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.hashFiles = exports2.create = void 0; + var internal_globber_1 = require_internal_globber(); + var internal_hash_files_1 = require_internal_hash_files(); + function create(patterns, options) { + return __awaiter2(this, void 0, void 0, function* () { + return yield internal_globber_1.DefaultGlobber.create(patterns, options); + }); + } + exports2.create = create; + function hashFiles(patterns, currentWorkspace = "", options, verbose = false) { + return __awaiter2(this, void 0, void 0, function* () { + let followSymbolicLinks = true; + if (options && typeof options.followSymbolicLinks === "boolean") { + followSymbolicLinks = options.followSymbolicLinks; + } + const globber = yield create(patterns, { followSymbolicLinks }); + return (0, internal_hash_files_1.hashFiles)(globber, currentWorkspace, verbose); + }); } + exports2.hashFiles = hashFiles; } }); -// node_modules/@azure/logger/dist/index.js -var require_dist = __commonJS({ - "node_modules/@azure/logger/dist/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - var os3 = require("os"); - var util = require("util"); - function _interopDefaultLegacy(e) { - return e && typeof e === "object" && "default" in e ? e : { "default": e }; - } - var util__default = /* @__PURE__ */ _interopDefaultLegacy(util); - function log(message, ...args) { - process.stderr.write(`${util__default["default"].format(message, ...args)}${os3.EOL}`); +// 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() { + }; } - var debugEnvVariable = typeof process !== "undefined" && process.env && process.env.DEBUG || void 0; - var enabledString; - var enabledNamespaces = []; - var skippedNamespaces = []; - var debuggers = []; - if (debugEnvVariable) { - enable(debugEnvVariable); + 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 debugObj = Object.assign((namespace) => { - return createDebugger(namespace); - }, { - enable, - enabled, - disable, - log - }); - function enable(namespaces) { - enabledString = namespaces; - enabledNamespaces = []; - skippedNamespaces = []; - const wildcard = /\*/g; - const namespaceList = namespaces.split(",").map((ns) => ns.trim().replace(wildcard, ".*?")); - for (const ns of namespaceList) { - if (ns.startsWith("-")) { - skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`)); - } else { - enabledNamespaces.push(new RegExp(`^${ns}$`)); - } + 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 + "}"); } - for (const instance of debuggers) { - instance.enabled = enabled(instance.namespace); + 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])); } } - function enabled(namespace) { - if (namespace.endsWith("*")) { - return true; + var i; + exports2.parse = parse; + function parse(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - for (const skipped of skippedNamespaces) { - if (skipped.test(namespace)) { - return false; - } + if (version instanceof SemVer) { + return version; } - for (const enabledNamespace of enabledNamespaces) { - if (enabledNamespace.test(namespace)) { - return true; - } + if (typeof version !== "string") { + return null; } - return false; - } - function disable() { - const result = enabledString || ""; - enable(""); - return result; - } - function createDebugger(namespace) { - const newDebugger = Object.assign(debug7, { - enabled: enabled(namespace), - destroy, - log: debugObj.log, - namespace, - extend: extend3 - }); - function debug7(...args) { - if (!newDebugger.enabled) { - return; - } - if (args.length > 0) { - args[0] = `${namespace} ${args[0]}`; - } - newDebugger.log(...args); + if (version.length > MAX_LENGTH) { + return null; } - debuggers.push(newDebugger); - return newDebugger; - } - function destroy() { - const index = debuggers.indexOf(this); - if (index >= 0) { - debuggers.splice(index, 1); - return true; + 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; } - return false; } - function extend3(namespace) { - const newDebugger = createDebugger(`${this.namespace}:${namespace}`); - newDebugger.log = this.log; - return newDebugger; + exports2.valid = valid3; + function valid3(version, options) { + var v = parse(version, options); + return v ? v.version : null; } - var debug6 = debugObj; - var registeredLoggers = /* @__PURE__ */ new Set(); - var logLevelFromEnv = typeof process !== "undefined" && process.env && process.env.AZURE_LOG_LEVEL || void 0; - var azureLogLevel; - var AzureLogger = debug6("azure"); - AzureLogger.log = (...args) => { - debug6.log(...args); - }; - var AZURE_LOG_LEVELS = ["verbose", "info", "warning", "error"]; - if (logLevelFromEnv) { - if (isAzureLogLevel(logLevelFromEnv)) { - setLogLevel(logLevelFromEnv); - } else { - console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`); - } + exports2.clean = clean3; + function clean3(version, options) { + var s = parse(version.trim().replace(/^[=v]+/, ""), options); + return s ? s.version : null; } - function setLogLevel(level) { - if (level && !isAzureLogLevel(level)) { - throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(",")}`); + exports2.SemVer = SemVer; + function SemVer(version, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - azureLogLevel = level; - const enabledNamespaces2 = []; - for (const logger of registeredLoggers) { - if (shouldEnable(logger)) { - enabledNamespaces2.push(logger.namespace); + 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); } - debug6.enable(enabledNamespaces2.join(",")); - } - function getLogLevel() { - return azureLogLevel; + 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(); } - var levelMap = { - verbose: 400, - info: 300, - warning: 200, - error: 100 + SemVer.prototype.format = function() { + this.version = this.major + "." + this.minor + "." + this.patch; + if (this.prerelease.length) { + this.version += "-" + this.prerelease.join("."); + } + return this.version; }; - function createClientLogger(namespace) { - const clientRootLogger = AzureLogger.extend(namespace); - patchLogMethod(AzureLogger, clientRootLogger); - return { - error: createLogger(clientRootLogger, "error"), - warning: createLogger(clientRootLogger, "warning"), - info: createLogger(clientRootLogger, "info"), - verbose: createLogger(clientRootLogger, "verbose") - }; - } - function patchLogMethod(parent, child) { - child.log = (...args) => { - parent.log(...args); - }; - } - function createLogger(parent, level) { - const logger = Object.assign(parent.extend(level), { - level - }); - patchLogMethod(parent, logger); - if (shouldEnable(logger)) { - const enabledNamespaces2 = debug6.disable(); - debug6.enable(enabledNamespaces2 + "," + logger.namespace); + 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); } - registeredLoggers.add(logger); - return logger; - } - function shouldEnable(logger) { - return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]); - } - function isAzureLogLevel(logLevel) { - return AZURE_LOG_LEVELS.includes(logLevel); - } - exports2.AzureLogger = AzureLogger; - exports2.createClientLogger = createClientLogger; - exports2.getLogLevel = getLogLevel; - exports2.setLogLevel = setLogLevel; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/log.js -var require_log = __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_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-rest-pipeline"); - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError = __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"; + 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); }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-util/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs = __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_AbortError(); - 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_commonjs(); - function createAbortablePromise(buildPromise, options) { - const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return new Promise((resolve6, reject) => { - function rejectOnAbort() { - reject(new abort_controller_1.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : "The operation was aborted.")); - } - function removeListeners() { - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener("abort", onAbort); + 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); } - function onAbort() { - cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort(); - removeListeners(); - rejectOnAbort(); + } 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); } - if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) { - return rejectOnAbort(); + } 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 = parse(version1); + var v2 = parse(version2); + var prefix = ""; + if (v1.prerelease.length || v2.prerelease.length) { + prefix = "pre"; + var defaultResult = "prerelease"; } - try { - buildPromise((x) => { - removeListeners(); - resolve6(x); - }, (x) => { - removeListeners(); - reject(x); - }); - } catch (err) { - reject(err); + for (var key in v1) { + if (key === "major" || key === "minor" || key === "patch") { + if (v1[key] !== v2[key]) { + return prefix + key; + } + } } - abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener("abort", onAbort); - }); + return defaultResult; + } } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/random.js -var require_random = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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; + exports2.compareIdentifiers = compareIdentifiers; + var numeric = /^[0-9]+$/; + function compareIdentifiers(a, b) { + var anum = numeric.test(a); + var bnum = numeric.test(b); + if (anum && bnum) { + a = +a; + b = +b; + } + return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/delay.js -var require_delay = __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 random_js_1 = require_random(); - var StandardAbortMessage = "The delay was aborted."; - function delay2(timeInMs, options) { - let token; - const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {}; - return (0, createAbortablePromise_js_1.createAbortablePromise)((resolve6) => { - token = setTimeout(resolve6, timeInMs); - }, { - cleanupBeforeAbort: () => clearTimeout(token), - abortSignal, - abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage - }); + exports2.rcompareIdentifiers = rcompareIdentifiers; + function rcompareIdentifiers(a, b) { + return compareIdentifiers(b, a); } - 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 }; + exports2.major = major; + function major(a, loose) { + return new SemVer(a, loose).major; } - } -}); - -// 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) { - var _a, _b; - const aborter = new AbortController(); - function abortHandler() { - aborter.abort(); - } - (_a = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _a === void 0 ? void 0 : _a.addEventListener("abort", abortHandler); - try { - return await Promise.race(abortablePromiseBuilders.map((p) => p({ abortSignal: aborter.signal }))); - } finally { - aborter.abort(); - (_b = options === null || options === void 0 ? void 0 : options.abortSignal) === null || _b === void 0 ? void 0 : _b.removeEventListener("abort", abortHandler); - } + exports2.minor = minor; + function minor(a, loose) { + return new SemVer(a, loose).minor; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/object.js -var require_object = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.patch = patch; + function patch(a, loose) { + return new SemVer(a, loose).patch; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/error.js -var require_error = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/error.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isError = isError; - exports2.getErrorMessage = getErrorMessage2; - 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; + exports2.compare = compare3; + function compare3(a, b, loose) { + return new SemVer(a, loose).compare(new SemVer(b, loose)); } - function getErrorMessage2(e) { - if (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}`; - } + exports2.compareLoose = compareLoose; + function compareLoose(a, b) { + return compare3(a, b, true); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/sha256.js -var require_sha256 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/sha256.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.computeSha256Hmac = computeSha256Hmac; - exports2.computeSha256Hash = computeSha256Hash; - var crypto_1 = require("crypto"); - async function computeSha256Hmac(key, stringToSign, encoding) { - const decodedKey = Buffer.from(key, "base64"); - return (0, crypto_1.createHmac)("sha256", decodedKey).update(stringToSign).digest(encoding); + 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); } - async function computeSha256Hash(content, encoding) { - return (0, crypto_1.createHash)("sha256").update(content).digest(encoding); + exports2.rcompare = rcompare; + function rcompare(a, b, loose) { + return compare3(b, a, loose); } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/typeGuards.js -var require_typeGuards = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isDefined = isDefined2; - exports2.isObjectWithProperties = isObjectWithProperties; - exports2.objectHasProperty = objectHasProperty; - function isDefined2(thing) { - return typeof thing !== "undefined" && thing !== null; + exports2.sort = sort; + function sort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(a, b, loose); + }); } - function isObjectWithProperties(thing, properties) { - if (!isDefined2(thing) || typeof thing !== "object") { - return false; - } - for (const property of properties) { - if (!objectHasProperty(thing, property)) { - return false; - } - } - return true; + exports2.rsort = rsort; + function rsort(list, loose) { + return list.sort(function(a, b) { + return exports2.compareBuild(b, a, loose); + }); } - function objectHasProperty(thing, property) { - return isDefined2(thing) && typeof thing === "object" && property in thing; + exports2.gt = gt; + function gt(a, b, loose) { + return compare3(a, b, loose) > 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/uuidUtils.js -var require_uuidUtils = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/uuidUtils.js"(exports2) { - "use strict"; - var _a; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.randomUUID = randomUUID2; - var crypto_1 = require("crypto"); - var uuidFunction = typeof ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a === void 0 ? void 0 : _a.randomUUID) === "function" ? globalThis.crypto.randomUUID.bind(globalThis.crypto) : crypto_1.randomUUID; - function randomUUID2() { - return uuidFunction(); + exports2.lt = lt; + function lt(a, b, loose) { + return compare3(a, b, loose) < 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js -var require_checkEnvironment = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/checkEnvironment.js"(exports2) { - "use strict"; - var _a; - var _b; - var _c; - var _d; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isReactNative = exports2.isNodeRuntime = exports2.isNode = 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 === null || self === void 0 ? void 0 : self.importScripts) === "function" && (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" || ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" || ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.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((_d = globalThis.process.versions) === null || _d === void 0 ? void 0 : _d.node); - exports2.isNode = exports2.isNodeLike; - exports2.isNodeRuntime = exports2.isNodeLike && !exports2.isBun && !exports2.isDeno; - exports2.isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; - } -}); - -// node_modules/@azure/core-util/dist/commonjs/bytesEncoding.js -var require_bytesEncoding = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/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); + exports2.eq = eq; + function eq(a, b, loose) { + return compare3(a, b, loose) === 0; } - function stringToUint8Array(value, format) { - return Buffer.from(value, format); + exports2.neq = neq; + function neq(a, b, loose) { + return compare3(a, b, loose) !== 0; } - } -}); - -// node_modules/@azure/core-util/dist/commonjs/index.js -var require_commonjs2 = __commonJS({ - "node_modules/@azure/core-util/dist/commonjs/index.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.stringToUint8Array = exports2.uint8ArrayToString = exports2.isWebWorker = exports2.isReactNative = exports2.isDeno = exports2.isNodeRuntime = exports2.isNodeLike = exports2.isNode = exports2.isBun = exports2.isBrowser = exports2.randomUUID = exports2.objectHasProperty = exports2.isObjectWithProperties = exports2.isDefined = exports2.computeSha256Hmac = exports2.computeSha256Hash = exports2.getErrorMessage = exports2.isError = exports2.isObject = exports2.getRandomIntegerInclusive = exports2.createAbortablePromise = exports2.cancelablePromiseRace = exports2.calculateRetryDelay = exports2.delay = void 0; - var delay_js_1 = require_delay(); - Object.defineProperty(exports2, "delay", { enumerable: true, get: function() { - return delay_js_1.delay; - } }); - Object.defineProperty(exports2, "calculateRetryDelay", { enumerable: true, get: function() { - return delay_js_1.calculateRetryDelay; - } }); - 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 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; - } }); - Object.defineProperty(exports2, "getErrorMessage", { enumerable: true, get: function() { - return error_js_1.getErrorMessage; - } }); - 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 typeGuards_js_1 = require_typeGuards(); - 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; - } }); - 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, "isNode", { enumerable: true, get: function() { - return checkEnvironment_js_1.isNode; - } }); - 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, "uint8ArrayToString", { enumerable: true, get: function() { - return bytesEncoding_js_1.uint8ArrayToString; - } }); - Object.defineProperty(exports2, "stringToUint8Array", { enumerable: true, get: function() { - return bytesEncoding_js_1.stringToUint8Array; - } }); - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js -var require_sanitizer = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/sanitizer.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.Sanitizer = void 0; - var core_util_1 = require_commonjs2(); - 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 { - 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())); + exports2.gte = gte6; + function gte6(a, b, loose) { + return compare3(a, b, loose) >= 0; + } + exports2.lte = lte; + function lte(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 gte6(a, b, loose); + case "<": + return lt(a, b, loose); + case "<=": + return lte(a, b, loose); + default: + throw new TypeError("Invalid operator: " + op); } - sanitize(obj) { - const seen = /* @__PURE__ */ new Set(); - return JSON.stringify(obj, (key, value) => { - if (value instanceof Error) { - return Object.assign(Object.assign({}, 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, core_util_1.isObject)(value)) { - if (seen.has(value)) { - return "[Circular]"; - } - seen.add(value); - } - return value; - }, 2); + } + exports2.Comparator = Comparator; + function Comparator(comp, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - 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); - } + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp; + } else { + comp = comp.value; } - 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; + if (!(this instanceof Comparator)) { + return new Comparator(comp, options); } - 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; + 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); } }; - exports2.Sanitizer = Sanitizer; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/logPolicy.js -var require_logPolicy = __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_log(); - var sanitizer_js_1 = require_sanitizer(); - exports2.logPolicyName = "logPolicy"; - function logPolicy(options = {}) { - var _a; - const logger = (_a = options.logger) !== null && _a !== void 0 ? _a : log_js_1.logger.info; - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedHeaderNames: options.additionalAllowedHeaderNames, - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - return { - name: exports2.logPolicyName, - async sendRequest(request, next) { - if (!logger.enabled) { - return next(request); - } - logger(`Request: ${sanitizer.sanitize(request)}`); - const response = await next(request); - logger(`Response status code: ${response.status}`); - logger(`Headers: ${sanitizer.sanitize(response.headers)}`); - return response; + 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; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/redirectPolicy.js -var require_redirectPolicy = __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; - exports2.redirectPolicyName = "redirectPolicy"; - var allowedRedirect = ["GET", "HEAD"]; - function redirectPolicy(options = {}) { - const { maxRetries = 20 } = options; - return { - name: exports2.redirectPolicyName, - async sendRequest(request, next) { - const response = await next(request); - return handleRedirect(next, response, maxRetries); + } + 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; } - }; - } - async function handleRedirect(next, response, maxRetries, currentRetries = 0) { - const { request, status, headers } = response; - const locationHeader = headers.get("location"); - if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { - const url2 = new URL(locationHeader, request.url); - request.url = url2.toString(); - if (status === 303) { - request.method = "GET"; - request.headers.delete("Content-Length"); - delete request.body; + rangeTmp = new Range2(comp.value, options); + return satisfies2(this.value, rangeTmp, options); + } else if (comp.operator === "") { + if (comp.value === "") { + return true; } - request.headers.delete("Authorization"); - const res = await next(request); - return handleRedirect(next, res, maxRetries, currentRetries + 1); + rangeTmp = new Range2(this.value, options); + return satisfies2(comp.semver, rangeTmp, options); } - return response; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/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, - __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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); + 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; }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - 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(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + exports2.Range = Range2; + function Range2(range, options) { + if (!options || typeof options !== "object") { + options = { + loose: !!options, + includePrerelease: false + }; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + if (range instanceof Range2) { + if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) { + return range; + } else { + return new Range2(range.raw, options); + } } + if (range instanceof Comparator) { + return new Range2(range.value, options); + } + if (!(this instanceof Range2)) { + return new Range2(range, options); + } + this.options = options; + this.loose = !!options.loose; + this.includePrerelease = !!options.includePrerelease; + this.raw = range.trim().split(/\s+/).join(" "); + this.set = this.raw.split("||").map(function(range2) { + return this.parseRange(range2.trim()); + }, this).filter(function(c) { + return c.length; + }); + if (!this.set.length) { + throw new TypeError("Invalid SemVer Range: " + this.raw); + } + this.format(); } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator(thisArg, body) { - var _ = { 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]); + Range2.prototype.format = function() { + this.range = this.set.map(function(comps) { + return comps.join(" ").trim(); + }).join("||").trim(); + return this.range; }; - } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; - } - op = body.call(thisArg, _); - } 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 (error4) { - e = { error: error4 }; - } 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); + Range2.prototype.toString = function() { + return this.range; }; - } - 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); + Range2.prototype.parseRange = function(range) { + var loose = this.options.loose; + var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]; + range = range.replace(hr, hyphenReplace); + debug6("hyphen replace", range); + range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace); + debug6("comparator trim", range, safeRe[t.COMPARATORTRIM]); + range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace); + range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace); + range = range.split(/\s+/).join(" "); + var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]; + var set2 = range.split(" ").map(function(comp) { + return parseComparator(comp, this.options); + }, this).join(" ").split(/\s+/); + if (this.options.loose) { + set2 = set2.filter(function(comp) { + return !!comp.match(compRe); }); - }; - 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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); - }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ 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 in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - } - __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); } + set2 = set2.map(function(comp) { + return new Comparator(comp, this.options); + }, this); + return set2; }; - 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); + Range2.prototype.intersects = function(range, options) { + if (!(range instanceof Range2)) { + throw new TypeError("a Range is required"); } - } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default; -var init_tslib_es6 = __esm({ - "node_modules/@azure/core-rest-pipeline/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 __assign4(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); + return this.set.some(function(thisComparators) { + return isSatisfiable(thisComparators, options) && range.set.some(function(rangeComparators) { + return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) { + return rangeComparators.every(function(rangeComparator) { + return thisComparator.intersects(rangeComparator, options); + }); + }); + }); + }); }; - __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]; - } }; + 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(); } - 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; - }; - _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default = { - __extends, - __assign, - __rest, - __decorate, - __param, - __metadata, - __awaiter, - __generator, - __createBinding, - __exportStar, - __values: __values2, - __read, - __spread, - __spreadArrays, - __spreadArray, - __await, - __asyncGenerator, - __asyncDelegator, - __asyncValues, - __makeTemplateObject, - __importStar, - __importDefault, - __classPrivateFieldGet, - __classPrivateFieldSet, - __classPrivateFieldIn, - __addDisposableResource, - __disposeResources - }; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgentPlatform.js -var require_userAgentPlatform = __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 os3 = tslib_1.__importStar(require("node:os")); - var process2 = tslib_1.__importStar(require("node:process")); - function getHeaderName() { - return "User-Agent"; + return result; } - async function setPlatformSpecificData(map2) { - if (process2 && process2.versions) { - const versions = process2.versions; - if (versions.bun) { - map2.set("Bun", versions.bun); - } else if (versions.deno) { - map2.set("Deno", versions.deno); - } else if (versions.node) { - map2.set("Node", versions.node); - } - } - map2.set("OS", `(${os3.arch()}-${os3.type()}-${os3.release()})`); + exports2.toComparators = toComparators; + function toComparators(range, options) { + return new Range2(range, options).set.map(function(comp) { + return comp.map(function(c) { + return c.value; + }).join(" ").trim().split(" "); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/constants.js -var require_constants8 = __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.17.0"; - exports2.DEFAULT_RETRY_POLICY_COUNT = 3; - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/userAgent.js -var require_userAgent = __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_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 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 getUserAgentHeaderName() { - return (0, userAgentPlatform_js_1.getHeaderName)(); + function isX(id) { + return !id || id.toLowerCase() === "x" || id === "*"; } - 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; + function replaceTildes(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceTilde(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/userAgentPolicy.js -var require_userAgentPolicy = __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_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(request, next) { - if (!request.headers.has(UserAgentHeaderName)) { - request.headers.set(UserAgentHeaderName, await userAgentValue); - } - return next(request); + function replaceTilde(comp, options) { + var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]; + return comp.replace(r, function(_, M, m, p, pr) { + debug6("tilde", comp, _, 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"; } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js -var require_typeGuards2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/typeGuards.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isNodeReadableStream = isNodeReadableStream; - exports2.isWebReadableStream = isWebReadableStream; - 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"); + debug6("tilde return", ret); + return ret; + }); } - function isReadableStream(x) { - return isNodeReadableStream(x) || isWebReadableStream(x); + function replaceCarets(comp, options) { + return comp.trim().split(/\s+/).map(function(comp2) { + return replaceCaret(comp2, options); + }).join(" "); } - function isBlob(x) { - return typeof x.stream === "function"; - } - } -}); - -// 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.getRawContent = getRawContent; - exports2.createFileFromStream = createFileFromStream; - exports2.createFile = createFile; - var core_util_1 = require_commonjs2(); - var typeGuards_js_1 = require_typeGuards2(); - var unimplementedMethods = { - arrayBuffer: () => { - throw new Error("Not implemented"); - }, - slice: () => { - throw new Error("Not implemented"); - }, - text: () => { - throw new Error("Not implemented"); - } - }; - var rawContent = Symbol("rawContent"); - function hasRawContent(x) { - return typeof x[rawContent] === "function"; - } - function getRawContent(blob) { - if (hasRawContent(blob)) { - return blob[rawContent](); - } else { - return blob.stream(); - } - } - function createFileFromStream(stream2, name, options = {}) { - var _a, _b, _c, _d; - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: (_d = options.size) !== null && _d !== void 0 ? _d : -1, name, stream: () => { - const s = stream2(); - if ((0, typeGuards_js_1.isNodeReadableStream)(s)) { - throw new Error("Not supported: a Node stream was provided as input to createFileFromStream."); + function replaceCaret(comp, options) { + debug6("caret", comp, options); + var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]; + return comp.replace(r, function(_, M, m, p, pr) { + debug6("caret", comp, _, 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"; + } } - return s; - }, [rawContent]: stream2 }); + debug6("caret return", ret); + return ret; + }); } - function createFile(content, name, options = {}) { - var _a, _b, _c; - if (core_util_1.isNodeLike) { - return Object.assign(Object.assign({}, unimplementedMethods), { type: (_a = options.type) !== null && _a !== void 0 ? _a : "", lastModified: (_b = options.lastModified) !== null && _b !== void 0 ? _b : (/* @__PURE__ */ new Date()).getTime(), webkitRelativePath: (_c = options.webkitRelativePath) !== null && _c !== void 0 ? _c : "", size: content.byteLength, name, arrayBuffer: async () => content.buffer, stream: () => new Blob([content]).stream(), [rawContent]: () => content }); - } else { - return new File([content], name, options); - } + function replaceXRanges(comp, options) { + debug6("replaceXRanges", comp, options); + return comp.split(/\s+/).map(function(comp2) { + return replaceXRange(comp2, options); + }).join(" "); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js -var require_concat = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/concat.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.concat = concat; - var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports)); - var node_stream_1 = require("node:stream"); - var typeGuards_js_1 = require_typeGuards2(); - var file_js_1 = require_file2(); - function streamAsyncIterator() { - return tslib_1.__asyncGenerator(this, arguments, function* streamAsyncIterator_1() { - const reader = this.getReader(); - try { - while (true) { - const { done, value } = yield tslib_1.__await(reader.read()); - if (done) { - return yield tslib_1.__await(void 0); + 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; } - yield yield tslib_1.__await(value); } - } finally { - reader.releaseLock(); + 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 makeAsyncIterable(webStream) { - if (!webStream[Symbol.asyncIterator]) { - webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); - } - if (!webStream.values) { - webStream.values = streamAsyncIterator.bind(webStream); - } + function replaceStars(comp, options) { + debug6("replaceStars", comp, options); + return comp.trim().replace(safeRe[t.STAR], ""); } - function ensureNodeStream(stream2) { - if (stream2 instanceof ReadableStream) { - makeAsyncIterable(stream2); - return node_stream_1.Readable.fromWeb(stream2); + 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 { - return stream2; + from = ">=" + from; } - } - function toStream(source) { - if (source instanceof Uint8Array) { - return node_stream_1.Readable.from(Buffer.from(source)); - } else if ((0, typeGuards_js_1.isBlob)(source)) { - return toStream((0, file_js_1.getRawContent)(source)); + 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 { - return ensureNodeStream(source); + to = "<=" + to; } + return (from + " " + to).trim(); } - async function concat(sources) { - return function() { - const streams = sources.map((x) => typeof x === "function" ? x() : x).map(toStream); - return node_stream_1.Readable.from((function() { - return tslib_1.__asyncGenerator(this, arguments, function* () { - var _a, e_1, _b, _c; - for (const stream2 of streams) { - try { - for (var _d = true, stream_1 = (e_1 = void 0, tslib_1.__asyncValues(stream2)), stream_1_1; stream_1_1 = yield tslib_1.__await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) { - _c = stream_1_1.value; - _d = false; - const chunk = _c; - yield yield tslib_1.__await(chunk); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = stream_1.return)) yield tslib_1.__await(_b.call(stream_1)); - } finally { - if (e_1) throw e_1.error; - } - } + 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(set2, version, options) { + for (var i2 = 0; i2 < set2.length; i2++) { + if (!set2[i2].test(version)) { + return false; + } + } + if (version.prerelease.length && !options.includePrerelease) { + for (i2 = 0; i2 < set2.length; i2++) { + debug6(set2[i2].semver); + if (set2[i2].semver === ANY) { + continue; + } + if (set2[i2].semver.prerelease.length > 0) { + var allowed = set2[i2].semver; + if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) { + return true; } - }); - })()); - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/multipartPolicy.js -var require_multipartPolicy = __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 core_util_1 = require_commonjs2(); - var concat_js_1 = require_concat(); - var typeGuards_js_1 = require_typeGuards2(); - function generateBoundary() { - return `----AzSDKFormBoundary${(0, core_util_1.randomUUID)()}`; + } + } + return false; + } + return true; } - function encodeHeaders(headers) { - let result = ""; - for (const [key, value] of headers) { - result += `${key}: ${value}\r -`; + exports2.satisfies = satisfies2; + function satisfies2(version, range, options) { + try { + range = new Range2(range, options); + } catch (er) { + return false; } - return result; + return range.test(version); } - 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; + exports2.maxSatisfying = maxSatisfying; + function maxSatisfying(versions, range, options) { + var max = null; + var maxSV = null; + try { + var rangeObj = new Range2(range, 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; } - 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; + exports2.minSatisfying = minSatisfying; + function minSatisfying(versions, range, options) { + var min = null; + var minSV = null; + try { + var rangeObj = new Range2(range, 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(range, loose) { + range = new Range2(range, loose); + var minver = new SemVer("0.0.0"); + if (range.test(minver)) { + return minver; } - return total; + minver = new SemVer("0.0.0-0"); + if (range.test(minver)) { + return minver; + } + minver = null; + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.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 && range.test(minver)) { + return minver; + } + return null; } - async function buildRequestBody(request, parts, boundary) { - const sources = [ - (0, core_util_1.stringToUint8Array)(`--${boundary}`, "utf-8"), - ...parts.flatMap((part) => [ - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - (0, core_util_1.stringToUint8Array)(encodeHeaders(part.headers), "utf-8"), - (0, core_util_1.stringToUint8Array)("\r\n", "utf-8"), - part.body, - (0, core_util_1.stringToUint8Array)(`\r ---${boundary}`, "utf-8") - ]), - (0, core_util_1.stringToUint8Array)("--\r\n\r\n", "utf-8") - ]; - const contentLength = getTotalLength(sources); - if (contentLength) { - request.headers.set("Content-Length", contentLength); + exports2.validRange = validRange; + function validRange(range, options) { + try { + return new Range2(range, options).range || "*"; + } catch (er) { + return null; } - request.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`); + exports2.ltr = ltr; + function ltr(version, range, options) { + return outside(version, range, "<", options); + } + exports2.gtr = gtr; + function gtr(version, range, options) { + return outside(version, range, ">", options); + } + exports2.outside = outside; + function outside(version, range, hilo, options) { + version = new SemVer(version, options); + range = new Range2(range, options); + var gtfn, ltefn, ltfn, comp, ecomp; + switch (hilo) { + case ">": + gtfn = gt; + ltefn = lte; + ltfn = lt; + comp = ">"; + ecomp = ">="; + break; + case "<": + gtfn = lt; + ltefn = gte6; + ltfn = gt; + comp = "<"; + ecomp = "<="; + break; + default: + throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { - throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); + if (satisfies2(version, range, options)) { + return false; } - } - function multipartPolicy() { - return { - name: exports2.multipartPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.multipartBody) { - return next(request); - } - if (request.body) { - throw new Error("multipartBody and regular body cannot be set at the same time"); - } - let boundary = request.multipartBody.boundary; - const contentTypeHeader = (_a = request.headers.get("Content-Type")) !== null && _a !== void 0 ? _a : "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}`); + for (var i2 = 0; i2 < range.set.length; ++i2) { + var comparators = range.set[i2]; + var high = null; + var low = null; + comparators.forEach(function(comparator) { + if (comparator.semver === ANY) { + comparator = new Comparator(">=0.0.0"); } - 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`); + 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; } - boundary !== null && boundary !== void 0 ? boundary : boundary = parsedBoundary; - if (boundary) { - assertValidBoundary(boundary); - } else { - boundary = generateBoundary(); + }); + 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 = parse(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 match = null; + if (!options.rtl) { + match = version.match(safeRe[t.COERCE]); + } else { + var next; + while ((next = safeRe[t.COERCERTL].exec(version)) && (!match || match.index + match[0].length !== version.length)) { + if (!match || next.index + next[0].length !== match.index + match[0].length) { + match = next; } - request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); - await buildRequestBody(request, request.multipartBody.parts, boundary); - request.multipartBody = void 0; - return next(request); + safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length; } - }; + safeRe[t.COERCERTL].lastIndex = -1; + } + if (match === null) { + return null; + } + return parse(match[2] + "." + (match[3] || "0") + "." + (match[4] || "0"), options); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js -var require_decompressResponsePolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/decompressResponsePolicy.js"(exports2) { +// 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.decompressResponsePolicyName = void 0; - exports2.decompressResponsePolicy = decompressResponsePolicy; - exports2.decompressResponsePolicyName = "decompressResponsePolicy"; - function decompressResponsePolicy() { - return { - name: exports2.decompressResponsePolicyName, - async sendRequest(request, next) { - if (request.method !== "HEAD") { - request.headers.set("Accept-Encoding", "gzip,deflate"); - } - return next(request); - } - }; - } + 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); } }); -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js -var require_AbortError2 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/AbortError.js"(exports2) { +// node_modules/@actions/cache/lib/internal/cacheUtils.js +var require_cacheUtils = __commonJS({ + "node_modules/@actions/cache/lib/internal/cacheUtils.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"; + 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]; + } }; } - }; - exports2.AbortError = AbortError; - } -}); - -// node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller/dist/commonjs/index.js -var require_commonjs3 = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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-rest-pipeline/dist/commonjs/util/helpers.js -var require_helpers = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/util/helpers.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.delay = delay2; - exports2.parseHeaderValueAsNumber = parseHeaderValueAsNumber; - var abort_controller_1 = require_commonjs3(); - var StandardAbortMessage = "The operation was aborted."; - function delay2(delayInMs, value, options) { - return new Promise((resolve6, reject) => { - let timer = void 0; - let onAborted = void 0; - const rejectOnAbort = () => { - return reject(new abort_controller_1.AbortError((options === null || options === void 0 ? void 0 : options.abortErrorMsg) ? options === null || options === void 0 ? void 0 : options.abortErrorMsg : StandardAbortMessage)); + 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; }; - const removeListeners = () => { - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && onAborted) { - options.abortSignal.removeEventListener("abort", onAborted); + 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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - }; - onAborted = () => { - if (timer) { - clearTimeout(timer); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - removeListeners(); - return rejectOnAbort(); - }; - if ((options === null || options === void 0 ? void 0 : options.abortSignal) && options.abortSignal.aborted) { - return rejectOnAbort(); } - timer = setTimeout(() => { - removeListeners(); - resolve6(value); - }, delayInMs); - if (options === null || options === void 0 ? void 0 : options.abortSignal) { - options.abortSignal.addEventListener("abort", onAborted); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - } - 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/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js -var require_throttlingRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/throttlingRetryStrategy.js"(exports2) { - "use strict"; + }; + 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(resolve6, reject) { + v = o[n](v), settle(resolve6, reject, v.done, v.value); + }); + }; + } + function settle(resolve6, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve6({ value: v2, done: d }); + }, reject); + } + }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; - exports2.throttlingRetryStrategy = throttlingRetryStrategy; - var helpers_js_1 = require_helpers(); - 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; + 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 core14 = __importStar2(require_core()); + var exec = __importStar2(require_exec()); + var glob = __importStar2(require_glob()); + var io6 = __importStar2(require_io()); + var crypto2 = __importStar2(require("crypto")); + var fs13 = __importStar2(require("fs")); + var path12 = __importStar2(require("path")); + var semver9 = __importStar2(require_semver3()); + var util = __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 = path12.join(baseLocation, "actions", "temp"); } - 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 (_a) { - return void 0; - } - } - function isThrottlingRetryResponse(response) { - return Number.isFinite(getRetryAfterInMs(response)); + const dest = path12.join(tempDirectory, crypto2.randomUUID()); + yield io6.mkdirP(dest); + return dest; + }); } - function throttlingRetryStrategy() { - return { - name: "throttlingRetryStrategy", - retry({ response }) { - const retryAfterInMs = getRetryAfterInMs(response); - if (!Number.isFinite(retryAfterInMs)) { - return { skipStrategy: true }; - } - return { - retryAfterInMs - }; - } - }; + function getArchiveFileSizeInBytes(filePath) { + return fs13.statSync(filePath).size; } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js -var require_exponentialRetryStrategy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/retryStrategies/exponentialRetryStrategy.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.exponentialRetryStrategy = exponentialRetryStrategy; - exports2.isExponentialRetryResponse = isExponentialRetryResponse; - exports2.isSystemError = isSystemError; - var core_util_1 = require_commonjs2(); - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var DEFAULT_CLIENT_RETRY_INTERVAL = 1e3; - var DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1e3 * 64; - function exponentialRetryStrategy(options = {}) { - var _a, _b; - const retryInterval = (_a = options.retryDelayInMs) !== null && _a !== void 0 ? _a : DEFAULT_CLIENT_RETRY_INTERVAL; - const maxRetryInterval = (_b = options.maxRetryDelayInMs) !== null && _b !== void 0 ? _b : DEFAULT_CLIENT_MAX_RETRY_INTERVAL; - let retryAfterInMs = retryInterval; - 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 }; + function resolvePaths(patterns) { + return __awaiter2(this, void 0, void 0, function* () { + var _a, 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 glob.create(patterns.join("\n"), { + implicitDescendants: false + }); + try { + for (var _e = true, _f = __asyncValues2(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a; _e = true) { + _c = _g.value; + _e = false; + const file = _c; + const relativeFile = path12.relative(workspace, file).replace(new RegExp(`\\${path12.sep}`, "g"), "/"); + core14.debug(`Matched: ${relativeFile}`); + if (relativeFile === "") { + paths.push("."); + } else { + paths.push(`${relativeFile}`); + } } - if (responseError && !matchedSystemError && !isExponential) { - return { errorToThrow: responseError }; + } catch (e_1_1) { + e_1 = { error: e_1_1 }; + } finally { + try { + if (!_e && !_a && (_b = _f.return)) yield _b.call(_f); + } finally { + if (e_1) throw e_1.error; } - const exponentialDelay = retryAfterInMs * Math.pow(2, retryCount); - const clampedExponentialDelay = Math.min(maxRetryInterval, exponentialDelay); - retryAfterInMs = clampedExponentialDelay / 2 + (0, core_util_1.getRandomIntegerInclusive)(0, clampedExponentialDelay / 2); - return { retryAfterInMs }; } - }; - } - function isExponentialRetryResponse(response) { - return Boolean(response && response.status !== void 0 && (response.status >= 500 || response.status === 408) && response.status !== 501 && response.status !== 505); + return paths; + }); } - 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"; + function unlinkFile(filePath) { + return __awaiter2(this, void 0, void 0, function* () { + return util.promisify(fs13.unlink)(filePath); + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/retryPolicy.js -var require_retryPolicy = __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 helpers_js_1 = require_helpers(); - var logger_1 = require_dist(); - var abort_controller_1 = require_commonjs3(); - var constants_js_1 = require_constants8(); - var retryPolicyLogger = (0, logger_1.createClientLogger)("core-rest-pipeline 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(request, next) { - var _a, _b; - 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`, request.requestId); - response = await next(request); - logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); - } catch (e) { - logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); - responseError = e; - if (!e || responseError.name !== "RestError") { - throw e; - } - response = responseError.response; - } - if ((_a = request.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) { - logger.error(`Retry ${retryCount}: Request aborted.`); - const abortError = new abort_controller_1.AbortError(); - throw abortError; - } - if (retryCount >= ((_b = options.maxRetries) !== null && _b !== void 0 ? _b : 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 || retryPolicyLogger; - 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: request.abortSignal }); - continue retryRequest; - } - if (redirectTo) { - strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); - request.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; + function getVersion(app_1) { + return __awaiter2(this, arguments, void 0, function* (app, additionalArgs = []) { + let versionOutput = ""; + additionalArgs.push("--version"); + core14.debug(`Checking ${app} ${additionalArgs.join(" ")}`); + try { + yield exec.exec(`${app}`, additionalArgs, { + ignoreReturnCode: true, + silent: true, + listeners: { + stdout: (data) => versionOutput += data.toString(), + stderr: (data) => versionOutput += data.toString() } - } + }); + } catch (err) { + core14.debug(err.message); } - }; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/defaultRetryPolicy.js -var require_defaultRetryPolicy = __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 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 = {}) { - var _a; - return { - name: exports2.defaultRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)(), (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(options)], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + versionOutput = versionOutput.trim(); + core14.debug(versionOutput); + return versionOutput; + }); } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js -var require_httpHeaders = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/httpHeaders.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createHttpHeaders = createHttpHeaders; - function normalizeName(name) { - return name.toLowerCase(); + function getCompressionMethod() { + return __awaiter2(this, void 0, void 0, function* () { + const versionOutput = yield getVersion("zstd", ["--quiet"]); + const version = semver9.clean(versionOutput); + core14.debug(`zstd version: ${version}`); + if (versionOutput === "") { + return constants_1.CompressionMethod.Gzip; + } else { + return constants_1.CompressionMethod.ZstdWithoutLong; + } + }); } - function* headerIterator(map2) { - for (const entry of map2.values()) { - yield [entry.name, entry.value]; - } + function getCacheFileName(compressionMethod) { + return compressionMethod === constants_1.CompressionMethod.Gzip ? constants_1.CacheFilename.Gzip : constants_1.CacheFilename.Zstd; } - var HttpHeadersImpl = class { - constructor(rawHeaders) { - this._headersMap = /* @__PURE__ */ new Map(); - if (rawHeaders) { - for (const headerName of Object.keys(rawHeaders)) { - this.set(headerName, rawHeaders[headerName]); - } + function getGnuTarPathOnWindows() { + return __awaiter2(this, void 0, void 0, function* () { + if (fs13.existsSync(constants_1.GnuTarPathOnWindows)) { + return constants_1.GnuTarPathOnWindows; } + const versionOutput = yield getVersion("tar"); + return versionOutput.toLowerCase().includes("gnu tar") ? io6.which("tar") : ""; + }); + } + function assertDefined(name, value) { + if (value === void 0) { + throw Error(`Expected ${name} but value was undefiend`); } - /** - * 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() }); + return value; + } + function getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) { + const components = paths.slice(); + if (compressionMethod) { + components.push(compressionMethod); } - /** - * 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) { - var _a; - return (_a = this._headersMap.get(normalizeName(name))) === null || _a === void 0 ? void 0 : _a.value; + if (process.platform === "win32" && !enableCrossOsArchive) { + components.push("windows-only"); } - /** - * 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)); + components.push(versionSalt); + return crypto2.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"); } - /** - * 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); + return token; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/formDataPolicy.js -var require_formDataPolicy = __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 core_util_1 = require_commonjs2(); - var httpHeaders_js_1 = require_httpHeaders(); - exports2.formDataPolicyName = "formDataPolicy"; - function formDataToFormDataMap(formData) { - var _a; - const formDataMap = {}; - for (const [key, value] of formData.entries()) { - (_a = formDataMap[key]) !== null && _a !== void 0 ? _a : formDataMap[key] = []; - formDataMap[key].push(value); - } - return formDataMap; - } - function formDataPolicy() { - return { - name: exports2.formDataPolicyName, - async sendRequest(request, next) { - if (core_util_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { - request.formData = formDataToFormDataMap(request.body); - request.body = void 0; - } - if (request.formData) { - const contentType = request.headers.get("Content-Type"); - if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { - request.body = wwwFormUrlEncode(request.formData); - } else { - await prepareFormData(request.formData, request); - } - request.formData = void 0; - } - return next(request); - } - }; - } - 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, request) { - const contentType = request.headers.get("Content-Type"); - if (contentType && !contentType.startsWith("multipart/form-data")) { - return; - } - request.headers.set("Content-Type", contentType !== null && contentType !== void 0 ? 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, core_util_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 - }); - } - } - } - request.multipartBody = { parts }; +// 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; } -}); - -// 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(val2, options) { - options = options || {}; - var type2 = typeof val2; - if (type2 === "string" && val2.length > 0) { - return parse(val2); - } else if (type2 === "number" && isFinite(val2)) { - return options.long ? fmtLong(val2) : fmtShort(val2); - } - throw new Error( - "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2) - ); + 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 _, done = false; + for (var i = decorators.length - 1; i >= 0; i--) { + var context2 = {}; + for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; + for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; + context2.addInitializer = function(f) { + if (done) throw new TypeError("Cannot add initializers after decoration has completed"); + extraInitializers.push(accept(f || null)); }; - function parse(str2) { - str2 = String(str2); - if (str2.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str2 - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type2 = (match[2] || "ms").toLowerCase(); - switch (type2) { - 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; - } + var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); + if (kind === "accessor") { + if (result === void 0) continue; + if (result === null || typeof result !== "object") throw new TypeError("Object expected"); + if (_ = accept(result.get)) descriptor.get = _; + if (_ = accept(result.set)) descriptor.set = _; + if (_ = accept(result.init)) initializers.unshift(_); + } else if (_ = accept(result)) { + if (kind === "field") initializers.unshift(_); + else descriptor[key] = _; } - 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"; + } + 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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - 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"); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - return ms + " ms"; } - function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} +function __generator(thisArg, body) { + var _ = { 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]); + }; } -}); - -// 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; + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (g && (g = 0, op[0] && (_ = 0)), _) 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: + _.label++; + return { value: op[1], done: false }; + case 5: + _.label++; + y = op[1]; + op = [0]; + continue; + case 7: + op = _.ops.pop(); + _.trys.pop(); + continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { + _ = 0; + continue; } - 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"); + if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { + _.label = op[1]; + break; } - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - if (match === "%%") { - return "%"; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === "function") { - const val2 = args[index]; - match = formatter.call(self2, val2); - args.splice(index, 1); - index--; - } - return match; - }); - 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 = extend3; - 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 (op[0] === 6 && _.label < t[1]) { + _.label = t[1]; + t = op; + break; } - }); - if (typeof createDebug.init === "function") { - createDebug.init(debug6); - } - return debug6; - } - function extend3(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); + if (t && _.label < t[2]) { + _.label = t[2]; + _.ops.push(op); + break; } - } + if (t[2]) _.ops.pop(); + _.trys.pop(); + continue; } - 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(val2) { - if (val2 instanceof Error) { - return val2.stack || val2.message; - } - return val2; - } - 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; + op = body.call(thisArg, _); + } catch (e) { + op = [6, e]; + y = 0; + } finally { + f = t = 0; } - module2.exports = setup; + if (op[0] & 5) throw op[1]; + return { value: op[0] ? op[1] : void 0, done: true }; } -}); - -// 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`."); - } +} +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); + }); }; - })(); - 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+)/); + if (f) i[n] = f(i[n]); } - 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 index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, (match) => { - if (match === "%%") { - return; - } - index++; - if (match === "%c") { - lastC = index; - } + } + 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(resolve6, reject) { + v = o[n](v), settle(resolve6, reject, v.done, v.value); }); - args.splice(lastC, 0, c); + }; + } + function settle(resolve6, reject, d, v) { + Promise.resolve(v).then(function(v2) { + resolve6({ 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]; } - exports2.log = console.debug || console.log || (() => { - }); - function save(namespaces) { - try { - if (namespaces) { - exports2.storage.setItem("debug", namespaces); - } else { - exports2.storage.removeItem("debug"); - } - } catch (error4) { - } + if (dispose === void 0) { + if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); + dispose = value[Symbol.dispose]; + if (async) inner = dispose; } - function load2() { - let r; + if (typeof dispose !== "function") throw new TypeError("Object not disposable."); + if (inner) dispose = function() { try { - r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG"); - } catch (error4) { - } - if (!r && typeof process !== "undefined" && "env" in process) { - r = process.env.DEBUG; + inner.call(this); + } catch (e) { + return Promise.reject(e); } - return r; - } - function localstorage() { + }; + 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 { - return localStorage; - } catch (error4) { + 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); } } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.j = function(v) { - try { - return JSON.stringify(v); - } catch (error4) { - return "[UnexpectedJSONParseError]: " + error4.message; + if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); + if (env.hasError) throw env.error; + } + return next(); +} +function __rewriteRelativeImportExtension(path12, preserveJsx) { + if (typeof path12 === "string" && /^\.\.?\//.test(path12)) { + return path12.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function(m, tsx, d, ext, cm) { + return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : d + ext + "." + cm.toLowerCase() + "js"; + }); + } + return path12; +} +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/has-flag/index.js -var require_has_flag = __commonJS({ - "node_modules/has-flag/index.js"(exports2, module2) { +// 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"; - 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); + 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/supports-color/index.js -var require_supports_color = __commonJS({ - "node_modules/supports-color/index.js"(exports2, module2) { +// 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"; - var os3 = 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; + 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}`); } - 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); - } + } +}); + +// 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); } - function translateLevel(level) { - if (level === 0) { - return false; + 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); + } } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; - } - function supportsColor(haveStream, streamIsTTY) { - if (forceColor === 0) { - return 0; + for (const instance of debuggers) { + instance.enabled = enabled(instance.namespace); } - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; + } + function enabled(namespace) { + if (namespace.endsWith("*")) { + return true; } - if (hasFlag("color=256")) { - return 2; + for (const skipped of skippedNamespaces) { + if (namespaceMatches(namespace, skipped)) { + return false; + } } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; + for (const enabledNamespace of enabledNamespaces) { + if (namespaceMatches(namespace, enabledNamespace)) { + return true; + } } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; + return false; + } + function namespaceMatches(namespace, patternToMatch) { + if (patternToMatch.indexOf("*") === -1) { + return namespace === patternToMatch; } - if (process.platform === "win32") { - const osRelease = os3.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; + 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; } - 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; + 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: extend3 + }); + function debug6(...args) { + if (!newDebugger.enabled) { + return; } - return min; + if (args.length > 0) { + args[0] = `${namespace} ${args[0]}`; + } + newDebugger.log(...args); } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + debuggers.push(newDebugger); + return newDebugger; + } + function destroy() { + const index = debuggers.indexOf(this); + if (index >= 0) { + debuggers.splice(index, 1); + return true; } - if (env.COLORTERM === "truecolor") { - return 3; + return false; + } + function extend3(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 ("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 (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(", ")}.`); } } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; + function shouldEnable(logger) { + return Boolean(logLevel && levelMap[logger.level] <= levelMap[logLevel]); } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; + function createLogger(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; } - if ("COLORTERM" in env) { - return 1; + function contextGetLogLevel() { + return logLevel; } - return min; + function contextCreateClientLogger(namespace) { + const clientRootLogger = clientLogger.extend(namespace); + patchLogMethod(clientLogger, clientRootLogger); + return { + error: createLogger(clientRootLogger, "error"), + warning: createLogger(clientRootLogger, "warning"), + info: createLogger(clientRootLogger, "info"), + verbose: createLogger(clientRootLogger, "verbose") + }; + } + return { + setLogLevel: contextSetLogLevel, + getLogLevel: contextGetLogLevel, + createClientLogger: contextCreateClientLogger, + logger: clientLogger + }; } - function getSupportLevel(stream2) { - const level = supportsColor(stream2, stream2 && stream2.isTTY); - return translateLevel(level); + var context2 = createLoggerContext({ + logLevelEnvVarName: "TYPESPEC_RUNTIME_LOG_LEVEL", + namespace: "typeSpecRuntime" + }); + exports2.TypeSpecRuntimeLogger = context2.logger; + function setLogLevel(logLevel) { + context2.setLogLevel(logLevel); + } + function getLogLevel() { + return context2.getLogLevel(); + } + function createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - 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 util = require("util"); - exports2.init = init; - exports2.log = log; - exports2.formatArgs = formatArgs; - exports2.save = save; - exports2.load = load2; - exports2.useColors = useColors; - exports2.destroy = util.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 (error4) { +// 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(); } - 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, (_, k) => { - return k.toUpperCase(); - }); - let val2 = process.env[key]; - if (/^(yes|on|true|enabled)$/i.test(val2)) { - val2 = true; - } else if (/^(no|off|false|disabled)$/i.test(val2)) { - val2 = false; - } else if (val2 === "null") { - val2 = null; - } else { - val2 = Number(val2); + function* headerIterator(map2) { + for (const entry of map2.values()) { + yield [entry.name, entry.value]; } - obj[prop] = val2; - 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]; + 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]); + } + } } - } - function getDate() { - if (exports2.inspectOpts.hideDate) { - return ""; + /** + * 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() }); } - return (/* @__PURE__ */ new Date()).toISOString() + " "; - } - function log(...args) { - return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); - } - function save(namespaces) { - if (namespaces) { - process.env.DEBUG = namespaces; - } else { - delete process.env.DEBUG; + /** + * 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; } - } - function load2() { - return process.env.DEBUG; - } - function init(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]]; + /** + * 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); } - } - module2.exports = require_common()(exports2); - var { formatters } = module2.exports; - formatters.o = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); - }; - formatters.O = function(v) { - this.inspectOpts.colors = this.useColors; - return util.inspect(v, this.inspectOpts); }; + function createHttpHeaders(rawHeaders) { + return new HttpHeadersImpl(rawHeaders); + } } }); -// 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/@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/agent-base/dist/helpers.js -var require_helpers2 = __commonJS({ - "node_modules/agent-base/dist/helpers.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.req = exports2.json = exports2.toBuffer = void 0; - var http = __importStar4(require("http")); - var https2 = __importStar4(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 json2(stream2) { - const buf = await toBuffer(stream2); - const str2 = buf.toString("utf8"); - try { - return JSON.parse(str2); - } catch (_err) { - const err = _err; - err.message += ` (input: ${str2})`; - throw err; - } - } - exports2.json = json2; - function req(url2, opts = {}) { - const href = typeof url2 === "string" ? url2 : url2.href; - const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); - const promise = new Promise((resolve6, reject) => { - req2.once("response", resolve6).once("error", reject).end(); - }); - req2.then = promise.then.bind(promise); - return req2; + } +}); + +// 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 = randomUUID2; + function randomUUID2() { + return crypto.randomUUID(); } - exports2.req = req; } }); -// node_modules/agent-base/dist/index.js -var require_dist2 = __commonJS({ - "node_modules/agent-base/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __exportStar4 = exports2 && exports2.__exportStar || function(m, exports3) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding4(exports3, m, p); }; + 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.Agent = void 0; - var net = __importStar4(require("net")); - var http = __importStar4(require("http")); - var https_1 = require("https"); - __exportStar4(require_helpers2(), exports2); - var INTERNAL = 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; + 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; } - decrementSockets(name, socket) { - if (!this.sockets[name] || socket === null) { - return; + addPolicy(policy, options = {}) { + if (options.phase && options.afterPhase) { + throw new Error("Policies inside a phase cannot specify afterPhase."); } - const sockets = this.sockets[name]; - const index = sockets.indexOf(socket); - if (index !== -1) { - sockets.splice(index, 1); - this.totalSocketCount--; - if (sockets.length === 0) { - delete this.sockets[name]; - } + if (options.phase && !ValidPhaseNames.has(options.phase)) { + throw new Error(`Invalid phase name: ${options.phase}`); } - } - // 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); + if (options.afterPhase && !ValidPhaseNames.has(options.afterPhase)) { + throw new Error(`Invalid afterPhase name: ${options.afterPhase}`); } - return super.getName(options); + this._policies.push({ + policy, + options + }); + this._orderedPolicies = void 0; } - 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); - } + 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[INTERNAL].currentSocket = socket; - super.createSocket(req, options, cb); - }, (err) => { - this.decrementSockets(name, fakeSocket); - cb(err); }); + this._orderedPolicies = void 0; + return removedPolicies; } - 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); + sendRequest(httpClient, request) { + const policies = this.getOrderedPolicies(); + const pipeline = policies.reduceRight((next, policy) => { + return (req) => { + return policy.sendRequest(req, next); + }; + }, (req) => httpClient.sendRequest(req)); + return pipeline(request); } - set defaultPort(v) { - if (this[INTERNAL]) { - this[INTERNAL].defaultPort = v; + getOrderedPolicies() { + if (!this._orderedPolicies) { + this._orderedPolicies = this.orderPolicies(); } + return this._orderedPolicies; } - get protocol() { - return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + clone() { + return new _HttpPipeline(this._policies); } - set protocol(v) { - if (this[INTERNAL]) { - this[INTERNAL].protocol = v; - } + static create() { + return new _HttpPipeline(); } - }; - 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 __importDefault4 = 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 = __importDefault4(require_src()); - var debug6 = (0, debug_1.default)("https-proxy-agent:parse-proxy-response"); - function parseProxyResponse(socket) { - return new Promise((resolve6, 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); + orderPolicies() { + const result = []; + const policyMap = /* @__PURE__ */ new Map(); + function createPhase(name) { + return { + name, + policies: /* @__PURE__ */ new Set(), + hasRun: false, + hasAfterPolicies: false + }; } - function onend() { - cleanup(); - debug6("onend"); - reject(new Error("Proxy connection ended before receiving CONNECT response")); + 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; + } } - function onerror(err) { - cleanup(); - debug6("onerror %o", err); - reject(err); + 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); } - 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; + 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}`); } - 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")); + if (options.afterPolicies) { + for (const afterPolicyName of options.afterPolicies) { + const afterNode = policyMap.get(afterPolicyName); + if (afterNode) { + node.dependsOn.add(afterNode); + afterNode.dependants.add(node); + } + } } - const firstLineParts = firstLine.split(" "); - const statusCode = +firstLineParts[1]; - const statusText = firstLineParts.slice(2).join(" "); - const headers = {}; - for (const header of headerParts) { - if (!header) + 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; - 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; + 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); } } - debug6("got proxy server response: %o %o", firstLine, headers); - cleanup(); - resolve6({ - 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 __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpsProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var assert_1 = __importDefault4(require("assert")); - var debug_1 = __importDefault4(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 HttpsProxyAgent = 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 ? omit(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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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 -`; + 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); + } + } } - 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({ - ...omit(setServernameFromNonIpHost(opts), "host", "path", "port"), - socket - }); + 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 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; + return result; } }; - HttpsProxyAgent.protocols = ["http", "https"]; - exports2.HttpsProxyAgent = HttpsProxyAgent; - function resume(socket) { - socket.resume(); - } - function omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + function createEmptyPipeline() { + return HttpPipeline.create(); } } }); -// node_modules/http-proxy-agent/dist/index.js -var require_dist4 = __commonJS({ - "node_modules/http-proxy-agent/dist/index.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __importDefault4 = exports2 && exports2.__importDefault || function(mod) { - return mod && mod.__esModule ? mod : { "default": mod }; - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.HttpProxyAgent = void 0; - var net = __importStar4(require("net")); - var tls = __importStar4(require("tls")); - var debug_1 = __importDefault4(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 ? omit(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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; - headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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 omit(obj, ...keys) { - const ret = {}; - let key; - for (key in obj) { - if (!keys.includes(key)) { - ret[key] = obj[key]; - } - } - return ret; + exports2.isObject = isObject2; + function isObject2(input) { + return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js -var require_proxyPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/proxyPolicy.js"(exports2) { +// 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.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_log(); - 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; + 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; } - const httpsProxy = getEnvironmentValue(HTTPS_PROXY); - const allProxy = getEnvironmentValue(ALL_PROXY); - const httpProxy = getEnvironmentValue(HTTP_PROXY); - return httpsProxy || allProxy || httpProxy; + return false; } - function isBypassed(uri, noProxyList, bypassedMap) { - if (noProxyList.length === 0) { - return false; - } - const host = new URL(uri).hostname; - if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) { - return bypassedMap.get(host); + } +}); + +// 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())); } - 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; - } + /** + * 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 + }; } - } else { - if (host === pattern) { - isBypassedFlag = true; + 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); } - } - } - bypassedMap === null || bypassedMap === void 0 ? void 0 : 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 value; + }, 2); } - return []; - } - function getDefaultProxySettings(proxyUrl) { - if (!proxyUrl) { - proxyUrl = loadEnvironmentProxyValue(); - if (!proxyUrl) { - return void 0; + /** + * 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 parsedUrl = new URL(proxyUrl); - const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; - return { - host: schema2 + 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 (_a) { - 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(request, cachedAgents, proxyUrl) { - if (request.agent) { - return; - } - const url2 = new URL(request.url); - const isInsecure = url2.protocol !== "https:"; - if (request.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 = request.headers.toJSON(); - if (isInsecure) { - if (!cachedAgents.httpProxyAgent) { - cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); + const url2 = new URL(value); + if (!url2.search) { + return value; } - request.agent = cachedAgents.httpProxyAgent; - } else { - if (!cachedAgents.httpsProxyAgent) { - cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); + for (const [key] of url2.searchParams) { + if (!this.allowedQueryParameters.has(key.toLowerCase())) { + url2.searchParams.set(key, RedactedString); + } } - request.agent = cachedAgents.httpsProxyAgent; - } - } - function proxyPolicy(proxySettings, options) { - if (!noProxyListLoaded) { - exports2.globalNoProxyList.push(...loadNoProxy()); + return url2.toString(); } - const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); - const cachedAgents = {}; - return { - name: exports2.proxyPolicyName, - async sendRequest(request, next) { - var _a; - if (!request.proxySettings && defaultProxy && !isBypassed(request.url, (_a = options === null || options === void 0 ? void 0 : options.customNoProxyList) !== null && _a !== void 0 ? _a : exports2.globalNoProxyList, (options === null || options === void 0 ? void 0 : options.customNoProxyList) ? void 0 : globalBypassedMap)) { - setProxyAgentOnRequest(request, cachedAgents, defaultProxy); - } else if (request.proxySettings) { - setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); + 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 next(request); } - }; - } - } -}); - -// 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(request, next) { - if (!request.headers.has(requestIdHeaderName)) { - request.headers.set(requestIdHeaderName, request.requestId); + 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 next(request); } - }; - } + return sanitized; + } + }; + exports2.Sanitizer = Sanitizer; } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js -var require_tlsPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/tlsPolicy.js"(exports2) { +// 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.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); - } - }; + 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/@azure/core-tracing/dist/commonjs/tracingContext.js -var require_tracingContext = __commonJS({ - "node_modules/@azure/core-tracing/dist/commonjs/tracingContext.js"(exports2) { +// 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.TracingContextImpl = exports2.createTracingContext = exports2.knownContextKeys = void 0; - exports2.knownContextKeys = { - span: Symbol.for("@azure/core-tracing span"), - namespace: Symbol.for("@azure/core-tracing namespace") - }; - function createTracingContext(options = {}) { - let context2 = new TracingContextImpl(options.parentContext); - if (options.span) { - context2 = context2.setValue(exports2.knownContextKeys.span, options.span); - } - if (options.namespace) { - context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); - } - return context2; + 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); } - exports2.createTracingContext = createTracingContext; - var TracingContextImpl = class _TracingContextImpl { - 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) { +// 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.state = void 0; - exports2.state = { - instrumenterImplementation: void 0 - }; + exports2.logger = void 0; + var logger_js_1 = require_logger(); + exports2.logger = (0, logger_js_1.createClientLogger)("ts-http-runtime"); } }); -// 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.getInstrumenter = exports2.useInstrumenter = exports2.createDefaultInstrumenter = exports2.createDefaultTracingSpan = void 0; - var tracingContext_js_1 = require_tracingContext(); - var state_js_1 = require_state(); - function createDefaultTracingSpan() { - return { - end: () => { - }, - isRecording: () => false, - recordException: () => { - }, - setAttribute: () => { - }, - setStatus: () => { - } - }; - } - exports2.createDefaultTracingSpan = createDefaultTracingSpan; - 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); - } - }; - } - exports2.createDefaultInstrumenter = createDefaultInstrumenter; - function useInstrumenter(instrumenter) { - state_js_1.state.instrumenterImplementation = instrumenter; - } - exports2.useInstrumenter = useInstrumenter; - function getInstrumenter() { - if (!state_js_1.state.instrumenterImplementation) { - state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); - } - return state_js_1.state.instrumenterImplementation; - } - exports2.getInstrumenter = getInstrumenter; - } -}); - -// 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 = void 0; - 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) { - var _a; - const startSpanResult = (0, instrumenter_js_1.getInstrumenter)().startSpan(name, Object.assign(Object.assign({}, spanOptions), { packageName, packageVersion, tracingContext: (_a = operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) === null || _a === void 0 ? void 0 : _a.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: Object.assign(Object.assign({}, operationOptions === null || operationOptions === void 0 ? void 0 : 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(context2, callback, ...callbackArgs) { - return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, 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 - }; - } - exports2.createTracingClient = createTracingClient; - } -}); - -// node_modules/@azure/core-tracing/dist/commonjs/index.js -var require_commonjs4 = __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/util/inspect.js -var require_inspect = __commonJS({ - "node_modules/@azure/core-rest-pipeline/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/@azure/core-rest-pipeline/dist/commonjs/restError.js -var require_restError = __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 core_util_1 = require_commonjs2(); - 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 { - 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 }); - Object.setPrototypeOf(this, _RestError.prototype); - } - /** - * Logging method for util.inspect in Node - */ - [inspect_js_1.custom]() { - return `RestError: ${this.message} - ${errorSanitizer.sanitize(Object.assign(Object.assign({}, this), { request: this.request, response: this.response }))}`; - } - }; - exports2.RestError = RestError; - RestError.REQUEST_SEND_ERROR = "REQUEST_SEND_ERROR"; - RestError.PARSE_ERROR = "PARSE_ERROR"; - function isRestError(e) { - if (e instanceof RestError) { - return true; - } - return (0, core_util_1.isError)(e) && e.name === "RestError"; - } - } -}); - -// 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_commonjs4(); - var constants_js_1 = require_constants8(); - var userAgent_js_1 = require_userAgent(); - var log_js_1 = require_log(); - var core_util_1 = require_commonjs2(); - var restError_js_1 = require_restError(); - var sanitizer_js_1 = require_sanitizer(); - exports2.tracingPolicyName = "tracingPolicy"; - function tracingPolicy(options = {}) { - const userAgentPromise = (0, userAgent_js_1.getUserAgentValue)(options.userAgentPrefix); - const sanitizer = new sanitizer_js_1.Sanitizer({ - additionalAllowedQueryParameters: options.additionalAllowedQueryParameters - }); - const tracingClient = tryCreateTracingClient(); - return { - name: exports2.tracingPolicyName, - async sendRequest(request, next) { - var _a; - if (!tracingClient) { - return next(request); - } - const userAgent = await userAgentPromise; - const spanAttributes = { - "http.url": sanitizer.sanitizeUrl(request.url), - "http.method": request.method, - "http.user_agent": userAgent, - requestId: request.requestId - }; - if (userAgent) { - spanAttributes["http.user_agent"] = userAgent; - } - const { span, tracingContext } = (_a = tryCreateSpan(tracingClient, request, spanAttributes)) !== null && _a !== void 0 ? _a : {}; - if (!span || !tracingContext) { - return next(request); - } - try { - const response = await tracingClient.withContext(tracingContext, next, request); - 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, request, spanAttributes) { - try { - const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { - request.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, error4) { - try { - span.setStatus({ - status: "error", - error: (0, core_util_1.isError)(error4) ? error4 : void 0 - }); - if ((0, restError_js_1.isRestError)(error4) && error4.statusCode) { - span.setAttribute("http.status_code", error4.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); - } - span.setStatus({ - status: "success" - }); - 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/createPipelineFromOptions.js -var require_createPipelineFromOptions = __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_logPolicy(); - var pipeline_js_1 = require_pipeline(); - var redirectPolicy_js_1 = require_redirectPolicy(); - var userAgentPolicy_js_1 = require_userAgentPolicy(); - var multipartPolicy_js_1 = require_multipartPolicy(); - var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); - var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); - var formDataPolicy_js_1 = require_formDataPolicy(); - var core_util_1 = require_commonjs2(); - var proxyPolicy_js_1 = require_proxyPolicy(); - var setClientRequestIdPolicy_js_1 = require_setClientRequestIdPolicy(); - var tlsPolicy_js_1 = require_tlsPolicy(); - var tracingPolicy_js_1 = require_tracingPolicy(); - function createPipelineFromOptions(options) { - var _a; - const pipeline = (0, pipeline_js_1.createEmptyPipeline)(); - if (core_util_1.isNodeLike) { - if (options.tlsOptions) { - pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); - } - pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); - pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); - } - pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); - pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); - pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)((_a = options.telemetryOptions) === null || _a === void 0 ? void 0 : _a.clientRequestIdHeaderName)); - pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); - pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); - pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)(Object.assign(Object.assign({}, options.userAgentOptions), options.loggingOptions)), { - afterPhase: "Retry" - }); - if (core_util_1.isNodeLike) { - pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); - } - pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); - return pipeline; - } - } -}); - -// node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js -var require_nodeHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/nodeHttpClient.js"(exports2) { +// 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 http = tslib_1.__importStar(require("node:http")); - var https2 = tslib_1.__importStar(require("node:https")); - var zlib2 = tslib_1.__importStar(require("node:zlib")); + 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 abort_controller_1 = require_commonjs3(); + var AbortError_js_1 = require_AbortError(); var httpHeaders_js_1 = require_httpHeaders(); var restError_js_1 = require_restError(); - var log_js_1 = require_log(); + 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((resolve6) => { const handler = () => { resolve6(); @@ -37926,6 +36601,8 @@ var require_nodeHttpClient = __commonJS({ 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); @@ -37939,25 +36616,22 @@ var require_nodeHttpClient = __commonJS({ } constructor(progressCallback) { super(); - this.loadedBytes = 0; this.progressCallback = progressCallback; } }; var NodeHttpClient = class { - constructor() { - this.cachedHttpsAgents = /* @__PURE__ */ new WeakMap(); - } + 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(request) { - var _a, _b, _c; const abortController = new AbortController(); let abortListener; if (request.abortSignal) { if (request.abortSignal.aborted) { - throw new abort_controller_1.AbortError("The operation was aborted."); + throw new AbortError_js_1.AbortError("The operation was aborted. Request has already been canceled."); } abortListener = (event) => { if (event.type === "abort") { @@ -37966,13 +36640,16 @@ var require_nodeHttpClient = __commonJS({ }; request.abortSignal.addEventListener("abort", abortListener); } + let timeoutId; if (request.timeout > 0) { - setTimeout(() => { + timeoutId = setTimeout(() => { + const sanitizer = new sanitizer_js_1.Sanitizer(); + log_js_1.logger.info(`request to '${sanitizer.sanitizeUrl(request.url)}' timed out. canceling...`); abortController.abort(); }, request.timeout); } const acceptEncoding = request.headers.get("Accept-Encoding"); - const shouldDecompress = (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("gzip")) || (acceptEncoding === null || acceptEncoding === void 0 ? void 0 : acceptEncoding.includes("deflate")); + const shouldDecompress = acceptEncoding?.includes("gzip") || acceptEncoding?.includes("deflate"); let body = typeof request.body === "function" ? request.body() : request.body; if (body && !request.headers.has("Content-Length")) { const bodyLength = getBodyLength(body); @@ -37996,8 +36673,11 @@ var require_nodeHttpClient = __commonJS({ body = uploadReportStream; } const res = await this.makeRequest(request, abortController, body); + if (timeoutId !== void 0) { + clearTimeout(timeoutId); + } const headers = getResponseHeaders(res); - const status = (_a = res.statusCode) !== null && _a !== void 0 ? _a : 0; + const status = res.statusCode ?? 0; const response = { status, headers, @@ -38019,7 +36699,7 @@ var require_nodeHttpClient = __commonJS({ } if ( // Value of POSITIVE_INFINITY in streamResponseStatusCodes is considered as any status code - ((_b = request.streamResponseStatusCodes) === null || _b === void 0 ? void 0 : _b.has(Number.POSITIVE_INFINITY)) || ((_c = request.streamResponseStatusCodes) === null || _c === void 0 ? void 0 : _c.has(response.status)) + request.streamResponseStatusCodes?.has(Number.POSITIVE_INFINITY) || request.streamResponseStatusCodes?.has(response.status) ) { response.readableStreamBody = responseStream; } else { @@ -38037,9 +36717,8 @@ var require_nodeHttpClient = __commonJS({ downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { - var _a2; if (abortListener) { - (_a2 = request.abortSignal) === null || _a2 === void 0 ? void 0 : _a2.removeEventListener("abort", abortListener); + request.abortSignal?.removeEventListener("abort", abortListener); } }).catch((e) => { log_js_1.logger.warning("Error when cleaning up abortListener on httpRequest", e); @@ -38048,29 +36727,28 @@ var require_nodeHttpClient = __commonJS({ } } makeRequest(request, abortController, body) { - var _a; const url2 = new URL(request.url); const isInsecure = url2.protocol !== "https:"; if (isInsecure && !request.allowInsecureConnection) { throw new Error(`Cannot connect to ${request.url} while allowInsecureConnection is false.`); } - const agent = (_a = request.agent) !== null && _a !== void 0 ? _a : this.getOrCreateAgent(request, isInsecure); + const agent = request.agent ?? this.getOrCreateAgent(request, isInsecure); const options = { agent, hostname: url2.hostname, path: `${url2.pathname}${url2.search}`, port: url2.port, method: request.method, - headers: request.headers.toJSON({ preserveCase: true }) + headers: request.headers.toJSON({ preserveCase: true }), + ...request.requestOverrides }; return new Promise((resolve6, reject) => { - const req = isInsecure ? http.request(options, resolve6) : https2.request(options, resolve6); + const req = isInsecure ? node_http_1.default.request(options, resolve6) : node_https_1.default.request(options, resolve6); req.once("error", (err) => { - var _a2; - reject(new restError_js_1.RestError(err.message, { code: (_a2 = err.code) !== null && _a2 !== void 0 ? _a2 : restError_js_1.RestError.REQUEST_SEND_ERROR, request })); + reject(new restError_js_1.RestError(err.message, { code: err.code ?? restError_js_1.RestError.REQUEST_SEND_ERROR, request })); }); abortController.signal.addEventListener("abort", () => { - const abortError = new abort_controller_1.AbortError("The operation was aborted."); + const abortError = new AbortError_js_1.AbortError("The operation was aborted. Rejecting from abort signal callback while making request."); req.destroy(abortError); reject(abortError); }); @@ -38091,30 +36769,31 @@ var require_nodeHttpClient = __commonJS({ }); } getOrCreateAgent(request, isInsecure) { - var _a; const disableKeepAlive = request.disableKeepAlive; if (isInsecure) { if (disableKeepAlive) { - return http.globalAgent; + return node_http_1.default.globalAgent; } if (!this.cachedHttpAgent) { - this.cachedHttpAgent = new http.Agent({ keepAlive: true }); + this.cachedHttpAgent = new node_http_1.default.Agent({ keepAlive: true }); } return this.cachedHttpAgent; } else { if (disableKeepAlive && !request.tlsSettings) { - return https2.globalAgent; + return node_https_1.default.globalAgent; } - const tlsSettings = (_a = request.tlsSettings) !== null && _a !== void 0 ? _a : DEFAULT_TLS_SETTINGS; + const tlsSettings = request.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 https2.Agent(Object.assign({ + agent = new node_https_1.default.Agent({ // keepAlive is true if disableKeepAlive is false. - keepAlive: !disableKeepAlive - }, tlsSettings)); + 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; } @@ -38137,11 +36816,11 @@ var require_nodeHttpClient = __commonJS({ function getDecodedResponseStream(stream2, headers) { const contentEncoding = headers.get("Content-Encoding"); if (contentEncoding === "gzip") { - const unzip = zlib2.createGunzip(); + const unzip = node_zlib_1.default.createGunzip(); stream2.pipe(unzip); return unzip; } else if (contentEncoding === "deflate") { - const inflate = zlib2.createInflate(); + const inflate = node_zlib_1.default.createInflate(); stream2.pipe(inflate); return inflate; } @@ -38161,7 +36840,7 @@ var require_nodeHttpClient = __commonJS({ resolve6(Buffer.concat(buffer).toString("utf8")); }); stream2.on("error", (e) => { - if (e && (e === null || e === void 0 ? void 0 : e.name) === "AbortError") { + if (e && e?.name === "AbortError") { reject(e); } else { reject(new restError_js_1.RestError(`Error reading response as text: ${e.message}`, { @@ -38192,9 +36871,9 @@ var require_nodeHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js var require_defaultHttpClient = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/defaultHttpClient.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/defaultHttpClient.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); exports2.createDefaultHttpClient = createDefaultHttpClient; @@ -38205,1760 +36884,1368 @@ var require_defaultHttpClient = __commonJS({ } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js -var require_pipelineRequest = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/pipelineRequest.js"(exports2) { +// 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.createPipelineRequest = createPipelineRequest; - var httpHeaders_js_1 = require_httpHeaders(); - var core_util_1 = require_commonjs2(); - var PipelineRequestImpl = class { - constructor(options) { - var _a, _b, _c, _d, _e, _f, _g; - this.url = options.url; - this.body = options.body; - this.headers = (_a = options.headers) !== null && _a !== void 0 ? _a : (0, httpHeaders_js_1.createHttpHeaders)(); - this.method = (_b = options.method) !== null && _b !== void 0 ? _b : "GET"; - this.timeout = (_c = options.timeout) !== null && _c !== void 0 ? _c : 0; - this.multipartBody = options.multipartBody; - this.formData = options.formData; - this.disableKeepAlive = (_d = options.disableKeepAlive) !== null && _d !== void 0 ? _d : false; - this.proxySettings = options.proxySettings; - this.streamResponseStatusCodes = options.streamResponseStatusCodes; - this.withCredentials = (_e = options.withCredentials) !== null && _e !== void 0 ? _e : false; - this.abortSignal = options.abortSignal; - this.tracingOptions = options.tracingOptions; - this.onUploadProgress = options.onUploadProgress; - this.onDownloadProgress = options.onDownloadProgress; - this.requestId = options.requestId || (0, core_util_1.randomUUID)(); - this.allowInsecureConnection = (_f = options.allowInsecureConnection) !== null && _f !== void 0 ? _f : false; - this.enableBrowserStreams = (_g = options.enableBrowserStreams) !== null && _g !== void 0 ? _g : false; - } - }; - function createPipelineRequest(options) { - return new PipelineRequestImpl(options); + 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(request, next) { + if (!logger.enabled) { + return next(request); + } + logger(`Request: ${sanitizer.sanitize(request)}`); + const response = await next(request); + logger(`Response status code: ${response.status}`); + logger(`Headers: ${sanitizer.sanitize(response.headers)}`); + return response; + } + }; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js -var require_exponentialRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/exponentialRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreSystemErrors: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }); + 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(request, next) { + const response = await next(request); + return handleRedirect(next, response, maxRetries); + } + }; + } + async function handleRedirect(next, response, maxRetries, currentRetries = 0) { + const { request, status, headers } = response; + const locationHeader = headers.get("location"); + if (locationHeader && (status === 300 || status === 301 && allowedRedirect.includes(request.method) || status === 302 && allowedRedirect.includes(request.method) || status === 303 && request.method === "POST" || status === 307) && currentRetries < maxRetries) { + const url2 = new URL(locationHeader, request.url); + request.url = url2.toString(); + if (status === 303) { + request.method = "GET"; + request.headers.delete("Content-Length"); + delete request.body; + } + request.headers.delete("Authorization"); + const res = await next(request); + return handleRedirect(next, res, maxRetries, currentRetries + 1); + } + return response; } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js -var require_systemErrorRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/systemErrorRetryPolicy.js"(exports2) { +// 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.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 = {}) { - var _a; - return { - name: exports2.systemErrorRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([ - (0, exponentialRetryStrategy_js_1.exponentialRetryStrategy)(Object.assign(Object.assign({}, options), { ignoreHttpStatusCodes: true })) - ], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } + } } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js -var require_throttlingRetryPolicy = __commonJS({ - "node_modules/@azure/core-rest-pipeline/dist/commonjs/policies/throttlingRetryPolicy.js"(exports2) { +// 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.throttlingRetryPolicyName = void 0; - exports2.throttlingRetryPolicy = throttlingRetryPolicy; - var throttlingRetryStrategy_js_1 = require_throttlingRetryStrategy(); - var retryPolicy_js_1 = require_retryPolicy(); + 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(); - exports2.throttlingRetryPolicyName = "throttlingRetryPolicy"; - function throttlingRetryPolicy(options = {}) { - var _a; - return { - name: exports2.throttlingRetryPolicyName, - sendRequest: (0, retryPolicy_js_1.retryPolicy)([(0, throttlingRetryStrategy_js_1.throttlingRetryStrategy)()], { - maxRetries: (_a = options.maxRetries) !== null && _a !== void 0 ? _a : constants_js_1.DEFAULT_RETRY_POLICY_COUNT - }).sendRequest - }; + 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/@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) { +// 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.DEFAULT_CYCLER_OPTIONS = void 0; - exports2.createTokenCycler = createTokenCycler; - var helpers_js_1 = require_helpers(); - 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 (_a) { - return null; - } - } else { - const finalToken = await getAccessToken(); - if (finalToken === null) { - throw new Error("Failed to refresh access token."); + 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(request, next) { + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - return finalToken; + return next(request); } - } - let token = await tryGetAccessToken(); - while (token === null) { - await (0, helpers_js_1.delay)(retryIntervalInMs); - token = await tryGetAccessToken(); - } - return token; + }; } - function createTokenCycler(credential, tokenCyclerOptions) { - let refreshWorker = null; - let token = null; - let tenantId; - const options = Object.assign(Object.assign({}, 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() { - var _a; - if (cycler.isRefreshing) { - return false; - } - if ((token === null || token === void 0 ? void 0 : token.refreshAfterTimestamp) && token.refreshAfterTimestamp < Date.now()) { - return true; + } +}); + +// 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(request, next) { + if (request.method !== "HEAD") { + request.headers.set("Accept-Encoding", "gzip,deflate"); } - return ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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(); + return next(request); } }; - function refresh(scopes, getTokenOptions) { - var _a; - 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 - (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 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); + } + } +}); + +// 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_helpers = __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((resolve6, 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(); } - if (cycler.shouldRefresh) { - refresh(scopes, tokenOptions); + timer = setTimeout(() => { + removeListeners(); + resolve6(value); + }, delayInMs); + if (options?.abortSignal) { + options.abortSignal.addEventListener("abort", onAborted); } - return token; - }; + }); + } + 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/@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) { +// 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.bearerTokenAuthenticationPolicyName = void 0; - exports2.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.bearerTokenAuthenticationPolicyName = "bearerTokenAuthenticationPolicy"; - async function defaultAuthorizeRequest(options) { - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions - }; - const accessToken = await getAccessToken(scopes, getTokenOptions); - if (accessToken) { - options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); + exports2.isThrottlingRetryResponse = isThrottlingRetryResponse; + exports2.throttlingRetryStrategy = throttlingRetryStrategy; + var helpers_js_1 = require_helpers(); + 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 getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + function isThrottlingRetryResponse(response) { + return Number.isFinite(getRetryAfterInMs(response)); } - function bearerTokenAuthenticationPolicy(options) { - var _a; - const { credential, scopes, challengeCallbacks } = options; - const logger = options.logger || log_js_1.logger; - const callbacks = Object.assign({ authorizeRequest: (_a = challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequest) !== null && _a !== void 0 ? _a : defaultAuthorizeRequest, authorizeRequestOnChallenge: challengeCallbacks === null || challengeCallbacks === void 0 ? void 0 : challengeCallbacks.authorizeRequestOnChallenge }, challengeCallbacks); - const getAccessToken = credential ? (0, tokenCycler_js_1.createTokenCycler)( - credential - /* , options */ - ) : () => Promise.resolve(null); + function throttlingRetryStrategy() { 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(request, next) { - if (!request.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, - getAccessToken, - logger - }); - let response; - let error4; - try { - response = await next(request); - } catch (err) { - error4 = err; - response = err.response; + name: "throttlingRetryStrategy", + retry({ response }) { + const retryAfterInMs = getRetryAfterInMs(response); + if (!Number.isFinite(retryAfterInMs)) { + return { skipStrategy: true }; } - if (callbacks.authorizeRequestOnChallenge && (response === null || response === void 0 ? void 0 : response.status) === 401 && getChallenge(response)) { - const shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - response, - getAccessToken, - logger - }); - if (shouldSendRequest) { - return next(request); - } + 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 (error4) { - throw error4; - } else { - return response; + 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/@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) { +// 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.ndJsonPolicyName = void 0; - exports2.ndJsonPolicy = ndJsonPolicy; - exports2.ndJsonPolicyName = "ndJsonPolicy"; - function ndJsonPolicy() { + exports2.retryPolicy = retryPolicy; + var helpers_js_1 = require_helpers(); + 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: exports2.ndJsonPolicyName, + name: retryPolicyName, async sendRequest(request, next) { - if (typeof request.body === "string" && request.body.startsWith("[")) { - const body = JSON.parse(request.body); - if (Array.isArray(body)) { - request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + 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`, request.requestId); + response = await next(request); + logger.info(`Retry ${retryCount}: Received a response from request`, request.requestId); + } catch (e) { + logger.error(`Retry ${retryCount}: Received an error from request`, request.requestId); + responseError = e; + if (!e || responseError.name !== "RestError") { + throw e; + } + response = responseError.response; + } + if (request.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: request.abortSignal }); + continue retryRequest; + } + if (redirectTo) { + strategyLogger.info(`Retry ${retryCount}: Retry strategy ${strategy.name} redirects to ${redirectTo}`); + request.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; } } - return next(request); } }; } } }); -// 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) { +// 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.auxiliaryAuthenticationHeaderPolicyName = void 0; - exports2.auxiliaryAuthenticationHeaderPolicy = auxiliaryAuthenticationHeaderPolicy; - var tokenCycler_js_1 = require_tokenCycler(); - var log_js_1 = require_log(); - exports2.auxiliaryAuthenticationHeaderPolicyName = "auxiliaryAuthenticationHeaderPolicy"; - var AUTHORIZATION_AUXILIARY_HEADER = "x-ms-authorization-auxiliary"; - async function sendAuthorizeRequest(options) { - var _a, _b; - const { scopes, getAccessToken, request } = options; - const getTokenOptions = { - abortSignal: request.abortSignal, - tracingOptions: request.tracingOptions + 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 }; - return (_b = (_a = await getAccessToken(scopes, getTokenOptions)) === null || _a === void 0 ? void 0 : _a.token) !== null && _b !== void 0 ? _b : ""; } - function auxiliaryAuthenticationHeaderPolicy(options) { - const { credentials, scopes } = options; - const logger = options.logger || log_js_1.logger; - const tokenCyclerMap = /* @__PURE__ */ new WeakMap(); + } +}); + +// 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.auxiliaryAuthenticationHeaderPolicyName, + name: exports2.formDataPolicyName, async sendRequest(request, next) { - if (!request.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(request); + if (checkEnvironment_js_1.isNodeLike && typeof FormData !== "undefined" && request.body instanceof FormData) { + request.formData = formDataToFormDataMap(request.body); + request.body = void 0; } - 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); + if (request.formData) { + const contentType = request.headers.get("Content-Type"); + if (contentType && contentType.indexOf("application/x-www-form-urlencoded") !== -1) { + request.body = wwwFormUrlEncode(request.formData); + } else { + await prepareFormData(request.formData, request); } - tokenPromises.push(sendAuthorizeRequest({ - scopes: Array.isArray(scopes) ? scopes : [scopes], - request, - 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(request); + request.formData = void 0; } - request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); return next(request); } }; } + 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, request) { + const contentType = request.headers.get("Content-Type"); + if (contentType && !contentType.startsWith("multipart/form-data")) { + return; + } + request.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 + }); + } + } + } + request.multipartBody = { parts }; + } } }); -// node_modules/@azure/core-rest-pipeline/dist/commonjs/index.js -var require_commonjs5 = __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.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_pipeline(); - Object.defineProperty(exports2, "createEmptyPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createEmptyPipeline; - } }); - var createPipelineFromOptions_js_1 = require_createPipelineFromOptions(); - Object.defineProperty(exports2, "createPipelineFromOptions", { enumerable: true, get: function() { - return createPipelineFromOptions_js_1.createPipelineFromOptions; - } }); - var defaultHttpClient_js_1 = require_defaultHttpClient(); - Object.defineProperty(exports2, "createDefaultHttpClient", { enumerable: true, get: function() { - return defaultHttpClient_js_1.createDefaultHttpClient; - } }); - var httpHeaders_js_1 = require_httpHeaders(); - Object.defineProperty(exports2, "createHttpHeaders", { enumerable: true, get: function() { - return httpHeaders_js_1.createHttpHeaders; - } }); - var pipelineRequest_js_1 = require_pipelineRequest(); - Object.defineProperty(exports2, "createPipelineRequest", { enumerable: true, get: function() { - return pipelineRequest_js_1.createPipelineRequest; - } }); - 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 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 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 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_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 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 retryPolicy_js_1 = require_retryPolicy(); - 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_defaultRetryPolicy(); - Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { - return defaultRetryPolicy_js_1.defaultRetryPolicy; - } }); - 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; - } }); - 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 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 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 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/storage-blob/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports2 = {}; -__export(tslib_es6_exports2, { - __addDisposableResource: () => __addDisposableResource2, - __assign: () => __assign2, - __asyncDelegator: () => __asyncDelegator2, - __asyncGenerator: () => __asyncGenerator2, - __asyncValues: () => __asyncValues2, - __await: () => __await2, - __awaiter: () => __awaiter2, - __classPrivateFieldGet: () => __classPrivateFieldGet2, - __classPrivateFieldIn: () => __classPrivateFieldIn2, - __classPrivateFieldSet: () => __classPrivateFieldSet2, - __createBinding: () => __createBinding2, - __decorate: () => __decorate2, - __disposeResources: () => __disposeResources2, - __esDecorate: () => __esDecorate2, - __exportStar: () => __exportStar2, - __extends: () => __extends2, - __generator: () => __generator2, - __importDefault: () => __importDefault2, - __importStar: () => __importStar2, - __makeTemplateObject: () => __makeTemplateObject2, - __metadata: () => __metadata2, - __param: () => __param2, - __propKey: () => __propKey2, - __read: () => __read2, - __rest: () => __rest2, - __runInitializers: () => __runInitializers2, - __setFunctionName: () => __setFunctionName2, - __spread: () => __spread2, - __spreadArray: () => __spreadArray2, - __spreadArrays: () => __spreadArrays2, - __values: () => __values3, - default: () => tslib_es6_default2 -}); -function __extends2(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics2(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest2(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 __decorate2(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 __param2(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate2(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.addInitializer = function(f) { - if (done) throw new TypeError("Cannot add initializers after decoration has completed"); - extraInitializers.push(accept(f || null)); +// 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 type2 = typeof val; + if (type2 === "string" && val.length > 0) { + return parse(val); + } else if (type2 === "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) + ); }; - var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; - } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers2(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 __propKey2(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName2(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 __metadata2(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter2(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); + function parse(str2) { + str2 = String(str2); + if (str2.length > 100) { + return; } - } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str2 + ); + if (!match) { + return; } - } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator2(thisArg, body) { - var _ = { 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] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; + var n = parseFloat(match[1]); + var type2 = (match[2] || "ms").toLowerCase(); + switch (type2) { + 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: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; + return void 0; } - op = body.call(thisArg, _); - } 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 __exportStar2(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding2(o, m, p); -} -function __values3(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 }; + 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"; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read2(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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"; } - } - return ar; -} -function __spread2() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read2(arguments[i])); - return ar; -} -function __spreadArrays2() { - 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 __spreadArray2(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]; + function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + " " + name + (isPlural ? "s" : ""); } } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await2(v) { - return this instanceof __await2 ? (this.v = v, this) : new __await2(v); -} -function __asyncGenerator2(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]); - } -} -function __asyncDelegator2(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: __await2(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues2(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 __values3 === "function" ? __values3(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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); +}); + +// 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]; }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject2(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar2(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; -} -function __importDefault2(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet2(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 __classPrivateFieldSet2(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 __classPrivateFieldIn2(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 __addDisposableResource2(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); + 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]; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources2(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError2(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(); + 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 index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + if (match === "%%") { + return "%"; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === "function") { + const val = args[index]; + match = formatter.call(self2, val); + args.splice(index, 1); + index--; + } + return match; }); - } 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(); -} -var extendStatics2, __assign2, __createBinding2, __setModuleDefault2, _SuppressedError2, tslib_es6_default2; -var init_tslib_es62 = __esm({ - "node_modules/@azure/storage-blob/node_modules/tslib/tslib.es6.mjs"() { - extendStatics2 = function(d, b) { - extendStatics2 = 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 extendStatics2(d, b); - }; - __assign2 = function() { - __assign2 = Object.assign || function __assign4(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]; + createDebug.formatArgs.call(self2, args); + const logFn = self2.log || createDebug.log; + logFn.apply(self2, args); } - return t; - }; - return __assign2.apply(this, arguments); - }; - __createBinding2 = 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]; - }); - __setModuleDefault2 = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }; - _SuppressedError2 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default2 = { - __extends: __extends2, - __assign: __assign2, - __rest: __rest2, - __decorate: __decorate2, - __param: __param2, - __metadata: __metadata2, - __awaiter: __awaiter2, - __generator: __generator2, - __createBinding: __createBinding2, - __exportStar: __exportStar2, - __values: __values3, - __read: __read2, - __spread: __spread2, - __spreadArrays: __spreadArrays2, - __spreadArray: __spreadArray2, - __await: __await2, - __asyncGenerator: __asyncGenerator2, - __asyncDelegator: __asyncDelegator2, - __asyncValues: __asyncValues2, - __makeTemplateObject: __makeTemplateObject2, - __importStar: __importStar2, - __importDefault: __importDefault2, - __classPrivateFieldGet: __classPrivateFieldGet2, - __classPrivateFieldSet: __classPrivateFieldSet2, - __classPrivateFieldIn: __classPrivateFieldIn2, - __addDisposableResource: __addDisposableResource2, - __disposeResources: __disposeResources2 - }; - } -}); - -// 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 { - /** - * 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"); + debug6.namespace = namespace; + debug6.useColors = createDebug.useColors(); + debug6.color = createDebug.selectColor(namespace); + debug6.extend = extend3; + 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); } - 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_commonjs2(); - 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_commonjs2(); - var AzureNamedKeyCredential = class { - /** - * The value of the key to be used in authentication. - */ - get key() { - return this._key; + return debug6; } - /** - * The value of the name to be used in authentication. - */ - get name() { - return this._name; + function extend3(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; } - /** - * 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"); + 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); + } } - 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"); + 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; + } } - this._name = newName; - this._key = newKey; + while (templateIndex < template.length && template[templateIndex] === "*") { + templateIndex++; + } + return templateIndex === template.length; } - }; - 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_commonjs2(); - var AzureSASCredential = class { - /** - * The value of the shared access signature to be used in authentication - */ - get signature() { - return this._signature; + function disable() { + const namespaces = [ + ...createDebug.names, + ...createDebug.skips.map((namespace) => "-" + namespace) + ].join(","); + createDebug.enable(""); + return namespaces; } - /** - * 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"); + function enabled(name) { + for (const skip of createDebug.skips) { + if (matchesTemplate(name, skip)) { + return false; + } } - this._signature = signature; + for (const ns of createDebug.names) { + if (matchesTemplate(name, ns)) { + return true; + } + } + return false; } - /** - * 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"); + function coerce3(val) { + if (val instanceof Error) { + return val.stack || val.message; } - this._signature = newSignature; + return val; } - }; - 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.isTokenCredential = isTokenCredential; - function isTokenCredential(credential) { - const castCredential = credential; - return castCredential && typeof castCredential.getToken === "function" && (castCredential.signRequest === void 0 || castCredential.getToken.length > 0); + 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/@azure/core-auth/dist/commonjs/index.js -var require_commonjs6 = __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.pipelineContainsDisableKeepAlivePolicy = exports2.createDisableKeepAlivePolicy = exports2.disableKeepAlivePolicyName = void 0; - exports2.disableKeepAlivePolicyName = "DisableKeepAlivePolicy"; - function createDisableKeepAlivePolicy() { - return { - name: exports2.disableKeepAlivePolicyName, - async sendRequest(request, next) { - request.disableKeepAlive = true; - return next(request); +// 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+)/); } - exports2.createDisableKeepAlivePolicy = createDisableKeepAlivePolicy; - function pipelineContainsDisableKeepAlivePolicy(pipeline) { - return pipeline.getOrderedPolicies().some((policy) => policy.name === exports2.disableKeepAlivePolicyName); - } - exports2.pipelineContainsDisableKeepAlivePolicy = pipelineContainsDisableKeepAlivePolicy; - } -}); - -// node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs -var tslib_es6_exports3 = {}; -__export(tslib_es6_exports3, { - __addDisposableResource: () => __addDisposableResource3, - __assign: () => __assign3, - __asyncDelegator: () => __asyncDelegator3, - __asyncGenerator: () => __asyncGenerator3, - __asyncValues: () => __asyncValues3, - __await: () => __await3, - __awaiter: () => __awaiter3, - __classPrivateFieldGet: () => __classPrivateFieldGet3, - __classPrivateFieldIn: () => __classPrivateFieldIn3, - __classPrivateFieldSet: () => __classPrivateFieldSet3, - __createBinding: () => __createBinding3, - __decorate: () => __decorate3, - __disposeResources: () => __disposeResources3, - __esDecorate: () => __esDecorate3, - __exportStar: () => __exportStar3, - __extends: () => __extends3, - __generator: () => __generator3, - __importDefault: () => __importDefault3, - __importStar: () => __importStar3, - __makeTemplateObject: () => __makeTemplateObject3, - __metadata: () => __metadata3, - __param: () => __param3, - __propKey: () => __propKey3, - __read: () => __read3, - __rest: () => __rest3, - __runInitializers: () => __runInitializers3, - __setFunctionName: () => __setFunctionName3, - __spread: () => __spread3, - __spreadArray: () => __spreadArray3, - __spreadArrays: () => __spreadArrays3, - __values: () => __values4, - default: () => tslib_es6_default3 -}); -function __extends3(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics3(d, b); - function __() { - this.constructor = d; - } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} -function __rest3(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 __decorate3(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 __param3(paramIndex, decorator) { - return function(target, key) { - decorator(target, key, paramIndex); - }; -} -function __esDecorate3(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 _, done = false; - for (var i = decorators.length - 1; i >= 0; i--) { - var context2 = {}; - for (var p in contextIn) context2[p] = p === "access" ? {} : contextIn[p]; - for (var p in contextIn.access) context2.access[p] = contextIn.access[p]; - context2.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], context2); - if (kind === "accessor") { - if (result === void 0) continue; - if (result === null || typeof result !== "object") throw new TypeError("Object expected"); - if (_ = accept(result.get)) descriptor.get = _; - if (_ = accept(result.set)) descriptor.set = _; - if (_ = accept(result.init)) initializers.unshift(_); - } else if (_ = accept(result)) { - if (kind === "field") initializers.unshift(_); - else descriptor[key] = _; + 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 index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, (match) => { + if (match === "%%") { + return; + } + index++; + if (match === "%c") { + lastC = index; + } + }); + args.splice(lastC, 0, c); } - } - if (target) Object.defineProperty(target, contextIn.name, descriptor); - done = true; -} -function __runInitializers3(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 __propKey3(x) { - return typeof x === "symbol" ? x : "".concat(x); -} -function __setFunctionName3(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 __metadata3(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} -function __awaiter3(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + exports2.log = console.debug || console.log || (() => { }); - } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { + function save(namespaces) { try { - step(generator.next(value)); - } catch (e) { - reject(e); + if (namespaces) { + exports2.storage.setItem("debug", namespaces); + } else { + exports2.storage.removeItem("debug"); + } + } catch (error3) { } } - function rejected(value) { + function load2() { + let r; try { - step(generator["throw"](value)); - } catch (e) { - reject(e); + 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 step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + function localstorage() { + try { + return localStorage; + } catch (error3) { + } } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} -function __generator3(thisArg, body) { - var _ = { 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]); + module2.exports = require_common()(exports2); + var { formatters } = module2.exports; + formatters.j = function(v) { + try { + return JSON.stringify(v); + } catch (error3) { + return "[UnexpectedJSONParseError]: " + error3.message; + } }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (g && (g = 0, op[0] && (_ = 0)), _) 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: - _.label++; - return { value: op[1], done: false }; - case 5: - _.label++; - y = op[1]; - op = [0]; - continue; - case 7: - op = _.ops.pop(); - _.trys.pop(); - continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { - _ = 0; - continue; - } - if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) { - _.label = op[1]; - break; - } - if (op[0] === 6 && _.label < t[1]) { - _.label = t[1]; - t = op; - break; - } - if (t && _.label < t[2]) { - _.label = t[2]; - _.ops.push(op); - break; - } - if (t[2]) _.ops.pop(); - _.trys.pop(); - continue; +}); + +// 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 os3 = 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); } - op = body.call(thisArg, _); - } 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 __exportStar3(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding3(o, m, p); -} -function __values4(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 }; + function translateLevel(level) { + if (level === 0) { + return false; + } + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} -function __read3(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 (error4) { - e = { error: error4 }; - } finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } finally { - if (e) throw e.error; + 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 = os3.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; } - } - return ar; -} -function __spread3() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read3(arguments[i])); - return ar; -} -function __spreadArrays3() { - 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 __spreadArray3(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]; + function getSupportLevel(stream2) { + const level = supportsColor(stream2, stream2 && stream2.isTTY); + return translateLevel(level); } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} -function __await3(v) { - return this instanceof __await3 ? (this.v = v, this) : new __await3(v); -} -function __asyncGenerator3(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); + module2.exports = { + supportsColor: getSupportLevel, + stdout: translateLevel(supportsColor(true, tty.isatty(1))), + stderr: translateLevel(supportsColor(true, tty.isatty(2))) }; } - 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) { +}); + +// node_modules/debug/src/node.js +var require_node = __commonJS({ + "node_modules/debug/src/node.js"(exports2, module2) { + var tty = require("tty"); + var util = require("util"); + exports2.init = init; + exports2.log = log; + exports2.formatArgs = formatArgs; + exports2.save = save; + exports2.load = load2; + exports2.useColors = useColors; + exports2.destroy = util.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 { - step(g[n](v)); - } catch (e) { - settle(q[0][3], e); - } - } - function step(r) { - r.value instanceof __await3 ? 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 __asyncDelegator3(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: __await3(o[n](v)), done: false } : f ? f(v) : v; - } : f; - } -} -function __asyncValues3(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 __values4 === "function" ? __values4(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(resolve6, reject) { - v = o[n](v), settle(resolve6, reject, v.done, v.value); + 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, (_, k) => { + return k.toUpperCase(); }); - }; - } - function settle(resolve6, reject, d, v) { - Promise.resolve(v).then(function(v2) { - resolve6({ value: v2, done: d }); - }, reject); - } -} -function __makeTemplateObject3(cooked, raw) { - if (Object.defineProperty) { - Object.defineProperty(cooked, "raw", { value: raw }); - } else { - cooked.raw = raw; - } - return cooked; -} -function __importStar3(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)) __createBinding3(result, mod, k); - } - __setModuleDefault3(result, mod); - return result; -} -function __importDefault3(mod) { - return mod && mod.__esModule ? mod : { default: mod }; -} -function __classPrivateFieldGet3(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 __classPrivateFieldSet3(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 __classPrivateFieldIn3(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 __addDisposableResource3(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]; + 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); } - if (dispose === void 0) { - if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); - dispose = value[Symbol.dispose]; - if (async) inner = dispose; + 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]; + } } - if (typeof dispose !== "function") throw new TypeError("Object not disposable."); - if (inner) dispose = function() { - try { - inner.call(this); - } catch (e) { - return Promise.reject(e); + function getDate() { + if (exports2.inspectOpts.hideDate) { + return ""; } - }; - env.stack.push({ value, dispose, async }); - } else if (async) { - env.stack.push({ async: true }); - } - return value; -} -function __disposeResources3(env) { - function fail(e) { - env.error = env.hasError ? new _SuppressedError3(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); + return (/* @__PURE__ */ new Date()).toISOString() + " "; + } + function log(...args) { + return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n"); + } + function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + delete process.env.DEBUG; } } - if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); - if (env.hasError) throw env.error; - } - return next(); -} -var extendStatics3, __assign3, __createBinding3, __setModuleDefault3, _SuppressedError3, tslib_es6_default3; -var init_tslib_es63 = __esm({ - "node_modules/@azure/core-client/node_modules/tslib/tslib.es6.mjs"() { - extendStatics3 = function(d, b) { - extendStatics3 = 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 extendStatics3(d, b); + function load2() { + return process.env.DEBUG; + } + function init(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 util.inspect(v, this.inspectOpts).split("\n").map((str2) => str2.trim()).join(" "); }; - __assign3 = function() { - __assign3 = Object.assign || function __assign4(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 __assign3.apply(this, arguments); + formatters.O = function(v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); }; - __createBinding3 = Object.create ? (function(o, m, k, k2) { + } +}); + +// 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_helpers2 = __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)) { @@ -39970,5397 +38257,9755 @@ var init_tslib_es63 = __esm({ }) : (function(o, m, k, k2) { if (k2 === void 0) k2 = k; o[k2] = m[k]; - }); - __setModuleDefault3 = Object.create ? (function(o, v) { + })); + 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; }; - _SuppressedError3 = typeof SuppressedError === "function" ? SuppressedError : function(error4, suppressed, message) { - var e = new Error(message); - return e.name = "SuppressedError", e.error = error4, e.suppressed = suppressed, e; - }; - tslib_es6_default3 = { - __extends: __extends3, - __assign: __assign3, - __rest: __rest3, - __decorate: __decorate3, - __param: __param3, - __metadata: __metadata3, - __awaiter: __awaiter3, - __generator: __generator3, - __createBinding: __createBinding3, - __exportStar: __exportStar3, - __values: __values4, - __read: __read3, - __spread: __spread3, - __spreadArrays: __spreadArrays3, - __spreadArray: __spreadArray3, - __await: __await3, - __asyncGenerator: __asyncGenerator3, - __asyncDelegator: __asyncDelegator3, - __asyncValues: __asyncValues3, - __makeTemplateObject: __makeTemplateObject3, - __importStar: __importStar3, - __importDefault: __importDefault3, - __classPrivateFieldGet: __classPrivateFieldGet3, - __classPrivateFieldSet: __classPrivateFieldSet3, - __classPrivateFieldIn: __classPrivateFieldIn3, - __addDisposableResource: __addDisposableResource3, - __disposeResources: __disposeResources3 - }; - } -}); - -// 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.decodeStringToString = exports2.decodeString = exports2.encodeByteArray = exports2.encodeString = void 0; - function encodeString(value) { - return Buffer.from(value).toString("base64"); - } - exports2.encodeString = encodeString; - function encodeByteArray(value) { - const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer); - return bufferValue.toString("base64"); + exports2.req = exports2.json = exports2.toBuffer = void 0; + var http = __importStar2(require("http")); + var https2 = __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.encodeByteArray = encodeByteArray; - function decodeString(value) { - return Buffer.from(value, "base64"); + exports2.toBuffer = toBuffer; + async function json2(stream2) { + const buf = await toBuffer(stream2); + const str2 = buf.toString("utf8"); + try { + return JSON.parse(str2); + } catch (_err) { + const err = _err; + err.message += ` (input: ${str2})`; + throw err; + } } - exports2.decodeString = decodeString; - function decodeStringToString(value) { - return Buffer.from(value, "base64").toString(); + exports2.json = json2; + function req(url2, opts = {}) { + const href = typeof url2 === "string" ? url2 : url2.href; + const req2 = (href.startsWith("https:") ? https2 : http).request(url2, opts); + const promise = new Promise((resolve6, reject) => { + req2.once("response", resolve6).once("error", reject).end(); + }); + req2.then = promise.then.bind(promise); + return req2; } - exports2.decodeStringToString = decodeStringToString; - } -}); - -// 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 = "_"; + exports2.req = req; } }); -// node_modules/@azure/core-client/dist/commonjs/utils.js -var require_utils5 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/utils.js"(exports2) { +// node_modules/agent-base/dist/index.js +var require_dist = __commonJS({ + "node_modules/agent-base/dist/index.js"(exports2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.flattenResponse = exports2.isValidUuid = exports2.isDuration = exports2.isPrimitiveBody = void 0; - function isPrimitiveBody(value, mapperTypeName) { - return mapperTypeName !== "Composite" && mapperTypeName !== "Dictionary" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || (mapperTypeName === null || mapperTypeName === void 0 ? void 0 : mapperTypeName.match(/^(Date|DateTime|DateTimeRfc1123|UnixTime|ByteArray|Base64Url)$/i)) !== null || value === void 0 || value === null); - } - exports2.isPrimitiveBody = isPrimitiveBody; - 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); - } - exports2.isDuration = isDuration; - 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); - } - exports2.isValidUuid = isValidUuid; - function handleNullableResponseAndWrappableBody(responseObject) { - const combinedHeadersAndBody = Object.assign(Object.assign({}, responseObject.headers), responseObject.body); - if (responseObject.hasNullableType && Object.getOwnPropertyNames(combinedHeadersAndBody).length === 0) { - return responseObject.shouldWrapBody ? { body: null } : null; - } else { - return responseObject.shouldWrapBody ? Object.assign(Object.assign({}, responseObject.headers), { body: responseObject.body }) : combinedHeadersAndBody; + 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]; + } }; } - } - function flattenResponse(fullResponse, responseSpec) { - var _a, _b; - const parsedHeaders = fullResponse.parsedHeaders; - if (fullResponse.request.method === "HEAD") { - return Object.assign(Object.assign({}, parsedHeaders), { body: fullResponse.parsedBody }); + 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); } - const bodyMapper = responseSpec && responseSpec.bodyMapper; - const isNullable = Boolean(bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.nullable); - const expectedBodyTypeName = bodyMapper === null || bodyMapper === void 0 ? void 0 : bodyMapper.type.name; - if (expectedBodyTypeName === "Stream") { - return Object.assign(Object.assign({}, parsedHeaders), { blobBody: fullResponse.blobBody, readableStreamBody: fullResponse.readableStreamBody }); + __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_helpers2(), exports2); + var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState"); + var Agent = class extends http.Agent { + constructor(opts) { + super(opts); + this[INTERNAL] = {}; } - const modelProperties = expectedBodyTypeName === "Composite" && bodyMapper.type.modelProperties || {}; - const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === ""); - if (expectedBodyTypeName === "Sequence" || isPageableResponse) { - const arrayResponse = (_a = fullResponse.parsedBody) !== null && _a !== void 0 ? _a : []; - for (const key of Object.keys(modelProperties)) { - if (modelProperties[key].serializedName) { - arrayResponse[key] = (_b = fullResponse.parsedBody) === null || _b === void 0 ? void 0 : _b[key]; + /** + * 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:"; } } - if (parsedHeaders) { - for (const key of Object.keys(parsedHeaders)) { - arrayResponse[key] = parsedHeaders[key]; + 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 index = sockets.indexOf(socket); + if (index !== -1) { + sockets.splice(index, 1); + this.totalSocketCount--; + if (sockets.length === 0) { + delete this.sockets[name]; } } - 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) - }); - } - exports2.flattenResponse = flattenResponse; - } -}); - -// 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 = exports2.createSerializer = void 0; - var tslib_1 = (init_tslib_es63(), __toCommonJS(tslib_es6_exports3)); - var base64 = tslib_1.__importStar(require_base64()); - var interfaces_js_1 = require_interfaces(); - var utils_js_1 = require_utils5(); - var SerializerImpl = class { - constructor(modelMappers = {}, isXML = false) { - this.modelMappers = modelMappers; - this.isXML = isXML; + // 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); } - /** - * @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}.`); + createSocket(req, options, cb) { + const connectOpts = { + ...options, + secureEndpoint: this.isSecureEndpoint(options) }; - 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); + 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); + } } - 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); - } - } + this[INTERNAL].currentSocket = socket; + super.createSocket(req, options, cb); + }, (err) => { + this.decrementSockets(name, fakeSocket); + cb(err); + }); } - /** - * 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, object, objectName, options = { xml: {} }) { - var _a, _b, _c; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - } - }; - let payload = {}; - const mapperType = mapper.type.name; - if (!objectName) { - objectName = mapper.serializedName; + createConnection() { + const socket = this[INTERNAL].currentSocket; + this[INTERNAL].currentSocket = void 0; + if (!socket) { + throw new Error("No socket was returned in the `connect()` function"); } - if (mapperType.match(/^Sequence$/i) !== null) { - payload = []; + return socket; + } + get defaultPort() { + return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80); + } + set defaultPort(v) { + if (this[INTERNAL]) { + this[INTERNAL].defaultPort = v; } - if (mapper.isConstant) { - object = mapper.defaultValue; + } + get protocol() { + return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:"); + } + set protocol(v) { + if (this[INTERNAL]) { + this[INTERNAL].protocol = v; } - const { required, nullable } = mapper; - if (required && nullable && object === void 0) { - throw new Error(`${objectName} cannot be undefined.`); + } + }; + 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((resolve6, reject) => { + let buffersLength = 0; + const buffers = []; + function read() { + const b = socket.read(); + if (b) + ondata(b); + else + socket.once("readable", read); } - if (required && !nullable && (object === void 0 || object === null)) { - throw new Error(`${objectName} cannot be null or undefined.`); + function cleanup() { + socket.removeListener("end", onend); + socket.removeListener("error", onerror); + socket.removeListener("readable", read); } - if (!required && nullable === false && object === null) { - throw new Error(`${objectName} cannot be null.`); + function onend() { + cleanup(); + debug6("onend"); + reject(new Error("Proxy connection ended before receiving CONNECT response")); } - if (object === void 0 || object === null) { - payload = object; - } else { - if (mapperType.match(/^any$/i) !== null) { - payload = object; - } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { - payload = serializeBasicTypes(mapperType, objectName, object); - } else if (mapperType.match(/^Enum$/i) !== null) { - const enumMapper = mapper; - payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); - } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { - payload = serializeDateTypes(mapperType, object, objectName); - } else if (mapperType.match(/^ByteArray$/i) !== null) { - payload = serializeByteArrayType(objectName, object); - } else if (mapperType.match(/^Base64Url$/i) !== null) { - payload = serializeBase64UrlType(objectName, object); - } else if (mapperType.match(/^Sequence$/i) !== null) { - payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Dictionary$/i) !== null) { - payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } else if (mapperType.match(/^Composite$/i) !== null) { - payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); - } + function onerror(err) { + cleanup(); + debug6("onerror %o", err); + reject(err); } - 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: {} }) { - var _a, _b, _c, _d; - const updatedOptions = { - xml: { - rootName: (_a = options.xml.rootName) !== null && _a !== void 0 ? _a : "", - includeRoot: (_b = options.xml.includeRoot) !== null && _b !== void 0 ? _b : false, - xmlCharKey: (_c = options.xml.xmlCharKey) !== null && _c !== void 0 ? _c : interfaces_js_1.XML_CHARKEY - }, - ignoreUnknownProperties: (_d = options.ignoreUnknownProperties) !== null && _d !== void 0 ? _d : 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; + 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; } - 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]; - } + 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")); } - if (mapperType.match(/^Number$/i) !== null) { - payload = parseFloat(responseBody); - if (isNaN(payload)) { - payload = responseBody; + 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}"`)); } - } else if (mapperType.match(/^Boolean$/i) !== null) { - if (responseBody === "true") { - payload = true; - } else if (responseBody === "false") { - payload = false; + 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 { - payload = responseBody; + headers[key] = value; } - } 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); } + debug6("got proxy server response: %o %o", firstLine, headers); + cleanup(); + resolve6({ + connect: { + statusCode, + statusText, + headers + }, + buffered + }); } - if (mapper.isConstant) { - payload = mapper.defaultValue; - } - return payload; - } - }; - function createSerializer(modelMappers = {}, isXML = false) { - return new SerializerImpl(modelMappers, isXML); - } - exports2.createSerializer = createSerializer; - function trimEnd(str2, ch) { - let len = str2.length; - while (len - 1 >= 0 && str2[len - 1] === ch) { - --len; - } - return str2.substr(0, len); + socket.on("error", onerror); + socket.on("end", onend); + read(); + }); } - function bufferToBase64Url(buffer) { - if (!buffer) { - return void 0; + exports2.parseProxyResponse = parseProxyResponse; + } +}); + +// node_modules/https-proxy-agent/dist/index.js +var require_dist2 = __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]; + } }; } - if (!(buffer instanceof Uint8Array)) { - throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`); + 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); } - const str2 = base64.encodeByteArray(buffer); - return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); - } - function base64UrlToByteArray(str2) { - if (!str2) { - return void 0; + __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_dist(); + 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 + }; } - if (str2 && typeof str2.valueOf() !== "string") { - throw new Error("Please provide an input of type string for converting to Uint8Array"); + return options; + }; + var HttpsProxyAgent = 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 ? omit(opts, "headers") : null, + host, + port + }; } - str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); - return base64.decodeString(str2); - } - 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 = ""; - } + /** + * 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'); } - } - 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.`); - } + 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); } - } - 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(); + 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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`; } - 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.`); + headers.Host = `${host}:${opts.port}`; + if (!headers["Proxy-Connection"]) { + headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close"; } - value = base64.encodeByteArray(value); + 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({ + ...omit(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; } - return value; + }; + HttpsProxyAgent.protocols = ["http", "https"]; + exports2.HttpsProxyAgent = HttpsProxyAgent; + function resume(socket) { + socket.resume(); } - function serializeBase64UrlType(objectName, value) { - if (value !== void 0 && value !== null) { - if (!(value instanceof Uint8Array)) { - throw new Error(`${objectName} must be of type Uint8Array.`); + function omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; } - value = bufferToBase64Url(value); } - return value; + return ret; } - 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}".`); + } +}); + +// node_modules/http-proxy-agent/dist/index.js +var require_dist3 = __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_dist(); + 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 ? omit(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 auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`; + headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).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); } } } - return 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 omit(obj, ...keys) { + const ret = {}; + let key; + for (key in obj) { + if (!keys.includes(key)) { + ret[key] = obj[key]; + } + } + return ret; } - function serializeSequenceType(serializer, mapper, object, objectName, isXml, options) { - var _a; - if (!Array.isArray(object)) { - throw new Error(`${objectName} must be of type Array.`); + } +}); + +// 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_dist2(); + var http_proxy_agent_1 = require_dist3(); + 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()]; } - 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}.`); + return void 0; + } + function loadEnvironmentProxyValue() { + if (!process) { + return void 0; } - if (elementType.type.name === "Composite" && elementType.type.className) { - elementType = (_a = serializer.modelMappers[elementType.type.className]) !== null && _a !== void 0 ? _a : elementType; + 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 tempArray = []; - for (let i = 0; i < object.length; i++) { - const serializedValue = serializer.serialize(elementType, object[i], objectName, options); - if (isXml && elementType.xmlNamespace) { - const xmlnsKey = elementType.xmlNamespacePrefix ? `xmlns:${elementType.xmlNamespacePrefix}` : "xmlns"; - if (elementType.type.name === "Composite") { - tempArray[i] = Object.assign({}, serializedValue); - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + 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 { - tempArray[i] = {}; - tempArray[i][options.xml.xmlCharKey] = serializedValue; - tempArray[i][interfaces_js_1.XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace }; + if (host.length === pattern.length - 1 && host === pattern.slice(1)) { + isBypassedFlag = true; + } } } else { - tempArray[i] = serializedValue; + if (host === pattern) { + isBypassedFlag = true; + } } } - return tempArray; + bypassedMap?.set(host, isBypassedFlag); + return isBypassedFlag; } - function serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) { - if (typeof object !== "object") { - throw new Error(`${objectName} must be of type object.`); + function loadNoProxy() { + const noProxy = getEnvironmentValue(NO_PROXY); + noProxyListLoaded = true; + if (noProxy) { + return noProxy.split(",").map((item) => item.trim()).filter((item) => item.length); } - 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}.`); + return []; + } + function getDefaultProxySettings(proxyUrl) { + if (!proxyUrl) { + proxyUrl = loadEnvironmentProxyValue(); + if (!proxyUrl) { + return void 0; + } } - const tempDictionary = {}; - for (const key of Object.keys(object)) { - const serializedValue = serializer.serialize(valueType, object[key], objectName, options); - tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options); + const parsedUrl = new URL(proxyUrl); + const schema2 = parsedUrl.protocol ? parsedUrl.protocol + "//" : ""; + return { + host: schema2 + 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}".`); } - 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; + parsedProxyUrl.port = String(settings.port); + if (settings.username) { + parsedProxyUrl.username = settings.username; } - 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 === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties; + if (settings.password) { + parsedProxyUrl.password = settings.password; } - return additionalProperties; + return parsedProxyUrl; } - 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)}".`); + function setProxyAgentOnRequest(request, cachedAgents, proxyUrl) { + if (request.agent) { + return; } - 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}".`); + const url2 = new URL(request.url); + const isInsecure = url2.protocol !== "https:"; + if (request.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 = request.headers.toJSON(); + if (isInsecure) { + if (!cachedAgents.httpProxyAgent) { + cachedAgents.httpProxyAgent = new http_proxy_agent_1.HttpProxyAgent(proxyUrl, { headers }); } - modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : 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}".`); + request.agent = cachedAgents.httpProxyAgent; + } else { + if (!cachedAgents.httpsProxyAgent) { + cachedAgents.httpsProxyAgent = new https_proxy_agent_1.HttpsProxyAgent(proxyUrl, { headers }); } + request.agent = cachedAgents.httpsProxyAgent; } - return modelProps; } - function serializeCompositeType(serializer, mapper, object, objectName, isXml, options) { - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + function proxyPolicy(proxySettings, options) { + if (!noProxyListLoaded) { + exports2.globalNoProxyList.push(...loadNoProxy()); } - if (object !== void 0 && object !== null) { - const payload = {}; - const modelProps = resolveModelProperties(serializer, mapper, objectName); - for (const key of Object.keys(modelProps)) { - const propertyMapper = modelProps[key]; - if (propertyMapper.readOnly) { - continue; + const defaultProxy = proxySettings ? getUrlFromProxySettings(proxySettings) : getDefaultProxySettingsInternal(); + const cachedAgents = {}; + return { + name: exports2.proxyPolicyName, + async sendRequest(request, next) { + if (!request.proxySettings && defaultProxy && !isBypassed(request.url, options?.customNoProxyList ?? exports2.globalNoProxyList, options?.customNoProxyList ? void 0 : globalBypassedMap)) { + setProxyAgentOnRequest(request, cachedAgents, defaultProxy); + } else if (request.proxySettings) { + setProxyAgentOnRequest(request, cachedAgents, getUrlFromProxySettings(request.proxySettings)); } - 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) && (object[key] !== void 0 && object[key] !== null || propertyMapper.defaultValue !== void 0)) { - parentObject[pathName] = {}; - } - parentObject = parentObject[pathName]; - } + return next(request); + } + }; + } + } +}); + +// 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; } - if (parentObject !== void 0 && parentObject !== null) { - if (isXml && mapper.xmlNamespace) { - const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : "xmlns"; - parentObject[interfaces_js_1.XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[interfaces_js_1.XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace }); - } - const propertyObjectName = propertyMapper.serializedName !== "" ? objectName + "." + propertyMapper.serializedName : objectName; - let toSerialize = object[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; - } - } + 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); } - const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName); - if (additionalPropertiesMapper) { - const propNames = Object.keys(modelProps); - for (const clientPropName in object) { - const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); - if (isAdditionalProperty) { - payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); - } + }; + } + } +}); + +// 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; } - return payload; + } finally { + reader.releaseLock(); } - return object; } - function getXmlObjectValue(propertyMapper, serializedValue, isXml, options) { - if (!isXml || !propertyMapper.xmlNamespace) { - return serializedValue; + function makeAsyncIterable(webStream) { + if (!webStream[Symbol.asyncIterator]) { + webStream[Symbol.asyncIterator] = streamAsyncIterator.bind(webStream); } - 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 = Object.assign({}, serializedValue); - result2[interfaces_js_1.XML_ATTRKEY] = xmlNamespace; - return result2; - } + if (!webStream.values) { + webStream.values = streamAsyncIterator.bind(webStream); } - 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 ensureNodeStream(stream2) { + if (stream2 instanceof ReadableStream) { + makeAsyncIterable(stream2); + return stream_1.Readable.fromWeb(stream2); + } else { + return stream2; + } } - function deserializeCompositeType(serializer, mapper, responseBody, objectName, options) { - var _a, _b; - const xmlCharKey = (_a = options.xml.xmlCharKey) !== null && _a !== void 0 ? _a : interfaces_js_1.XML_CHARKEY; - if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { - mapper = getPolymorphicMapper(serializer, mapper, responseBody, "serializedName"); + 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); } - 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 = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : []; - 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); + } + 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 { - 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; - } + total += partLength; } } - 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 total; + } + async function buildRequestBody(request, 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) { + request.headers.set("Content-Length", contentLength); } - return instance; + request.body = await (0, concat_js_1.concat)(sources); } - 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}`); + 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 (responseBody) { - const tempDictionary = {}; - for (const key of Object.keys(responseBody)) { - tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options); - } - return tempDictionary; + if (Array.from(boundary).some((x) => !validBoundaryCharacters.has(x))) { + throw new Error(`Multipart boundary "${boundary}" contains invalid characters`); } - return responseBody; } - function deserializeSequenceType(serializer, mapper, responseBody, objectName, options) { - var _a; - 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]; + function multipartPolicy() { + return { + name: exports2.multipartPolicyName, + async sendRequest(request, next) { + if (!request.multipartBody) { + return next(request); + } + if (request.body) { + throw new Error("multipartBody and regular body cannot be set at the same time"); + } + let boundary = request.multipartBody.boundary; + const contentTypeHeader = request.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(); + } + request.headers.set("Content-Type", `${contentType}; boundary=${boundary}`); + await buildRequestBody(request, request.multipartBody.parts, boundary); + request.multipartBody = void 0; + return next(request); } - if (element.type.name === "Composite" && element.type.className) { - element = (_a = serializer.modelMappers[element.type.className]) !== null && _a !== void 0 ? _a : element; + }; + } + } +}); + +// 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (checkEnvironment_js_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - const tempArray = []; - for (let i = 0; i < responseBody.length; i++) { - tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options); + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); } - return tempArray; + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); - } - } - } + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + if (checkEnvironment_js_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return void 0; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - function getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) { - var _a; - const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); - if (polymorphicDiscriminator) { - let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; - if (discriminatorName) { - if (polymorphicPropertyName === "serializedName") { - discriminatorName = discriminatorName.replace(/\\/gi, ""); - } - const discriminatorValue = object[discriminatorName]; - const typeName = (_a = mapper.type.uberParent) !== null && _a !== void 0 ? _a : mapper.type.className; - if (typeof discriminatorValue === "string" && typeName) { - const polymorphicMapper = getIndexDiscriminator(serializer.modelMappers.discriminators, discriminatorValue, typeName); - if (polymorphicMapper) { - mapper = polymorphicMapper; - } + } +}); + +// 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); } - } - 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) { +// 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.state = void 0; - exports2.state = { - operationRequestMap: /* @__PURE__ */ new WeakMap() - }; + 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/@azure/core-client/dist/commonjs/operationHelpers.js -var require_operationHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/operationHelpers.js"(exports2) { +// 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.getOperationRequestInfo = exports2.getOperationArgumentValueFromParameter = void 0; - 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; - } + exports2.ensureSecureConnection = ensureSecureConnection; + var log_js_1 = require_log2(); + var insecureConnectionWarningEmmitted = false; + function allowInsecureConnection(request, options) { + if (options.allowInsecureConnection && request.allowInsecureConnection) { + const url2 = new URL(request.url); + if (url2.hostname === "localhost" || url2.hostname === "127.0.0.1") { + return true; } } - return value; + return false; } - exports2.getOperationArgumentValueFromParameter = getOperationArgumentValueFromParameter; - 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]; + function emitInsecureConnectionWarning() { + const warning10 = "Sending token over insecure transport. Assume any token issued is compromised."; + log_js_1.logger.warning(warning10); + if (typeof process?.emitWarning === "function" && !insecureConnectionWarningEmmitted) { + insecureConnectionWarningEmmitted = true; + process.emitWarning(warning10); + } + } + function ensureSecureConnection(request, options) { + if (!request.url.toLowerCase().startsWith("https://")) { + if (allowInsecureConnection(request, options)) { + emitInsecureConnectionWarning(); } else { - break; + throw new Error("Authentication is not permitted for non-TLS protected (non-https) URLs when allowInsecureConnection is false."); } } - if (i === parameterPath.length) { - result.propertyValue = parent; - result.propertyFound = true; - } - return result; } - var originalRequestSymbol = Symbol.for("@azure/core-client original request"); - function hasOriginalRequest(request) { - return originalRequestSymbol in request; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "apiKey"); + if (!scheme) { + return next(request); + } + if (scheme.apiKeyLocation !== "header") { + throw new Error(`Unsupported API key location: ${scheme.apiKeyLocation}`); + } + request.headers.set(scheme.name, options.credential.key); + return next(request); + } + }; } - function getOperationRequestInfo(request) { - if (hasOriginalRequest(request)) { - return getOperationRequestInfo(request[originalRequestSymbol]); - } - let info6 = state_js_1.state.operationRequestMap.get(request); - if (!info6) { - info6 = {}; - state_js_1.state.operationRequestMap.set(request, info6); - } - return info6; + } +}); + +// 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "basic"); + if (!scheme) { + return next(request); + } + const { username, password } = options.credential; + const headerValue = (0, bytesEncoding_js_1.uint8ArrayToString)((0, bytesEncoding_js_1.stringToUint8Array)(`${username}:${password}`, "utf-8"), "base64"); + request.headers.set("Authorization", `Basic ${headerValue}`); + return next(request); + } + }; } - exports2.getOperationRequestInfo = getOperationRequestInfo; } }); -// node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js -var require_deserializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/deserializationPolicy.js"(exports2) { +// 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.deserializationPolicy = exports2.deserializationPolicyName = void 0; - var interfaces_js_1 = require_interfaces(); - var core_rest_pipeline_1 = require_commonjs5(); - 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 = {}) { - var _a, _b, _c, _d, _e, _f, _g; - const jsonContentTypes = (_b = (_a = options.expectedContentTypes) === null || _a === void 0 ? void 0 : _a.json) !== null && _b !== void 0 ? _b : defaultJsonContentTypes; - const xmlContentTypes = (_d = (_c = options.expectedContentTypes) === null || _c === void 0 ? void 0 : _c.xml) !== null && _d !== void 0 ? _d : defaultXmlContentTypes; - const parseXML = options.parseXML; - const serializerOptions = options.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_e = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _e !== void 0 ? _e : "", - includeRoot: (_f = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _f !== void 0 ? _f : false, - xmlCharKey: (_g = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _g !== void 0 ? _g : interfaces_js_1.XML_CHARKEY + 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(request, next) { + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "http" && x.scheme === "bearer"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getBearerToken({ + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; + } + } +}); + +// 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.deserializationPolicyName, + name: exports2.oauth2AuthenticationPolicyName, async sendRequest(request, next) { - const response = await next(request); - return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + (0, checkInsecureConnection_js_1.ensureSecureConnection)(request, options); + const scheme = (request.authSchemes ?? options.authSchemes)?.find((x) => x.kind === "oauth2"); + if (!scheme) { + return next(request); + } + const token = await options.credential.getOAuth2Token(scheme.flows, { + abortSignal: request.abortSignal + }); + request.headers.set("Authorization", `Bearer ${token}`); + return next(request); } }; } - exports2.deserializationPolicy = deserializationPolicy; - function getOperationResponseMap(parsedResponse) { - let result; - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (operationSpec) { - if (!(operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter)) { - result = operationSpec.responses[parsedResponse.status]; - } else { - result = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationResponseGetter(operationSpec, parsedResponse); + } +}); + +// 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 pipeline = (0, createPipelineFromOptions_js_1.createPipelineFromOptions)(options); + pipeline.addPolicy((0, apiVersionPolicy_js_1.apiVersionPolicy)(options)); + const { credential, authSchemes, allowInsecureConnection } = options; + if (credential) { + if ((0, credentials_js_1.isApiKeyCredential)(credential)) { + pipeline.addPolicy((0, apiKeyAuthenticationPolicy_js_1.apiKeyAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBasicCredential)(credential)) { + pipeline.addPolicy((0, basicAuthenticationPolicy_js_1.basicAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isBearerTokenCredential)(credential)) { + pipeline.addPolicy((0, bearerAuthenticationPolicy_js_1.bearerAuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); + } else if ((0, credentials_js_1.isOAuth2TokenCredential)(credential)) { + pipeline.addPolicy((0, oauth2AuthenticationPolicy_js_1.oauth2AuthenticationPolicy)({ authSchemes, credential, allowInsecureConnection })); } } - return result; + return pipeline; } - function shouldDeserializeResponse(parsedResponse) { - const request = parsedResponse.request; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const shouldDeserialize = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.shouldDeserialize; - let result; - if (shouldDeserialize === void 0) { - result = true; - } else if (typeof shouldDeserialize === "boolean") { - result = shouldDeserialize; - } else { - result = shouldDeserialize(parsedResponse); + function getCachedDefaultHttpsClient() { + if (!cachedHttpClient) { + cachedHttpClient = (0, defaultHttpClient_js_1.createDefaultHttpClient)(); } - return result; + return cachedHttpClient; } - async function deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options, parseXML) { - const parsedResponse = await parse(jsonContentTypes, xmlContentTypes, response, options, parseXML); - if (!shouldDeserializeResponse(parsedResponse)) { - return parsedResponse; + } +}); + +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/multipart.js +var require_multipart2 = __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]; + } } - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(parsedResponse.request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - if (!operationSpec || !operationSpec.responses) { - return parsedResponse; + return void 0; + } + function getPartContentType(descriptor) { + const contentTypeHeader = getHeaderValue(descriptor, "content-type"); + if (contentTypeHeader) { + return contentTypeHeader; } - const responseSpec = getOperationResponseMap(parsedResponse); - const { error: error4, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec, options); - if (error4) { - throw error4; - } else if (shouldReturnResponse) { - return parsedResponse; + if (descriptor.contentType === null) { + return void 0; } - 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 }); - } + if (descriptor.contentType) { + return descriptor.contentType; } - return parsedResponse; + 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 isOperationSpecEmpty(operationSpec) { - const expectedStatusCodes = Object.keys(operationSpec.responses); - return expectedStatusCodes.length === 0 || expectedStatusCodes.length === 1 && expectedStatusCodes[0] === "default"; + function escapeDispositionField(value) { + return JSON.stringify(value); } - function handleErrorResponse(parsedResponse, operationSpec, responseSpec, options) { - var _a; - 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 }; - } + function getContentDisposition(descriptor) { + const contentDispositionHeader = getHeaderValue(descriptor, "content-disposition"); + if (contentDispositionHeader) { + return contentDispositionHeader; } - const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default; - const initialErrorMessage = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ? `Unexpected status code: ${parsedResponse.status}` : parsedResponse.bodyAsText; - const error4 = new core_rest_pipeline_1.RestError(initialErrorMessage, { - statusCode: parsedResponse.status, - request: parsedResponse.request, - response: parsedResponse - }); - if (!errorResponseSpec) { - throw error4; + if (descriptor.dispositionType === void 0 && descriptor.name === void 0 && descriptor.filename === void 0) { + return void 0; } - 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; - error4.code = internalError.code; - if (internalError.message) { - error4.message = internalError.message; - } - if (defaultBodyMapper) { - error4.response.parsedBody = deserializedError; - } - } - if (parsedResponse.headers && defaultHeadersMapper) { - error4.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJSON(), "operationRes.parsedHeaders"); - } - } catch (defaultError) { - error4.message = `Error "${defaultError.message}" occurred in deserializing the responseBody - "${parsedResponse.bodyAsText}" for the default response.`; + const dispositionType = descriptor.dispositionType ?? "form-data"; + let disposition = dispositionType; + if (descriptor.name) { + disposition += `; name=${escapeDispositionField(descriptor.name)}`; } - return { error: error4, shouldReturnResponse: false }; - } - async function parse(jsonContentTypes, xmlContentTypes, operationResponse, opts, parseXML) { - var _a; - if (!((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.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; + 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; } } - return operationResponse; + if (filename) { + disposition += `; filename=${escapeDispositionField(filename)}`; + } + return disposition; } - } -}); - -// 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.getPathStringFromParameter = exports2.getStreamingResponseStatusCodes = void 0; - 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)); - } + function normalizeBody(body, contentType) { + if (body === void 0) { + return new Uint8Array([]); } - return result; + 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}`); } - exports2.getStreamingResponseStatusCodes = getStreamingResponseStatusCodes; - 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; + 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); } - return result; + if (contentDisposition) { + headers.set("content-disposition", contentDisposition); + } + const body = normalizeBody(descriptor.body, contentType); + return { + headers, + body + }; + } + function buildMultipartBody(parts) { + return { parts: parts.map(buildBodyPart) }; } - exports2.getPathStringFromParameter = getPathStringFromParameter; } }); -// node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js -var require_serializationPolicy = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serializationPolicy.js"(exports2) { +// 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.serializeRequestBody = exports2.serializeHeaders = exports2.serializationPolicy = exports2.serializationPolicyName = void 0; - 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(request, next) { - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - const operationSpec = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationSpec; - const operationArguments = operationInfo === null || operationInfo === void 0 ? void 0 : operationInfo.operationArguments; - if (operationSpec && operationArguments) { - serializeHeaders(request, operationArguments, operationSpec); - serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); - } - return next(request); - } - }; - } - exports2.serializationPolicy = serializationPolicy; - function serializeHeaders(request, operationArguments, operationSpec) { - var _a, _b; - 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)) { - request.headers.set(headerCollectionPrefix + key, headerValue[key]); - } - } else { - request.headers.set(headerParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(headerParameter), headerValue); - } - } + 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_multipart2(); + async function sendRequest(method, url2, pipeline, options = {}, customHttpClient) { + const httpClient = customHttpClient ?? (0, clientHelpers_js_1.getCachedDefaultHttpsClient)(); + const request = buildPipelineRequest(method, url2, options); + try { + const response = await pipeline.sendRequest(httpClient, request); + 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, rawHeaders: headers, parsedBody }); } - } - const customHeaders = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.requestOptions) === null || _b === void 0 ? void 0 : _b.customHeaders; - if (customHeaders) { - for (const customHeaderName of Object.keys(customHeaders)) { - request.headers.set(customHeaderName, customHeaders[customHeaderName]); + return { + request, + 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, rawHeaders }, e); } + throw e; } } - exports2.serializeHeaders = serializeHeaders; - function serializeRequestBody(request, operationArguments, operationSpec, stringifyXML = function() { - throw new Error("XML serialization unsupported!"); - }) { - var _a, _b, _c, _d, _e; - const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions; - const updatedOptions = { - xml: { - rootName: (_b = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.rootName) !== null && _b !== void 0 ? _b : "", - includeRoot: (_c = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.includeRoot) !== null && _c !== void 0 ? _c : false, - xmlCharKey: (_d = serializerOptions === null || serializerOptions === void 0 ? void 0 : serializerOptions.xml.xmlCharKey) !== null && _d !== void 0 ? _d : interfaces_js_1.XML_CHARKEY - } - }; - const xmlCharKey = updatedOptions.xml.xmlCharKey; - if (operationSpec.requestBody && operationSpec.requestBody.mapper) { - request.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; + 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 { - if (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { - const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); - request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); - const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; - if (operationSpec.isXML) { - const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; - const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); - if (typeName === serializer_js_1.MapperTypeNames.Sequence) { - request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); - } else if (!isStream) { - request.body = stringifyXML(value, { - rootName: xmlName || serializedName, - xmlCharKey - }); - } - } else if (typeName === serializer_js_1.MapperTypeNames.String && (((_e = operationSpec.contentType) === null || _e === void 0 ? void 0 : _e.match("text/plain")) || operationSpec.mediaType === "text")) { - return; - } else if (!isStream) { - request.body = JSON.stringify(request.body); - } - } - } catch (error4) { - throw new Error(`Error "${error4.message}" occurred in serializing the payload - ${JSON.stringify(serializedName, void 0, " ")}.`); - } - } else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) { - request.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); - request.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, (0, interfaceHelpers_js_1.getPathStringFromParameter)(formDataParameter), updatedOptions); - } + JSON.parse(body); + return "application/json"; + } catch (error3) { + return void 0; } } + return "application/json"; } - exports2.serializeRequestBody = serializeRequestBody; - 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 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 prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) { - if (!Array.isArray(obj)) { - obj = [obj]; + function getRequestBody(body, contentType = "") { + if (body === void 0) { + return { body: void 0 }; } - if (!xmlNamespaceKey || !xmlNamespace) { - return { [elementName]: obj }; + if (typeof FormData !== "undefined" && body instanceof FormData) { + return { body }; } - 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_pipeline2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/pipeline.js"(exports2) { - "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createClientPipeline = void 0; - var deserializationPolicy_js_1 = require_deserializationPolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var serializationPolicy_js_1 = require_serializationPolicy(); - function createClientPipeline(options = {}) { - const pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options !== null && options !== void 0 ? options : {}); - if (options.credentialOptions) { - pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ - credential: options.credentialOptions.credential, - scopes: options.credentialOptions.credentialScopes - })); + 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) }; } - pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); - pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { - phase: "Deserialize" - }); - return pipeline; } - exports2.createClientPipeline = createClientPipeline; - } -}); - -// 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 = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var cachedHttpClient; - function getCachedDefaultHttpClient() { - if (!cachedHttpClient) { - cachedHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); + 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); } - return cachedHttpClient; + 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 + }); } - exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; } }); -// node_modules/@azure/core-client/dist/commonjs/urlHelpers.js +// node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js var require_urlHelpers = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/urlHelpers.js"(exports2) { + "node_modules/@typespec/ts-http-runtime/dist/commonjs/client/urlHelpers.js"(exports2) { "use strict"; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.appendQueryParams = exports2.getRequestUrl = void 0; - 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 path12 = replaceAll(operationSpec.path, urlReplacements); - if (operationSpec.path === "/{nextLink}" && path12.startsWith("/")) { - path12 = path12.substring(1); - } - if (isAbsoluteUrl(path12)) { - requestUrl = path12; - isAbsolutePath = true; - } else { - requestUrl = appendPath(requestUrl, path12); - } + 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(endpoint, routePath, pathParameters, options = {}) { + if (routePath.startsWith("https://") || routePath.startsWith("http://")) { + return routePath; + } + endpoint = buildBaseUrl(endpoint, options); + routePath = buildRoutePath(routePath, pathParameters, options); + const requestUrl = appendQueryParams(`${endpoint}/${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 = ","; } - const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject); - requestUrl = appendQueryParams(requestUrl, queryParams, sequenceParams, isAbsolutePath); - return requestUrl; - } - exports2.getRequestUrl = getRequestUrl; - function replaceAll(input, replacements) { - let result = input; - for (const [searchValue, replaceValue] of replacements) { - result = result.split(searchValue).join(replaceValue); + 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]; } - return result; - } - function calculateUrlReplacements(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - if ((_a = operationSpec.urlParameters) === null || _a === void 0 ? void 0 : _a.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); + const value = paramValues.map((p) => { + if (p === null || p === void 0) { + return ""; } - } - return result; - } - function isAbsoluteUrl(url2) { - return url2.includes("://"); + 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 appendPath(url2, pathToAppend) { - if (!pathToAppend) { + function appendQueryParams(url2, options = {}) { + if (!options.queryParameters) { 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 path12 = pathToAppend.substring(0, searchStart); - const search = pathToAppend.substring(searchStart + 1); - newPath = newPath + path12; - if (search) { - parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search; + const queryParams = options.queryParameters; + const paramStrings = []; + for (const key of Object.keys(queryParams)) { + const param = queryParams[key]; + if (param === void 0 || param === null) { + continue; } - } else { - newPath = newPath + pathToAppend; - } - parsedUrl.pathname = newPath; - return parsedUrl.toString(); - } - function calculateQueryParameters(operationSpec, operationArguments, fallbackObject) { - var _a; - const result = /* @__PURE__ */ new Map(); - const sequenceParams = /* @__PURE__ */ new Set(); - if ((_a = operationSpec.queryParameters) === null || _a === void 0 ? void 0 : _a.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); - } + 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)); } - if (Array.isArray(queryParameterValue) && (queryParameter.collectionFormat === "CSV" || queryParameter.collectionFormat === "Pipes")) { - queryParameterValue = queryParameterValue.join(delimiter); + } else if (typeof rawValue === "object") { + for (const [actualKey, value] of Object.entries(rawValue)) { + paramStrings.push(getQueryParamValue(actualKey, options.skipUrlEncoding ?? false, style, value)); } - result.set(queryParameter.mapper.serializedName || (0, interfaceHelpers_js_1.getPathStringFromParameter)(queryParameter), queryParameterValue); + } 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)); } } - return { - queryParams: result, - sequenceParams - }; + if (parsedUrl.search !== "") { + parsedUrl.search += "&"; + } + parsedUrl.search += paramStrings.join("&"); + return parsedUrl.toString(); } - function simpleParseQueryParams(queryString) { - const result = /* @__PURE__ */ new Map(); - if (!queryString || queryString[0] !== "?") { - return result; + function buildBaseUrl(endpoint, options) { + if (!options.pathParameters) { + return endpoint; } - queryString = queryString.slice(1); - const pairs2 = queryString.split("&"); - for (const pair of pairs2) { - 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); + 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); + } + endpoint = replaceAll(endpoint, `{${key}}`, value) ?? ""; } - return result; + return endpoint; } - function appendQueryParams(url2, queryParams, sequenceParams, noOverwrite = false) { - if (queryParams.size === 0) { - return url2; + 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)); } - 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); + 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(endpoint, clientOptions = {}) { + const pipeline = 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; + pipeline.addPolicy(policy, { + afterPhase + }); } } - 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}`); + const { allowInsecureConnection, httpClient } = clientOptions; + const endpointUrl = clientOptions.endpoint ?? endpoint; + const client = (path12, ...args) => { + const getUrl = (requestOptions) => (0, urlHelpers_js_1.buildRequestUrl)(endpointUrl, path12, args, { allowInsecureConnection, ...requestOptions }); + return { + get: (requestOptions = {}) => { + return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + post: (requestOptions = {}) => { + return buildOperation("POST", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + put: (requestOptions = {}) => { + return buildOperation("PUT", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + patch: (requestOptions = {}) => { + return buildOperation("PATCH", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + delete: (requestOptions = {}) => { + return buildOperation("DELETE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + head: (requestOptions = {}) => { + return buildOperation("HEAD", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + options: (requestOptions = {}) => { + return buildOperation("OPTIONS", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + }, + trace: (requestOptions = {}) => { + return buildOperation("TRACE", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); + } + }; + }; + return { + path: client, + pathUnchecked: client, + pipeline + }; + } + function buildOperation(method, url2, pipeline, options, allowInsecureConnection, httpClient) { + allowInsecureConnection = options.allowInsecureConnection ?? allowInsecureConnection; + return { + then: function(onFulfilled, onrejected) { + return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline, { ...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, pipeline, { ...options, allowInsecureConnection, responseAsStream: true }, httpClient); + } + }, + async asNodeStream() { + if (checkEnvironment_js_1.isNodeLike) { + return (0, sendRequest_js_1.sendRequest)(method, url2, pipeline, { ...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."); } - } else { - searchPieces.push(`${name}=${value}`); } - } - parsedUrl.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; - return parsedUrl.toString(); + }; } - exports2.appendQueryParams = appendQueryParams; } }); -// node_modules/@azure/core-client/dist/commonjs/log.js -var require_log2 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/log.js"(exports2) { +// 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.logger = void 0; - var logger_1 = require_dist(); - exports2.logger = (0, logger_1.createClientLogger)("core-client"); + 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/@azure/core-client/dist/commonjs/serviceClient.js -var require_serviceClient = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/serviceClient.js"(exports2) { +// 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.ServiceClient = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var pipeline_js_1 = require_pipeline2(); - var utils_js_1 = require_utils5(); - var httpClientCache_js_1 = require_httpClientCache(); - var operationHelpers_js_1 = require_operationHelpers(); - var urlHelpers_js_1 = require_urlHelpers(); - var interfaceHelpers_js_1 = require_interfaceHelpers(); - var log_js_1 = require_log2(); - var ServiceClient = class { - /** - * The ServiceClient constructor - * @param credential - The credentials used for authentication with the service. - * @param options - The service client options that govern the behavior of the client. - */ - constructor(options = {}) { - var _a, _b; - this._requestContentType = options.requestContentType; - this._endpoint = (_a = options.endpoint) !== null && _a !== void 0 ? _a : 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 ((_b = options.additionalPolicies) === null || _b === void 0 ? void 0 : _b.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(request) { - return this.pipeline.sendRequest(this._httpClient, request); - } - /** - * 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 endpoint = operationSpec.baseUrl || this._endpoint; - if (!endpoint) { - 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)(endpoint, operationSpec, operationArguments, this); - const request = (0, core_rest_pipeline_1.createPipelineRequest)({ - url: url2 - }); - request.method = operationSpec.httpMethod; - const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); - operationInfo.operationSpec = operationSpec; - operationInfo.operationArguments = operationArguments; - const contentType = operationSpec.contentType || this._requestContentType; - if (contentType && operationSpec.requestBody) { - request.headers.set("Content-Type", contentType); - } - const options = operationArguments.options; - if (options) { - const requestOptions = options.requestOptions; - if (requestOptions) { - if (requestOptions.timeout) { - request.timeout = requestOptions.timeout; - } - if (requestOptions.onUploadProgress) { - request.onUploadProgress = requestOptions.onUploadProgress; - } - if (requestOptions.onDownloadProgress) { - request.onDownloadProgress = requestOptions.onDownloadProgress; - } - if (requestOptions.shouldDeserialize !== void 0) { - operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; - } - if (requestOptions.allowInsecureConnection) { - request.allowInsecureConnection = true; - } - } - if (options.abortSignal) { - request.abortSignal = options.abortSignal; - } - if (options.tracingOptions) { - request.tracingOptions = options.tracingOptions; - } - } - if (this._allowInsecureConnection) { - request.allowInsecureConnection = true; - } - if (request.streamResponseStatusCodes === void 0) { - request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); - } - try { - const rawResponse = await this.sendRequest(request); - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[rawResponse.status]); - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse); - } - return flatResponse; - } catch (error4) { - if (typeof error4 === "object" && (error4 === null || error4 === void 0 ? void 0 : error4.response)) { - const rawResponse = error4.response; - const flatResponse = (0, utils_js_1.flattenResponse)(rawResponse, operationSpec.responses[error4.statusCode] || operationSpec.responses["default"]); - error4.details = flatResponse; - if (options === null || options === void 0 ? void 0 : options.onResponse) { - options.onResponse(rawResponse, flatResponse, error4); - } - } - throw error4; - } - } - }; - 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)(Object.assign(Object.assign({}, options), { credentialOptions })); + 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 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; + 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/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js -var require_authorizeRequestOnClaimChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnClaimChallenge.js"(exports2) { +// 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.authorizeRequestOnClaimChallenge = exports2.parseCAEChallenge = void 0; - var log_js_1 = require_log2(); - 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) => Object.assign(Object.assign({}, a), b), {}); - }); - } - exports2.parseCAEChallenge = parseCAEChallenge; - 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", `Bearer ${accessToken.token}`); - return 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)(); } - exports2.authorizeRequestOnClaimChallenge = authorizeRequestOnClaimChallenge; } }); -// node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js -var require_authorizeRequestOnTenantChallenge = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/authorizeRequestOnTenantChallenge.js"(exports2) { +// 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.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); + 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 context2 = (0, logger_1.createLoggerContext)({ + logLevelEnvVarName: "AZURE_LOG_LEVEL", + namespace: "azure" + }); + exports2.AzureLogger = context2.logger; + function setLogLevel(level) { + context2.setLogLevel(level); } - 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, Object.assign(Object.assign({}, requestOptions), { tenantId })); - if (!accessToken) { - return false; - } - challengeOptions.request.headers.set(Constants.HeaderConstants.AUTHORIZATION, `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 getLogLevel() { + return context2.getLogLevel(); } - 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 createClientLogger(namespace) { + return context2.createClientLogger(namespace); } - function getChallenge(response) { - const challenge = response.headers.get("WWW-Authenticate"); - if (response.status === 401 && challenge) { - return challenge; - } - return; + } +}); + +// 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 + }); } - 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) => Object.assign(Object.assign({}, a), b), {}); + } +}); + +// 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 + }; } - function requestToOptions(request) { + } +}); + +// 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 { - abortSignal: request.abortSignal, - requestOptions: { - timeout: request.timeout - }, - tracingOptions: request.tracingOptions + 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/@azure/core-client/dist/commonjs/index.js -var require_commonjs7 = __commonJS({ - "node_modules/@azure/core-client/dist/commonjs/index.js"(exports2) { +// 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.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; + 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, "MapperTypeNames", { enumerable: true, get: function() { - return serializer_js_1.MapperTypeNames; + Object.defineProperty(exports2, "agentPolicyName", { enumerable: true, get: function() { + return agentPolicy_js_1.agentPolicyName; } }); - var serviceClient_js_1 = require_serviceClient(); - Object.defineProperty(exports2, "ServiceClient", { enumerable: true, get: function() { - return serviceClient_js_1.ServiceClient; + var decompressResponsePolicy_js_1 = require_decompressResponsePolicy(); + Object.defineProperty(exports2, "decompressResponsePolicy", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicy; } }); - var pipeline_js_1 = require_pipeline2(); - Object.defineProperty(exports2, "createClientPipeline", { enumerable: true, get: function() { - return pipeline_js_1.createClientPipeline; + Object.defineProperty(exports2, "decompressResponsePolicyName", { enumerable: true, get: function() { + return decompressResponsePolicy_js_1.decompressResponsePolicyName; } }); - var interfaces_js_1 = require_interfaces(); - Object.defineProperty(exports2, "XML_ATTRKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_ATTRKEY; + var defaultRetryPolicy_js_1 = require_defaultRetryPolicy(); + Object.defineProperty(exports2, "defaultRetryPolicy", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicy; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return interfaces_js_1.XML_CHARKEY; + Object.defineProperty(exports2, "defaultRetryPolicyName", { enumerable: true, get: function() { + return defaultRetryPolicy_js_1.defaultRetryPolicyName; } }); - var deserializationPolicy_js_1 = require_deserializationPolicy(); - Object.defineProperty(exports2, "deserializationPolicy", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicy; + var exponentialRetryPolicy_js_1 = require_exponentialRetryPolicy(); + Object.defineProperty(exports2, "exponentialRetryPolicy", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicy; } }); - Object.defineProperty(exports2, "deserializationPolicyName", { enumerable: true, get: function() { - return deserializationPolicy_js_1.deserializationPolicyName; + Object.defineProperty(exports2, "exponentialRetryPolicyName", { enumerable: true, get: function() { + return exponentialRetryPolicy_js_1.exponentialRetryPolicyName; } }); - var serializationPolicy_js_1 = require_serializationPolicy(); - Object.defineProperty(exports2, "serializationPolicy", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicy; + var retryPolicy_js_1 = require_retryPolicy(); + Object.defineProperty(exports2, "retryPolicy", { enumerable: true, get: function() { + return retryPolicy_js_1.retryPolicy; } }); - Object.defineProperty(exports2, "serializationPolicyName", { enumerable: true, get: function() { - return serializationPolicy_js_1.serializationPolicyName; + var systemErrorRetryPolicy_js_1 = require_systemErrorRetryPolicy(); + Object.defineProperty(exports2, "systemErrorRetryPolicy", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicy; } }); - var authorizeRequestOnClaimChallenge_js_1 = require_authorizeRequestOnClaimChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnClaimChallenge", { enumerable: true, get: function() { - return authorizeRequestOnClaimChallenge_js_1.authorizeRequestOnClaimChallenge; + Object.defineProperty(exports2, "systemErrorRetryPolicyName", { enumerable: true, get: function() { + return systemErrorRetryPolicy_js_1.systemErrorRetryPolicyName; } }); - var authorizeRequestOnTenantChallenge_js_1 = require_authorizeRequestOnTenantChallenge(); - Object.defineProperty(exports2, "authorizeRequestOnTenantChallenge", { enumerable: true, get: function() { - return authorizeRequestOnTenantChallenge_js_1.authorizeRequestOnTenantChallenge; + 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-http-compat/dist/commonjs/util.js -var require_util8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/util.js"(exports2) { +// 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.HttpHeaders = exports2.toHttpHeadersLike = exports2.toWebResourceLike = exports2.toPipelineRequest = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var originalRequestSymbol = Symbol("Original PipelineRequest"); - var originalClientRequestSymbol = Symbol.for("@azure/core-client original request"); - function toPipelineRequest(webResource, options = {}) { - const compatWebResource = webResource; - const request = compatWebResource[originalRequestSymbol]; - const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); - if (request) { - request.headers = headers; - return request; - } 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 - }); - if (options.originalRequest) { - newRequest[originalClientRequestSymbol] = options.originalRequest; - } - return newRequest; - } + 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 + }); } - exports2.toPipelineRequest = toPipelineRequest; - function toWebResourceLike(request, options) { - var _a; - const originalRequest = (_a = options === null || options === void 0 ? void 0 : options.originalRequest) !== null && _a !== void 0 ? _a : request; - const webResource = { - url: request.url, - method: request.method, - headers: toHttpHeadersLike(request.headers), - withCredentials: request.withCredentials, - timeout: request.timeout, - requestId: request.headers.get("x-ms-client-request-id") || request.requestId, - abortSignal: request.abortSignal, - body: request.body, - formData: request.formData, - keepAlive: !!request.disableKeepAlive, - onDownloadProgress: request.onDownloadProgress, - onUploadProgress: request.onUploadProgress, - proxySettings: request.proxySettings, - streamResponseStatusCodes: request.streamResponseStatusCodes, - 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 === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(webResource, { - get(target, prop, receiver) { - if (prop === originalRequestSymbol) { - return request; - } 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") { - request.disableKeepAlive = !value; - } - const passThroughProps = [ - "url", - "method", - "withCredentials", - "timeout", - "requestId", - "abortSignal", - "body", - "formData", - "onDownloadProgress", - "onUploadProgress", - "proxySettings", - "streamResponseStatusCodes" - ]; - if (typeof prop === "string" && passThroughProps.includes(prop)) { - request[prop] = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return webResource; - } - } - exports2.toWebResourceLike = toWebResourceLike; - function toHttpHeadersLike(headers) { - return new HttpHeaders(headers.toJSON({ preserveCase: true })); - } - exports2.toHttpHeadersLike = toHttpHeadersLike; - function getHeaderKey(headerName) { - return headerName.toLowerCase(); + } +}); + +// 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); } - var HttpHeaders = class _HttpHeaders { - 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) { +// 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.toPipelineResponse = exports2.toCompatResponse = void 0; - var core_rest_pipeline_1 = require_commonjs5(); - var util_js_1 = require_util8(); - var originalResponse = Symbol("Original FullOperationResponse"); - function toCompatResponse(response, options) { - let request = (0, util_js_1.toWebResourceLike)(response.request); - let headers = (0, util_js_1.toHttpHeadersLike)(response.headers); - if (options === null || options === void 0 ? void 0 : options.createProxy) { - return new Proxy(response, { - get(target, prop, receiver) { - if (prop === "headers") { - return headers; - } else if (prop === "request") { - return request; - } 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") { - request = value; - } - return Reflect.set(target, prop, value, receiver); - } - }); - } else { - return Object.assign(Object.assign({}, response), { - request, - headers - }); - } + 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"; } - exports2.toCompatResponse = toCompatResponse; - 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 Object.assign(Object.assign({}, compatResponse), { headers, request: (0, util_js_1.toPipelineRequest)(compatResponse.request) }); + async function setPlatformSpecificData(map2) { + 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) { + map2.set("Bun", `${versions.bun} (${osInfo})`); + } else if (versions.deno) { + map2.set("Deno", `${versions.deno} (${osInfo})`); + } else if (versions.node) { + map2.set("Node", `${versions.node} (${osInfo})`); + } } } - exports2.toPipelineResponse = toPipelineResponse; } }); -// 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) { +// 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.ExtendedServiceClient = void 0; - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - var core_rest_pipeline_1 = require_commonjs5(); - var core_client_1 = require_commonjs7(); - var response_js_1 = require_response2(); - var ExtendedServiceClient = class extends core_client_1.ServiceClient { - constructor(options) { - var _a, _b; - super(options); - if (((_a = options.keepAliveOptions) === null || _a === void 0 ? void 0 : _a.enable) === false && !(0, disableKeepAlivePolicy_js_1.pipelineContainsDisableKeepAlivePolicy)(this.pipeline)) { - this.pipeline.addPolicy((0, disableKeepAlivePolicy_js_1.createDisableKeepAlivePolicy)()); - } - if (((_b = options.redirectOptions) === null || _b === void 0 ? void 0 : _b.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) { - var _a; - const userProvidedCallBack = (_a = operationArguments === null || operationArguments === void 0 ? void 0 : operationArguments.options) === null || _a === void 0 ? void 0 : _a.onResponse; - let lastResponse; - function onResponse(rawResponse, flatResponse, error4) { - lastResponse = rawResponse; - if (userProvidedCallBack) { - userProvidedCallBack(rawResponse, flatResponse, error4); - } - } - operationArguments.options = Object.assign(Object.assign({}, 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; + 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-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js -var require_requestPolicyFactoryPolicy = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/policies/requestPolicyFactoryPolicy.js"(exports2) { +// 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.createRequestPolicyFactoryPolicy = exports2.requestPolicyFactoryPolicyName = exports2.HttpPipelineLogLevel = void 0; - var util_js_1 = require_util8(); - 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.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); } - }; - exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; - function createRequestPolicyFactoryPolicy(factories) { - const orderedFactories = factories.slice().reverse(); + 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.requestPolicyFactoryPolicyName, + name: exports2.userAgentPolicyName, async sendRequest(request, 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); + if (!request.headers.has(UserAgentHeaderName)) { + request.headers.set(UserAgentHeaderName, await userAgentValue); } - const webResourceLike = (0, util_js_1.toWebResourceLike)(request, { createProxy: true }); - const response = await httpPipeline.sendRequest(webResourceLike); - return (0, response_js_1.toPipelineResponse)(response); + return next(request); } }; } - exports2.createRequestPolicyFactoryPolicy = createRequestPolicyFactoryPolicy; } }); -// 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) { +// 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.convertHttpClient = void 0; - var response_js_1 = require_response2(); - var util_js_1 = require_util8(); - function convertHttpClient(requestPolicyClient) { - return { - sendRequest: async (request) => { - const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { createProxy: true })); - return (0, response_js_1.toPipelineResponse)(response); - } - }; + 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); } - exports2.convertHttpClient = convertHttpClient; } }); -// node_modules/@azure/core-http-compat/dist/commonjs/index.js -var require_commonjs8 = __commonJS({ - "node_modules/@azure/core-http-compat/dist/commonjs/index.js"(exports2) { +// 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.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; + 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 requestPolicyFactoryPolicy_js_1 = require_requestPolicyFactoryPolicy(); - Object.defineProperty(exports2, "requestPolicyFactoryPolicyName", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.requestPolicyFactoryPolicyName; + var random_js_1 = require_random(); + Object.defineProperty(exports2, "getRandomIntegerInclusive", { enumerable: true, get: function() { + return random_js_1.getRandomIntegerInclusive; } }); - Object.defineProperty(exports2, "createRequestPolicyFactoryPolicy", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.createRequestPolicyFactoryPolicy; + var object_js_1 = require_object(); + Object.defineProperty(exports2, "isObject", { enumerable: true, get: function() { + return object_js_1.isObject; } }); - Object.defineProperty(exports2, "HttpPipelineLogLevel", { enumerable: true, get: function() { - return requestPolicyFactoryPolicy_js_1.HttpPipelineLogLevel; + var error_js_1 = require_error(); + Object.defineProperty(exports2, "isError", { enumerable: true, get: function() { + return error_js_1.isError; } }); - var disableKeepAlivePolicy_js_1 = require_disableKeepAlivePolicy(); - Object.defineProperty(exports2, "disableKeepAlivePolicyName", { enumerable: true, get: function() { - return disableKeepAlivePolicy_js_1.disableKeepAlivePolicyName; + var sha256_js_1 = require_sha256(); + Object.defineProperty(exports2, "computeSha256Hash", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hash; } }); - var httpClientAdapter_js_1 = require_httpClientAdapter(); - Object.defineProperty(exports2, "convertHttpClient", { enumerable: true, get: function() { - return httpClientAdapter_js_1.convertHttpClient; + Object.defineProperty(exports2, "computeSha256Hmac", { enumerable: true, get: function() { + return sha256_js_1.computeSha256Hmac; } }); - var util_js_1 = require_util8(); - Object.defineProperty(exports2, "toHttpHeadersLike", { enumerable: true, get: function() { - return util_js_1.toHttpHeadersLike; + 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/fast-xml-parser/src/util.js -var require_util9 = __commonJS({ - "node_modules/fast-xml-parser/src/util.js"(exports2) { - "use strict"; - var nameStartChar = ":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"; - var nameChar = nameStartChar + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; - var nameRegexp = "[" + nameStartChar + "][" + nameChar + "]*"; - var regexName = new RegExp("^" + nameRegexp + "$"); - var getAllMatches = function(string, regex) { - const matches = []; - let match = regex.exec(string); - while (match) { - const allmatches = []; - allmatches.startIndex = regex.lastIndex - match[0].length; - const len = match.length; - for (let index = 0; index < len; index++) { - allmatches.push(match[index]); - } - matches.push(allmatches); - match = regex.exec(string); - } - return matches; - }; - var isName = function(string) { - const match = regexName.exec(string); - return !(match === null || typeof match === "undefined"); - }; - exports2.isExist = function(v) { - return typeof v !== "undefined"; - }; - exports2.isEmptyObject = function(obj) { - return Object.keys(obj).length === 0; - }; - exports2.merge = function(target, a, arrayMode) { - if (a) { - const keys = Object.keys(a); - const len = keys.length; - for (let i = 0; i < len; i++) { - if (arrayMode === "strict") { - target[keys[i]] = [a[keys[i]]]; - } else { - target[keys[i]] = a[keys[i]]; - } - } +// 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(); } - }; - exports2.getValue = function(v) { - if (exports2.isExist(v)) { - return v; - } else { - return ""; + 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.isName = isName; - exports2.getAllMatches = getAllMatches; - exports2.nameRegexp = nameRegexp; + exports2.AbortError = AbortError; } }); -// node_modules/fast-xml-parser/src/validator.js -var require_validator = __commonJS({ - "node_modules/fast-xml-parser/src/validator.js"(exports2) { - "use strict"; - var util = require_util9(); - var defaultOptions = { - allowBooleanAttributes: false, - //A tag can have attributes without any value - unpairedTags: [] - }; - exports2.validate = function(xmlData, options) { - options = Object.assign({}, defaultOptions, options); - const tags = []; - let tagFound = false; - let reachedRoot = false; - if (xmlData[0] === "\uFEFF") { - xmlData = xmlData.substr(1); - } - for (let i = 0; i < xmlData.length; i++) { - if (xmlData[i] === "<" && xmlData[i + 1] === "?") { - i += 2; - i = readPI(xmlData, i); - if (i.err) return i; - } else if (xmlData[i] === "<") { - let tagStartPos = i; - i++; - if (xmlData[i] === "!") { - i = readCommentAndCDATA(xmlData, i); - continue; - } else { - let closingTag = false; - if (xmlData[i] === "/") { - closingTag = true; - i++; - } - let tagName = ""; - for (; i < xmlData.length && xmlData[i] !== ">" && xmlData[i] !== " " && xmlData[i] !== " " && xmlData[i] !== "\n" && xmlData[i] !== "\r"; i++) { - tagName += xmlData[i]; - } - tagName = tagName.trim(); - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substring(0, tagName.length - 1); - i--; - } - if (!validateTagName(tagName)) { - let msg; - if (tagName.trim().length === 0) { - msg = "Invalid space after '<'."; - } else { - msg = "Tag '" + tagName + "' is an invalid name."; - } - return getErrorObject("InvalidTag", msg, getLineNumberForPosition(xmlData, i)); - } - const result = readAttributeStr(xmlData, i); - if (result === false) { - return getErrorObject("InvalidAttr", "Attributes for '" + tagName + "' have open quote.", getLineNumberForPosition(xmlData, i)); - } - let attrStr = result.value; - i = result.index; - if (attrStr[attrStr.length - 1] === "/") { - const attrStrStart = i - attrStr.length; - attrStr = attrStr.substring(0, attrStr.length - 1); - const isValid = validateAttributeString(attrStr, options); - if (isValid === true) { - tagFound = true; - } else { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid.err.line)); - } - } else if (closingTag) { - if (!result.tagClosed) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' doesn't have proper closing.", getLineNumberForPosition(xmlData, i)); - } else if (attrStr.trim().length > 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' can't have attributes or invalid starting.", getLineNumberForPosition(xmlData, tagStartPos)); - } else if (tags.length === 0) { - return getErrorObject("InvalidTag", "Closing tag '" + tagName + "' has not been opened.", getLineNumberForPosition(xmlData, tagStartPos)); - } else { - const otg = tags.pop(); - if (tagName !== otg.tagName) { - let openPos = getLineNumberForPosition(xmlData, otg.tagStartPos); - return getErrorObject( - "InvalidTag", - "Expected closing tag '" + otg.tagName + "' (opened in line " + openPos.line + ", col " + openPos.col + ") instead of closing tag '" + tagName + "'.", - getLineNumberForPosition(xmlData, tagStartPos) - ); - } - if (tags.length == 0) { - reachedRoot = true; - } - } - } else { - const isValid = validateAttributeString(attrStr, options); - if (isValid !== true) { - return getErrorObject(isValid.err.code, isValid.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid.err.line)); - } - if (reachedRoot === true) { - return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i)); - } else if (options.unpairedTags.indexOf(tagName) !== -1) { - } else { - tags.push({ tagName, tagStartPos }); - } - tagFound = true; - } - for (i++; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "!") { - i++; - i = readCommentAndCDATA(xmlData, i); - continue; - } else if (xmlData[i + 1] === "?") { - i = readPI(xmlData, ++i); - if (i.err) return i; - } else { - break; - } - } else if (xmlData[i] === "&") { - const afterAmp = validateAmpersand(xmlData, i); - if (afterAmp == -1) - return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(xmlData, i)); - i = afterAmp; - } else { - if (reachedRoot === true && !isWhiteSpace(xmlData[i])) { - return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(xmlData, i)); - } - } - } - if (xmlData[i] === "<") { - i--; - } - } - } else { - if (isWhiteSpace(xmlData[i])) { - continue; - } - return getErrorObject("InvalidChar", "char '" + xmlData[i] + "' is not expected.", getLineNumberForPosition(xmlData, i)); +// 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((resolve6, reject) => { + function rejectOnAbort() { + reject(new abort_controller_1.AbortError(abortErrorMsg ?? "The operation was aborted.")); } - } - if (!tagFound) { - return getErrorObject("InvalidXml", "Start tag expected.", 1); - } else if (tags.length == 1) { - return getErrorObject("InvalidTag", "Unclosed tag '" + tags[0].tagName + "'.", getLineNumberForPosition(xmlData, tags[0].tagStartPos)); - } else if (tags.length > 0) { - return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(tags.map((t) => t.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }); - } - return true; - }; - function isWhiteSpace(char) { - return char === " " || char === " " || char === "\n" || char === "\r"; - } - function readPI(xmlData, i) { - const start = i; - for (; i < xmlData.length; i++) { - if (xmlData[i] == "?" || xmlData[i] == " ") { - const tagname = xmlData.substr(start, i - start); - if (i > 5 && tagname === "xml") { - return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(xmlData, i)); - } else if (xmlData[i] == "?" && xmlData[i + 1] == ">") { - i++; - break; - } else { - continue; - } + function removeListeners() { + abortSignal?.removeEventListener("abort", onAbort); } - } - return i; - } - function readCommentAndCDATA(xmlData, i) { - if (xmlData.length > i + 5 && xmlData[i + 1] === "-" && xmlData[i + 2] === "-") { - for (i += 3; i < xmlData.length; i++) { - if (xmlData[i] === "-" && xmlData[i + 1] === "-" && xmlData[i + 2] === ">") { - i += 2; - break; - } + function onAbort() { + cleanupBeforeAbort?.(); + removeListeners(); + rejectOnAbort(); } - } else if (xmlData.length > i + 8 && xmlData[i + 1] === "D" && xmlData[i + 2] === "O" && xmlData[i + 3] === "C" && xmlData[i + 4] === "T" && xmlData[i + 5] === "Y" && xmlData[i + 6] === "P" && xmlData[i + 7] === "E") { - let angleBracketsCount = 1; - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - angleBracketsCount++; - } else if (xmlData[i] === ">") { - angleBracketsCount--; - if (angleBracketsCount === 0) { - break; - } - } + if (abortSignal?.aborted) { + return rejectOnAbort(); } - } else if (xmlData.length > i + 9 && xmlData[i + 1] === "[" && xmlData[i + 2] === "C" && xmlData[i + 3] === "D" && xmlData[i + 4] === "A" && xmlData[i + 5] === "T" && xmlData[i + 6] === "A" && xmlData[i + 7] === "[") { - for (i += 8; i < xmlData.length; i++) { - if (xmlData[i] === "]" && xmlData[i + 1] === "]" && xmlData[i + 2] === ">") { - i += 2; - break; - } + try { + buildPromise((x) => { + removeListeners(); + resolve6(x); + }, (x) => { + removeListeners(); + reject(x); + }); + } catch (err) { + reject(err); } - } - return i; + 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)((resolve6) => { + token = setTimeout(resolve6, 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 }; } - var doubleQuote = '"'; - var singleQuote = "'"; - function readAttributeStr(xmlData, i) { - let attrStr = ""; - let startChar = ""; - let tagClosed = false; - for (; i < xmlData.length; i++) { - if (xmlData[i] === doubleQuote || xmlData[i] === singleQuote) { - if (startChar === "") { - startChar = xmlData[i]; - } else if (startChar !== xmlData[i]) { + } +}); + +// 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 { - startChar = ""; - } - } else if (xmlData[i] === ">") { - if (startChar === "") { - tagClosed = true; - break; + stringified = String(e); } + } catch (err) { + stringified = "[unable to stringify input]"; } - attrStr += xmlData[i]; - } - if (startChar !== "") { - return false; - } - return { - value: attrStr, - index: i, - tagClosed - }; - } - var validAttrStrRegxp = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); - function validateAttributeString(attrStr, options) { - const matches = util.getAllMatches(attrStr, validAttrStrRegxp); - const attrNames = {}; - for (let i = 0; i < matches.length; i++) { - if (matches[i][1].length === 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' has no space in starting.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] !== void 0 && matches[i][4] === void 0) { - return getErrorObject("InvalidAttr", "Attribute '" + matches[i][2] + "' is without value.", getPositionFromMatch(matches[i])); - } else if (matches[i][3] === void 0 && !options.allowBooleanAttributes) { - return getErrorObject("InvalidAttr", "boolean attribute '" + matches[i][2] + "' is not allowed.", getPositionFromMatch(matches[i])); - } - const attrName = matches[i][2]; - if (!validateAttrName(attrName)) { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is an invalid name.", getPositionFromMatch(matches[i])); - } - if (!attrNames.hasOwnProperty(attrName)) { - attrNames[attrName] = 1; - } else { - return getErrorObject("InvalidAttr", "Attribute '" + attrName + "' is repeated.", getPositionFromMatch(matches[i])); - } + return `Unknown error ${stringified}`; } - return true; } - function validateNumberAmpersand(xmlData, i) { - let re = /\d/; - if (xmlData[i] === "x") { - i++; - re = /[\da-fA-F]/; - } - for (; i < xmlData.length; i++) { - if (xmlData[i] === ";") - return i; - if (!xmlData[i].match(re)) - break; - } - return -1; + } +}); + +// 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 = isDefined2; + exports2.isObjectWithProperties = isObjectWithProperties; + exports2.objectHasProperty = objectHasProperty; + function isDefined2(thing) { + return typeof thing !== "undefined" && thing !== null; } - function validateAmpersand(xmlData, i) { - i++; - if (xmlData[i] === ";") - return -1; - if (xmlData[i] === "#") { - i++; - return validateNumberAmpersand(xmlData, i); - } - let count = 0; - for (; i < xmlData.length; i++, count++) { - if (xmlData[i].match(/\w/) && count < 20) - continue; - if (xmlData[i] === ";") - break; - return -1; + function isObjectWithProperties(thing, properties) { + if (!isDefined2(thing) || typeof thing !== "object") { + return false; } - return i; - } - function getErrorObject(code, message, lineNumber) { - return { - err: { - code, - msg: message, - line: lineNumber.line || lineNumber, - col: lineNumber.col - } - }; - } - function validateAttrName(attrName) { - return util.isName(attrName); - } - function validateTagName(tagname) { - return util.isName(tagname); - } - function getLineNumberForPosition(xmlData, index) { - const lines = xmlData.substring(0, index).split(/\r?\n/); - return { - line: lines.length, - // column number is last line's length + 1, because column numbering starts at 1: - col: lines[lines.length - 1].length + 1 - }; - } - function getPositionFromMatch(match) { - return match.startIndex + match[1].length; - } - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js -var require_OptionsBuilder = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"(exports2) { - var defaultOptions = { - preserveOrder: false, - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - removeNSPrefix: false, - // remove NS from tag name or attribute name if true - allowBooleanAttributes: false, - //a tag can have attributes without any value - //ignoreRootElement : false, - parseTagValue: true, - parseAttributeValue: false, - trimValues: true, - //Trim string values of tag and attributes - cdataPropName: false, - numberParseOptions: { - hex: true, - leadingZeros: true, - eNotation: true - }, - tagValueProcessor: function(tagName, val2) { - return val2; - }, - attributeValueProcessor: function(attrName, val2) { - return val2; - }, - stopNodes: [], - //nested tags will not be parsed even for errors - alwaysCreateTextNode: false, - isArray: () => false, - commentPropName: false, - unpairedTags: [], - processEntities: true, - htmlEntities: false, - ignoreDeclaration: false, - ignorePiTags: false, - transformTagName: false, - transformAttributeName: false, - updateTag: function(tagName, jPath, attrs) { - return tagName; - } - // skipEmptyListItem: false - }; - var buildOptions = function(options) { - return Object.assign({}, defaultOptions, options); - }; - exports2.buildOptions = buildOptions; - exports2.defaultOptions = defaultOptions; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/xmlNode.js -var require_xmlNode = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"(exports2, module2) { - "use strict"; - var XmlNode = class { - constructor(tagname) { - this.tagname = tagname; - this.child = []; - this[":@"] = {}; - } - add(key, val2) { - if (key === "__proto__") key = "#__proto__"; - this.child.push({ [key]: val2 }); - } - addChild(node) { - if (node.tagname === "__proto__") node.tagname = "#__proto__"; - if (node[":@"] && Object.keys(node[":@"]).length > 0) { - this.child.push({ [node.tagname]: node.child, [":@"]: node[":@"] }); - } else { - this.child.push({ [node.tagname]: node.child }); - } - } - }; - module2.exports = XmlNode; - } -}); - -// node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js -var require_DocTypeReader = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"(exports2, module2) { - var util = require_util9(); - function readDocType(xmlData, i) { - const entities = {}; - if (xmlData[i + 3] === "O" && xmlData[i + 4] === "C" && xmlData[i + 5] === "T" && xmlData[i + 6] === "Y" && xmlData[i + 7] === "P" && xmlData[i + 8] === "E") { - i = i + 9; - let angleBracketsCount = 1; - let hasBody = false, comment = false; - let exp = ""; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<" && !comment) { - if (hasBody && isEntity(xmlData, i)) { - i += 7; - [entityName, val, i] = readEntityExp(xmlData, i + 1); - if (val.indexOf("&") === -1) - entities[validateEntityName(entityName)] = { - regx: RegExp(`&${entityName};`, "g"), - val - }; - } else if (hasBody && isElement(xmlData, i)) i += 8; - else if (hasBody && isAttlist(xmlData, i)) i += 8; - else if (hasBody && isNotation(xmlData, i)) i += 9; - else if (isComment) comment = true; - else throw new Error("Invalid DOCTYPE"); - angleBracketsCount++; - exp = ""; - } else if (xmlData[i] === ">") { - if (comment) { - if (xmlData[i - 1] === "-" && xmlData[i - 2] === "-") { - comment = false; - angleBracketsCount--; - } - } else { - angleBracketsCount--; - } - if (angleBracketsCount === 0) { - break; - } - } else if (xmlData[i] === "[") { - hasBody = true; - } else { - exp += xmlData[i]; - } - } - if (angleBracketsCount !== 0) { - throw new Error(`Unclosed DOCTYPE`); + for (const property of properties) { + if (!objectHasProperty(thing, property)) { + return false; } - } else { - throw new Error(`Invalid Tag instead of DOCTYPE`); } - return { entities, i }; + return true; } - function readEntityExp(xmlData, i) { - let entityName2 = ""; - for (; i < xmlData.length && (xmlData[i] !== "'" && xmlData[i] !== '"'); i++) { - entityName2 += xmlData[i]; - } - entityName2 = entityName2.trim(); - if (entityName2.indexOf(" ") !== -1) throw new Error("External entites are not supported"); - const startChar = xmlData[i++]; - let val2 = ""; - for (; i < xmlData.length && xmlData[i] !== startChar; i++) { - val2 += xmlData[i]; - } - return [entityName2, val2, i]; + function objectHasProperty(thing, property) { + return isDefined2(thing) && typeof thing === "object" && property in thing; } - function isComment(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "-" && xmlData[i + 3] === "-") return true; - return false; + } +}); + +// 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 = randomUUID2; + 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 isEntity(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "N" && xmlData[i + 4] === "T" && xmlData[i + 5] === "I" && xmlData[i + 6] === "T" && xmlData[i + 7] === "Y") return true; - return false; + function computeSha256Hash(content, encoding) { + return tspRuntime.computeSha256Hash(content, encoding); } - function isElement(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "E" && xmlData[i + 3] === "L" && xmlData[i + 4] === "E" && xmlData[i + 5] === "M" && xmlData[i + 6] === "E" && xmlData[i + 7] === "N" && xmlData[i + 8] === "T") return true; - return false; + function computeSha256Hmac(key, stringToSign, encoding) { + return tspRuntime.computeSha256Hmac(key, stringToSign, encoding); } - function isAttlist(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "A" && xmlData[i + 3] === "T" && xmlData[i + 4] === "T" && xmlData[i + 5] === "L" && xmlData[i + 6] === "I" && xmlData[i + 7] === "S" && xmlData[i + 8] === "T") return true; - return false; + function getRandomIntegerInclusive(min, max) { + return tspRuntime.getRandomIntegerInclusive(min, max); } - function isNotation(xmlData, i) { - if (xmlData[i + 1] === "!" && xmlData[i + 2] === "N" && xmlData[i + 3] === "O" && xmlData[i + 4] === "T" && xmlData[i + 5] === "A" && xmlData[i + 6] === "T" && xmlData[i + 7] === "I" && xmlData[i + 8] === "O" && xmlData[i + 9] === "N") return true; - return false; + function isError(e) { + return tspRuntime.isError(e); } - function validateEntityName(name) { - if (util.isName(name)) - return name; - else - throw new Error(`Invalid entity name ${name}`); - } - module2.exports = readDocType; - } -}); - -// node_modules/strnum/strnum.js -var require_strnum = __commonJS({ - "node_modules/strnum/strnum.js"(exports2, module2) { - var hexRegex = /^[-+]?0x[a-fA-F0-9]+$/; - var numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/; - if (!Number.parseInt && window.parseInt) { - Number.parseInt = window.parseInt; - } - if (!Number.parseFloat && window.parseFloat) { - Number.parseFloat = window.parseFloat; - } - var consider = { - hex: true, - leadingZeros: true, - decimalPoint: ".", - eNotation: true - //skipLike: /regex/ - }; - function toNumber2(str2, options = {}) { - options = Object.assign({}, consider, options); - if (!str2 || typeof str2 !== "string") return str2; - let trimmedStr = str2.trim(); - if (options.skipLike !== void 0 && options.skipLike.test(trimmedStr)) return str2; - else if (options.hex && hexRegex.test(trimmedStr)) { - return Number.parseInt(trimmedStr, 16); - } else { - const match = numRegex.exec(trimmedStr); - if (match) { - const sign = match[1]; - const leadingZeros = match[2]; - let numTrimmedByZeros = trimZeros(match[3]); - const eNotation = match[4] || match[6]; - if (!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str2; - else if (!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str2; - else { - const num = Number(trimmedStr); - const numStr = "" + num; - if (numStr.search(/[eE]/) !== -1) { - if (options.eNotation) return num; - else return str2; - } else if (eNotation) { - if (options.eNotation) return num; - else return str2; - } else if (trimmedStr.indexOf(".") !== -1) { - if (numStr === "0" && numTrimmedByZeros === "") return num; - else if (numStr === numTrimmedByZeros) return num; - else if (sign && numStr === "-" + numTrimmedByZeros) return num; - else return str2; - } - if (leadingZeros) { - if (numTrimmedByZeros === numStr) return num; - else if (sign + numTrimmedByZeros === numStr) return num; - else return str2; - } - if (trimmedStr === numStr) return num; - else if (trimmedStr === sign + numStr) return num; - return str2; - } - } else { - return str2; - } - } + function isObject2(input) { + return tspRuntime.isObject(input); } - function trimZeros(numStr) { - if (numStr && numStr.indexOf(".") !== -1) { - numStr = numStr.replace(/0+$/, ""); - if (numStr === ".") numStr = "0"; - else if (numStr[0] === ".") numStr = "0" + numStr; - else if (numStr[numStr.length - 1] === ".") numStr = numStr.substr(0, numStr.length - 1); - return numStr; - } - return numStr; + function randomUUID2() { + 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); } - module2.exports = toNumber2; - } -}); - -// node_modules/fast-xml-parser/src/ignoreAttributes.js -var require_ignoreAttributes = __commonJS({ - "node_modules/fast-xml-parser/src/ignoreAttributes.js"(exports2, module2) { - function getIgnoreAttributesFn(ignoreAttributes) { - if (typeof ignoreAttributes === "function") { - return ignoreAttributes; - } - if (Array.isArray(ignoreAttributes)) { - return (attrName) => { - for (const pattern of ignoreAttributes) { - if (typeof pattern === "string" && attrName === pattern) { - return true; - } - if (pattern instanceof RegExp && pattern.test(attrName)) { - return true; - } - } - }; - } - return () => false; + function stringToUint8Array(value, format) { + return tspRuntime.stringToUint8Array(value, format); } - module2.exports = getIgnoreAttributesFn; } }); -// node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js -var require_OrderedObjParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"(exports2, module2) { +// 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"; - var util = require_util9(); - var xmlNode = require_xmlNode(); - var readDocType = require_DocTypeReader(); - var toNumber2 = require_strnum(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var OrderedObjParser = class { - constructor(options) { - this.options = options; - this.currentNode = null; - this.tagsNodeStack = []; - this.docTypeEntities = {}; - this.lastEntities = { - "apos": { regex: /&(apos|#39|#x27);/g, val: "'" }, - "gt": { regex: /&(gt|#62|#x3E);/g, val: ">" }, - "lt": { regex: /&(lt|#60|#x3C);/g, val: "<" }, - "quot": { regex: /&(quot|#34|#x22);/g, val: '"' } - }; - this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }; - this.htmlEntities = { - "space": { regex: /&(nbsp|#160);/g, val: " " }, - // "lt" : { regex: /&(lt|#60);/g, val: "<" }, - // "gt" : { regex: /&(gt|#62);/g, val: ">" }, - // "amp" : { regex: /&(amp|#38);/g, val: "&" }, - // "quot" : { regex: /&(quot|#34);/g, val: "\"" }, - // "apos" : { regex: /&(apos|#39);/g, val: "'" }, - "cent": { regex: /&(cent|#162);/g, val: "\xA2" }, - "pound": { regex: /&(pound|#163);/g, val: "\xA3" }, - "yen": { regex: /&(yen|#165);/g, val: "\xA5" }, - "euro": { regex: /&(euro|#8364);/g, val: "\u20AC" }, - "copyright": { regex: /&(copy|#169);/g, val: "\xA9" }, - "reg": { regex: /&(reg|#174);/g, val: "\xAE" }, - "inr": { regex: /&(inr|#8377);/g, val: "\u20B9" }, - "num_dec": { regex: /&#([0-9]{1,7});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 10)) }, - "num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (_, str2) => String.fromCharCode(Number.parseInt(str2, 16)) } - }; - this.addExternalEntities = addExternalEntities; - this.parseXml = parseXml; - this.parseTextData = parseTextData; - this.resolveNameSpace = resolveNameSpace; - this.buildAttributesMap = buildAttributesMap; - this.isItStopNode = isItStopNode; - this.replaceEntitiesValue = replaceEntitiesValue; - this.readStopNodeData = readStopNodeData; - this.saveTextToParentTag = saveTextToParentTag; - this.addChild = addChild; - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - } - }; - function addExternalEntities(externalEntities) { - const entKeys = Object.keys(externalEntities); - for (let i = 0; i < entKeys.length; i++) { - const ent = entKeys[i]; - this.lastEntities[ent] = { - regex: new RegExp("&" + ent + ";", "g"), - val: externalEntities[ent] - }; - } - } - function parseTextData(val2, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) { - if (val2 !== void 0) { - if (this.options.trimValues && !dontTrim) { - val2 = val2.trim(); - } - if (val2.length > 0) { - if (!escapeEntities) val2 = this.replaceEntitiesValue(val2); - const newval = this.options.tagValueProcessor(tagName, val2, jPath, hasAttributes, isLeafNode); - if (newval === null || newval === void 0) { - return val2; - } else if (typeof newval !== typeof val2 || newval !== val2) { - return newval; - } else if (this.options.trimValues) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - const trimmedVal = val2.trim(); - if (trimmedVal === val2) { - return parseValue(val2, this.options.parseTagValue, this.options.numberParseOptions); - } else { - return val2; - } - } - } - } - } - function resolveNameSpace(tagname) { - if (this.options.removeNSPrefix) { - const tags = tagname.split(":"); - const prefix = tagname.charAt(0) === "/" ? "/" : ""; - if (tags[0] === "xmlns") { - return ""; - } - if (tags.length === 2) { - tagname = prefix + tags[1]; - } - } - return tagname; - } - var attrsRegx = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); - function buildAttributesMap(attrStr, jPath, tagName) { - if (this.options.ignoreAttributes !== true && typeof attrStr === "string") { - const matches = util.getAllMatches(attrStr, attrsRegx); - const len = matches.length; - const attrs = {}; - for (let i = 0; i < len; i++) { - const attrName = this.resolveNameSpace(matches[i][1]); - if (this.ignoreAttributesFn(attrName, jPath)) { - continue; - } - let oldVal = matches[i][4]; - let aName = this.options.attributeNamePrefix + attrName; - if (attrName.length) { - if (this.options.transformAttributeName) { - aName = this.options.transformAttributeName(aName); - } - if (aName === "__proto__") aName = "#__proto__"; - if (oldVal !== void 0) { - if (this.options.trimValues) { - oldVal = oldVal.trim(); - } - oldVal = this.replaceEntitiesValue(oldVal); - const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath); - if (newVal === null || newVal === void 0) { - attrs[aName] = oldVal; - } else if (typeof newVal !== typeof oldVal || newVal !== oldVal) { - attrs[aName] = newVal; - } else { - attrs[aName] = parseValue( - oldVal, - this.options.parseAttributeValue, - this.options.numberParseOptions - ); - } - } else if (this.options.allowBooleanAttributes) { - attrs[aName] = true; - } - } - } - if (!Object.keys(attrs).length) { - return; - } - if (this.options.attributesGroupName) { - const attrCollection = {}; - attrCollection[this.options.attributesGroupName] = attrs; - return attrCollection; - } - return attrs; - } - } - var parseXml = function(xmlData) { - xmlData = xmlData.replace(/\r\n?/g, "\n"); - const xmlObj = new xmlNode("!xml"); - let currentNode = xmlObj; - let textData = ""; - let jPath = ""; - for (let i = 0; i < xmlData.length; i++) { - const ch = xmlData[i]; - if (ch === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed."); - let tagName = xmlData.substring(i + 2, closeIndex).trim(); - if (this.options.removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - } - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode) { - textData = this.saveTextToParentTag(textData, currentNode, jPath); - } - const lastTagName = jPath.substring(jPath.lastIndexOf(".") + 1); - if (tagName && this.options.unpairedTags.indexOf(tagName) !== -1) { - throw new Error(`Unpaired tag can not be used as closing tag: `); - } - let propIndex = 0; - if (lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1) { - propIndex = jPath.lastIndexOf(".", jPath.lastIndexOf(".") - 1); - this.tagsNodeStack.pop(); - } else { - propIndex = jPath.lastIndexOf("."); - } - jPath = jPath.substring(0, propIndex); - currentNode = this.tagsNodeStack.pop(); - textData = ""; - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - let tagData = readTagExp(xmlData, i, false, "?>"); - if (!tagData) throw new Error("Pi Tag is not closed."); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - if (this.options.ignoreDeclaration && tagData.tagName === "?xml" || this.options.ignorePiTags) { - } else { - const childNode = new xmlNode(tagData.tagName); - childNode.add(this.options.textNodeName, ""); - if (tagData.tagName !== tagData.tagExp && tagData.attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName); - } - this.addChild(currentNode, childNode, jPath); - } - i = tagData.closeIndex + 1; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const endIndex = findClosingIndex(xmlData, "-->", i + 4, "Comment is not closed."); - if (this.options.commentPropName) { - const comment = xmlData.substring(i + 4, endIndex - 2); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - currentNode.add(this.options.commentPropName, [{ [this.options.textNodeName]: comment }]); - } - i = endIndex; - } else if (xmlData.substr(i + 1, 2) === "!D") { - const result = readDocType(xmlData, i); - this.docTypeEntities = result.entities; - i = result.i; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2; - const tagExp = xmlData.substring(i + 9, closeIndex); - textData = this.saveTextToParentTag(textData, currentNode, jPath); - let val2 = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true); - if (val2 == void 0) val2 = ""; - if (this.options.cdataPropName) { - currentNode.add(this.options.cdataPropName, [{ [this.options.textNodeName]: tagExp }]); - } else { - currentNode.add(this.options.textNodeName, val2); - } - i = closeIndex + 2; - } else { - let result = readTagExp(xmlData, i, this.options.removeNSPrefix); - let tagName = result.tagName; - const rawTagName = result.rawTagName; - let tagExp = result.tagExp; - let attrExpPresent = result.attrExpPresent; - let closeIndex = result.closeIndex; - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - if (currentNode && textData) { - if (currentNode.tagname !== "!xml") { - textData = this.saveTextToParentTag(textData, currentNode, jPath, false); - } - } - const lastTag = currentNode; - if (lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1) { - currentNode = this.tagsNodeStack.pop(); - jPath = jPath.substring(0, jPath.lastIndexOf(".")); - } - if (tagName !== xmlObj.tagname) { - jPath += jPath ? "." + tagName : tagName; - } - if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) { - let tagContent = ""; - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - i = result.closeIndex; - } else if (this.options.unpairedTags.indexOf(tagName) !== -1) { - i = result.closeIndex; - } else { - const result2 = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1); - if (!result2) throw new Error(`Unexpected end of ${rawTagName}`); - i = result2.i; - tagContent = result2.tagContent; - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - if (tagContent) { - tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true); - } - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - childNode.add(this.options.textNodeName, tagContent); - this.addChild(currentNode, childNode, jPath); - } else { - if (tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1) { - if (tagName[tagName.length - 1] === "/") { - tagName = tagName.substr(0, tagName.length - 1); - jPath = jPath.substr(0, jPath.length - 1); - tagExp = tagName; - } else { - tagExp = tagExp.substr(0, tagExp.length - 1); - } - if (this.options.transformTagName) { - tagName = this.options.transformTagName(tagName); - } - const childNode = new xmlNode(tagName); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - jPath = jPath.substr(0, jPath.lastIndexOf(".")); - } else { - const childNode = new xmlNode(tagName); - this.tagsNodeStack.push(currentNode); - if (tagName !== tagExp && attrExpPresent) { - childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName); - } - this.addChild(currentNode, childNode, jPath); - currentNode = childNode; - } - textData = ""; - i = closeIndex; - } - } - } else { - textData += xmlData[i]; - } - } - return xmlObj.child; - }; - function addChild(currentNode, childNode, jPath) { - const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"]); - if (result === false) { - } else if (typeof result === "string") { - childNode.tagname = result; - currentNode.addChild(childNode); - } else { - currentNode.addChild(childNode); - } + 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 replaceEntitiesValue = function(val2) { - if (this.options.processEntities) { - for (let entityName2 in this.docTypeEntities) { - const entity = this.docTypeEntities[entityName2]; - val2 = val2.replace(entity.regx, entity.val); - } - for (let entityName2 in this.lastEntities) { - const entity = this.lastEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - if (this.options.htmlEntities) { - for (let entityName2 in this.htmlEntities) { - const entity = this.htmlEntities[entityName2]; - val2 = val2.replace(entity.regex, entity.val); - } - } - val2 = val2.replace(this.ampEntity.regex, this.ampEntity.val); + 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"); } - return val2; }; - function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) { - if (textData) { - if (isLeafNode === void 0) isLeafNode = Object.keys(currentNode.child).length === 0; - textData = this.parseTextData( - textData, - currentNode.tagname, - jPath, - false, - currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false, - isLeafNode - ); - if (textData !== void 0 && textData !== "") - currentNode.add(this.options.textNodeName, textData); - textData = ""; - } - return textData; - } - function isItStopNode(stopNodes, jPath, currentTagName) { - const allNodesExp = "*." + currentTagName; - for (const stopNodePath in stopNodes) { - const stopNodeExp = stopNodes[stopNodePath]; - if (allNodesExp === stopNodeExp || jPath === stopNodeExp) return true; - } - return false; - } - function tagExpWithClosingIndex(xmlData, i, closingChar = ">") { - let attrBoundary; - let tagExp = ""; - for (let index = i; index < xmlData.length; index++) { - let ch = xmlData[index]; - if (attrBoundary) { - if (ch === attrBoundary) attrBoundary = ""; - } else if (ch === '"' || ch === "'") { - attrBoundary = ch; - } else if (ch === closingChar[0]) { - if (closingChar[1]) { - if (xmlData[index + 1] === closingChar[1]) { - return { - data: tagExp, - index - }; - } - } else { - return { - data: tagExp, - index - }; - } - } else if (ch === " ") { - ch = " "; - } - tagExp += ch; - } + var rawContent = /* @__PURE__ */ Symbol("rawContent"); + function hasRawContent(x) { + return typeof x[rawContent] === "function"; } - function findClosingIndex(xmlData, str2, i, errMsg) { - const closingIndex = xmlData.indexOf(str2, i); - if (closingIndex === -1) { - throw new Error(errMsg); + function getRawContent(blob) { + if (hasRawContent(blob)) { + return blob[rawContent](); } else { - return closingIndex + str2.length - 1; + return blob; } } - function readTagExp(xmlData, i, removeNSPrefix, closingChar = ">") { - const result = tagExpWithClosingIndex(xmlData, i + 1, closingChar); - if (!result) return; - let tagExp = result.data; - const closeIndex = result.index; - const separatorIndex = tagExp.search(/\s/); - let tagName = tagExp; - let attrExpPresent = true; - if (separatorIndex !== -1) { - tagName = tagExp.substring(0, separatorIndex); - tagExp = tagExp.substring(separatorIndex + 1).trimStart(); - } - const rawTagName = tagName; - if (removeNSPrefix) { - const colonIndex = tagName.indexOf(":"); - if (colonIndex !== -1) { - tagName = tagName.substr(colonIndex + 1); - attrExpPresent = tagName !== result.data.substr(colonIndex + 1); - } - } + function createFileFromStream(stream2, name, options = {}) { return { - tagName, - tagExp, - closeIndex, - attrExpPresent, - rawTagName + ...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 readStopNodeData(xmlData, tagName, i) { - const startIndex = i; - let openTagCount = 1; - for (; i < xmlData.length; i++) { - if (xmlData[i] === "<") { - if (xmlData[i + 1] === "/") { - const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`); - let closeTagName = xmlData.substring(i + 2, closeIndex).trim(); - if (closeTagName === tagName) { - openTagCount--; - if (openTagCount === 0) { - return { - tagContent: xmlData.substring(startIndex, i), - i: closeIndex - }; - } - } - i = closeIndex; - } else if (xmlData[i + 1] === "?") { - const closeIndex = findClosingIndex(xmlData, "?>", i + 1, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 3) === "!--") { - const closeIndex = findClosingIndex(xmlData, "-->", i + 3, "StopNode is not closed."); - i = closeIndex; - } else if (xmlData.substr(i + 1, 2) === "![") { - const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2; - i = closeIndex; - } else { - const tagData = readTagExp(xmlData, i, ">"); - if (tagData) { - const openTagName = tagData && tagData.tagName; - if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length - 1] !== "/") { - openTagCount++; - } - i = tagData.closeIndex; - } - } - } + 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 parseValue(val2, shouldParse, options) { - if (shouldParse && typeof val2 === "string") { - const newval = val2.trim(); - if (newval === "true") return true; - else if (newval === "false") return false; - else return toNumber2(val2, options); - } else { - if (util.isExist(val2)) { - return val2; - } else { - return ""; - } + function toArrayBuffer(source) { + if ("resize" in source.buffer) { + return source; } + return source.map((x) => x); } - module2.exports = OrderedObjParser; } }); -// node_modules/fast-xml-parser/src/xmlparser/node2json.js -var require_node2json = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/node2json.js"(exports2) { +// 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"; - function prettify(node, options) { - return compress(node, options); - } - function compress(arr, options, jPath) { - let text; - const compressedObj = {}; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const property = propName(tagObj); - let newJpath = ""; - if (jPath === void 0) newJpath = property; - else newJpath = jPath + "." + property; - if (property === options.textNodeName) { - if (text === void 0) text = tagObj[property]; - else text += "" + tagObj[property]; - } else if (property === void 0) { - continue; - } else if (tagObj[property]) { - let val2 = compress(tagObj[property], options, newJpath); - const isLeaf = isLeafTag(val2, options); - if (tagObj[":@"]) { - assignAttributes(val2, tagObj[":@"], newJpath, options); - } else if (Object.keys(val2).length === 1 && val2[options.textNodeName] !== void 0 && !options.alwaysCreateTextNode) { - val2 = val2[options.textNodeName]; - } else if (Object.keys(val2).length === 0) { - if (options.alwaysCreateTextNode) val2[options.textNodeName] = ""; - else val2 = ""; - } - if (compressedObj[property] !== void 0 && compressedObj.hasOwnProperty(property)) { - if (!Array.isArray(compressedObj[property])) { - compressedObj[property] = [compressedObj[property]]; - } - compressedObj[property].push(val2); - } else { - if (options.isArray(property, newJpath, isLeaf)) { - compressedObj[property] = [val2]; - } else { - compressedObj[property] = val2; + 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 (request, next) => { + if (request.multipartBody) { + for (const part of request.multipartBody.parts) { + if ((0, file_js_1.hasRawContent)(part.body)) { + part.body = (0, file_js_1.getRawContent)(part.body); + } } } + return tspPolicy.sendRequest(request, next); } - } - if (typeof text === "string") { - if (text.length > 0) compressedObj[options.textNodeName] = text; - } else if (text !== void 0) compressedObj[options.textNodeName] = text; - return compressedObj; - } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (key !== ":@") return key; - } - } - function assignAttributes(obj, attrMap, jpath, options) { - if (attrMap) { - const keys = Object.keys(attrMap); - const len = keys.length; - for (let i = 0; i < len; i++) { - const atrrName = keys[i]; - if (options.isArray(atrrName, jpath + "." + atrrName, true, true)) { - obj[atrrName] = [attrMap[atrrName]]; - } else { - obj[atrrName] = attrMap[atrrName]; - } - } - } - } - function isLeafTag(obj, options) { - const { textNodeName } = options; - const propCount = Object.keys(obj).length; - if (propCount === 0) { - return true; - } - if (propCount === 1 && (obj[textNodeName] || typeof obj[textNodeName] === "boolean" || obj[textNodeName] === 0)) { - return true; - } - return false; + }; } - exports2.prettify = prettify; } }); -// node_modules/fast-xml-parser/src/xmlparser/XMLParser.js -var require_XMLParser = __commonJS({ - "node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"(exports2, module2) { - var { buildOptions } = require_OptionsBuilder(); - var OrderedObjParser = require_OrderedObjParser(); - var { prettify } = require_node2json(); - var validator = require_validator(); - var XMLParser = class { - constructor(options) { - this.externalEntities = {}; - this.options = buildOptions(options); - } - /** - * Parse XML dats to JS object - * @param {string|Buffer} xmlData - * @param {boolean|Object} validationOption - */ - parse(xmlData, validationOption) { - if (typeof xmlData === "string") { - } else if (xmlData.toString) { - xmlData = xmlData.toString(); - } else { - throw new Error("XML data is accepted in String or Bytes[] form."); - } - if (validationOption) { - if (validationOption === true) validationOption = {}; - const result = validator.validate(xmlData, validationOption); - if (result !== true) { - throw Error(`${result.err.msg}:${result.err.line}:${result.err.col}`); - } - } - const orderedObjParser = new OrderedObjParser(this.options); - orderedObjParser.addExternalEntities(this.externalEntities); - const orderedResult = orderedObjParser.parseXml(xmlData); - if (this.options.preserveOrder || orderedResult === void 0) return orderedResult; - else return prettify(orderedResult, this.options); - } - /** - * Add Entity which is not by default supported by this library - * @param {string} key - * @param {string} value - */ - addEntity(key, value) { - if (value.indexOf("&") !== -1) { - throw new Error("Entity value can't have '&'"); - } else if (key.indexOf("&") !== -1 || key.indexOf(";") !== -1) { - throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '"); - } else if (value === "&") { - throw new Error("An entity with value '&' is not permitted"); - } else { - this.externalEntities[key] = value; - } - } - }; - module2.exports = XMLParser; +// 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/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js -var require_orderedJs2Xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"(exports2, module2) { - var EOL = "\n"; - function toXml(jArray, options) { - let indentation = ""; - if (options.format && options.indentBy.length > 0) { - indentation = EOL; - } - return arrToStr(jArray, options, "", indentation); - } - function arrToStr(arr, options, jPath, indentation) { - let xmlStr = ""; - let isPreviousElementTag = false; - for (let i = 0; i < arr.length; i++) { - const tagObj = arr[i]; - const tagName = propName(tagObj); - if (tagName === void 0) continue; - let newJPath = ""; - if (jPath.length === 0) newJPath = tagName; - else newJPath = `${jPath}.${tagName}`; - if (tagName === options.textNodeName) { - let tagText = tagObj[tagName]; - if (!isStopNode(newJPath, options)) { - tagText = options.tagValueProcessor(tagName, tagText); - tagText = replaceEntitiesValue(tagText, options); - } - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += tagText; - isPreviousElementTag = false; - continue; - } else if (tagName === options.cdataPropName) { - if (isPreviousElementTag) { - xmlStr += indentation; - } - xmlStr += ``; - isPreviousElementTag = false; - continue; - } else if (tagName === options.commentPropName) { - xmlStr += indentation + ``; - isPreviousElementTag = true; - continue; - } else if (tagName[0] === "?") { - const attStr2 = attr_to_str(tagObj[":@"], options); - const tempInd = tagName === "?xml" ? "" : indentation; - let piTextNodeName = tagObj[tagName][0][options.textNodeName]; - piTextNodeName = piTextNodeName.length !== 0 ? " " + piTextNodeName : ""; - xmlStr += tempInd + `<${tagName}${piTextNodeName}${attStr2}?>`; - isPreviousElementTag = true; - continue; - } - let newIdentation = indentation; - if (newIdentation !== "") { - newIdentation += options.indentBy; - } - const attStr = attr_to_str(tagObj[":@"], options); - const tagStart = indentation + `<${tagName}${attStr}`; - const tagValue = arrToStr(tagObj[tagName], options, newJPath, newIdentation); - if (options.unpairedTags.indexOf(tagName) !== -1) { - if (options.suppressUnpairedNode) xmlStr += tagStart + ">"; - else xmlStr += tagStart + "/>"; - } else if ((!tagValue || tagValue.length === 0) && options.suppressEmptyNode) { - xmlStr += tagStart + "/>"; - } else if (tagValue && tagValue.endsWith(">")) { - xmlStr += tagStart + `>${tagValue}${indentation}`; - } else { - xmlStr += tagStart + ">"; - if (tagValue && indentation !== "" && (tagValue.includes("/>") || tagValue.includes("`; - } - isPreviousElementTag = true; - } - return xmlStr; +// 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); } - function propName(obj) { - const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) { - const key = keys[i]; - if (!obj.hasOwnProperty(key)) continue; - if (key !== ":@") return key; - } - } - function attr_to_str(attrMap, options) { - let attrStr = ""; - if (attrMap && !options.ignoreAttributes) { - for (let attr in attrMap) { - if (!attrMap.hasOwnProperty(attr)) continue; - let attrVal = options.attributeValueProcessor(attr, attrMap[attr]); - attrVal = replaceEntitiesValue(attrVal, options); - if (attrVal === true && options.suppressBooleanAttributes) { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}`; - } else { - attrStr += ` ${attr.substr(options.attributeNamePrefix.length)}="${attrVal}"`; - } - } - } - return attrStr; + } +}); + +// 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)(); } - function isStopNode(jPath, options) { - jPath = jPath.substr(0, jPath.length - options.textNodeName.length - 1); - let tagName = jPath.substr(jPath.lastIndexOf(".") + 1); - for (let index in options.stopNodes) { - if (options.stopNodes[index] === jPath || options.stopNodes[index] === "*." + tagName) return true; - } - return false; + } +}); + +// 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 replaceEntitiesValue(textValue, options) { - if (textValue && textValue.length > 0 && options.processEntities) { - for (let i = 0; i < options.entities.length; i++) { - const entity = options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; + function proxyPolicy(proxySettings, options) { + return (0, policies_1.proxyPolicy)(proxySettings, options); } - module2.exports = toXml; } }); -// node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js -var require_json2xml = __commonJS({ - "node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js"(exports2, module2) { +// 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"; - var buildFromOrderedJs = require_orderedJs2Xml(); - var getIgnoreAttributesFn = require_ignoreAttributes(); - var defaultOptions = { - attributeNamePrefix: "@_", - attributesGroupName: false, - textNodeName: "#text", - ignoreAttributes: true, - cdataPropName: false, - format: false, - indentBy: " ", - suppressEmptyNode: false, - suppressUnpairedNode: true, - suppressBooleanAttributes: true, - tagValueProcessor: function(key, a) { - return a; - }, - attributeValueProcessor: function(attrName, a) { - return a; - }, - preserveOrder: false, - commentPropName: false, - unpairedTags: [], - entities: [ - { regex: new RegExp("&", "g"), val: "&" }, - //it must be on top - { regex: new RegExp(">", "g"), val: ">" }, - { regex: new RegExp("<", "g"), val: "<" }, - { regex: new RegExp("'", "g"), val: "'" }, - { regex: new RegExp('"', "g"), val: """ } - ], - processEntities: true, - stopNodes: [], - // transformTagName: false, - // transformAttributeName: false, - oneListGroup: false - }; - function Builder(options) { - this.options = Object.assign({}, defaultOptions, options); - if (this.options.ignoreAttributes === true || this.options.attributesGroupName) { - this.isAttribute = function() { - return false; - }; - } else { - this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes); - this.attrPrefixLen = this.options.attributeNamePrefix.length; - this.isAttribute = isAttribute; - } - this.processTextOrObjNode = processTextOrObjNode; - if (this.options.format) { - this.indentate = indentate; - this.tagEndChar = ">\n"; - this.newLine = "\n"; - } else { - this.indentate = function() { - return ""; - }; - this.tagEndChar = ">"; - this.newLine = ""; - } - } - Builder.prototype.build = function(jObj) { - if (this.options.preserveOrder) { - return buildFromOrderedJs(jObj, this.options); - } else { - if (Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) { - jObj = { - [this.options.arrayNodeName]: jObj - }; - } - return this.j2x(jObj, 0, []).val; - } - }; - Builder.prototype.j2x = function(jObj, level, ajPath) { - let attrStr = ""; - let val2 = ""; - const jPath = ajPath.join("."); - for (let key in jObj) { - if (!Object.prototype.hasOwnProperty.call(jObj, key)) continue; - if (typeof jObj[key] === "undefined") { - if (this.isAttribute(key)) { - val2 += ""; - } - } else if (jObj[key] === null) { - if (this.isAttribute(key)) { - val2 += ""; - } else if (key[0] === "?") { - val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - } else { - val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } - } else if (jObj[key] instanceof Date) { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } else if (typeof jObj[key] !== "object") { - const attr = this.isAttribute(key); - if (attr && !this.ignoreAttributesFn(attr, jPath)) { - attrStr += this.buildAttrPairStr(attr, "" + jObj[key]); - } else if (!attr) { - if (key === this.options.textNodeName) { - let newval = this.options.tagValueProcessor(key, "" + jObj[key]); - val2 += this.replaceEntitiesValue(newval); - } else { - val2 += this.buildTextValNode(jObj[key], key, "", level); - } - } - } else if (Array.isArray(jObj[key])) { - const arrLen = jObj[key].length; - let listTagVal = ""; - let listTagAttr = ""; - for (let j = 0; j < arrLen; j++) { - const item = jObj[key][j]; - if (typeof item === "undefined") { - } else if (item === null) { - if (key[0] === "?") val2 += this.indentate(level) + "<" + key + "?" + this.tagEndChar; - else val2 += this.indentate(level) + "<" + key + "/" + this.tagEndChar; - } else if (typeof item === "object") { - if (this.options.oneListGroup) { - const result = this.j2x(item, level + 1, ajPath.concat(key)); - listTagVal += result.val; - if (this.options.attributesGroupName && item.hasOwnProperty(this.options.attributesGroupName)) { - listTagAttr += result.attrStr; - } - } else { - listTagVal += this.processTextOrObjNode(item, key, level, ajPath); - } - } else { - if (this.options.oneListGroup) { - let textValue = this.options.tagValueProcessor(key, item); - textValue = this.replaceEntitiesValue(textValue); - listTagVal += textValue; - } else { - listTagVal += this.buildTextValNode(item, key, "", level); - } - } - } - if (this.options.oneListGroup) { - listTagVal = this.buildObjectNode(listTagVal, key, listTagAttr, level); - } - val2 += listTagVal; - } else { - if (this.options.attributesGroupName && key === this.options.attributesGroupName) { - const Ks = Object.keys(jObj[key]); - const L = Ks.length; - for (let j = 0; j < L; j++) { - attrStr += this.buildAttrPairStr(Ks[j], "" + jObj[key][Ks[j]]); - } - } else { - val2 += this.processTextOrObjNode(jObj[key], key, level, ajPath); + 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(request, next) { + if (!request.headers.has(requestIdHeaderName)) { + request.headers.set(requestIdHeaderName, request.requestId); } + return next(request); } - } - return { attrStr, val: val2 }; - }; - Builder.prototype.buildAttrPairStr = function(attrName, val2) { - val2 = this.options.attributeValueProcessor(attrName, "" + val2); - val2 = this.replaceEntitiesValue(val2); - if (this.options.suppressBooleanAttributes && val2 === "true") { - return " " + attrName; - } else return " " + attrName + '="' + val2 + '"'; - }; - function processTextOrObjNode(object, key, level, ajPath) { - const result = this.j2x(object, level + 1, ajPath.concat(key)); - if (object[this.options.textNodeName] !== void 0 && Object.keys(object).length === 1) { - return this.buildTextValNode(object[this.options.textNodeName], key, result.attrStr, level); - } else { - return this.buildObjectNode(result.val, key, result.attrStr, level); - } + }; } - Builder.prototype.buildObjectNode = function(val2, key, attrStr, level) { - if (val2 === "") { - if (key[0] === "?") return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - else { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } - } else { - let tagEndExp = "" + val2 + tagEndExp; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName && piClosingChar.length === 0) { - return this.indentate(level) + `` + this.newLine; - } else { - return this.indentate(level) + "<" + key + attrStr + piClosingChar + this.tagEndChar + val2 + this.indentate(level) + tagEndExp; - } - } - }; - Builder.prototype.closeTag = function(key) { - let closeTag = ""; - if (this.options.unpairedTags.indexOf(key) !== -1) { - if (!this.options.suppressUnpairedNode) closeTag = "/"; - } else if (this.options.suppressEmptyNode) { - closeTag = "/"; - } else { - closeTag = `>` + this.newLine; - } else if (this.options.commentPropName !== false && key === this.options.commentPropName) { - return this.indentate(level) + `` + this.newLine; - } else if (key[0] === "?") { - return this.indentate(level) + "<" + key + attrStr + "?" + this.tagEndChar; - } else { - let textValue = this.options.tagValueProcessor(key, val2); - textValue = this.replaceEntitiesValue(textValue); - if (textValue === "") { - return this.indentate(level) + "<" + key + attrStr + this.closeTag(key) + this.tagEndChar; - } else { - return this.indentate(level) + "<" + key + attrStr + ">" + textValue + " 0 && this.options.processEntities) { - for (let i = 0; i < this.options.entities.length; i++) { - const entity = this.options.entities[i]; - textValue = textValue.replace(entity.regex, entity.val); - } - } - return textValue; - }; - function indentate(level) { - return this.options.indentBy.repeat(level); + } +}); + +// 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); } - function isAttribute(name) { - if (name.startsWith(this.options.attributeNamePrefix) && name !== this.options.textNodeName) { - return name.substr(this.attrPrefixLen); - } else { - return false; - } + } +}); + +// 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); } - module2.exports = Builder; } }); -// node_modules/fast-xml-parser/src/fxp.js -var require_fxp = __commonJS({ - "node_modules/fast-xml-parser/src/fxp.js"(exports2, module2) { +// 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"; - var validator = require_validator(); - var XMLParser = require_XMLParser(); - var XMLBuilder = require_json2xml(); - module2.exports = { - XMLParser, - XMLValidator: validator, - XMLBuilder + 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 context2 = new TracingContextImpl(options.parentContext); + if (options.span) { + context2 = context2.setValue(exports2.knownContextKeys.span, options.span); + } + if (options.namespace) { + context2 = context2.setValue(exports2.knownContextKeys.namespace, options.namespace); + } + return context2; + } + 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-xml/dist/commonjs/xml.common.js -var require_xml_common = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.common.js"(exports2) { +// 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.XML_CHARKEY = exports2.XML_ATTRKEY = void 0; - exports2.XML_ATTRKEY = "$"; - exports2.XML_CHARKEY = "_"; + exports2.state = void 0; + exports2.state = { + instrumenterImplementation: void 0 + }; } }); -// node_modules/@azure/core-xml/dist/commonjs/xml.js -var require_xml = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/xml.js"(exports2) { +// 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.stringifyXML = stringifyXML; - exports2.parseXML = parseXML; - var fast_xml_parser_1 = require_fxp(); - var xml_common_js_1 = require_xml_common(); - function getCommonOptions(options) { - var _a; + 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 { - attributesGroupName: xml_common_js_1.XML_ATTRKEY, - textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, - ignoreAttributes: false, - suppressBooleanAttributes: false + end: () => { + }, + isRecording: () => false, + recordException: () => { + }, + setAttribute: () => { + }, + setStatus: () => { + }, + addEvent: () => { + } }; } - function getSerializerOptions(options = {}) { - var _a, _b; - return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "root", cdataPropName: (_b = options.cdataPropName) !== null && _b !== void 0 ? _b : "__cdata" }); + 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 getParserOptions(options = {}) { - return Object.assign(Object.assign({}, getCommonOptions(options)), { parseAttributeValue: false, parseTagValue: false, attributeNamePrefix: "", stopNodes: options.stopNodes, processEntities: true }); + function useInstrumenter(instrumenter) { + state_js_1.state.instrumenterImplementation = instrumenter; } - 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, ""); + function getInstrumenter() { + if (!state_js_1.state.instrumenterImplementation) { + state_js_1.state.instrumenterImplementation = createDefaultInstrumenter(); + } + return state_js_1.state.instrumenterImplementation; } - async function parseXML(str2, opts = {}) { - if (!str2) { - throw new Error("Document is empty"); + } +}); + +// 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 + }; } - const validation = fast_xml_parser_1.XMLValidator.validate(str2); - if (validation !== true) { - throw validation; + 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(); + } } - const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); - const parsedXml = parser.parse(str2); - if (parsedXml["?xml"]) { - delete parsedXml["?xml"]; + function withContext(context2, callback, ...callbackArgs) { + return (0, instrumenter_js_1.getInstrumenter)().withContext(context2, callback, ...callbackArgs); } - if (!opts.includeRoot) { - for (const key of Object.keys(parsedXml)) { - const value = parsedXml[key]; - return typeof value === "object" ? Object.assign({}, value) : value; - } + function parseTraceparentHeader(traceparentHeader) { + return (0, instrumenter_js_1.getInstrumenter)().parseTraceparentHeader(traceparentHeader); } - return parsedXml; + function createRequestHeaders(tracingContext) { + return (0, instrumenter_js_1.getInstrumenter)().createRequestHeaders(tracingContext); + } + return { + startSpan, + withSpan, + withContext, + parseTraceparentHeader, + createRequestHeaders + }; } } }); -// node_modules/@azure/core-xml/dist/commonjs/index.js -var require_commonjs9 = __commonJS({ - "node_modules/@azure/core-xml/dist/commonjs/index.js"(exports2) { +// 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.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; + 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; } }); - Object.defineProperty(exports2, "XML_CHARKEY", { enumerable: true, get: function() { - return xml_common_js_1.XML_CHARKEY; + var tracingClient_js_1 = require_tracingClient(); + Object.defineProperty(exports2, "createTracingClient", { enumerable: true, get: function() { + return tracingClient_js_1.createTracingClient; } }); } }); -// 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_commonjs10 = __commonJS({ - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller/dist/commonjs/index.js"(exports2) { +// 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.AbortError = void 0; - var AbortError_js_1 = require_AbortError3(); - Object.defineProperty(exports2, "AbortError", { enumerable: true, get: function() { - return AbortError_js_1.AbortError; - } }); + 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/abort-controller/dist/index.js -var require_dist5 = __commonJS({ - "node_modules/@azure/abort-controller/dist/index.js"(exports2) { +// 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 }); - 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."); + 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(request, next) { + if (!tracingClient) { + return next(request); + } + const userAgent = await userAgentPromise; + const spanAttributes = { + "http.url": sanitizer.sanitizeUrl(request.url), + "http.method": request.method, + "http.user_agent": userAgent, + requestId: request.requestId + }; + if (userAgent) { + spanAttributes["http.user_agent"] = userAgent; + } + const { span, tracingContext } = tryCreateSpan(tracingClient, request, spanAttributes) ?? {}; + if (!span || !tracingContext) { + return next(request); + } + try { + const response = await tracingClient.withContext(tracingContext, next, request); + tryProcessResponse(span, response); + return response; + } catch (err) { + tryProcessError(span, err); + throw err; + } } - return abortedMap.get(this); + }; + } + 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; } - /** - * Creates a new AbortSignal instance that will never be aborted. - * - * @readonly - */ - static get none() { - return new _AbortSignal(); + } + function tryCreateSpan(tracingClient, request, spanAttributes) { + try { + const { span, updatedOptions } = tracingClient.startSpan(`HTTP ${request.method}`, { tracingOptions: request.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)) { + request.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; } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - listeners.push(listener); + span.end(); + } catch (e) { + log_js_1.logger.warning(`Skipping tracing span processing due to an error: ${(0, core_util_1.getErrorMessage)(e)}`); } - /** - * 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."); + } + 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); } - const listeners = listenersMap.get(this); - const index = listeners.indexOf(listener); - if (index > -1) { - listeners.splice(index, 1); + 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)}`); } - /** - * 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."); + } + } +}); + +// 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 }; } - }; - function abortSignal(signal) { - if (signal.aborted) { - return; + if (abortSignalLike.aborted) { + return { abortSignal: AbortSignal.abort(abortSignalLike.reason) }; } - if (signal.onabort) { - signal.onabort.call(signal); + const controller = new AbortController(); + let needsCleanup = true; + function cleanup() { + if (needsCleanup) { + abortSignalLike.removeEventListener("abort", listener); + needsCleanup = false; + } } - const listeners = listenersMap.get(signal); - if (listeners) { - listeners.slice().forEach((listener) => { - listener.call(signal, { type: "abort" }); - }); + function listener() { + controller.abort(abortSignalLike.reason); + cleanup(); } - abortedMap.set(signal, true); + abortSignalLike.addEventListener("abort", listener); + return { abortSignal: controller.signal, cleanup }; } - 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(); - }); + } +}); + +// 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 (request, next) => { + if (!request.abortSignal) { + return next(request); + } + const { abortSignal, cleanup } = (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal); + request.abortSignal = abortSignal; + try { + return await next(request); + } finally { + cleanup?.(); } } - } - /** - * 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/@azure/core-lro/dist/index.js -var require_dist6 = __commonJS({ - "node_modules/@azure/core-lro/dist/index.js"(exports2) { +// 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 }); - var logger$1 = require_dist(); - var abortController = require_dist5(); - var coreUtil = require_commonjs2(); - var logger = logger$1.createClientLogger("core-lro"); - var POLL_INTERVAL_IN_MS = 2e3; - var terminalStates = ["succeeded", "canceled", "failed"]; - function deserializeState(serializedState) { - try { - return JSON.parse(serializedState).state; - } catch (e) { - throw new Error(`Unable to deserialize input state: ${serializedState}`); - } - } - function setStateError(inputs) { - const { state, stateProxy, isOperationError: isOperationError2 } = inputs; - return (error4) => { - if (isOperationError2(error4)) { - stateProxy.setError(state, error4); - stateProxy.setFailed(state); + 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 pipeline = (0, pipeline_js_1.createEmptyPipeline)(); + if (core_util_1.isNodeLike) { + if (options.agent) { + pipeline.addPolicy((0, agentPolicy_js_1.agentPolicy)(options.agent)); } - throw error4; - }; - } - function appendReadableErrorMessage(currentMessage, innerMessage) { - let message = currentMessage; - if (message.slice(-1) !== ".") { - message = message + "."; + if (options.tlsOptions) { + pipeline.addPolicy((0, tlsPolicy_js_1.tlsPolicy)(options.tlsOptions)); + } + pipeline.addPolicy((0, proxyPolicy_js_1.proxyPolicy)(options.proxyOptions)); + pipeline.addPolicy((0, decompressResponsePolicy_js_1.decompressResponsePolicy)()); } - 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); + pipeline.addPolicy((0, wrapAbortSignalLikePolicy_js_1.wrapAbortSignalLikePolicy)()); + pipeline.addPolicy((0, formDataPolicy_js_1.formDataPolicy)(), { beforePolicies: [multipartPolicy_js_1.multipartPolicyName] }); + pipeline.addPolicy((0, userAgentPolicy_js_1.userAgentPolicy)(options.userAgentOptions)); + pipeline.addPolicy((0, setClientRequestIdPolicy_js_1.setClientRequestIdPolicy)(options.telemetryOptions?.clientRequestIdHeaderName)); + pipeline.addPolicy((0, multipartPolicy_js_1.multipartPolicy)(), { afterPhase: "Deserialize" }); + pipeline.addPolicy((0, defaultRetryPolicy_js_1.defaultRetryPolicy)(options.retryOptions), { phase: "Retry" }); + pipeline.addPolicy((0, tracingPolicy_js_1.tracingPolicy)({ ...options.userAgentOptions, ...options.loggingOptions }), { + afterPhase: "Retry" + }); + if (core_util_1.isNodeLike) { + pipeline.addPolicy((0, redirectPolicy_js_1.redirectPolicy)(options.redirectOptions), { afterPhase: "Retry" }); } - return { - code, - message - }; + pipeline.addPolicy((0, logPolicy_js_1.logPolicy)(options.loggingOptions), { afterPhase: "Sign" }); + return pipeline; } - 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}`; + } +}); + +// 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(request) { + const { abortSignal, cleanup } = request.abortSignal ? (0, wrapAbortSignal_js_1.wrapAbortSignalLike)(request.abortSignal) : {}; + try { + request.abortSignal = abortSignal; + return await client.sendRequest(request); + } finally { + cleanup?.(); } - const errStr = `The long-running operation has failed${postfix}`; - stateProxy.setError(state, new Error(errStr)); - stateProxy.setFailed(state); - 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, stateProxy, processResult, getOperationStatus: getOperationStatus2, withOperationLocation, setErrorAsResult } = inputs; - const { operationLocation, resourceLocation, metadata, response } = await init(); - if (operationLocation) - withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false); - const config = { - metadata, - operationLocation, - resourceLocation }; - logger.verbose(`LRO: Operation description:`, config); - const state = stateProxy.initState(config); - const status = getOperationStatus2({ response, state, operationLocation }); - processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult }); - return state; } - async function pollOperationHelper(inputs) { - const { poll, state, stateProxy, operationLocation, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, isOperationError: isOperationError2, options } = inputs; - const response = await poll(operationLocation, options).catch(setStateError({ - state, - stateProxy, - isOperationError: isOperationError2 - })); - const status = getOperationStatus2(response, state); - logger.verbose(`LRO: Status: - Polling from: ${state.config.operationLocation} - Operation status: ${status} - Polling status: ${terminalStates.includes(status) ? "Stopped" : "Running"}`); - if (status === "succeeded") { - const resourceLocation = getResourceLocation2(response, state); - if (resourceLocation !== void 0) { - return { - response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError: isOperationError2 })), - status - }; - } - } - return { response, status }; + } +}); + +// 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); } - async function pollOperation(inputs) { - const { poll, state, stateProxy, options, getOperationStatus: getOperationStatus2, getResourceLocation: getResourceLocation2, getOperationLocation: getOperationLocation2, isOperationError: isOperationError2, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult } = inputs; - const { operationLocation } = state.config; - if (operationLocation !== void 0) { - const { response, status } = await pollOperationHelper({ - poll, - getOperationStatus: getOperationStatus2, - state, - stateProxy, - operationLocation, - getResourceLocation: getResourceLocation2, - isOperationError: isOperationError2, - options - }); - processOperationStatus({ - status, - response, - state, - stateProxy, - isDone, - processResult, - getError, - setErrorAsResult - }); - if (!terminalStates.includes(status)) { - const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response); - if (intervalInMs) - setDelay(intervalInMs); - const location = getOperationLocation2 === null || getOperationLocation2 === void 0 ? void 0 : getOperationLocation2(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); - } + } +}); + +// 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); } - function getOperationLocationPollingUrl(inputs) { - const { azureAsyncOperation, operationLocation } = inputs; - return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation; + } +}); + +// 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); } - function getLocationHeader(rawResponse) { - return rawResponse.headers["location"]; + } +}); + +// 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); } - function getOperationLocationHeader(rawResponse) { - return rawResponse.headers["operation-location"]; + } +}); + +// 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); } - function getAzureAsyncOperationHeader(rawResponse) { - return rawResponse.headers["azure-asyncoperation"]; + } +}); + +// 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 + }); } - function findResourceLocation(inputs) { - const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; - switch (requestMethod) { - case "PUT": { - return requestPath; - } - case "DELETE": { - return void 0; - } - default: { - switch (resourceLocationConfig) { - case "azure-async-operation": { - return void 0; - } - case "original-uri": { - return requestPath; - } - case "location": - default: { - return location; - } + } +}); + +// 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; } } - } - 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; + let token = await tryGetAccessToken(); + while (token === null) { + await (0, core_util_1.delay)(retryIntervalInMs); + token = await tryGetAccessToken(); } + return token; } - 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.verbose(`LRO: unrecognized operation status: ${status}`); - return status; + 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; + }; } - function getStatus(rawResponse) { - var _a; - const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - return transformStatus({ status, statusCode: rawResponse.statusCode }); - } - function getProvisioningState(rawResponse) { - var _a, _b; - const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; - 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"; + } +}); + +// 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(request, next) { + try { + return [await next(request), void 0]; + } catch (e) { + if ((0, restError_js_1.isRestError)(e) && e.response) { + return [e.response, e]; + } else { + throw e; + } } } - 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; + async function defaultAuthorizeRequest(options) { + const { scopes, getAccessToken, request } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.tracingOptions, + enableCae: true + }; + const accessToken = await getAccessToken(scopes, getTokenOptions); + if (accessToken) { + options.request.headers.set("Authorization", `Bearer ${accessToken.token}`); } - return void 0; } - function getErrorFromResponse(response) { - const error4 = response.flatResponse.error; - if (!error4) { - logger.warning(`The long-running operation failed but there is no error property in the response's body`); - return; - } - if (!error4.code || !error4.message) { - logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`); - return; - } - return error4; + function isChallengeResponse(response) { + return response.status === 401 && response.headers.has("WWW-Authenticate"); } - function calculatePollingIntervalFromDate(retryAfterDate) { - const timeNow = Math.floor((/* @__PURE__ */ new Date()).getTime()); - const retryAfterTime = retryAfterDate.getTime(); - if (timeNow < retryAfterTime) { - return retryAfterTime - timeNow; + async function authorizeRequestOnCaeChallenge(onChallengeOptions, caeClaims) { + const { scopes } = onChallengeOptions; + const accessToken = await onChallengeOptions.getAccessToken(scopes, { + enableCae: true, + claims: caeClaims + }); + if (!accessToken) { + return false; } - return void 0; + onChallengeOptions.request.headers.set("Authorization", `${accessToken.tokenType ?? "Bearer"} ${accessToken.token}`); + return true; } - function getStatusFromInitialResponse(inputs) { - const { response, state, operationLocation } = inputs; - function helper() { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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; - } - async function initHttpOperation(inputs) { - const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs; - return initOperation({ - init: async () => { - const response = await lro.sendInitialRequest(); - const config = inferLroMode({ - rawResponse: response.rawResponse, - requestPath: lro.requestPath, - requestMethod: lro.requestMethod, - resourceLocationConfig + 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(request, next) { + if (!request.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, + getAccessToken, + logger }); - 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 - }); + let response; + let error3; + let shouldSendRequest; + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } else if (callbacks.authorizeRequestOnChallenge) { + shouldSendRequest = await callbacks.authorizeRequestOnChallenge({ + scopes: Array.isArray(scopes) ? scopes : [scopes], + request, + response, + getAccessToken, + logger + }); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, 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, + getAccessToken, + logger + }, parsedClaim); + if (shouldSendRequest) { + [response, error3] = await trySendRequest(request, next); + } + } + } + } + } + if (error3) { + throw error3; + } else { + return response; + } + } + }; } - function getOperationLocation({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getOperationLocationPollingUrl({ - operationLocation: getOperationLocationHeader(rawResponse), - azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) - }); + function parseChallenges(challenges) { + const challengeRegex = /(\w+)\s+((?:\w+=(?:"[^"]*"|[^,]*),?\s*)+)/g; + const paramRegex = /(\w+)="([^"]*)"/g; + const parsedChallenges = []; + let match; + while ((match = challengeRegex.exec(challenges)) !== null) { + const scheme = match[1]; + const paramsString = match[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(request, next) { + if (typeof request.body === "string" && request.body.startsWith("[")) { + const body = JSON.parse(request.body); + if (Array.isArray(body)) { + request.body = body.map((item) => JSON.stringify(item) + "\n").join(""); + } + } + return next(request); } - case "ResourceLocation": { - return getLocationHeader(rawResponse); + }; + } + } +}); + +// 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 } = options; + const getTokenOptions = { + abortSignal: request.abortSignal, + tracingOptions: request.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(request, next) { + if (!request.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(request); + } + 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, + 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(request); + } + request.headers.set(AUTHORIZATION_AUXILIARY_HEADER, auxiliaryTokens.map((token) => `Bearer ${token}`).join(", ")); + return next(request); } - case "Body": - default: { - return void 0; + }; + } + } +}); + +// 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"; } - function getOperationStatus({ rawResponse }, state) { - var _a; - const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; - switch (mode) { - case "OperationLocation": { - return getStatus(rawResponse); - } - case "ResourceLocation": { - return toOperationStatus(rawResponse.statusCode); + } +}); + +// 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"); } - case "Body": { - return getProvisioningState(rawResponse); + 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"); } - default: - throw new Error(`Internal error: Unexpected operation mode: ${mode}`); + 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"; } - function getResourceLocation({ flatResponse }, state) { - if (typeof flatResponse === "object") { - const resourceLocation = flatResponse.resourceLocation; - if (resourceLocation !== void 0) { - state.config.resourceLocation = resourceLocation; + } +}); + +// 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; } - return state.config.resourceLocation; - } - function isOperationError(e) { - return e.name === "RestError"; - } - async function pollHttpOperation(inputs) { - const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult } = inputs; - return 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 - }); - } - var createStateProxy$1 = () => ({ /** - * 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. + * 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 */ - initState: (config) => ({ status: "running", config }), - setCanceled: (state) => state.status = "canceled", - setError: (state, error4) => state.error = error4, - 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: getOperationLocation2, getStatusFromInitialResponse: getStatusFromInitialResponse2, getStatusFromPollResponse, isOperationError: isOperationError2, getResourceLocation: getResourceLocation2, getPollingInterval, getError, resolveOnUnsuccessful } = inputs; - return async ({ init, poll }, options) => { - const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom } = options || {}; - const stateProxy = createStateProxy$1(); - 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 ? deserializeState(restoreFrom) : await initOperation({ - init, - stateProxy, - processResult, - getOperationStatus: getStatusFromInitialResponse2, - withOperationLocation, - setErrorAsResult: !resolveOnUnsuccessful - }); - let resultPromise; - const abortController$1 = new abortController.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$1.abort(); - }, - toString: () => JSON.stringify({ - state - }), - onProgress: (callback) => { - const s = Symbol(); - handlers.set(s, callback); - return () => handlers.delete(s); + 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(request, next) { + request.disableKeepAlive = true; + return next(request); + } + }; + } + function pipelineContainsDisableKeepAlivePolicy(pipeline) { + return pipeline.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_utils6 = __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_utils6(); + 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, object, 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) { + object = mapper.defaultValue; + } + const { required, nullable } = mapper; + if (required && nullable && object === void 0) { + throw new Error(`${objectName} cannot be undefined.`); + } + if (required && !nullable && (object === void 0 || object === null)) { + throw new Error(`${objectName} cannot be null or undefined.`); + } + if (!required && nullable === false && object === null) { + throw new Error(`${objectName} cannot be null.`); + } + if (object === void 0 || object === null) { + payload = object; + } else { + if (mapperType.match(/^any$/i) !== null) { + payload = object; + } else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) { + payload = serializeBasicTypes(mapperType, objectName, object); + } else if (mapperType.match(/^Enum$/i) !== null) { + const enumMapper = mapper; + payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object); + } else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) { + payload = serializeDateTypes(mapperType, object, objectName); + } else if (mapperType.match(/^ByteArray$/i) !== null) { + payload = serializeByteArrayType(objectName, object); + } else if (mapperType.match(/^Base64Url$/i) !== null) { + payload = serializeBase64UrlType(objectName, object); + } else if (mapperType.match(/^Sequence$/i) !== null) { + payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Dictionary$/i) !== null) { + payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions); + } else if (mapperType.match(/^Composite$/i) !== null) { + payload = serializeCompositeType(this, mapper, object, 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 }, - pollUntilDone: (pollOptions) => resultPromise !== null && resultPromise !== void 0 ? resultPromise : resultPromise = (async () => { - const { abortSignal: inputAbortSignal } = pollOptions || {}; - const { signal: abortSignal } = inputAbortSignal ? new abortController.AbortController([inputAbortSignal, abortController$1.signal]) : abortController$1; - if (!poller.isDone()) { - await poller.poll({ abortSignal }); - while (!poller.isDone()) { - await coreUtil.delay(currentPollIntervalInMs, { abortSignal }); - await poller.poll({ abortSignal }); - } + 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 (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`); - } + } + if (mapperType.match(/^Number$/i) !== null) { + payload = parseFloat(responseBody); + if (isNaN(payload)) { + payload = responseBody; } - })().finally(() => { - resultPromise = void 0; - }), - async poll(pollOptions) { - if (resolveOnUnsuccessful) { - if (poller.isDone()) - return; + } else if (mapperType.match(/^Boolean$/i) !== null) { + if (responseBody === "true") { + payload = true; + } else if (responseBody === "false") { + payload = false; } else { - switch (state.status) { - case "succeeded": - return; - case "canceled": - throw new Error(cancelErrMsg); - case "failed": - throw state.error; - } - } - await pollOperation({ - poll, - state, - stateProxy, - getOperationLocation: getOperationLocation2, - isOperationError: isOperationError2, - withOperationLocation, - getPollingInterval, - getOperationStatus: getStatusFromPollResponse, - getResourceLocation: getResourceLocation2, - 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; - } + 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); } - }; - return poller; - }; + } + if (mapper.isConstant) { + payload = mapper.defaultValue; + } + return payload; + } + }; + function createSerializer(modelMappers = {}, isXML = false) { + return new SerializerImpl(modelMappers, isXML); } - async function createHttpPoller(lro, options) { - const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false } = options || {}; - return buildCreatePoller({ - getStatusFromInitialResponse, - getStatusFromPollResponse: getOperationStatus, - isOperationError, - getOperationLocation, - getResourceLocation, - getPollingInterval: parseRetryAfter, - getError: getErrorFromResponse, - resolveOnUnsuccessful - })({ - 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 } } : {}); - }, - poll: lro.sendPollRequest - }, { - intervalInMs, - withOperationLocation, - restoreFrom, - updateState, - processResult: processResult ? ({ flatResponse }, state) => processResult(flatResponse, state) : ({ flatResponse }) => flatResponse - }); + function trimEnd(str2, ch) { + let len = str2.length; + while (len - 1 >= 0 && str2[len - 1] === ch) { + --len; + } + return str2.substr(0, len); } - var createStateProxy = () => ({ - initState: (config) => ({ config, isStarted: true }), - setCanceled: (state) => state.isCancelled = true, - setError: (state, error4) => state.error = error4, - setResult: (state, result) => state.result = result, - setRunning: (state) => state.isStarted = true, - setSucceeded: (state) => state.isCompleted = true, - setFailed: () => { + 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 str2 = base64.encodeByteArray(buffer); + return trimEnd(str2, "=").replace(/\+/g, "-").replace(/\//g, "_"); + } + function base64UrlToByteArray(str2) { + if (!str2) { + return void 0; + } + if (str2 && typeof str2.valueOf() !== "string") { + throw new Error("Please provide an input of type string for converting to Uint8Array"); + } + str2 = str2.replace(/-/g, "+").replace(/_/g, "/"); + return base64.decodeString(str2); + } + 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, object, objectName, isXml, options) { + if (!Array.isArray(object)) { + 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 < object.length; i++) { + const serializedValue = serializer.serialize(elementType, object[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, object, objectName, isXml, options) { + if (typeof object !== "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(object)) { + const serializedValue = serializer.serialize(valueType, object[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, object, objectName, isXml, options) { + if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) { + mapper = getPolymorphicMapper(serializer, mapper, object, "clientName"); + } + if (object !== void 0 && object !== 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) && (object[key] !== void 0 && object[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 = object[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 object) { + const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName); + if (isAdditionalProperty) { + payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '["' + clientPropName + '"]', options); + } + } + } + return payload; + } + return object; + } + 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, object, polymorphicPropertyName) { + const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper); + if (polymorphicDiscriminator) { + let discriminatorName = polymorphicDiscriminator[polymorphicPropertyName]; + if (discriminatorName) { + if (polymorphicPropertyName === "serializedName") { + discriminatorName = discriminatorName.replace(/\\/gi, ""); + } + const discriminatorValue = object[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(request) { + return originalRequestSymbol in request; + } + function getOperationRequestInfo(request) { + if (hasOriginalRequest(request)) { + return getOperationRequestInfo(request[originalRequestSymbol]); + } + let info6 = state_js_1.state.operationRequestMap.get(request); + if (!info6) { + info6 = {}; + state_js_1.state.operationRequestMap.set(request, info6); + } + return info6; + } + } +}); + +// 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(request, next) { + const response = await next(request); + return deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, updatedOptions, parseXML); + } + }; + } + function getOperationResponseMap(parsedResponse) { + let result; + const request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + 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 request = parsedResponse.request; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + 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 parse(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 parse(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(request, next) { + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + const operationSpec = operationInfo?.operationSpec; + const operationArguments = operationInfo?.operationArguments; + if (operationSpec && operationArguments) { + serializeHeaders(request, operationArguments, operationSpec); + serializeRequestBody(request, operationArguments, operationSpec, stringifyXML); + } + return next(request); + } + }; + } + function serializeHeaders(request, 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)) { + request.headers.set(headerCollectionPrefix + key, headerValue[key]); + } + } else { + request.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)) { + request.headers.set(customHeaderName, customHeaders[customHeaderName]); + } + } + } + function serializeRequestBody(request, 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) { + request.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 (request.body !== void 0 && request.body !== null || nullable && request.body === null || required) { + const requestBodyParameterPathString = (0, interfaceHelpers_js_1.getPathStringFromParameter)(operationSpec.requestBody); + request.body = operationSpec.serializer.serialize(bodyMapper, request.body, requestBodyParameterPathString, updatedOptions); + const isStream = typeName === serializer_js_1.MapperTypeNames.Stream; + if (operationSpec.isXML) { + const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : "xmlns"; + const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, request.body, updatedOptions); + if (typeName === serializer_js_1.MapperTypeNames.Sequence) { + request.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), { rootName: xmlName || serializedName, xmlCharKey }); + } else if (!isStream) { + request.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 (!isStream) { + request.body = JSON.stringify(request.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) { + request.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); + request.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 pipeline = (0, core_rest_pipeline_1.createPipelineFromOptions)(options ?? {}); + if (options.credentialOptions) { + pipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ + credential: options.credentialOptions.credential, + scopes: options.credentialOptions.credentialScopes + })); + } + pipeline.addPolicy((0, serializationPolicy_js_1.serializationPolicy)(options.serializationOptions), { phase: "Serialize" }); + pipeline.addPolicy((0, deserializationPolicy_js_1.deserializationPolicy)(options.deserializationOptions), { + phase: "Deserialize" + }); + return pipeline; + } + } +}); + +// 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 path12 = replaceAll(operationSpec.path, urlReplacements); + if (operationSpec.path === "/{nextLink}" && path12.startsWith("/")) { + path12 = path12.substring(1); + } + if (isAbsoluteUrl(path12)) { + requestUrl = path12; + isAbsolutePath = true; + } else { + requestUrl = appendPath(requestUrl, path12); + } + } + 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 path12 = pathToAppend.substring(0, searchStart); + const search = pathToAppend.substring(searchStart + 1); + newPath = newPath + path12; + 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 pairs2 = queryString.split("&"); + for (const pair of pairs2) { + 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_utils6(); + 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(request) { + return this.pipeline.sendRequest(this._httpClient, request); + } + /** + * 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 endpoint = operationSpec.baseUrl || this._endpoint; + if (!endpoint) { + 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)(endpoint, operationSpec, operationArguments, this); + const request = (0, core_rest_pipeline_1.createPipelineRequest)({ + url: url2 + }); + request.method = operationSpec.httpMethod; + const operationInfo = (0, operationHelpers_js_1.getOperationRequestInfo)(request); + operationInfo.operationSpec = operationSpec; + operationInfo.operationArguments = operationArguments; + const contentType = operationSpec.contentType || this._requestContentType; + if (contentType && operationSpec.requestBody) { + request.headers.set("Content-Type", contentType); + } + const options = operationArguments.options; + if (options) { + const requestOptions = options.requestOptions; + if (requestOptions) { + if (requestOptions.timeout) { + request.timeout = requestOptions.timeout; + } + if (requestOptions.onUploadProgress) { + request.onUploadProgress = requestOptions.onUploadProgress; + } + if (requestOptions.onDownloadProgress) { + request.onDownloadProgress = requestOptions.onDownloadProgress; + } + if (requestOptions.shouldDeserialize !== void 0) { + operationInfo.shouldDeserialize = requestOptions.shouldDeserialize; + } + if (requestOptions.allowInsecureConnection) { + request.allowInsecureConnection = true; + } + } + if (options.abortSignal) { + request.abortSignal = options.abortSignal; + } + if (options.tracingOptions) { + request.tracingOptions = options.tracingOptions; + } + } + if (this._allowInsecureConnection) { + request.allowInsecureConnection = true; + } + if (request.streamResponseStatusCodes === void 0) { + request.streamResponseStatusCodes = (0, interfaceHelpers_js_1.getStreamingResponseStatusCodes)(operationSpec); + } + try { + const rawResponse = await this.sendRequest(request); + 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(request) { + return { + abortSignal: request.abortSignal, + requestOptions: { + timeout: request.timeout + }, + tracingOptions: request.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_util8 = __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 request = compatWebResource[originalRequestSymbol]; + const headers = (0, core_rest_pipeline_1.createHttpHeaders)(webResource.headers.toJson({ preserveCase: true })); + if (request) { + request.headers = headers; + return request; + } 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(request, options) { + const originalRequest = options?.originalRequest ?? request; + const webResource = { + url: request.url, + method: request.method, + headers: toHttpHeadersLike(request.headers), + withCredentials: request.withCredentials, + timeout: request.timeout, + requestId: request.headers.get("x-ms-client-request-id") || request.requestId, + abortSignal: request.abortSignal, + body: request.body, + formData: request.formData, + keepAlive: !!request.disableKeepAlive, + onDownloadProgress: request.onDownloadProgress, + onUploadProgress: request.onUploadProgress, + proxySettings: request.proxySettings, + streamResponseStatusCodes: request.streamResponseStatusCodes, + agent: request.agent, + requestOverrides: request.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 request; + } 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") { + request.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)) { + request[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_util8(); + var originalResponse = /* @__PURE__ */ Symbol("Original FullOperationResponse"); + function toCompatResponse(response, options) { + let request = (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 request; + } 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") { + request = value; + } + return Reflect.set(target, prop, value, receiver); + } + }); + } else { + return { + ...response, + request, + 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_util8(); + 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) { }, - 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; + shouldLog(_logLevel) { + return false; + } + }; + exports2.requestPolicyFactoryPolicyName = "RequestPolicyFactoryPolicy"; + function createRequestPolicyFactoryPolicy(factories) { + const orderedFactories = factories.slice().reverse(); + return { + name: exports2.requestPolicyFactoryPolicyName, + async sendRequest(request, 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)(request, { 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_util8(); + function convertHttpClient(requestPolicyClient) { + return { + sendRequest: async (request) => { + const response = await requestPolicyClient.sendRequest((0, util_js_1.toWebResourceLike)(request, { 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_util8(); + 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, i2) => { + for (var n2 in i2) t.o(i2, n2) && !t.o(e2, n2) && Object.defineProperty(e2, n2, { enumerable: true, get: i2[n2] }); + }, 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: () => lt, XMLParser: () => tt, XMLValidator: () => pt }); + const i = ":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", n = new RegExp("^[" + i + "][" + i + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"); + function s(t2, e2) { + const i2 = []; + let n2 = e2.exec(t2); + for (; n2; ) { + const s2 = []; + s2.startIndex = e2.lastIndex - n2[0].length; + const r2 = n2.length; + for (let t3 = 0; t3 < r2; t3++) s2.push(n2[t3]); + i2.push(s2), n2 = e2.exec(t2); + } + return i2; + } + const r = function(t2) { + return !(null == n.exec(t2)); + }, o = { allowBooleanAttributes: false, unpairedTags: [] }; + function a(t2, e2) { + e2 = Object.assign({}, o, e2); + const i2 = []; + let n2 = false, s2 = false; + "\uFEFF" === t2[0] && (t2 = t2.substr(1)); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2] && "?" === t2[o2 + 1]) { + if (o2 += 2, o2 = u(t2, o2), o2.err) return o2; + } else { + if ("<" !== t2[o2]) { + if (l(t2[o2])) continue; + return x("InvalidChar", "char '" + t2[o2] + "' is not expected.", b(t2, o2)); + } + { + let a2 = o2; + if (o2++, "!" === t2[o2]) { + o2 = h(t2, o2); + continue; + } + { + let d2 = false; + "/" === t2[o2] && (d2 = true, o2++); + let p2 = ""; + for (; o2 < t2.length && ">" !== t2[o2] && " " !== t2[o2] && " " !== t2[o2] && "\n" !== t2[o2] && "\r" !== t2[o2]; o2++) p2 += t2[o2]; + if (p2 = p2.trim(), "/" === p2[p2.length - 1] && (p2 = p2.substring(0, p2.length - 1), o2--), !r(p2)) { + let e3; + return e3 = 0 === p2.trim().length ? "Invalid space after '<'." : "Tag '" + p2 + "' is an invalid name.", x("InvalidTag", e3, b(t2, o2)); + } + const c2 = f(t2, o2); + if (false === c2) return x("InvalidAttr", "Attributes for '" + p2 + "' have open quote.", b(t2, o2)); + let N2 = c2.value; + if (o2 = c2.index, "/" === N2[N2.length - 1]) { + const i3 = o2 - N2.length; + N2 = N2.substring(0, N2.length - 1); + const s3 = g(N2, e2); + if (true !== s3) return x(s3.err.code, s3.err.msg, b(t2, i3 + s3.err.line)); + n2 = true; + } else if (d2) { + if (!c2.tagClosed) return x("InvalidTag", "Closing tag '" + p2 + "' doesn't have proper closing.", b(t2, o2)); + if (N2.trim().length > 0) return x("InvalidTag", "Closing tag '" + p2 + "' can't have attributes or invalid starting.", b(t2, a2)); + if (0 === i2.length) return x("InvalidTag", "Closing tag '" + p2 + "' has not been opened.", b(t2, a2)); + { + const e3 = i2.pop(); + if (p2 !== e3.tagName) { + let i3 = b(t2, e3.tagStartPos); + return x("InvalidTag", "Expected closing tag '" + e3.tagName + "' (opened in line " + i3.line + ", col " + i3.col + ") instead of closing tag '" + p2 + "'.", b(t2, a2)); + } + 0 == i2.length && (s2 = true); + } + } else { + const r2 = g(N2, e2); + if (true !== r2) return x(r2.err.code, r2.err.msg, b(t2, o2 - N2.length + r2.err.line)); + if (true === s2) return x("InvalidXml", "Multiple possible root nodes found.", b(t2, o2)); + -1 !== e2.unpairedTags.indexOf(p2) || i2.push({ tagName: p2, tagStartPos: a2 }), n2 = true; + } + for (o2++; o2 < t2.length; o2++) if ("<" === t2[o2]) { + if ("!" === t2[o2 + 1]) { + o2++, o2 = h(t2, o2); + continue; + } + if ("?" !== t2[o2 + 1]) break; + if (o2 = u(t2, ++o2), o2.err) return o2; + } else if ("&" === t2[o2]) { + const e3 = m(t2, o2); + if (-1 == e3) return x("InvalidChar", "char '&' is not expected.", b(t2, o2)); + o2 = e3; + } else if (true === s2 && !l(t2[o2])) return x("InvalidXml", "Extra text at the end", b(t2, o2)); + "<" === t2[o2] && o2--; + } + } + } + return n2 ? 1 == i2.length ? x("InvalidTag", "Unclosed tag '" + i2[0].tagName + "'.", b(t2, i2[0].tagStartPos)) : !(i2.length > 0) || x("InvalidXml", "Invalid '" + JSON.stringify(i2.map(((t3) => t3.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : x("InvalidXml", "Start tag expected.", 1); + } + function l(t2) { + return " " === t2 || " " === t2 || "\n" === t2 || "\r" === t2; + } + function u(t2, e2) { + const i2 = e2; + for (; e2 < t2.length; e2++) if ("?" != t2[e2] && " " != t2[e2]) ; + else { + const n2 = t2.substr(i2, e2 - i2); + if (e2 > 5 && "xml" === n2) return x("InvalidXml", "XML declaration allowed only at the start of the document.", b(t2, e2)); + if ("?" == t2[e2] && ">" == t2[e2 + 1]) { + e2++; + break; + } + } + return e2; + } + function h(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 i2 = 1; + for (e2 += 8; e2 < t2.length; e2++) if ("<" === t2[e2]) i2++; + else if (">" === t2[e2] && (i2--, 0 === i2)) 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 = '"', p = "'"; + function f(t2, e2) { + let i2 = "", n2 = "", s2 = false; + for (; e2 < t2.length; e2++) { + if (t2[e2] === d || t2[e2] === p) "" === n2 ? n2 = t2[e2] : n2 !== t2[e2] || (n2 = ""); + else if (">" === t2[e2] && "" === n2) { + s2 = true; + break; + } + i2 += t2[e2]; + } + return "" === n2 && { value: i2, index: e2, tagClosed: s2 }; + } + const c = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g"); + function g(t2, e2) { + const i2 = s(t2, c), n2 = {}; + for (let t3 = 0; t3 < i2.length; t3++) { + if (0 === i2[t3][1].length) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' has no space in starting.", E(i2[t3])); + if (void 0 !== i2[t3][3] && void 0 === i2[t3][4]) return x("InvalidAttr", "Attribute '" + i2[t3][2] + "' is without value.", E(i2[t3])); + if (void 0 === i2[t3][3] && !e2.allowBooleanAttributes) return x("InvalidAttr", "boolean attribute '" + i2[t3][2] + "' is not allowed.", E(i2[t3])); + const s2 = i2[t3][2]; + if (!N(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is an invalid name.", E(i2[t3])); + if (n2.hasOwnProperty(s2)) return x("InvalidAttr", "Attribute '" + s2 + "' is repeated.", E(i2[t3])); + n2[s2] = 1; + } + return true; + } + function m(t2, e2) { + if (";" === t2[++e2]) return -1; + if ("#" === t2[e2]) return (function(t3, e3) { + let i3 = /\d/; + for ("x" === t3[e3] && (e3++, i3 = /[\da-fA-F]/); e3 < t3.length; e3++) { + if (";" === t3[e3]) return e3; + if (!t3[e3].match(i3)) break; + } + return -1; + })(t2, ++e2); + let i2 = 0; + for (; e2 < t2.length; e2++, i2++) if (!(t2[e2].match(/\w/) && i2 < 20)) { + if (";" === t2[e2]) break; + return -1; + } + return e2; + } + function x(t2, e2, i2) { + return { err: { code: t2, msg: e2, line: i2.line || i2, col: i2.col } }; + } + function N(t2) { + return r(t2); + } + function b(t2, e2) { + const i2 = t2.substring(0, e2).split(/\r?\n/); + return { line: i2.length, col: i2[i2.length - 1].length + 1 }; + } + function E(t2) { + return t2.startIndex + t2[1].length; + } + const v = { 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, ignoreDeclaration: false, ignorePiTags: false, transformTagName: false, transformAttributeName: false, updateTag: function(t2, e2, i2) { + return t2; + }, captureMetaData: false }; + let T; + T = "function" != typeof Symbol ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata"); + class y { + constructor(t2) { + this.tagname = t2, this.child = [], this[":@"] = {}; + } + 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][T] = { startIndex: e2 }); + } + static getMetaDataSymbol() { + return T; + } + } + class w { + constructor(t2) { + this.suppressValidationErr = !t2; + } + readDocType(t2, e2) { + const i2 = {}; + 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 n2 = 1, s2 = false, r2 = false, o2 = ""; + for (; e2 < t2.length; e2++) if ("<" !== t2[e2] || r2) if (">" === t2[e2]) { + if (r2 ? "-" === t2[e2 - 1] && "-" === t2[e2 - 2] && (r2 = false, n2--) : n2--, 0 === n2) break; + } else "[" === t2[e2] ? s2 = true : o2 += t2[e2]; + else { + if (s2 && P(t2, "!ENTITY", e2)) { + let n3, s3; + e2 += 7, [n3, s3, e2] = this.readEntityExp(t2, e2 + 1, this.suppressValidationErr), -1 === s3.indexOf("&") && (i2[n3] = { regx: RegExp(`&${n3};`, "g"), val: s3 }); + } else if (s2 && P(t2, "!ELEMENT", e2)) { + e2 += 8; + const { index: i3 } = this.readElementExp(t2, e2 + 1); + e2 = i3; + } else if (s2 && P(t2, "!ATTLIST", e2)) e2 += 8; + else if (s2 && P(t2, "!NOTATION", e2)) { + e2 += 9; + const { index: i3 } = this.readNotationExp(t2, e2 + 1, this.suppressValidationErr); + e2 = i3; + } else { + if (!P(t2, "!--", e2)) throw new Error("Invalid DOCTYPE"); + r2 = true; + } + n2++, o2 = ""; + } + if (0 !== n2) throw new Error("Unclosed DOCTYPE"); + } + return { entities: i2, i: e2 }; + } + readEntityExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]) && '"' !== t2[e2] && "'" !== t2[e2]; ) i2 += t2[e2], e2++; + if (O(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 n2 = ""; + return [e2, n2] = this.readIdentifierVal(t2, e2, "entity"), [i2, n2, --e2]; + } + readNotationExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + !this.suppressValidationErr && O(i2), e2 = I(t2, e2); + const n2 = t2.substring(e2, e2 + 6).toUpperCase(); + if (!this.suppressValidationErr && "SYSTEM" !== n2 && "PUBLIC" !== n2) throw new Error(`Expected SYSTEM or PUBLIC, found "${n2}"`); + e2 += n2.length, e2 = I(t2, e2); + let s2 = null, r2 = null; + if ("PUBLIC" === n2) [e2, s2] = this.readIdentifierVal(t2, e2, "publicIdentifier"), '"' !== t2[e2 = I(t2, e2)] && "'" !== t2[e2] || ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier")); + else if ("SYSTEM" === n2 && ([e2, r2] = this.readIdentifierVal(t2, e2, "systemIdentifier"), !this.suppressValidationErr && !r2)) throw new Error("Missing mandatory system identifier for SYSTEM notation"); + return { notationName: i2, publicIdentifier: s2, systemIdentifier: r2, index: --e2 }; + } + readIdentifierVal(t2, e2, i2) { + let n2 = ""; + const s2 = t2[e2]; + if ('"' !== s2 && "'" !== s2) throw new Error(`Expected quoted string, found "${s2}"`); + for (e2++; e2 < t2.length && t2[e2] !== s2; ) n2 += t2[e2], e2++; + if (t2[e2] !== s2) throw new Error(`Unterminated ${i2} value`); + return [++e2, n2]; + } + readElementExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + if (!this.suppressValidationErr && !r(i2)) throw new Error(`Invalid element name: "${i2}"`); + let n2 = ""; + if ("E" === t2[e2 = I(t2, e2)] && P(t2, "MPTY", e2)) e2 += 4; + else if ("A" === t2[e2] && P(t2, "NY", e2)) e2 += 2; + else if ("(" === t2[e2]) { + for (e2++; e2 < t2.length && ")" !== t2[e2]; ) n2 += t2[e2], e2++; + if (")" !== 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: n2.trim(), index: e2 }; + } + readAttlistExp(t2, e2) { + e2 = I(t2, e2); + let i2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) i2 += t2[e2], e2++; + O(i2), e2 = I(t2, e2); + let n2 = ""; + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) n2 += t2[e2], e2++; + if (!O(n2)) throw new Error(`Invalid attribute name: "${n2}"`); + e2 = I(t2, e2); + let s2 = ""; + if ("NOTATION" === t2.substring(e2, e2 + 8).toUpperCase()) { + if (s2 = "NOTATION", "(" !== t2[e2 = I(t2, e2 += 8)]) throw new Error(`Expected '(', found "${t2[e2]}"`); + e2++; + let i3 = []; + for (; e2 < t2.length && ")" !== t2[e2]; ) { + let n3 = ""; + for (; e2 < t2.length && "|" !== t2[e2] && ")" !== t2[e2]; ) n3 += t2[e2], e2++; + if (n3 = n3.trim(), !O(n3)) throw new Error(`Invalid notation name: "${n3}"`); + i3.push(n3), "|" === t2[e2] && (e2++, e2 = I(t2, e2)); + } + if (")" !== t2[e2]) throw new Error("Unterminated list of notations"); + e2++, s2 += " (" + i3.join("|") + ")"; + } else { + for (; e2 < t2.length && !/\s/.test(t2[e2]); ) s2 += t2[e2], e2++; + const i3 = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"]; + if (!this.suppressValidationErr && !i3.includes(s2.toUpperCase())) throw new Error(`Invalid attribute type: "${s2}"`); + } + e2 = I(t2, e2); + let r2 = ""; + return "#REQUIRED" === t2.substring(e2, e2 + 8).toUpperCase() ? (r2 = "#REQUIRED", e2 += 8) : "#IMPLIED" === t2.substring(e2, e2 + 7).toUpperCase() ? (r2 = "#IMPLIED", e2 += 7) : [e2, r2] = this.readIdentifierVal(t2, e2, "ATTLIST"), { elementName: i2, attributeName: n2, attributeType: s2, defaultValue: r2, index: e2 }; + } + } + const I = (t2, e2) => { + for (; e2 < t2.length && /\s/.test(t2[e2]); ) e2++; + return e2; + }; + function P(t2, e2, i2) { + for (let n2 = 0; n2 < e2.length; n2++) if (e2[n2] !== t2[i2 + n2 + 1]) return false; + return true; + } + function O(t2) { + if (r(t2)) return t2; + throw new Error(`Invalid entity name ${t2}`); + } + const A = /^[-+]?0x[a-fA-F0-9]+$/, S = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, C = { hex: true, leadingZeros: true, decimalPoint: ".", eNotation: true }; + const V = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/; + function $(t2) { + return "function" == typeof t2 ? t2 : Array.isArray(t2) ? (e2) => { + for (const i2 of t2) { + if ("string" == typeof i2 && e2 === i2) return true; + if (i2 instanceof RegExp && i2.test(e2)) return true; + } + } : () => false; + } + class D { + constructor(t2) { + if (this.options = t2, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "\xA2" }, pound: { regex: /&(pound|#163);/g, val: "\xA3" }, yen: { regex: /&(yen|#165);/g, val: "\xA5" }, euro: { regex: /&(euro|#8364);/g, val: "\u20AC" }, copyright: { regex: /&(copy|#169);/g, val: "\xA9" }, reg: { regex: /&(reg|#174);/g, val: "\xAE" }, inr: { regex: /&(inr|#8377);/g, val: "\u20B9" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 10)) }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (t3, e2) => String.fromCodePoint(Number.parseInt(e2, 16)) } }, this.addExternalEntities = j, this.parseXml = L, this.parseTextData = M, this.resolveNameSpace = F, this.buildAttributesMap = k, this.isItStopNode = Y, this.replaceEntitiesValue = B, this.readStopNodeData = W, this.saveTextToParentTag = R, this.addChild = U, this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) { + this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set(); + for (let t3 = 0; t3 < this.options.stopNodes.length; t3++) { + const e2 = this.options.stopNodes[t3]; + "string" == typeof e2 && (e2.startsWith("*.") ? this.stopNodesWildcard.add(e2.substring(2)) : this.stopNodesExact.add(e2)); + } + } + } + } + function j(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + this.lastEntities[n2] = { regex: new RegExp("&" + n2 + ";", "g"), val: t2[n2] }; + } + } + function M(t2, e2, i2, n2, s2, r2, o2) { + if (void 0 !== t2 && (this.options.trimValues && !n2 && (t2 = t2.trim()), t2.length > 0)) { + o2 || (t2 = this.replaceEntitiesValue(t2)); + const n3 = this.options.tagValueProcessor(e2, t2, i2, s2, r2); + return null == n3 ? t2 : typeof n3 != typeof t2 || n3 !== t2 ? n3 : this.options.trimValues || t2.trim() === t2 ? q(t2, this.options.parseTagValue, this.options.numberParseOptions) : t2; + } + } + function F(t2) { + if (this.options.removeNSPrefix) { + const e2 = t2.split(":"), i2 = "/" === t2.charAt(0) ? "/" : ""; + if ("xmlns" === e2[0]) return ""; + 2 === e2.length && (t2 = i2 + e2[1]); + } + return t2; + } + const _ = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm"); + function k(t2, e2) { + if (true !== this.options.ignoreAttributes && "string" == typeof t2) { + const i2 = s(t2, _), n2 = i2.length, r2 = {}; + for (let t3 = 0; t3 < n2; t3++) { + const n3 = this.resolveNameSpace(i2[t3][1]); + if (this.ignoreAttributesFn(n3, e2)) continue; + let s2 = i2[t3][4], o2 = this.options.attributeNamePrefix + n3; + if (n3.length) if (this.options.transformAttributeName && (o2 = this.options.transformAttributeName(o2)), "__proto__" === o2 && (o2 = "#__proto__"), void 0 !== s2) { + this.options.trimValues && (s2 = s2.trim()), s2 = this.replaceEntitiesValue(s2); + const t4 = this.options.attributeValueProcessor(n3, s2, e2); + r2[o2] = null == t4 ? s2 : typeof t4 != typeof s2 || t4 !== s2 ? t4 : q(s2, this.options.parseAttributeValue, this.options.numberParseOptions); + } else this.options.allowBooleanAttributes && (r2[o2] = true); + } + if (!Object.keys(r2).length) return; + if (this.options.attributesGroupName) { + const t3 = {}; + return t3[this.options.attributesGroupName] = r2, t3; + } + return r2; + } + } + const L = function(t2) { + t2 = t2.replace(/\r\n?/g, "\n"); + const e2 = new y("!xml"); + let i2 = e2, n2 = "", s2 = ""; + const r2 = new w(this.options.processEntities); + for (let o2 = 0; o2 < t2.length; o2++) if ("<" === t2[o2]) if ("/" === t2[o2 + 1]) { + const e3 = G(t2, ">", o2, "Closing Tag is not closed."); + let r3 = t2.substring(o2 + 2, e3).trim(); + if (this.options.removeNSPrefix) { + const t3 = r3.indexOf(":"); + -1 !== t3 && (r3 = r3.substr(t3 + 1)); + } + this.options.transformTagName && (r3 = this.options.transformTagName(r3)), i2 && (n2 = this.saveTextToParentTag(n2, i2, s2)); + const a2 = s2.substring(s2.lastIndexOf(".") + 1); + if (r3 && -1 !== this.options.unpairedTags.indexOf(r3)) throw new Error(`Unpaired tag can not be used as closing tag: `); + let l2 = 0; + a2 && -1 !== this.options.unpairedTags.indexOf(a2) ? (l2 = s2.lastIndexOf(".", s2.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : l2 = s2.lastIndexOf("."), s2 = s2.substring(0, l2), i2 = this.tagsNodeStack.pop(), n2 = "", o2 = e3; + } else if ("?" === t2[o2 + 1]) { + let e3 = X(t2, o2, false, "?>"); + if (!e3) throw new Error("Pi Tag is not closed."); + if (n2 = this.saveTextToParentTag(n2, i2, s2), this.options.ignoreDeclaration && "?xml" === e3.tagName || this.options.ignorePiTags) ; + else { + const t3 = new y(e3.tagName); + t3.add(this.options.textNodeName, ""), e3.tagName !== e3.tagExp && e3.attrExpPresent && (t3[":@"] = this.buildAttributesMap(e3.tagExp, s2)), this.addChild(i2, t3, s2, o2); + } + o2 = e3.closeIndex + 1; + } else if ("!--" === t2.substr(o2 + 1, 3)) { + const e3 = G(t2, "-->", o2 + 4, "Comment is not closed."); + if (this.options.commentPropName) { + const r3 = t2.substring(o2 + 4, e3 - 2); + n2 = this.saveTextToParentTag(n2, i2, s2), i2.add(this.options.commentPropName, [{ [this.options.textNodeName]: r3 }]); + } + o2 = e3; + } else if ("!D" === t2.substr(o2 + 1, 2)) { + const e3 = r2.readDocType(t2, o2); + this.docTypeEntities = e3.entities, o2 = e3.i; + } else if ("![" === t2.substr(o2 + 1, 2)) { + const e3 = G(t2, "]]>", o2, "CDATA is not closed.") - 2, r3 = t2.substring(o2 + 9, e3); + n2 = this.saveTextToParentTag(n2, i2, s2); + let a2 = this.parseTextData(r3, i2.tagname, s2, true, false, true, true); + null == a2 && (a2 = ""), this.options.cdataPropName ? i2.add(this.options.cdataPropName, [{ [this.options.textNodeName]: r3 }]) : i2.add(this.options.textNodeName, a2), o2 = e3 + 2; + } else { + let r3 = X(t2, o2, this.options.removeNSPrefix), a2 = r3.tagName; + const l2 = r3.rawTagName; + let u2 = r3.tagExp, h2 = r3.attrExpPresent, d2 = r3.closeIndex; + if (this.options.transformTagName) { + const t3 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t3), a2 = t3; + } + i2 && n2 && "!xml" !== i2.tagname && (n2 = this.saveTextToParentTag(n2, i2, s2, false)); + const p2 = i2; + p2 && -1 !== this.options.unpairedTags.indexOf(p2.tagname) && (i2 = this.tagsNodeStack.pop(), s2 = s2.substring(0, s2.lastIndexOf("."))), a2 !== e2.tagname && (s2 += s2 ? "." + a2 : a2); + const f2 = o2; + if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s2, a2)) { + let e3 = ""; + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) "/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), o2 = r3.closeIndex; + else if (-1 !== this.options.unpairedTags.indexOf(a2)) o2 = r3.closeIndex; + else { + const i3 = this.readStopNodeData(t2, l2, d2 + 1); + if (!i3) throw new Error(`Unexpected end of ${l2}`); + o2 = i3.i, e3 = i3.tagContent; + } + const n3 = new y(a2); + a2 !== u2 && h2 && (n3[":@"] = this.buildAttributesMap(u2, s2)), e3 && (e3 = this.parseTextData(e3, a2, s2, true, h2, true, true)), s2 = s2.substr(0, s2.lastIndexOf(".")), n3.add(this.options.textNodeName, e3), this.addChild(i2, n3, s2, f2); + } else { + if (u2.length > 0 && u2.lastIndexOf("/") === u2.length - 1) { + if ("/" === a2[a2.length - 1] ? (a2 = a2.substr(0, a2.length - 1), s2 = s2.substr(0, s2.length - 1), u2 = a2) : u2 = u2.substr(0, u2.length - 1), this.options.transformTagName) { + const t4 = this.options.transformTagName(a2); + u2 === a2 && (u2 = t4), a2 = t4; + } + const t3 = new y(a2); + a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), s2 = s2.substr(0, s2.lastIndexOf(".")); + } else { + const t3 = new y(a2); + this.tagsNodeStack.push(i2), a2 !== u2 && h2 && (t3[":@"] = this.buildAttributesMap(u2, s2)), this.addChild(i2, t3, s2, f2), i2 = t3; + } + n2 = "", o2 = d2; + } + } + else n2 += t2[o2]; + return e2.child; + }; + function U(t2, e2, i2, n2) { + this.options.captureMetaData || (n2 = void 0); + const s2 = this.options.updateTag(e2.tagname, i2, e2[":@"]); + false === s2 || ("string" == typeof s2 ? (e2.tagname = s2, t2.addChild(e2, n2)) : t2.addChild(e2, n2)); + } + const B = function(t2) { + if (this.options.processEntities) { + for (let e2 in this.docTypeEntities) { + const i2 = this.docTypeEntities[e2]; + t2 = t2.replace(i2.regx, i2.val); + } + for (let e2 in this.lastEntities) { + const i2 = this.lastEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + if (this.options.htmlEntities) for (let e2 in this.htmlEntities) { + const i2 = this.htmlEntities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + t2 = t2.replace(this.ampEntity.regex, this.ampEntity.val); + } + return t2; + }; + function R(t2, e2, i2, n2) { + return t2 && (void 0 === n2 && (n2 = 0 === e2.child.length), void 0 !== (t2 = this.parseTextData(t2, e2.tagname, i2, false, !!e2[":@"] && 0 !== Object.keys(e2[":@"]).length, n2)) && "" !== t2 && e2.add(this.options.textNodeName, t2), t2 = ""), t2; + } + function Y(t2, e2, i2, n2) { + return !(!e2 || !e2.has(n2)) || !(!t2 || !t2.has(i2)); + } + function G(t2, e2, i2, n2) { + const s2 = t2.indexOf(e2, i2); + if (-1 === s2) throw new Error(n2); + return s2 + e2.length - 1; + } + function X(t2, e2, i2, n2 = ">") { + const s2 = (function(t3, e3, i3 = ">") { + let n3, s3 = ""; + for (let r3 = e3; r3 < t3.length; r3++) { + let e4 = t3[r3]; + if (n3) e4 === n3 && (n3 = ""); + else if ('"' === e4 || "'" === e4) n3 = e4; + else if (e4 === i3[0]) { + if (!i3[1]) return { data: s3, index: r3 }; + if (t3[r3 + 1] === i3[1]) return { data: s3, index: r3 }; + } else " " === e4 && (e4 = " "); + s3 += e4; + } + })(t2, e2 + 1, n2); + if (!s2) return; + let r2 = s2.data; + const o2 = s2.index, a2 = r2.search(/\s/); + let l2 = r2, u2 = true; + -1 !== a2 && (l2 = r2.substring(0, a2), r2 = r2.substring(a2 + 1).trimStart()); + const h2 = l2; + if (i2) { + const t3 = l2.indexOf(":"); + -1 !== t3 && (l2 = l2.substr(t3 + 1), u2 = l2 !== s2.data.substr(t3 + 1)); + } + return { tagName: l2, tagExp: r2, closeIndex: o2, attrExpPresent: u2, rawTagName: h2 }; + } + function W(t2, e2, i2) { + const n2 = i2; + let s2 = 1; + for (; i2 < t2.length; i2++) if ("<" === t2[i2]) if ("/" === t2[i2 + 1]) { + const r2 = G(t2, ">", i2, `${e2} is not closed`); + if (t2.substring(i2 + 2, r2).trim() === e2 && (s2--, 0 === s2)) return { tagContent: t2.substring(n2, i2), i: r2 }; + i2 = r2; + } else if ("?" === t2[i2 + 1]) i2 = G(t2, "?>", i2 + 1, "StopNode is not closed."); + else if ("!--" === t2.substr(i2 + 1, 3)) i2 = G(t2, "-->", i2 + 3, "StopNode is not closed."); + else if ("![" === t2.substr(i2 + 1, 2)) i2 = G(t2, "]]>", i2, "StopNode is not closed.") - 2; + else { + const n3 = X(t2, i2, ">"); + n3 && ((n3 && n3.tagName) === e2 && "/" !== n3.tagExp[n3.tagExp.length - 1] && s2++, i2 = n3.closeIndex); + } + } + function q(t2, e2, i2) { + if (e2 && "string" == typeof t2) { + const e3 = t2.trim(); + return "true" === e3 || "false" !== e3 && (function(t3, e4 = {}) { + if (e4 = Object.assign({}, C, e4), !t3 || "string" != typeof t3) return t3; + let i3 = t3.trim(); + if (void 0 !== e4.skipLike && e4.skipLike.test(i3)) return t3; + if ("0" === t3) return 0; + if (e4.hex && A.test(i3)) 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"); + })(i3); + if (-1 !== i3.search(/.+[eE].+/)) return (function(t4, e5, i4) { + if (!i4.eNotation) return t4; + const n3 = e5.match(V); + if (n3) { + let s2 = n3[1] || ""; + const r2 = -1 === n3[3].indexOf("e") ? "E" : "e", o2 = n3[2], a2 = s2 ? t4[o2.length + 1] === r2 : t4[o2.length] === r2; + return o2.length > 1 && a2 ? t4 : 1 !== o2.length || !n3[3].startsWith(`.${r2}`) && n3[3][0] !== r2 ? i4.leadingZeros && !a2 ? (e5 = (n3[1] || "") + n3[3], Number(e5)) : t4 : Number(e5); + } + return t4; + })(t3, i3, e4); + { + const s2 = S.exec(i3); + if (s2) { + const r2 = s2[1] || "", o2 = s2[2]; + let a2 = (n2 = s2[3]) && -1 !== n2.indexOf(".") ? ("." === (n2 = n2.replace(/0+$/, "")) ? n2 = "0" : "." === n2[0] ? n2 = "0" + n2 : "." === n2[n2.length - 1] && (n2 = n2.substring(0, n2.length - 1)), n2) : n2; + const l2 = r2 ? "." === t3[o2.length + 1] : "." === t3[o2.length]; + if (!e4.leadingZeros && (o2.length > 1 || 1 === o2.length && !l2)) return t3; + { + const n3 = Number(i3), s3 = String(n3); + if (0 === n3 || -0 === n3) return n3; + if (-1 !== s3.search(/[eE]/)) return e4.eNotation ? n3 : t3; + if (-1 !== i3.indexOf(".")) return "0" === s3 || s3 === a2 || s3 === `${r2}${a2}` ? n3 : t3; + let l3 = o2 ? a2 : i3; + return o2 ? l3 === s3 || r2 + l3 === s3 ? n3 : t3 : l3 === s3 || l3 === r2 + s3 ? n3 : t3; + } + } + return t3; + } + var n2; + })(t2, i2); + } + return void 0 !== t2 ? t2 : ""; + } + const Z = y.getMetaDataSymbol(); + function K(t2, e2) { + return Q(t2, e2); + } + function Q(t2, e2, i2) { + let n2; + const s2 = {}; + for (let r2 = 0; r2 < t2.length; r2++) { + const o2 = t2[r2], a2 = z(o2); + let l2 = ""; + if (l2 = void 0 === i2 ? a2 : i2 + "." + a2, a2 === e2.textNodeName) void 0 === n2 ? n2 = o2[a2] : n2 += "" + o2[a2]; + else { + if (void 0 === a2) continue; + if (o2[a2]) { + let t3 = Q(o2[a2], e2, l2); + const i3 = H(t3, e2); + void 0 !== o2[Z] && (t3[Z] = o2[Z]), o2[":@"] ? J(t3, o2[":@"], l2, 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 !== s2[a2] && s2.hasOwnProperty(a2) ? (Array.isArray(s2[a2]) || (s2[a2] = [s2[a2]]), s2[a2].push(t3)) : e2.isArray(a2, l2, i3) ? s2[a2] = [t3] : s2[a2] = t3; + } + } + } + return "string" == typeof n2 ? n2.length > 0 && (s2[e2.textNodeName] = n2) : void 0 !== n2 && (s2[e2.textNodeName] = n2), s2; + } + function z(t2) { + const e2 = Object.keys(t2); + for (let t3 = 0; t3 < e2.length; t3++) { + const i2 = e2[t3]; + if (":@" !== i2) return i2; + } + } + function J(t2, e2, i2, n2) { + if (e2) { + const s2 = Object.keys(e2), r2 = s2.length; + for (let o2 = 0; o2 < r2; o2++) { + const r3 = s2[o2]; + n2.isArray(r3, i2 + "." + r3, true, true) ? t2[r3] = [e2[r3]] : t2[r3] = e2[r3]; + } + } + } + function H(t2, e2) { + const { textNodeName: i2 } = e2, n2 = Object.keys(t2).length; + return 0 === n2 || !(1 !== n2 || !t2[i2] && "boolean" != typeof t2[i2] && 0 !== t2[i2]); + } + class tt { + constructor(t2) { + this.externalEntities = {}, this.options = (function(t3) { + return Object.assign({}, v, t3); + })(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 i3 = a(t2, e2); + if (true !== i3) throw Error(`${i3.err.msg}:${i3.err.line}:${i3.err.col}`); + } + const i2 = new D(this.options); + i2.addExternalEntities(this.externalEntities); + const n2 = i2.parseXml(t2); + return this.options.preserveOrder || void 0 === n2 ? n2 : K(n2, this.options); + } + 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 y.getMetaDataSymbol(); + } + } + function et(t2, e2) { + let i2 = ""; + return e2.format && e2.indentBy.length > 0 && (i2 = "\n"), it(t2, e2, "", i2); + } + function it(t2, e2, i2, n2) { + let s2 = "", r2 = false; + for (let o2 = 0; o2 < t2.length; o2++) { + const a2 = t2[o2], l2 = nt(a2); + if (void 0 === l2) continue; + let u2 = ""; + if (u2 = 0 === i2.length ? l2 : `${i2}.${l2}`, l2 === e2.textNodeName) { + let t3 = a2[l2]; + rt(u2, e2) || (t3 = e2.tagValueProcessor(l2, t3), t3 = ot(t3, e2)), r2 && (s2 += n2), s2 += t3, r2 = false; + continue; + } + if (l2 === e2.cdataPropName) { + r2 && (s2 += n2), s2 += ``, r2 = false; + continue; + } + if (l2 === e2.commentPropName) { + s2 += n2 + ``, r2 = true; + continue; + } + if ("?" === l2[0]) { + const t3 = st(a2[":@"], e2), i3 = "?xml" === l2 ? "" : n2; + let o3 = a2[l2][0][e2.textNodeName]; + o3 = 0 !== o3.length ? " " + o3 : "", s2 += i3 + `<${l2}${o3}${t3}?>`, r2 = true; + continue; + } + let h2 = n2; + "" !== h2 && (h2 += e2.indentBy); + const d2 = n2 + `<${l2}${st(a2[":@"], e2)}`, p2 = it(a2[l2], e2, u2, h2); + -1 !== e2.unpairedTags.indexOf(l2) ? e2.suppressUnpairedNode ? s2 += d2 + ">" : s2 += d2 + "/>" : p2 && 0 !== p2.length || !e2.suppressEmptyNode ? p2 && p2.endsWith(">") ? s2 += d2 + `>${p2}${n2}` : (s2 += d2 + ">", p2 && "" !== n2 && (p2.includes("/>") || p2.includes("`) : s2 += d2 + "/>", r2 = true; + } + return s2; + } + function nt(t2) { + const e2 = Object.keys(t2); + for (let i2 = 0; i2 < e2.length; i2++) { + const n2 = e2[i2]; + if (t2.hasOwnProperty(n2) && ":@" !== n2) return n2; + } + } + function st(t2, e2) { + let i2 = ""; + if (t2 && !e2.ignoreAttributes) for (let n2 in t2) { + if (!t2.hasOwnProperty(n2)) continue; + let s2 = e2.attributeValueProcessor(n2, t2[n2]); + s2 = ot(s2, e2), true === s2 && e2.suppressBooleanAttributes ? i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}` : i2 += ` ${n2.substr(e2.attributeNamePrefix.length)}="${s2}"`; + } + return i2; + } + function rt(t2, e2) { + let i2 = (t2 = t2.substr(0, t2.length - e2.textNodeName.length - 1)).substr(t2.lastIndexOf(".") + 1); + for (let n2 in e2.stopNodes) if (e2.stopNodes[n2] === t2 || e2.stopNodes[n2] === "*." + i2) return true; + return false; + } + function ot(t2, e2) { + if (t2 && t2.length > 0 && e2.processEntities) for (let i2 = 0; i2 < e2.entities.length; i2++) { + const n2 = e2.entities[i2]; + t2 = t2.replace(n2.regex, n2.val); + } + return t2; + } + const at = { 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 }; + function lt(t2) { + this.options = Object.assign({}, at, t2), true === this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() { + return false; + } : (this.ignoreAttributesFn = $(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = dt), this.processTextOrObjNode = ut, this.options.format ? (this.indentate = ht, this.tagEndChar = ">\n", this.newLine = "\n") : (this.indentate = function() { + return ""; + }, this.tagEndChar = ">", this.newLine = ""); + } + function ut(t2, e2, i2, n2) { + const s2 = this.j2x(t2, i2 + 1, n2.concat(e2)); + return void 0 !== t2[this.options.textNodeName] && 1 === Object.keys(t2).length ? this.buildTextValNode(t2[this.options.textNodeName], e2, s2.attrStr, i2) : this.buildObjectNode(s2.val, e2, s2.attrStr, i2); + } + function ht(t2) { + return this.options.indentBy.repeat(t2); + } + function dt(t2) { + return !(!t2.startsWith(this.options.attributeNamePrefix) || t2 === this.options.textNodeName) && t2.substr(this.attrPrefixLen); + } + lt.prototype.build = function(t2) { + return this.options.preserveOrder ? et(t2, this.options) : (Array.isArray(t2) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t2 = { [this.options.arrayNodeName]: t2 }), this.j2x(t2, 0, []).val); + }, lt.prototype.j2x = function(t2, e2, i2) { + let n2 = "", s2 = ""; + const r2 = i2.join("."); + for (let o2 in t2) if (Object.prototype.hasOwnProperty.call(t2, o2)) if (void 0 === t2[o2]) this.isAttribute(o2) && (s2 += ""); + else if (null === t2[o2]) this.isAttribute(o2) || o2 === this.options.cdataPropName ? s2 += "" : "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if (t2[o2] instanceof Date) s2 += this.buildTextValNode(t2[o2], o2, "", e2); + else if ("object" != typeof t2[o2]) { + const i3 = this.isAttribute(o2); + if (i3 && !this.ignoreAttributesFn(i3, r2)) n2 += this.buildAttrPairStr(i3, "" + t2[o2]); + else if (!i3) if (o2 === this.options.textNodeName) { + let e3 = this.options.tagValueProcessor(o2, "" + t2[o2]); + s2 += this.replaceEntitiesValue(e3); + } else s2 += this.buildTextValNode(t2[o2], o2, "", e2); + } else if (Array.isArray(t2[o2])) { + const n3 = t2[o2].length; + let r3 = "", a2 = ""; + for (let l2 = 0; l2 < n3; l2++) { + const n4 = t2[o2][l2]; + if (void 0 === n4) ; + else if (null === n4) "?" === o2[0] ? s2 += this.indentate(e2) + "<" + o2 + "?" + this.tagEndChar : s2 += this.indentate(e2) + "<" + o2 + "/" + this.tagEndChar; + else if ("object" == typeof n4) if (this.options.oneListGroup) { + const t3 = this.j2x(n4, e2 + 1, i2.concat(o2)); + r3 += t3.val, this.options.attributesGroupName && n4.hasOwnProperty(this.options.attributesGroupName) && (a2 += t3.attrStr); + } else r3 += this.processTextOrObjNode(n4, o2, e2, i2); + else if (this.options.oneListGroup) { + let t3 = this.options.tagValueProcessor(o2, n4); + t3 = this.replaceEntitiesValue(t3), r3 += t3; + } else r3 += this.buildTextValNode(n4, o2, "", e2); + } + this.options.oneListGroup && (r3 = this.buildObjectNode(r3, o2, a2, e2)), s2 += r3; + } else if (this.options.attributesGroupName && o2 === this.options.attributesGroupName) { + const e3 = Object.keys(t2[o2]), i3 = e3.length; + for (let s3 = 0; s3 < i3; s3++) n2 += this.buildAttrPairStr(e3[s3], "" + t2[o2][e3[s3]]); + } else s2 += this.processTextOrObjNode(t2[o2], o2, e2, i2); + return { attrStr: n2, val: s2 }; + }, lt.prototype.buildAttrPairStr = function(t2, e2) { + return e2 = this.options.attributeValueProcessor(t2, "" + e2), e2 = this.replaceEntitiesValue(e2), this.options.suppressBooleanAttributes && "true" === e2 ? " " + t2 : " " + t2 + '="' + e2 + '"'; + }, lt.prototype.buildObjectNode = function(t2, e2, i2, n2) { + if ("" === t2) return "?" === e2[0] ? this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar; + { + let s2 = "` + this.newLine : this.indentate(n2) + "<" + e2 + i2 + r2 + this.tagEndChar + t2 + this.indentate(n2) + s2 : this.indentate(n2) + "<" + e2 + i2 + r2 + ">" + t2 + s2; + } + }, lt.prototype.closeTag = function(t2) { + let e2 = ""; + return -1 !== this.options.unpairedTags.indexOf(t2) ? this.options.suppressUnpairedNode || (e2 = "/") : e2 = this.options.suppressEmptyNode ? "/" : `>` + this.newLine; + if (false !== this.options.commentPropName && e2 === this.options.commentPropName) return this.indentate(n2) + `` + this.newLine; + if ("?" === e2[0]) return this.indentate(n2) + "<" + e2 + i2 + "?" + this.tagEndChar; + { + let s2 = this.options.tagValueProcessor(e2, t2); + return s2 = this.replaceEntitiesValue(s2), "" === s2 ? this.indentate(n2) + "<" + e2 + i2 + this.closeTag(e2) + this.tagEndChar : this.indentate(n2) + "<" + e2 + i2 + ">" + s2 + " 0 && this.options.processEntities) for (let e2 = 0; e2 < this.options.entities.length; e2++) { + const i2 = this.options.entities[e2]; + t2 = t2.replace(i2.regex, i2.val); + } + return t2; + }; + const pt = { validate: a }; + 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 _a; + return { + attributesGroupName: xml_common_js_1.XML_ATTRKEY, + textNodeName: (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : xml_common_js_1.XML_CHARKEY, + ignoreAttributes: false, + suppressBooleanAttributes: false + }; + } + function getSerializerOptions(options = {}) { + var _a, _b; + return Object.assign(Object.assign({}, getCommonOptions(options)), { attributeNamePrefix: "@_", format: true, suppressEmptyNode: true, indentBy: "", rootNodeName: (_a = options.rootName) !== null && _a !== void 0 ? _a : "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(str2, opts = {}) { + if (!str2) { + throw new Error("Document is empty"); + } + const validation = fast_xml_parser_1.XMLValidator.validate(str2); + if (validation !== true) { + throw validation; + } + const parser = new fast_xml_parser_1.XMLParser(getParserOptions(opts)); + const parsedXml = parser.parse(str2); + 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 path12 = urlParsed.pathname; + path12 = path12 || "/"; + path12 = escape(path12); + urlParsed.pathname = path12; + 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 escape(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 path12 = urlParsed.pathname; + path12 = path12 ? path12.endsWith("/") ? `${path12}${name}` : `${path12}/${name}` : name; + urlParsed.pathname = path12; + 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((resolve6, reject) => { + let timeout; + const abortHandler = () => { + if (timeout !== void 0) { + clearTimeout(timeout); + } + reject(abortError); + }; + const resolveHandler = () => { + if (aborter !== void 0) { + aborter.removeEventListener("abort", abortHandler); + } + resolve6(); + }; + 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(request) { + return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request) { + return this._nextPolicy.sendRequest(this.signRequest(request)); + } + /** + * Child classes must implement this method with request signing. This method + * will be executed in {@link sendRequest}. + * + * @param request - + */ + signRequest(request) { + return request; + } + }; + 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; } - setPollerConfig(pollerConfig) { - this.pollerConfig = pollerConfig; + /** + * Signs request. + * + * @param request - + */ + signRequest(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; } - async update(options) { - var _a; - const stateProxy = createStateProxy(); - if (!this.state.isStarted) { - this.state = Object.assign(Object.assign({}, this.state), await initHttpOperation({ - lro: this.lro, - stateProxy, - resourceLocationConfig: this.lroResourceLocationConfig, - processResult: this.processResult, - setErrorAsResult: this.setErrorAsResult - })); + /** + * 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(request, headerName) { + const value = request.headers.get(headerName); + if (!value) { + return ""; } - const updateState = this.updateState; - const isDone = this.isDone; - if (!this.state.isCompleted && this.state.error === void 0) { - await 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 - }); + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { + return ""; } - (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); - return this; - } - async cancel() { - logger.error("`cancelOperation` is deprecated because it wasn't implemented"); - return this; + return value; } /** - * Serializes the Poller operation. + * 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 - */ - toString() { - return JSON.stringify({ - state: this.state + getCanonicalizedHeadersString(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { + return false; + } + return true; + }); + let canonicalizedHeadersStringToSign = ""; + headersArray.forEach((header) => { + canonicalizedHeadersStringToSign += `${header.name.toLowerCase().trimRight()}:${header.value.trimLeft()} +`; }); + return canonicalizedHeadersStringToSign; } - }; - var PollerStoppedError = class _PollerStoppedError extends Error { - constructor(message) { - super(message); - this.name = "PollerStoppedError"; - Object.setPrototypeOf(this, _PollerStoppedError.prototype); + /** + * Retrieves the webResource canonicalized resource string. + * + * @param request - + */ + getCanonicalizedResourceString(request) { + const path12 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path12}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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; } }; - var PollerCancelledError = class _PollerCancelledError extends Error { - constructor(message) { - super(message); - this.name = "PollerCancelledError"; - Object.setPrototypeOf(this, _PollerCancelledError.prototype); + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); } }; - var Poller = class { + exports2.Credential = Credential; + } +}); + +// 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 { /** - * 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: + * 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. * - * ```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 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 operation - Must contain the basic properties of `PollOperation`. + * @param stringToSign - */ - constructor(operation) { - this.resolveOnUnsuccessful = false; - this.stopped = true; - this.pollProgressCallbacks = []; - this.operation = operation; - this.promise = new Promise((resolve6, reject) => { - this.resolve = resolve6; - this.reject = reject; - }); - this.promise.catch(() => { - }); + 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 { /** - * Starts a loop that will break only if the poller is done - * or if the poller is stopped. + * Creates an instance of AnonymousCredentialPolicy. + * @param nextPolicy - + * @param options - */ - async startPolling(pollOptions = {}) { - if (this.stopped) { - this.stopped = false; - } - while (!this.isStopped() && !this.isDone()) { - await this.poll(pollOptions); - await this.delay(); - } + // 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 { /** - * pollOnce does one polling, by calling to the update method of the underlying - * poll operation to make any relevant change effective. + * Creates an {@link AnonymousCredentialPolicy} object. * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @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 options - Optional properties passed to the operation's update method. + * @param buffers - Array of buffers containing the data + * @param byteLength - The total length of data contained in the buffers */ - async pollOnce(options = {}) { - if (!this.isDone()) { - this.operation = await this.operation.update({ - abortSignal: options.abortSignal, - fireProgress: this.fireProgress.bind(this) - }); + 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."); } - 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. + * Internal _read() that will be called when the stream wants to pull more data in. * - * @param state - The current operation state. + * @param size - Optional. The size of data to be read */ - fireProgress(state) { - for (const callback of this.pollProgressCallbacks) { - callback(state); + _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 { /** - * Invokes the underlying operation's cancel method. + * Internal buffers used to keep the data. + * Each buffer has a length of the maxBufferLength except last one. */ - async cancelOnce(options = {}) { - this.operation = await this.operation.cancel(options); + 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); + } } /** - * 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. + * 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. * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * @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. * - * @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; + 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 (this.operation.state.isCancelled) { - this.stopped = true; - if (!this.resolveOnUnsuccessful) { - const error4 = new PollerCancelledError("Operation was canceled"); - this.reject(error4); - throw error4; + if (targetOffset === target.length) { + j++; + targetOffset = 0; } } - if (this.isDone() && this.resolve) { - this.resolve(this.getResult()); + buffers.splice(0, i); + if (buffers.length > 0) { + buffers[0] = buffers[0].slice(sourceOffset); } } /** - * Returns a promise that will resolve once the underlying operation is completed. + * Get the readable stream assembled from all the data in the internal buffers. + * */ - async pollUntilDone(pollOptions = {}) { - if (this.stopped) { - this.startPolling(pollOptions).catch(this.reject); - } - this.processUpdatedState(); - return this.promise; + 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 { /** - * 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. + * 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. */ - onProgress(callback) { - this.pollProgressCallbacks.push(callback); - return () => { - this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); - }; - } + incoming = []; /** - * Returns true if the poller has finished polling. + * The array (queue) includes all the buffers filled from stream data. */ - isDone() { - const state = this.operation.state; - return Boolean(state.isCompleted || state.isCancelled || state.error); - } + outgoing = []; /** - * Stops the poller from continuing to poll. + * 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 */ - stopPolling() { - if (!this.stopped) { - this.stopped = true; - if (this.reject) { - this.reject(new PollerStoppedError("This poller is already stopped")); - } + 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; } /** - * Returns true if the poller is stopped. + * Start the scheduler, will return error when stream of any of the outgoingHandlers + * returns error. + * */ - isStopped() { - return this.stopped; + async do() { + return new Promise((resolve6, 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(resolve6).catch(reject); + } else if (this.unresolvedLength >= this.bufferSize) { + return; + } else { + resolve6(); + } + } + }); + }); } /** - * Attempts to cancel the underlying operation. - * - * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. + * Insert a new data into unresolved array. * - * If it's called again before it finishes, it will throw an error. + * @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. * - * @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"); + shiftBufferFromUnresolvedDataArray(buffer) { + if (!buffer) { + buffer = new PooledBuffer_js_1.PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); + } else { + buffer.fill(this.unresolvedDataArray, this.unresolvedLength); } - return this.cancelPromise; + this.unresolvedLength -= buffer.size; + return buffer; } /** - * 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, + * 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. * - * // The only other property needed by PublicState. - * publicProperty: state.publicProperty - * } - * } - * } - * ``` + * Return false when available buffers in incoming are not enough, else true. * - * You can see this in the tests of this repository, go to the file: - * `../test/utils/testPoller.ts` - * and look for the getOperationState implementation. + * @returns Return false when buffers in incoming are not enough, else true. */ - getOperationState() { - return this.operation.state; + 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; } /** - * 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. + * Try to trigger a outgoing handler for every buffer in outgoing. Stop when + * concurrency reaches. */ - getResult() { - const state = this.operation.state; - return state.result; + async triggerOutgoingHandlers() { + let buffer; + do { + if (this.executingOutgoingHandlers >= this.concurrency) { + return; + } + buffer = this.outgoing.shift(); + if (buffer) { + this.triggerOutgoingHandler(buffer); + } + } while (buffer); } /** - * Returns a serialized version of the poller's operation - * by invoking the operation's toString method. + * Trigger a outgoing handler for a buffer shifted from outgoing. + * + * @param buffer - */ - toString() { - return this.operation.toString(); - } - }; - var LroEngine = class extends Poller { - constructor(lro, options) { - const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState } = options || {}; - const state = resumeFrom ? deserializeState(resumeFrom) : {}; - const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone); - super(operation); - this.resolveOnUnsuccessful = resolveOnUnsuccessful; - this.config = { intervalInMs }; - operation.setPollerConfig(this.config); + 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"); } /** - * The method used by the poller to wait before attempting to update its operation. + * Return buffer used by outgoing handler into incoming. + * + * @param buffer - */ - delay() { - return new Promise((resolve6) => setTimeout(() => resolve6(), this.config.intervalInMs)); + reuseBuffer(buffer) { + this.incoming.push(buffer); + if (!this.isError && this.resolveData() && !this.isStreamEnd) { + this.readable.resume(); + } } }; - exports2.LroEngine = LroEngine; - exports2.Poller = Poller; - exports2.PollerCancelledError = PollerCancelledError; - exports2.PollerStoppedError = PollerStoppedError; - exports2.createHttpPoller = createHttpPoller; + exports2.BufferScheduler = BufferScheduler; } }); -// node_modules/@azure/storage-blob/dist/index.js -var require_dist7 = __commonJS({ - "node_modules/@azure/storage-blob/dist/index.js"(exports2) { +// 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 }); - var coreRestPipeline = require_commonjs5(); - var tslib = (init_tslib_es62(), __toCommonJS(tslib_es6_exports2)); - var coreAuth = require_commonjs6(); - var coreUtil = require_commonjs2(); - var coreHttpCompat = require_commonjs8(); - var coreClient = require_commonjs7(); - var coreXml = require_commonjs9(); - var logger$1 = require_dist(); - var abortController = require_commonjs10(); - var crypto = require("crypto"); - var coreTracing = require_commonjs4(); - var stream2 = require("stream"); - var coreLro = require_dist6(); - var events = require("events"); - var fs13 = require("fs"); - var util = require("util"); - var buffer = require("buffer"); - function _interopNamespaceDefault(e) { - var n = /* @__PURE__ */ Object.create(null); - if (e) { - Object.keys(e).forEach(function(k) { - if (k !== "default") { - var d = Object.getOwnPropertyDescriptor(e, k); - Object.defineProperty(n, k, d.get ? d : { - enumerable: true, - get: function() { - return e[k]; - } - }); - } - }); + exports2.getCachedDefaultHttpClient = getCachedDefaultHttpClient; + var core_rest_pipeline_1 = require_commonjs6(); + var _defaultHttpClient; + function getCachedDefaultHttpClient() { + if (!_defaultHttpClient) { + _defaultHttpClient = (0, core_rest_pipeline_1.createDefaultHttpClient)(); } - n.default = e; - return Object.freeze(n); + return _defaultHttpClient; } - var coreHttpCompat__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreHttpCompat); - var coreClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(coreClient); - var fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs13); - var util__namespace = /* @__PURE__ */ _interopNamespaceDefault(util); - var logger = logger$1.createClientLogger("storage-blob"); + } +}); + +// 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. */ @@ -45386,17 +48031,18 @@ var require_dist7 = __commonJS({ this._options.log(logLevel, message); } }; - var SDK_VERSION = "12.25.0"; - var SERVICE_VERSION = "2024-11-04"; - var BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; - var BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4e3 * 1024 * 1024; - var BLOCK_BLOB_MAX_BLOCKS = 5e4; - var DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; - var DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; - var DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5; - var REQUEST_TIMEOUT = 100 * 1e3; - var StorageOAuthScopes = "https://storage.azure.com/.default"; - var URLConstants = { + 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", @@ -45405,14 +48051,7 @@ var require_dist7 = __commonJS({ TIMEOUT: "timeout" } }; - var HTTPURLConnection = { - HTTP_ACCEPTED: 202, - HTTP_CONFLICT: 409, - HTTP_NOT_FOUND: 404, - HTTP_PRECON_FAILED: 412, - HTTP_RANGE_NOT_SATISFIABLE: 416 - }; - var HeaderConstants = { + exports2.HeaderConstants = { AUTHORIZATION: "Authorization", AUTHORIZATION_SCHEME: "Bearer", CONTENT_ENCODING: "Content-Encoding", @@ -45438,151 +48077,8 @@ var require_dist7 = __commonJS({ X_MS_VERSION: "x-ms-version", X_MS_CopySourceErrorCode: "x-ms-copy-source-error-code" }; - var ETagNone = ""; - var ETagAny = "*"; - var SIZE_1_MB = 1 * 1024 * 1024; - var BATCH_MAX_REQUEST = 256; - var BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB; - var HTTP_LINE_ENDING = "\r\n"; - var HTTP_VERSION_1_1 = "HTTP/1.1"; - var EncryptionAlgorithmAES25 = "AES256"; - var DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; - var 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" - ]; - var 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" - ]; - var BlobUsesCustomerSpecifiedEncryptionMsg = "BlobUsesCustomerSpecifiedEncryption"; - var BlobDoesNotUseCustomerSpecifiedEncryption = "BlobDoesNotUseCustomerSpecifiedEncryption"; - var PathStylePorts = [ + exports2.DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`; + exports2.PathStylePorts = [ "10000", "10001", "10002", @@ -45604,8 +48100,46 @@ var require_dist7 = __commonJS({ "11103", "11104" ]; - function escapeURLPath(url3) { - const urlParsed = new URL(url3); + } +}); + +// 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 path12 = urlParsed.pathname; path12 = path12 || "/"; path12 = escape(path12); @@ -45637,7 +48171,7 @@ var require_dist7 = __commonJS({ let proxyUri = ""; if (connectionString.startsWith("UseDevelopmentStorage=true")) { proxyUri = getProxyUriFromDevConnString(connectionString); - connectionString = DevelopmentConnectionString; + connectionString = constants_js_1.DevelopmentConnectionString; } let blobEndpoint = getValueInConnString(connectionString, "BlobEndpoint"); blobEndpoint = blobEndpoint.endsWith("/") ? blobEndpoint.slice(0, -1) : blobEndpoint; @@ -45692,15 +48226,15 @@ var require_dist7 = __commonJS({ function escape(text) { return encodeURIComponent(text).replace(/%2F/g, "/").replace(/'/g, "%27").replace(/\+/g, "%20").replace(/%25/g, "%"); } - function appendToURLPath(url3, name) { - const urlParsed = new URL(url3); + function appendToURLPath(url2, name) { + const urlParsed = new URL(url2); let path12 = urlParsed.pathname; path12 = path12 ? path12.endsWith("/") ? `${path12}${name}` : `${path12}/${name}` : name; urlParsed.pathname = path12; return urlParsed.toString(); } - function setURLParameter(url3, name, value) { - const urlParsed = new URL(url3); + 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; @@ -45719,34 +48253,33 @@ var require_dist7 = __commonJS({ urlParsed.search = searchPieces.length ? `?${searchPieces.join("&")}` : ""; return urlParsed.toString(); } - function getURLParameter(url3, name) { - var _a; - const urlParsed = new URL(url3); - return (_a = urlParsed.searchParams.get(name)) !== null && _a !== void 0 ? _a : void 0; + function getURLParameter(url2, name) { + const urlParsed = new URL(url2); + return urlParsed.searchParams.get(name) ?? void 0; } - function setURLHost(url3, host) { - const urlParsed = new URL(url3); + function setURLHost(url2, host) { + const urlParsed = new URL(url2); urlParsed.hostname = host; return urlParsed.toString(); } - function getURLPath(url3) { + function getURLPath(url2) { try { - const urlParsed = new URL(url3); + const urlParsed = new URL(url2); return urlParsed.pathname; } catch (e) { return void 0; } } - function getURLScheme(url3) { + function getURLScheme(url2) { try { - const urlParsed = new URL(url3); + const urlParsed = new URL(url2); return urlParsed.protocol.endsWith(":") ? urlParsed.protocol.slice(0, -1) : urlParsed.protocol; } catch (e) { return void 0; } } - function getURLPathAndQuery(url3) { - const urlParsed = new URL(url3); + function getURLPathAndQuery(url2) { + const urlParsed = new URL(url2); const pathString = urlParsed.pathname; if (!pathString) { throw new RangeError("Invalid url without valid path."); @@ -45758,8 +48291,8 @@ var require_dist7 = __commonJS({ } return `${pathString}${queryString}`; } - function getURLQueries(url3) { - let queryString = new URL(url3).search; + function getURLQueries(url2) { + let queryString = new URL(url2).search; if (!queryString) { return {}; } @@ -45780,8 +48313,8 @@ var require_dist7 = __commonJS({ } return queries; } - function appendToURLQuery(url3, queryParts) { - const urlParsed = new URL(url3); + function appendToURLQuery(url2, queryParts) { + const urlParsed = new URL(url2); let query = urlParsed.search; if (query) { query += "&" + queryParts; @@ -45796,7 +48329,10 @@ var require_dist7 = __commonJS({ return withMilliseconds ? dateString.substring(0, dateString.length - 1) + "0000Z" : dateString.substring(0, dateString.length - 5) + "Z"; } function base64encode(content) { - return !coreUtil.isNode ? btoa(content) : Buffer.from(content).toString("base64"); + 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; @@ -45819,242 +48355,80 @@ var require_dist7 = __commonJS({ }; const resolveHandler = () => { if (aborter !== void 0) { - aborter.removeEventListener("abort", abortHandler); - } - resolve6(); - }; - 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 iEqual(str1, str2) { - return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); - } - function getAccountNameFromUrl(url3) { - const parsedUrl = new URL(url3); - 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 (error4) { - 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) && PathStylePorts.includes(parsedUrl.port); - } - function toBlobTagsString(tags2) { - if (tags2 === void 0) { - return void 0; - } - const tagPairs = []; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`); - } - } - return tagPairs.join("&"); - } - function toBlobTags(tags2) { - if (tags2 === void 0) { - return void 0; - } - const res = { - blobTagSet: [] - }; - for (const key in tags2) { - if (Object.prototype.hasOwnProperty.call(tags2, key)) { - const value = tags2[key]; - res.blobTagSet.push({ - key, - value - }); - } - } - return res; - } - function toTags(tags2) { - if (tags2 === void 0) { - return void 0; - } - const res = {}; - for (const blobTag of tags2.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."); - } + aborter.removeEventListener("abort", abortHandler); + } + resolve6(); + }; + timeout = setTimeout(resolveHandler, timeInMs); + if (aborter !== void 0) { + aborter.addEventListener("abort", abortHandler); + } + }); } - function parseObjectReplicationRecord(objectReplicationRecord) { - if (!objectReplicationRecord) { - return void 0; - } - if ("policy-id" in objectReplicationRecord) { - return void 0; + function padStart2(currentString, targetLength, padString = " ") { + if (String.prototype.padStart) { + return currentString.padStart(targetLength, padString); } - 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] - }); + 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; } - return orProperties; - } - 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 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 ConvertInternalResponseOfListBlobFlat(internalResponse) { - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + 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 ConvertInternalResponseOfListBlobHierarchy(internalResponse) { - var _a; - return Object.assign(Object.assign({}, internalResponse), { segment: { - blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }), - blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => { - const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) }); - return blobItem; - }) - } }); + function iEqual(str1, str2) { + return str1.toLocaleLowerCase() === str2.toLocaleLowerCase(); } - 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; + 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 { - yield { - start: clearRange[clearRangeIndex].start, - end: clearRange[clearRangeIndex].end, - isClear: true - }; - ++clearRangeIndex; + accountName = ""; } + return accountName; + } catch (error3) { + throw new Error("Unable to extract accountName with provided information."); } - 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 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("/"); @@ -46069,178 +48443,84 @@ var require_dist7 = __commonJS({ } throw new TypeError(`Unexpected response object ${response}`); } - exports2.StorageRetryPolicyType = void 0; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(exports2.StorageRetryPolicyType || (exports2.StorageRetryPolicyType = {})); - var DEFAULT_RETRY_OPTIONS$1 = { - maxRetryDelayInMs: 120 * 1e3, - maxTries: 4, - retryDelayInMs: 4 * 1e3, - retryPolicyType: exports2.StorageRetryPolicyType.EXPONENTIAL, - secondaryHost: "", - tryTimeoutInMs: void 0 - // Use server side default timeout strategy - }; - var RETRY_ABORT_ERROR$1 = new abortController.AbortError("The operation was aborted."); - var StorageRetryPolicy = class extends BaseRequestPolicy { + } +}); + +// 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 RetryPolicy. - * + * Creates an instance of StorageBrowserPolicy. * @param nextPolicy - * @param options - - * @param retryOptions - */ - constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS$1) { + // 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); - this.retryOptions = { - retryPolicyType: retryOptions.retryPolicyType ? retryOptions.retryPolicyType : DEFAULT_RETRY_OPTIONS$1.retryPolicyType, - maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1 ? Math.floor(retryOptions.maxTries) : DEFAULT_RETRY_OPTIONS$1.maxTries, - tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0 ? retryOptions.tryTimeoutInMs : DEFAULT_RETRY_OPTIONS$1.tryTimeoutInMs, - retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0 ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs) : DEFAULT_RETRY_OPTIONS$1.retryDelayInMs, - maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0 ? retryOptions.maxRetryDelayInMs : DEFAULT_RETRY_OPTIONS$1.maxRetryDelayInMs, - secondaryHost: retryOptions.secondaryHost ? retryOptions.secondaryHost : DEFAULT_RETRY_OPTIONS$1.secondaryHost - }; } /** - * Sends request. + * Sends out request. * * @param request - */ async sendRequest(request) { - return this.attemptSendRequest(request, 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(request, secondaryHas404, attempt) { - const newRequest = request.clone(); - const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.method === "OPTIONS") || attempt % 2 === 1; - if (!isPrimaryRetry) { - newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost); - } - if (this.retryOptions.tryTimeoutInMs) { - newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1e3).toString()); - } - let response; - try { - 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) { - 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, request.abortSignal); - return this.attemptSendRequest(request, 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions.maxTries}, no further try.`); - return false; - } - const retriableErrors2 = [ - "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 retriableErrors2) { - if (err.name.toUpperCase().includes(retriableError) || err.message.toUpperCase().includes(retriableError) || err.code && err.code.toString().toUpperCase() === retriableError) { - 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) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); - return true; - } - if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); - return true; - } - } - if ((err === null || err === void 0 ? void 0 : err.code) === "PARSE_ERROR" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); - return true; + if (core_util_1.isNodeLike) { + return this._nextPolicy.sendRequest(request); } - 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 exports2.StorageRetryPolicyType.EXPONENTIAL: - delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs); - break; - case exports2.StorageRetryPolicyType.FIXED: - delayTimeInMs = this.retryOptions.retryDelayInMs; - break; - } - } else { - delayTimeInMs = Math.random() * 1e3; + if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); - return delay2(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR$1); + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return this._nextPolicy.sendRequest(request); } }; - var StorageRetryPolicyFactory = class { - /** - * Creates an instance of StorageRetryPolicyFactory. - * @param retryOptions - - */ - constructor(retryOptions) { - this.retryOptions = retryOptions; - } + 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 StorageRetryPolicy object. + * Creates a StorageBrowserPolicyFactory object. * * @param nextPolicy - * @param options - */ create(nextPolicy, options) { - return new StorageRetryPolicy(nextPolicy, options, this.retryOptions); + return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); } }; - var CredentialPolicy = class extends BaseRequestPolicy { + 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. * @@ -46259,6 +48539,83 @@ var require_dist7 = __commonJS({ return request; } }; + 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 Credential = class { + /** + * Creates a RequestPolicy object. + * + * @param _nextPolicy - + * @param _options - + */ + create(_nextPolicy, _options) { + throw new Error("Method should be implemented in children classes."); + } + }; + exports2.Credential = Credential; + } +}); + +// 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, @@ -46682,81 +49039,735 @@ var require_dist7 = __commonJS({ } return false; } - var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy { + } +}); + +// 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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + this.getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); + const signature = this.factory.computeHMACSHA256(stringToSign); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); + return request; + } + /** + * 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(request, headerName) { + const value = request.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(request) { + let headersArray = request.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, index, array) => { + if (index > 0 && value.name.toLowerCase() === array[index - 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(request) { + const path12 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; + let canonicalizedResourceString = ""; + canonicalizedResourceString += `/${this.factory.accountName}${path12}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.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 { /** - * Creates an instance of StorageSharedKeyCredentialPolicy. + * RetryOptions. + */ + retryOptions; + /** + * Creates an instance of RetryPolicy. + * * @param nextPolicy - * @param options - - * @param factory - + * @param retryOptions - */ - constructor(nextPolicy, options, factory) { + constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) { super(nextPolicy, options); - this.factory = factory; + 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 + }; } /** - * Signs request. + * Sends request. * * @param request - */ - signRequest(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); - if (request.body && (typeof request.body === "string" || request.body !== void 0) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); - } - const stringToSign = [ - request.method.toUpperCase(), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - this.getHeaderValueToSign(request, HeaderConstants.DATE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - this.getHeaderValueToSign(request, HeaderConstants.RANGE) - ].join("\n") + "\n" + this.getCanonicalizedHeadersString(request) + this.getCanonicalizedResourceString(request); - const signature = this.factory.computeHMACSHA256(stringToSign); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`); - return request; + async sendRequest(request) { + return this.attemptSendRequest(request, false, 1); } /** - * Retrieve header value according to shared key sign rules. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key + * Decide and perform next retry. Won't mutate request parameter. * * @param request - - * @param headerName - + * @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. */ - getHeaderValueToSign(request, headerName) { + async attemptSendRequest(request, secondaryHas404, attempt) { + const newRequest = request.clone(); + const isPrimaryRetry = secondaryHas404 || !this.retryOptions.secondaryHost || !(request.method === "GET" || request.method === "HEAD" || request.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, request.abortSignal); + return this.attemptSendRequest(request, 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(request, next) { + if (core_util_1.isNodeLike) { + return next(request); + } + if (request.method === "GET" || request.method === "HEAD") { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + } + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); + return next(request); + } + }; + } + } +}); + +// 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(request) { + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + } + return { + name: exports2.storageCorrectContentLengthPolicyName, + async sendRequest(request, next) { + correctContentLength(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + if (tryTimeoutInMs) { + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + } + const primaryUrl = request.url; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.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(request.method) || attempt % 2 === 1; + request.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(request); + 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), request.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(request) { + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + } + const stringToSign = [ + request.method.toUpperCase(), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) + ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + } + function getHeaderValueToSign(request, headerName) { const value = request.headers.get(headerName); if (!value) { return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { + 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(request) { - let headersArray = request.headers.headersArray().filter((value) => { - return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE); - }); + function getCanonicalizedHeadersString(request) { + let headersArray = []; + for (const [name, value] of request.headers) { + if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { + headersArray.push({ name, value }); + } + } headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); }); headersArray = headersArray.filter((value, index, array) => { if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { @@ -46771,16 +49782,11 @@ var require_dist7 = __commonJS({ }); return canonicalizedHeadersStringToSign; } - /** - * Retrieves the webResource canonicalized resource string. - * - * @param request - - */ - getCanonicalizedResourceString(request) { - const path12 = getURLPath(request.url) || "/"; + function getCanonicalizedResourceString(request) { + const path12 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; let canonicalizedResourceString = ""; - canonicalizedResourceString += `/${this.factory.accountName}${path12}`; - const queries = getURLQueries(request.url); + canonicalizedResourceString += `/${options.accountName}${path12}`; + const queries = (0, utils_common_js_1.getURLQueries)(request.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -46799,105 +49805,132 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } return canonicalizedResourceString; } - }; - var Credential = class { - /** - * Creates a RequestPolicy object. - * - * @param _nextPolicy - - * @param _options - - */ - create(_nextPolicy, _options) { - throw new Error("Method should be implemented in children classes."); - } - }; - var StorageSharedKeyCredential = class extends Credential { - /** - * 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(nextPolicy, options, this); - } - /** - * Generates a hash signature for an HTTP request or for a SAS. - * - * @param stringToSign - - */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.accountKey).update(stringToSign, "utf8").digest("base64"); - } - }; - var AnonymousCredentialPolicy = class extends 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); - } - }; - var AnonymousCredential = class extends Credential { - /** - * Creates an {@link AnonymousCredentialPolicy} object. - * - * @param nextPolicy - - * @param options - - */ - create(nextPolicy, options) { - return new AnonymousCredentialPolicy(nextPolicy, options); - } - }; - var _defaultHttpClient; - function getCachedDefaultHttpClient() { - if (!_defaultHttpClient) { - _defaultHttpClient = coreRestPipeline.createDefaultHttpClient(); - } - return _defaultHttpClient; + return { + name: exports2.storageSharedKeyCredentialPolicyName, + async sendRequest(request, next) { + signRequest(request); + return next(request); + } + }; + } + } +}); + +// 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(request, next) { + try { + const response = await next(request); + 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; + } + } + }; } - var storageBrowserPolicyName = "storageBrowserPolicy"; + } +}); + +// 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: storageBrowserPolicyName, + name: exports2.storageBrowserPolicyName, async sendRequest(request, next) { - if (coreUtil.isNode) { + if (core_util_1.isNodeLike) { return next(request); } if (request.method === "GET" || request.method === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request.headers.delete(HeaderConstants.COOKIE); - request.headers.delete(HeaderConstants.CONTENT_LENGTH); + request.headers.delete(constants_js_1.HeaderConstants.COOKIE); + request.headers.delete(constants_js_1.HeaderConstants.CONTENT_LENGTH); return next(request); } }; } - var storageRetryPolicyName = "storageRetryPolicy"; - var StorageRetryPolicyType; - (function(StorageRetryPolicyType2) { - StorageRetryPolicyType2[StorageRetryPolicyType2["EXPONENTIAL"] = 0] = "EXPONENTIAL"; - StorageRetryPolicyType2[StorageRetryPolicyType2["FIXED"] = 1] = "FIXED"; - })(StorageRetryPolicyType || (StorageRetryPolicyType = {})); + } +}); + +// 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: StorageRetryPolicyType.EXPONENTIAL, + retryPolicyType: StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL, secondaryHost: "", tryTimeoutInMs: void 0 // Use server side default timeout strategy @@ -46913,137 +49946,162 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; "EPIPE", "REQUEST_SEND_ERROR" ]; - var RETRY_ABORT_ERROR = new abortController.AbortError("The operation was aborted."); + var RETRY_ABORT_ERROR = new abort_controller_1.AbortError("The operation was aborted."); function storageRetryPolicy(options = {}) { - var _a, _b, _c, _d, _e, _f; - const retryPolicyType = (_a = options.retryPolicyType) !== null && _a !== void 0 ? _a : DEFAULT_RETRY_OPTIONS.retryPolicyType; - const maxTries = (_b = options.maxTries) !== null && _b !== void 0 ? _b : DEFAULT_RETRY_OPTIONS.maxTries; - const retryDelayInMs = (_c = options.retryDelayInMs) !== null && _c !== void 0 ? _c : DEFAULT_RETRY_OPTIONS.retryDelayInMs; - const maxRetryDelayInMs = (_d = options.maxRetryDelayInMs) !== null && _d !== void 0 ? _d : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs; - const secondaryHost = (_e = options.secondaryHost) !== null && _e !== void 0 ? _e : DEFAULT_RETRY_OPTIONS.secondaryHost; - const tryTimeoutInMs = (_f = options.tryTimeoutInMs) !== null && _f !== void 0 ? _f : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs; - function shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }) { - var _a2, _b2; + 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) { - logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); + log_js_1.logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${maxTries}, no further try.`); return false; } - if (error4) { + if (error3) { for (const retriableError of retriableErrors) { - if (error4.name.toUpperCase().includes(retriableError) || error4.message.toUpperCase().includes(retriableError) || error4.code && error4.code.toString().toUpperCase() === retriableError) { - logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`); + 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 ((error4 === null || error4 === void 0 ? void 0 : error4.code) === "PARSE_ERROR" && (error4 === null || error4 === void 0 ? void 0 : error4.message.startsWith(`Error "Error: Unclosed root tag`))) { - logger.info("RetryPolicy: Incomplete XML response likely due to service timeout, will retry."); + 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 || error4) { - const statusCode = (_b2 = (_a2 = response === null || response === void 0 ? void 0 : response.status) !== null && _a2 !== void 0 ? _a2 : error4 === null || error4 === void 0 ? void 0 : error4.statusCode) !== null && _b2 !== void 0 ? _b2 : 0; + if (response || error3) { + const statusCode = response?.status ?? error3?.statusCode ?? 0; if (!isPrimaryRetry && statusCode === 404) { - logger.info(`RetryPolicy: Secondary access with 404, will retry.`); + log_js_1.logger.info(`RetryPolicy: Secondary access with 404, will retry.`); return true; } if (statusCode === 503 || statusCode === 500) { - logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`); + 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 StorageRetryPolicyType.EXPONENTIAL: + case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.EXPONENTIAL: delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * retryDelayInMs, maxRetryDelayInMs); break; - case StorageRetryPolicyType.FIXED: + case StorageRetryPolicyFactory_js_1.StorageRetryPolicyType.FIXED: delayTimeInMs = retryDelayInMs; break; } } else { delayTimeInMs = Math.random() * 1e3; } - logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); + log_js_1.logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`); return delayTimeInMs; } return { - name: storageRetryPolicyName, + name: exports2.storageRetryPolicyName, async sendRequest(request, next) { if (tryTimeoutInMs) { - request.url = setURLParameter(request.url, URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.TIMEOUT, String(Math.floor(tryTimeoutInMs / 1e3))); } const primaryUrl = request.url; - const secondaryUrl = secondaryHost ? setURLHost(request.url, secondaryHost) : void 0; + const secondaryUrl = secondaryHost ? (0, utils_common_js_1.setURLHost)(request.url, secondaryHost) : void 0; let secondaryHas404 = false; let attempt = 1; let retryAgain = true; let response; - let error4; + let error3; while (retryAgain) { const isPrimaryRetry = secondaryHas404 || !secondaryUrl || !["GET", "HEAD", "OPTIONS"].includes(request.method) || attempt % 2 === 1; request.url = isPrimaryRetry ? primaryUrl : secondaryUrl; response = void 0; - error4 = void 0; + error3 = void 0; try { - logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); + log_js_1.logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? "Primary" : "Secondary"}`); response = await next(request); secondaryHas404 = secondaryHas404 || !isPrimaryRetry && response.status === 404; } catch (e) { - if (coreRestPipeline.isRestError(e)) { - logger.error(`RetryPolicy: Caught error, message: ${e.message}, code: ${e.code}`); - error4 = 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 { - logger.error(`RetryPolicy: Caught error, message: ${coreUtil.getErrorMessage(e)}`); + log_js_1.logger.error(`RetryPolicy: Caught error, message: ${(0, core_util_1.getErrorMessage)(e)}`); throw e; } } - retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error4 }); + retryAgain = shouldRetry({ isPrimaryRetry, attempt, response, error: error3 }); if (retryAgain) { - await delay2(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); + await (0, utils_common_js_1.delay)(calculateDelay(isPrimaryRetry, attempt), request.abortSignal, RETRY_ABORT_ERROR); } attempt++; } if (response) { return response; } - throw error4 !== null && error4 !== void 0 ? error4 : new coreRestPipeline.RestError("RetryPolicy failed without known error."); + throw error3 ?? new core_rest_pipeline_1.RestError("RetryPolicy failed without known error."); } }; } - var storageSharedKeyCredentialPolicyName = "storageSharedKeyCredentialPolicy"; + } +}); + +// 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(request) { - request.headers.set(HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); + request.headers.set(constants_js_1.HeaderConstants.X_MS_DATE, (/* @__PURE__ */ new Date()).toUTCString()); if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } const stringToSign = [ request.method.toUpperCase(), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE), - getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING), - getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH), - getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5), - getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE), - getHeaderValueToSign(request, HeaderConstants.DATE), - getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.IF_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH), - getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE), - getHeaderValueToSign(request, HeaderConstants.RANGE) + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LANGUAGE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_ENCODING), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_LENGTH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_MD5), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.CONTENT_TYPE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.DATE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_NONE_MATCH), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.IF_UNMODIFIED_SINCE), + getHeaderValueToSign(request, constants_js_1.HeaderConstants.RANGE) ].join("\n") + "\n" + getCanonicalizedHeadersString(request) + getCanonicalizedResourceString(request); - const signature = crypto.createHmac("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); - request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); + const signature = (0, node_crypto_1.createHmac)("sha256", options.accountKey).update(stringToSign, "utf8").digest("base64"); + request.headers.set(constants_js_1.HeaderConstants.AUTHORIZATION, `SharedKey ${options.accountName}:${signature}`); } function getHeaderValueToSign(request, headerName) { const value = request.headers.get(headerName); if (!value) { return ""; } - if (headerName === HeaderConstants.CONTENT_LENGTH && value === "0") { + if (headerName === constants_js_1.HeaderConstants.CONTENT_LENGTH && value === "0") { return ""; } return value; @@ -47051,12 +50109,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; function getCanonicalizedHeadersString(request) { let headersArray = []; for (const [name, value] of request.headers) { - if (name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE)) { + if (name.toLowerCase().startsWith(constants_js_1.HeaderConstants.PREFIX_FOR_STORAGE)) { headersArray.push({ name, value }); } } headersArray.sort((a, b) => { - return compareHeader(a.name.toLowerCase(), b.name.toLowerCase()); + return (0, SharedKeyComparator_js_1.compareHeader)(a.name.toLowerCase(), b.name.toLowerCase()); }); headersArray = headersArray.filter((value, index, array) => { if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) { @@ -47072,10 +50130,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return canonicalizedHeadersStringToSign; } function getCanonicalizedResourceString(request) { - const path12 = getURLPath(request.url) || "/"; + const path12 = (0, utils_common_js_1.getURLPath)(request.url) || "/"; let canonicalizedResourceString = ""; canonicalizedResourceString += `/${options.accountName}${path12}`; - const queries = getURLQueries(request.url); + const queries = (0, utils_common_js_1.getURLQueries)(request.url); const lowercaseQueries = {}; if (queries) { const queryKeys = []; @@ -47095,14 +50153,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return canonicalizedResourceString; } return { - name: storageSharedKeyCredentialPolicyName, + name: exports2.storageSharedKeyCredentialPolicyName, async sendRequest(request, next) { signRequest(request); return next(request); } }; } - var StorageBrowserPolicy = class extends BaseRequestPolicy { + } +}); + +// 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 - @@ -47119,17 +50190,31 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param request - */ async sendRequest(request) { - if (coreUtil.isNode) { + if (core_util_1.isNodeLike) { return this._nextPolicy.sendRequest(request); } if (request.method.toUpperCase() === "GET" || request.method.toUpperCase() === "HEAD") { - request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); + request.url = (0, utils_common_js_1.setURLParameter)(request.url, constants_js_1.URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, (/* @__PURE__ */ new Date()).getTime().toString()); } - request.headers.remove(HeaderConstants.COOKIE); - request.headers.remove(HeaderConstants.CONTENT_LENGTH); + request.headers.remove(constants_js_1.HeaderConstants.COOKIE); + request.headers.remove(constants_js_1.HeaderConstants.CONTENT_LENGTH); return this._nextPolicy.sendRequest(request); } }; + 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. @@ -47138,24 +50223,68 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * @param options - */ create(nextPolicy, options) { - return new StorageBrowserPolicy(nextPolicy, options); + return new StorageBrowserPolicy_js_1.StorageBrowserPolicy(nextPolicy, options); } }; - var storageCorrectContentLengthPolicyName = "StorageCorrectContentLengthPolicy"; + 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(request) { if (request.body && (typeof request.body === "string" || Buffer.isBuffer(request.body)) && request.body.length > 0) { - request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); + request.headers.set(constants_js_1.HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body)); } } return { - name: storageCorrectContentLengthPolicyName, + name: exports2.storageCorrectContentLengthPolicyName, async sendRequest(request, next) { correctContentLength(request); return next(request); } }; } + } +}); + +// 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(pipeline) { if (!pipeline || typeof pipeline !== "object") { return false; @@ -47164,6 +50293,14 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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. * @@ -47187,9 +50324,10 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; }; } }; + exports2.Pipeline = Pipeline; function newPipeline(credential, pipelineOptions = {}) { if (!credential) { - credential = new AnonymousCredential(); + credential = new AnonymousCredential_js_1.AnonymousCredential(); } const pipeline = new Pipeline([], pipelineOptions); pipeline._credential = credential; @@ -47212,7 +50350,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; if (novelFactories.length) { const hasInjector = novelFactories.some((factory) => isInjectorPolicyFactory(factory)); return { - wrappedPolicies: coreHttpCompat.createRequestPolicyFactoryPolicy(novelFactories), + wrappedPolicies: (0, core_http_compat_1.createRequestPolicyFactoryPolicy)(novelFactories), afterRetry: hasInjector }; } @@ -47220,75 +50358,86 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return void 0; } function getCoreClientOptions(pipeline) { - var _a; - const _b = pipeline.options, { httpClient: v1Client } = _b, restOptions = tslib.__rest(_b, ["httpClient"]); + const { httpClient: v1Client, ...restOptions } = pipeline.options; let httpClient = pipeline._coreHttpClient; if (!httpClient) { - httpClient = v1Client ? coreHttpCompat.convertHttpClient(v1Client) : getCachedDefaultHttpClient(); + httpClient = v1Client ? (0, core_http_compat_1.convertHttpClient)(v1Client) : (0, storage_common_1.getCachedDefaultHttpClient)(); pipeline._coreHttpClient = httpClient; } let corePipeline = pipeline._corePipeline; if (!corePipeline) { - const packageDetails = `azsdk-js-azure-storage-blob/${SDK_VERSION}`; + 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 = coreClient.createClientPipeline(Object.assign(Object.assign({}, restOptions), { loggingOptions: { - additionalAllowedHeaderNames: StorageBlobLoggingAllowedHeaderNames, - additionalAllowedQueryParameters: StorageBlobLoggingAllowedQueryParameters, - logger: logger.info - }, userAgentOptions: { - userAgentPrefix - }, serializationOptions: { - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - // Use customized XML char key of "#" so we can deserialize metadata - // with "_" key - xmlCharKey: "#" + 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: coreXml.parseXML, - 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: coreRestPipeline.decompressResponsePolicyName }); - corePipeline.addPolicy(storageCorrectContentLengthPolicy()); - corePipeline.addPolicy(storageRetryPolicy(restOptions.retryOptions), { phase: "Retry" }); - corePipeline.addPolicy(storageBrowserPolicy()); + 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(pipeline); if (downlevelResults) { corePipeline.addPolicy(downlevelResults.wrappedPolicies, downlevelResults.afterRetry ? { afterPhase: "Retry" } : void 0); } const credential = getCredentialFromPipeline(pipeline); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ + if ((0, core_auth_1.isTokenCredential)(credential)) { + corePipeline.addPolicy((0, core_rest_pipeline_1.bearerTokenAuthenticationPolicy)({ credential, - scopes: (_a = restOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } + scopes: restOptions.audience ?? constants_js_1.StorageOAuthScopes, + challengeCallbacks: { authorizeRequestOnChallenge: core_client_1.authorizeRequestOnTenantChallenge } }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ + } else if (credential instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { + corePipeline.addPolicy((0, StorageSharedKeyCredentialPolicyV2_js_1.storageSharedKeyCredentialPolicy)({ accountName: credential.accountName, accountKey: credential.accountKey }), { phase: "Sign" }); } pipeline._corePipeline = corePipeline; } - return Object.assign(Object.assign({}, restOptions), { allowInsecureConnection: true, httpClient, pipeline: corePipeline }); + return { + ...restOptions, + allowInsecureConnection: true, + httpClient, + pipeline: corePipeline + }; } function getCredentialFromPipeline(pipeline) { if (pipeline._credential) { return pipeline._credential; } - let credential = new AnonymousCredential(); + let credential = new AnonymousCredential_js_1.AnonymousCredential(); for (const factory of pipeline.factories) { - if (coreAuth.isTokenCredential(factory.credential)) { + if ((0, core_auth_1.isTokenCredential)(factory.credential)) { credential = factory.credential; } else if (isStorageSharedKeyCredential(factory)) { return factory; @@ -47297,28 +50446,28 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return credential; } function isStorageSharedKeyCredential(factory) { - if (factory instanceof StorageSharedKeyCredential) { + if (factory instanceof StorageSharedKeyCredential_js_1.StorageSharedKeyCredential) { return true; } return factory.constructor.name === "StorageSharedKeyCredential"; } function isAnonymousCredential(factory) { - if (factory instanceof AnonymousCredential) { + if (factory instanceof AnonymousCredential_js_1.AnonymousCredential) { return true; } return factory.constructor.name === "AnonymousCredential"; } function isCoreHttpBearerTokenFactory(factory) { - return coreAuth.isTokenCredential(factory.credential); + return (0, core_auth_1.isTokenCredential)(factory.credential); } function isStorageBrowserPolicyFactory(factory) { - if (factory instanceof StorageBrowserPolicyFactory) { + if (factory instanceof StorageBrowserPolicyFactory_js_1.StorageBrowserPolicyFactory) { return true; } return factory.constructor.name === "StorageBrowserPolicyFactory"; } function isStorageRetryPolicyFactory(factory) { - if (factory instanceof StorageRetryPolicyFactory) { + if (factory instanceof StorageRetryPolicyFactory_js_1.StorageRetryPolicyFactory) { return true; } return factory.constructor.name === "StorageRetryPolicyFactory"; @@ -47361,7 +50510,160 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; return policyName.startsWith(knownPolicyName); }); } - var BlobServiceProperties = { + } +}); + +// 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: { @@ -47433,7 +50735,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Logging = { + exports2.Logging = { serializedName: "Logging", type: { name: "Composite", @@ -47482,7 +50784,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var RetentionPolicy = { + exports2.RetentionPolicy = { serializedName: "RetentionPolicy", type: { name: "Composite", @@ -47509,7 +50811,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Metrics = { + exports2.Metrics = { serializedName: "Metrics", type: { name: "Composite", @@ -47548,7 +50850,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var CorsRule = { + exports2.CorsRule = { serializedName: "CorsRule", type: { name: "Composite", @@ -47600,7 +50902,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var StaticWebsite = { + exports2.StaticWebsite = { serializedName: "StaticWebsite", type: { name: "Composite", @@ -47638,7 +50940,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var StorageError = { + exports2.StorageError = { serializedName: "StorageError", type: { name: "Composite", @@ -47651,6 +50953,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -47668,7 +50991,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobServiceStatistics = { + exports2.BlobServiceStatistics = { serializedName: "BlobServiceStatistics", xmlName: "StorageServiceStats", type: { @@ -47686,7 +51009,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var GeoReplication = { + exports2.GeoReplication = { serializedName: "GeoReplication", type: { name: "Composite", @@ -47712,7 +51035,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListContainersSegmentResponse = { + exports2.ListContainersSegmentResponse = { serializedName: "ListContainersSegmentResponse", xmlName: "EnumerationResults", type: { @@ -47775,7 +51098,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerItem = { + exports2.ContainerItem = { serializedName: "ContainerItem", xmlName: "Container", type: { @@ -47823,7 +51146,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerProperties = { + exports2.ContainerProperties = { serializedName: "ContainerProperties", type: { name: "Composite", @@ -47935,7 +51258,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var KeyInfo = { + exports2.KeyInfo = { serializedName: "KeyInfo", type: { name: "Composite", @@ -47960,7 +51283,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var UserDelegationKey = { + exports2.UserDelegationKey = { serializedName: "UserDelegationKey", type: { name: "Composite", @@ -48025,7 +51348,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobSegment = { + exports2.FilterBlobSegment = { serializedName: "FilterBlobSegment", xmlName: "EnumerationResults", type: { @@ -48075,7 +51398,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var FilterBlobItem = { + exports2.FilterBlobItem = { serializedName: "FilterBlobItem", xmlName: "Blob", type: { @@ -48109,7 +51432,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobTags = { + exports2.BlobTags = { serializedName: "BlobTags", xmlName: "Tags", type: { @@ -48135,7 +51458,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobTag = { + exports2.BlobTag = { serializedName: "BlobTag", xmlName: "Tag", type: { @@ -48161,7 +51484,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var SignedIdentifier = { + exports2.SignedIdentifier = { serializedName: "SignedIdentifier", xmlName: "SignedIdentifier", type: { @@ -48187,7 +51510,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AccessPolicy = { + exports2.AccessPolicy = { serializedName: "AccessPolicy", type: { name: "Composite", @@ -48217,7 +51540,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsFlatSegmentResponse = { + exports2.ListBlobsFlatSegmentResponse = { serializedName: "ListBlobsFlatSegmentResponse", xmlName: "EnumerationResults", type: { @@ -48281,7 +51604,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobFlatListSegment = { + exports2.BlobFlatListSegment = { serializedName: "BlobFlatListSegment", xmlName: "Blobs", type: { @@ -48306,7 +51629,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobItemInternal = { + exports2.BlobItemInternal = { serializedName: "BlobItemInternal", xmlName: "Blob", type: { @@ -48393,7 +51716,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobName = { + exports2.BlobName = { serializedName: "BlobName", type: { name: "Composite", @@ -48418,7 +51741,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPropertiesInternal = { + exports2.BlobPropertiesInternal = { serializedName: "BlobPropertiesInternal", xmlName: "Properties", type: { @@ -48745,7 +52068,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ListBlobsHierarchySegmentResponse = { + exports2.ListBlobsHierarchySegmentResponse = { serializedName: "ListBlobsHierarchySegmentResponse", xmlName: "EnumerationResults", type: { @@ -48816,7 +52139,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobHierarchyListSegment = { + exports2.BlobHierarchyListSegment = { serializedName: "BlobHierarchyListSegment", xmlName: "Blobs", type: { @@ -48855,7 +52178,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobPrefix = { + exports2.BlobPrefix = { serializedName: "BlobPrefix", type: { name: "Composite", @@ -48872,7 +52195,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockLookupList = { + exports2.BlockLookupList = { serializedName: "BlockLookupList", xmlName: "BlockList", type: { @@ -48921,7 +52244,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlockList = { + exports2.BlockList = { serializedName: "BlockList", type: { name: "Composite", @@ -48960,7 +52283,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var Block = { + exports2.Block = { serializedName: "Block", type: { name: "Composite", @@ -48985,7 +52308,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageList = { + exports2.PageList = { serializedName: "PageList", type: { name: "Composite", @@ -49029,7 +52352,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageRange = { + exports2.PageRange = { serializedName: "PageRange", xmlName: "PageRange", type: { @@ -49055,7 +52378,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ClearRange = { + exports2.ClearRange = { serializedName: "ClearRange", xmlName: "ClearRange", type: { @@ -49081,7 +52404,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QueryRequest = { + exports2.QueryRequest = { serializedName: "QueryRequest", xmlName: "QueryRequest", type: { @@ -49123,7 +52446,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QuerySerialization = { + exports2.QuerySerialization = { serializedName: "QuerySerialization", type: { name: "Composite", @@ -49140,7 +52463,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var QueryFormat = { + exports2.QueryFormat = { serializedName: "QueryFormat", type: { name: "Composite", @@ -49190,7 +52513,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var DelimitedTextConfiguration = { + exports2.DelimitedTextConfiguration = { serializedName: "DelimitedTextConfiguration", xmlName: "DelimitedTextConfiguration", type: { @@ -49235,7 +52558,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var JsonTextConfiguration = { + exports2.JsonTextConfiguration = { serializedName: "JsonTextConfiguration", xmlName: "JsonTextConfiguration", type: { @@ -49252,7 +52575,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ArrowConfiguration = { + exports2.ArrowConfiguration = { serializedName: "ArrowConfiguration", xmlName: "ArrowConfiguration", type: { @@ -49278,7 +52601,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ArrowField = { + exports2.ArrowField = { serializedName: "ArrowField", xmlName: "Field", type: { @@ -49317,7 +52640,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesHeaders = { + exports2.ServiceSetPropertiesHeaders = { serializedName: "Service_setPropertiesHeaders", type: { name: "Composite", @@ -49354,7 +52677,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSetPropertiesExceptionHeaders = { + exports2.ServiceSetPropertiesExceptionHeaders = { serializedName: "Service_setPropertiesExceptionHeaders", type: { name: "Composite", @@ -49370,7 +52693,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesHeaders = { + exports2.ServiceGetPropertiesHeaders = { serializedName: "Service_getPropertiesHeaders", type: { name: "Composite", @@ -49407,7 +52730,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetPropertiesExceptionHeaders = { + exports2.ServiceGetPropertiesExceptionHeaders = { serializedName: "Service_getPropertiesExceptionHeaders", type: { name: "Composite", @@ -49423,7 +52746,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsHeaders = { + exports2.ServiceGetStatisticsHeaders = { serializedName: "Service_getStatisticsHeaders", type: { name: "Composite", @@ -49467,7 +52790,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetStatisticsExceptionHeaders = { + exports2.ServiceGetStatisticsExceptionHeaders = { serializedName: "Service_getStatisticsExceptionHeaders", type: { name: "Composite", @@ -49483,7 +52806,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentHeaders = { + exports2.ServiceListContainersSegmentHeaders = { serializedName: "Service_listContainersSegmentHeaders", type: { name: "Composite", @@ -49520,7 +52843,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceListContainersSegmentExceptionHeaders = { + exports2.ServiceListContainersSegmentExceptionHeaders = { serializedName: "Service_listContainersSegmentExceptionHeaders", type: { name: "Composite", @@ -49536,7 +52859,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyHeaders = { + exports2.ServiceGetUserDelegationKeyHeaders = { serializedName: "Service_getUserDelegationKeyHeaders", type: { name: "Composite", @@ -49580,7 +52903,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetUserDelegationKeyExceptionHeaders = { + exports2.ServiceGetUserDelegationKeyExceptionHeaders = { serializedName: "Service_getUserDelegationKeyExceptionHeaders", type: { name: "Composite", @@ -49596,7 +52919,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoHeaders = { + exports2.ServiceGetAccountInfoHeaders = { serializedName: "Service_getAccountInfoHeaders", type: { name: "Composite", @@ -49675,7 +52998,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceGetAccountInfoExceptionHeaders = { + exports2.ServiceGetAccountInfoExceptionHeaders = { serializedName: "Service_getAccountInfoExceptionHeaders", type: { name: "Composite", @@ -49691,7 +53014,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchHeaders = { + exports2.ServiceSubmitBatchHeaders = { serializedName: "Service_submitBatchHeaders", type: { name: "Composite", @@ -49735,7 +53058,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceSubmitBatchExceptionHeaders = { + exports2.ServiceSubmitBatchExceptionHeaders = { serializedName: "Service_submitBatchExceptionHeaders", type: { name: "Composite", @@ -49751,7 +53074,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsHeaders = { + exports2.ServiceFilterBlobsHeaders = { serializedName: "Service_filterBlobsHeaders", type: { name: "Composite", @@ -49795,7 +53118,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ServiceFilterBlobsExceptionHeaders = { + exports2.ServiceFilterBlobsExceptionHeaders = { serializedName: "Service_filterBlobsExceptionHeaders", type: { name: "Composite", @@ -49811,7 +53134,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateHeaders = { + exports2.ContainerCreateHeaders = { serializedName: "Container_createHeaders", type: { name: "Composite", @@ -49869,7 +53192,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerCreateExceptionHeaders = { + exports2.ContainerCreateExceptionHeaders = { serializedName: "Container_createExceptionHeaders", type: { name: "Composite", @@ -49885,7 +53208,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesHeaders = { + exports2.ContainerGetPropertiesHeaders = { serializedName: "Container_getPropertiesHeaders", type: { name: "Composite", @@ -50025,7 +53348,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetPropertiesExceptionHeaders = { + exports2.ContainerGetPropertiesExceptionHeaders = { serializedName: "Container_getPropertiesExceptionHeaders", type: { name: "Composite", @@ -50041,7 +53364,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteHeaders = { + exports2.ContainerDeleteHeaders = { serializedName: "Container_deleteHeaders", type: { name: "Composite", @@ -50085,7 +53408,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerDeleteExceptionHeaders = { + exports2.ContainerDeleteExceptionHeaders = { serializedName: "Container_deleteExceptionHeaders", type: { name: "Composite", @@ -50101,7 +53424,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataHeaders = { + exports2.ContainerSetMetadataHeaders = { serializedName: "Container_setMetadataHeaders", type: { name: "Composite", @@ -50159,7 +53482,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetMetadataExceptionHeaders = { + exports2.ContainerSetMetadataExceptionHeaders = { serializedName: "Container_setMetadataExceptionHeaders", type: { name: "Composite", @@ -50175,7 +53498,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyHeaders = { + exports2.ContainerGetAccessPolicyHeaders = { serializedName: "Container_getAccessPolicyHeaders", type: { name: "Composite", @@ -50241,7 +53564,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccessPolicyExceptionHeaders = { + exports2.ContainerGetAccessPolicyExceptionHeaders = { serializedName: "Container_getAccessPolicyExceptionHeaders", type: { name: "Composite", @@ -50257,7 +53580,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyHeaders = { + exports2.ContainerSetAccessPolicyHeaders = { serializedName: "Container_setAccessPolicyHeaders", type: { name: "Composite", @@ -50315,7 +53638,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSetAccessPolicyExceptionHeaders = { + exports2.ContainerSetAccessPolicyExceptionHeaders = { serializedName: "Container_setAccessPolicyExceptionHeaders", type: { name: "Composite", @@ -50331,7 +53654,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreHeaders = { + exports2.ContainerRestoreHeaders = { serializedName: "Container_restoreHeaders", type: { name: "Composite", @@ -50375,7 +53698,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRestoreExceptionHeaders = { + exports2.ContainerRestoreExceptionHeaders = { serializedName: "Container_restoreExceptionHeaders", type: { name: "Composite", @@ -50391,7 +53714,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameHeaders = { + exports2.ContainerRenameHeaders = { serializedName: "Container_renameHeaders", type: { name: "Composite", @@ -50435,7 +53758,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenameExceptionHeaders = { + exports2.ContainerRenameExceptionHeaders = { serializedName: "Container_renameExceptionHeaders", type: { name: "Composite", @@ -50451,7 +53774,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchHeaders = { + exports2.ContainerSubmitBatchHeaders = { serializedName: "Container_submitBatchHeaders", type: { name: "Composite", @@ -50481,7 +53804,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerSubmitBatchExceptionHeaders = { + exports2.ContainerSubmitBatchExceptionHeaders = { serializedName: "Container_submitBatchExceptionHeaders", type: { name: "Composite", @@ -50497,7 +53820,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsHeaders = { + exports2.ContainerFilterBlobsHeaders = { serializedName: "Container_filterBlobsHeaders", type: { name: "Composite", @@ -50534,7 +53857,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerFilterBlobsExceptionHeaders = { + exports2.ContainerFilterBlobsExceptionHeaders = { serializedName: "Container_filterBlobsExceptionHeaders", type: { name: "Composite", @@ -50550,7 +53873,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseHeaders = { + exports2.ContainerAcquireLeaseHeaders = { serializedName: "Container_acquireLeaseHeaders", type: { name: "Composite", @@ -50608,7 +53931,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerAcquireLeaseExceptionHeaders = { + exports2.ContainerAcquireLeaseExceptionHeaders = { serializedName: "Container_acquireLeaseExceptionHeaders", type: { name: "Composite", @@ -50624,7 +53947,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseHeaders = { + exports2.ContainerReleaseLeaseHeaders = { serializedName: "Container_releaseLeaseHeaders", type: { name: "Composite", @@ -50675,7 +53998,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerReleaseLeaseExceptionHeaders = { + exports2.ContainerReleaseLeaseExceptionHeaders = { serializedName: "Container_releaseLeaseExceptionHeaders", type: { name: "Composite", @@ -50691,7 +54014,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseHeaders = { + exports2.ContainerRenewLeaseHeaders = { serializedName: "Container_renewLeaseHeaders", type: { name: "Composite", @@ -50749,7 +54072,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerRenewLeaseExceptionHeaders = { + exports2.ContainerRenewLeaseExceptionHeaders = { serializedName: "Container_renewLeaseExceptionHeaders", type: { name: "Composite", @@ -50765,7 +54088,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseHeaders = { + exports2.ContainerBreakLeaseHeaders = { serializedName: "Container_breakLeaseHeaders", type: { name: "Composite", @@ -50823,7 +54146,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerBreakLeaseExceptionHeaders = { + exports2.ContainerBreakLeaseExceptionHeaders = { serializedName: "Container_breakLeaseExceptionHeaders", type: { name: "Composite", @@ -50839,7 +54162,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseHeaders = { + exports2.ContainerChangeLeaseHeaders = { serializedName: "Container_changeLeaseHeaders", type: { name: "Composite", @@ -50897,7 +54220,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerChangeLeaseExceptionHeaders = { + exports2.ContainerChangeLeaseExceptionHeaders = { serializedName: "Container_changeLeaseExceptionHeaders", type: { name: "Composite", @@ -50913,7 +54236,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentHeaders = { + exports2.ContainerListBlobFlatSegmentHeaders = { serializedName: "Container_listBlobFlatSegmentHeaders", type: { name: "Composite", @@ -50964,7 +54287,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobFlatSegmentExceptionHeaders = { + exports2.ContainerListBlobFlatSegmentExceptionHeaders = { serializedName: "Container_listBlobFlatSegmentExceptionHeaders", type: { name: "Composite", @@ -50980,7 +54303,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentHeaders = { + exports2.ContainerListBlobHierarchySegmentHeaders = { serializedName: "Container_listBlobHierarchySegmentHeaders", type: { name: "Composite", @@ -51031,7 +54354,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerListBlobHierarchySegmentExceptionHeaders = { + exports2.ContainerListBlobHierarchySegmentExceptionHeaders = { serializedName: "Container_listBlobHierarchySegmentExceptionHeaders", type: { name: "Composite", @@ -51047,7 +54370,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoHeaders = { + exports2.ContainerGetAccountInfoHeaders = { serializedName: "Container_getAccountInfoHeaders", type: { name: "Composite", @@ -51119,7 +54442,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var ContainerGetAccountInfoExceptionHeaders = { + exports2.ContainerGetAccountInfoExceptionHeaders = { serializedName: "Container_getAccountInfoExceptionHeaders", type: { name: "Composite", @@ -51135,7 +54458,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadHeaders = { + exports2.BlobDownloadHeaders = { serializedName: "Blob_downloadHeaders", type: { name: "Composite", @@ -51475,7 +54798,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDownloadExceptionHeaders = { + exports2.BlobDownloadExceptionHeaders = { serializedName: "Blob_downloadExceptionHeaders", type: { name: "Composite", @@ -51491,7 +54814,7 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetPropertiesHeaders = { + exports2.BlobGetPropertiesHeaders = { serializedName: "Blob_getPropertiesHeaders", type: { name: "Composite", @@ -51722,132 +55045,588 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - acceptRanges: { - serializedName: "accept-ranges", - xmlName: "accept-ranges", + 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" } - }, - blobCommittedBlockCount: { - serializedName: "x-ms-blob-committed-block-count", - xmlName: "x-ms-blob-committed-block-count", + } + } + } + }; + exports2.BlobSetHttpHeadersExceptionHeaders = { + serializedName: "Blob_setHttpHeadersExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetHttpHeadersExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Number" + name: "String" } - }, - isServerEncrypted: { - serializedName: "x-ms-server-encrypted", - xmlName: "x-ms-server-encrypted", + } + } + } + }; + 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: "Boolean" + name: "String" } }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - accessTier: { - serializedName: "x-ms-access-tier", - xmlName: "x-ms-access-tier", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "String" + name: "DateTimeRfc1123" } }, - accessTierInferred: { - serializedName: "x-ms-access-tier-inferred", - xmlName: "x-ms-access-tier-inferred", + immutabilityPolicyExpiry: { + serializedName: "x-ms-immutability-policy-until-date", + xmlName: "x-ms-immutability-policy-until-date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, - archiveStatus: { - serializedName: "x-ms-archive-status", - xmlName: "x-ms-archive-status", + immutabilityPolicyMode: { + serializedName: "x-ms-immutability-policy-mode", + xmlName: "x-ms-immutability-policy-mode", type: { - name: "String" + name: "Enum", + allowedValues: ["Mutable", "Unlocked", "Locked"] } - }, - accessTierChangedOn: { - serializedName: "x-ms-access-tier-change-time", - xmlName: "x-ms-access-tier-change-time", + } + } + } + }; + exports2.BlobSetImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + type: { + name: "Composite", + className: "BlobSetImmutabilityPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } - }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", + } + } + } + }; + 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" } }, - isCurrentVersion: { - serializedName: "x-ms-is-current-version", - xmlName: "x-ms-is-current-version", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "Boolean" + name: "String" } }, - tagCount: { - serializedName: "x-ms-tag-count", - xmlName: "x-ms-tag-count", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "Number" + name: "String" } }, - expiresOn: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", + date: { + serializedName: "date", + xmlName: "date", type: { name: "DateTimeRfc1123" } - }, - isSealed: { - serializedName: "x-ms-blob-sealed", - xmlName: "x-ms-blob-sealed", + } + } + } + }; + exports2.BlobDeleteImmutabilityPolicyExceptionHeaders = { + serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + type: { + name: "Composite", + className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + modelProperties: { + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } - }, - rehydratePriority: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", + } + } + } + }; + 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: "Enum", - allowedValues: ["High", "Standard"] + name: "String" } }, - lastAccessed: { - serializedName: "x-ms-last-access-time", - xmlName: "x-ms-last-access-time", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyExpiresOn: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { - name: "DateTimeRfc1123" + name: "String" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + name: "DateTimeRfc1123" } }, legalHold: { @@ -51856,22 +55635,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "Boolean" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var BlobGetPropertiesExceptionHeaders = { - serializedName: "Blob_getPropertiesExceptionHeaders", + exports2.BlobSetLegalHoldExceptionHeaders = { + serializedName: "Blob_setLegalHoldExceptionHeaders", type: { name: "Composite", - className: "BlobGetPropertiesExceptionHeaders", + className: "BlobSetLegalHoldExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51883,12 +55655,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteHeaders = { - serializedName: "Blob_deleteHeaders", + exports2.BlobSetMetadataHeaders = { + serializedName: "Blob_setMetadataHeaders", type: { name: "Composite", - className: "BlobDeleteHeaders", + 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", @@ -51910,6 +55696,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -51917,6 +55710,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -51927,11 +55741,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteExceptionHeaders = { - serializedName: "Blob_deleteExceptionHeaders", + exports2.BlobSetMetadataExceptionHeaders = { + serializedName: "Blob_setMetadataExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteExceptionHeaders", + className: "BlobSetMetadataExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -51943,12 +55757,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobUndeleteHeaders = { - serializedName: "Blob_undeleteHeaders", + exports2.BlobAcquireLeaseHeaders = { + serializedName: "Blob_acquireLeaseHeaders", type: { name: "Composite", - className: "BlobUndeleteHeaders", + 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", @@ -51976,22 +55811,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var BlobUndeleteExceptionHeaders = { - serializedName: "Blob_undeleteExceptionHeaders", + exports2.BlobAcquireLeaseExceptionHeaders = { + serializedName: "Blob_acquireLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobUndeleteExceptionHeaders", + className: "BlobAcquireLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52003,11 +55831,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryHeaders = { - serializedName: "Blob_setExpiryHeaders", + exports2.BlobReleaseLeaseHeaders = { + serializedName: "Blob_releaseLeaseHeaders", type: { name: "Composite", - className: "BlobSetExpiryHeaders", + className: "BlobReleaseLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52054,11 +55882,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetExpiryExceptionHeaders = { - serializedName: "Blob_setExpiryExceptionHeaders", + exports2.BlobReleaseLeaseExceptionHeaders = { + serializedName: "Blob_releaseLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobSetExpiryExceptionHeaders", + className: "BlobReleaseLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52070,11 +55898,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetHttpHeadersHeaders = { - serializedName: "Blob_setHttpHeadersHeaders", + exports2.BlobRenewLeaseHeaders = { + serializedName: "Blob_renewLeaseHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersHeaders", + className: "BlobRenewLeaseHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52090,11 +55918,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + leaseId: { + serializedName: "x-ms-lease-id", + xmlName: "x-ms-lease-id", type: { - name: "Number" + name: "String" } }, clientRequestId: { @@ -52124,22 +55952,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } - }, - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } } } } }; - var BlobSetHttpHeadersExceptionHeaders = { - serializedName: "Blob_setHttpHeadersExceptionHeaders", + exports2.BlobRenewLeaseExceptionHeaders = { + serializedName: "Blob_renewLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobSetHttpHeadersExceptionHeaders", + className: "BlobRenewLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52151,12 +55972,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetImmutabilityPolicyHeaders = { - serializedName: "Blob_setImmutabilityPolicyHeaders", + exports2.BlobChangeLeaseHeaders = { + serializedName: "Blob_changeLeaseHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyHeaders", + 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", @@ -52171,6 +56006,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52184,30 +56026,89 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } }, - immutabilityPolicyExpiry: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { name: "DateTimeRfc1123" } }, - immutabilityPolicyMode: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", + leaseTime: { + serializedName: "x-ms-lease-time", + xmlName: "x-ms-lease-time", type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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" } } } } }; - var BlobSetImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_setImmutabilityPolicyExceptionHeaders", + exports2.BlobBreakLeaseExceptionHeaders = { + serializedName: "Blob_breakLeaseExceptionHeaders", type: { name: "Composite", - className: "BlobSetImmutabilityPolicyExceptionHeaders", + className: "BlobBreakLeaseExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52219,12 +56120,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobDeleteImmutabilityPolicyHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyHeaders", + exports2.BlobCreateSnapshotHeaders = { + serializedName: "Blob_createSnapshotHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyHeaders", + 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", @@ -52246,21 +56168,42 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobDeleteImmutabilityPolicyExceptionHeaders = { - serializedName: "Blob_deleteImmutabilityPolicyExceptionHeaders", + exports2.BlobCreateSnapshotExceptionHeaders = { + serializedName: "Blob_createSnapshotExceptionHeaders", type: { name: "Composite", - className: "BlobDeleteImmutabilityPolicyExceptionHeaders", + className: "BlobCreateSnapshotExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52272,12 +56215,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetLegalHoldHeaders = { - serializedName: "Blob_setLegalHoldHeaders", + exports2.BlobStartCopyFromURLHeaders = { + serializedName: "Blob_startCopyFromURLHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldHeaders", + 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", @@ -52299,28 +56256,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + 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: "DateTimeRfc1123" + name: "Enum", + allowedValues: ["pending", "success", "aborted", "failed"] } }, - legalHold: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobSetLegalHoldExceptionHeaders = { - serializedName: "Blob_setLegalHoldExceptionHeaders", + exports2.BlobStartCopyFromURLExceptionHeaders = { + serializedName: "Blob_startCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobSetLegalHoldExceptionHeaders", + className: "BlobStartCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52328,15 +56307,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobSetMetadataHeaders = { - serializedName: "Blob_setMetadataHeaders", + exports2.BlobCopyFromURLHeaders = { + serializedName: "Blob_copyFromURLHeaders", type: { name: "Composite", - className: "BlobSetMetadataHeaders", + className: "BlobCopyFromURLHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52387,20 +56380,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", + copyId: { + serializedName: "x-ms-copy-id", + xmlName: "x-ms-copy-id", type: { - name: "Boolean" + name: "String" } }, - encryptionKeySha256: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", + 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", @@ -52418,11 +56426,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetMetadataExceptionHeaders = { - serializedName: "Blob_setMetadataExceptionHeaders", + exports2.BlobCopyFromURLExceptionHeaders = { + serializedName: "Blob_copyFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobSetMetadataExceptionHeaders", + className: "BlobCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52430,37 +56438,30 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobAcquireLeaseHeaders = { - serializedName: "Blob_acquireLeaseHeaders", + exports2.BlobAbortCopyFromURLHeaders = { + serializedName: "Blob_abortCopyFromURLHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseHeaders", + className: "BlobAbortCopyFromURLHeaders", 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", @@ -52488,15 +56489,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobAcquireLeaseExceptionHeaders = { - serializedName: "Blob_acquireLeaseExceptionHeaders", + exports2.BlobAbortCopyFromURLExceptionHeaders = { + serializedName: "Blob_abortCopyFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobAcquireLeaseExceptionHeaders", + className: "BlobAbortCopyFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52508,26 +56516,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobReleaseLeaseHeaders = { - serializedName: "Blob_releaseLeaseHeaders", + exports2.BlobSetTierHeaders = { + serializedName: "Blob_setTierHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseHeaders", + className: "BlobSetTierHeaders", 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", @@ -52549,21 +56543,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - date: { - serializedName: "date", - xmlName: "date", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "DateTimeRfc1123" + name: "String" } } } } }; - var BlobReleaseLeaseExceptionHeaders = { - serializedName: "Blob_releaseLeaseExceptionHeaders", + exports2.BlobSetTierExceptionHeaders = { + serializedName: "Blob_setTierExceptionHeaders", type: { name: "Composite", - className: "BlobReleaseLeaseExceptionHeaders", + className: "BlobSetTierExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52575,33 +56569,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobRenewLeaseHeaders = { - serializedName: "Blob_renewLeaseHeaders", + exports2.BlobGetAccountInfoHeaders = { + serializedName: "Blob_getAccountInfoHeaders", type: { name: "Composite", - className: "BlobRenewLeaseHeaders", + className: "BlobGetAccountInfoHeaders", 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", @@ -52629,15 +56602,50 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobRenewLeaseExceptionHeaders = { - serializedName: "Blob_renewLeaseExceptionHeaders", + exports2.BlobGetAccountInfoExceptionHeaders = { + serializedName: "Blob_getAccountInfoExceptionHeaders", type: { name: "Composite", - className: "BlobRenewLeaseExceptionHeaders", + className: "BlobGetAccountInfoExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52649,12 +56657,49 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobChangeLeaseHeaders = { - serializedName: "Blob_changeLeaseHeaders", + exports2.BlobQueryHeaders = { + serializedName: "Blob_queryHeaders", type: { name: "Composite", - className: "BlobChangeLeaseHeaders", + 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", @@ -52662,13 +56707,129 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + 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", @@ -52683,16 +56844,16 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - leaseId: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - version: { - serializedName: "x-ms-version", - xmlName: "x-ms-version", + acceptRanges: { + serializedName: "accept-ranges", + xmlName: "accept-ranges", type: { name: "String" } @@ -52703,15 +56864,64 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobChangeLeaseExceptionHeaders = { - serializedName: "Blob_changeLeaseExceptionHeaders", + exports2.BlobQueryExceptionHeaders = { + serializedName: "Blob_queryExceptionHeaders", type: { name: "Composite", - className: "BlobChangeLeaseExceptionHeaders", + className: "BlobQueryExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52723,33 +56933,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobBreakLeaseHeaders = { - serializedName: "Blob_breakLeaseHeaders", + exports2.BlobGetTagsHeaders = { + serializedName: "Blob_getTagsHeaders", type: { name: "Composite", - className: "BlobBreakLeaseHeaders", + className: "BlobGetTagsHeaders", 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", @@ -52777,15 +56966,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "DateTimeRfc1123" } + }, + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", + type: { + name: "String" + } } } } }; - var BlobBreakLeaseExceptionHeaders = { - serializedName: "Blob_breakLeaseExceptionHeaders", + exports2.BlobGetTagsExceptionHeaders = { + serializedName: "Blob_getTagsExceptionHeaders", type: { name: "Composite", - className: "BlobBreakLeaseExceptionHeaders", + className: "BlobGetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52797,33 +56993,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotHeaders = { - serializedName: "Blob_createSnapshotHeaders", + exports2.BlobSetTagsHeaders = { + serializedName: "Blob_setTagsHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotHeaders", + className: "BlobSetTagsHeaders", 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", @@ -52845,25 +57020,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + xmlName: "date", type: { - name: "Boolean" + name: "DateTimeRfc1123" } }, errorCode: { @@ -52876,11 +57037,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCreateSnapshotExceptionHeaders = { - serializedName: "Blob_createSnapshotExceptionHeaders", + exports2.BlobSetTagsExceptionHeaders = { + serializedName: "Blob_setTagsExceptionHeaders", type: { name: "Composite", - className: "BlobCreateSnapshotExceptionHeaders", + className: "BlobSetTagsExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52892,11 +57053,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLHeaders = { - serializedName: "Blob_startCopyFromURLHeaders", + exports2.PageBlobCreateHeaders = { + serializedName: "PageBlob_createHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLHeaders", + className: "PageBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -52912,6 +57073,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -52947,19 +57115,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -52972,11 +57146,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobStartCopyFromURLExceptionHeaders = { - serializedName: "Blob_startCopyFromURLExceptionHeaders", + exports2.PageBlobCreateExceptionHeaders = { + serializedName: "PageBlob_createExceptionHeaders", type: { name: "Composite", - className: "BlobStartCopyFromURLExceptionHeaders", + className: "PageBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -52988,11 +57162,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLHeaders = { - serializedName: "Blob_copyFromURLHeaders", + exports2.PageBlobUploadPagesHeaders = { + serializedName: "PageBlob_uploadPagesHeaders", type: { name: "Composite", - className: "BlobCopyFromURLHeaders", + className: "PageBlobUploadPagesHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53008,6 +57182,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53029,13 +57224,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -53043,35 +57231,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + isServerEncrypted: { + serializedName: "x-ms-request-server-encrypted", + xmlName: "x-ms-request-server-encrypted", type: { - name: "String" + name: "Boolean" } }, - copyStatus: { - defaultValue: "success", - isConstant: true, - serializedName: "x-ms-copy-status", + encryptionKeySha256: { + serializedName: "x-ms-encryption-key-sha256", + xmlName: "x-ms-encryption-key-sha256", 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", @@ -53089,11 +57262,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobCopyFromURLExceptionHeaders = { - serializedName: "Blob_copyFromURLExceptionHeaders", + exports2.PageBlobUploadPagesExceptionHeaders = { + serializedName: "PageBlob_uploadPagesExceptionHeaders", type: { name: "Composite", - className: "BlobCopyFromURLExceptionHeaders", + className: "PageBlobUploadPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53105,12 +57278,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAbortCopyFromURLHeaders = { - serializedName: "Blob_abortCopyFromURLHeaders", + exports2.PageBlobClearPagesHeaders = { + serializedName: "PageBlob_clearPagesHeaders", type: { name: "Composite", - className: "BlobAbortCopyFromURLHeaders", + 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", @@ -53149,11 +57357,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobAbortCopyFromURLExceptionHeaders = { - serializedName: "Blob_abortCopyFromURLExceptionHeaders", + exports2.PageBlobClearPagesExceptionHeaders = { + serializedName: "PageBlob_clearPagesExceptionHeaders", type: { name: "Composite", - className: "BlobAbortCopyFromURLExceptionHeaders", + className: "PageBlobClearPagesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53165,19 +57373,47 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierHeaders = { - serializedName: "Blob_setTierHeaders", + exports2.PageBlobUploadPagesFromURLHeaders = { + serializedName: "PageBlob_uploadPagesFromURLHeaders", type: { name: "Composite", - className: "BlobSetTierHeaders", + className: "PageBlobUploadPagesFromURLHeaders", modelProperties: { - clientRequestId: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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", @@ -53192,6 +57428,34 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53202,11 +57466,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTierExceptionHeaders = { - serializedName: "Blob_setTierExceptionHeaders", + exports2.PageBlobUploadPagesFromURLExceptionHeaders = { + serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", type: { name: "Composite", - className: "BlobSetTierExceptionHeaders", + className: "PageBlobUploadPagesFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53214,16 +57478,51 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var BlobGetAccountInfoHeaders = { - serializedName: "Blob_getAccountInfoHeaders", + exports2.PageBlobGetPageRangesHeaders = { + serializedName: "PageBlob_getPageRangesHeaders", type: { name: "Composite", - className: "BlobGetAccountInfoHeaders", + 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", @@ -53252,49 +57551,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { - name: "Boolean" + name: "String" } } } } }; - var BlobGetAccountInfoExceptionHeaders = { - serializedName: "Blob_getAccountInfoExceptionHeaders", + exports2.PageBlobGetPageRangesExceptionHeaders = { + serializedName: "PageBlob_getPageRangesExceptionHeaders", type: { name: "Composite", - className: "BlobGetAccountInfoExceptionHeaders", + className: "PageBlobGetPageRangesExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53306,11 +57577,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobQueryHeaders = { - serializedName: "Blob_queryHeaders", + exports2.PageBlobGetPageRangesDiffHeaders = { + serializedName: "PageBlob_getPageRangesDiffHeaders", type: { name: "Composite", - className: "BlobQueryHeaders", + className: "PageBlobGetPageRangesDiffHeaders", modelProperties: { lastModified: { serializedName: "last-modified", @@ -53319,36 +57590,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53356,127 +57597,92 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", - type: { - name: "ByteArray" - } - }, - contentEncoding: { - serializedName: "content-encoding", - xmlName: "content-encoding", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "String" + name: "Number" } }, - cacheControl: { - serializedName: "cache-control", - xmlName: "cache-control", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { name: "String" } }, - contentDisposition: { - serializedName: "content-disposition", - xmlName: "content-disposition", + requestId: { + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - contentLanguage: { - serializedName: "content-language", - xmlName: "content-language", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", 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", + date: { + serializedName: "date", + xmlName: "date", 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", + errorCode: { + serializedName: "x-ms-error-code", + xmlName: "x-ms-error-code", type: { name: "String" } - }, - copyProgress: { - serializedName: "x-ms-copy-progress", - xmlName: "x-ms-copy-progress", + } + } + } + }; + 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" } - }, - copySource: { - serializedName: "x-ms-copy-source", - xmlName: "x-ms-copy-source", + } + } + } + }; + exports2.PageBlobResizeHeaders = { + serializedName: "PageBlob_resizeHeaders", + type: { + name: "Composite", + className: "PageBlobResizeHeaders", + modelProperties: { + etag: { + serializedName: "etag", + xmlName: "etag", 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", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Enum", - allowedValues: [ - "available", - "leased", - "expired", - "breaking", - "broken" - ] + name: "DateTimeRfc1123" } }, - leaseStatus: { - serializedName: "x-ms-lease-status", - xmlName: "x-ms-lease-status", + blobSequenceNumber: { + serializedName: "x-ms-blob-sequence-number", + xmlName: "x-ms-blob-sequence-number", type: { - name: "Enum", - allowedValues: ["locked", "unlocked"] + name: "Number" } }, clientRequestId: { @@ -53487,66 +57693,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } }, 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", + serializedName: "x-ms-request-id", + xmlName: "x-ms-request-id", type: { name: "String" } }, - encryptionScope: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", + version: { + serializedName: "x-ms-version", + xmlName: "x-ms-version", type: { name: "String" } }, - blobContentMD5: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", + date: { + serializedName: "date", + xmlName: "date", type: { - name: "ByteArray" + name: "DateTimeRfc1123" } }, errorCode: { @@ -53555,22 +57719,15 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; type: { name: "String" } - }, - contentCrc64: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } } } } }; - var BlobQueryExceptionHeaders = { - serializedName: "Blob_queryExceptionHeaders", + exports2.PageBlobResizeExceptionHeaders = { + serializedName: "PageBlob_resizeExceptionHeaders", type: { name: "Composite", - className: "BlobQueryExceptionHeaders", + className: "PageBlobResizeExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53582,12 +57739,33 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetTagsHeaders = { - serializedName: "Blob_getTagsHeaders", + exports2.PageBlobUpdateSequenceNumberHeaders = { + serializedName: "PageBlob_updateSequenceNumberHeaders", type: { name: "Composite", - className: "BlobGetTagsHeaders", + 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", @@ -53626,11 +57804,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobGetTagsExceptionHeaders = { - serializedName: "Blob_getTagsExceptionHeaders", + exports2.PageBlobUpdateSequenceNumberExceptionHeaders = { + serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", type: { name: "Composite", - className: "BlobGetTagsExceptionHeaders", + className: "PageBlobUpdateSequenceNumberExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53642,12 +57820,26 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTagsHeaders = { - serializedName: "Blob_setTagsHeaders", + exports2.PageBlobCopyIncrementalHeaders = { + serializedName: "PageBlob_copyIncrementalHeaders", type: { name: "Composite", - className: "BlobSetTagsHeaders", + 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", @@ -53676,6 +57868,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53686,11 +57893,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var BlobSetTagsExceptionHeaders = { - serializedName: "Blob_setTagsExceptionHeaders", + exports2.PageBlobCopyIncrementalExceptionHeaders = { + serializedName: "PageBlob_copyIncrementalExceptionHeaders", type: { name: "Composite", - className: "BlobSetTagsExceptionHeaders", + className: "PageBlobCopyIncrementalExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53702,11 +57909,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateHeaders = { - serializedName: "PageBlob_createHeaders", + exports2.AppendBlobCreateHeaders = { + serializedName: "AppendBlob_createHeaders", type: { name: "Composite", - className: "PageBlobCreateHeaders", + className: "AppendBlobCreateHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53795,11 +58002,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCreateExceptionHeaders = { - serializedName: "PageBlob_createExceptionHeaders", + exports2.AppendBlobCreateExceptionHeaders = { + serializedName: "AppendBlob_createExceptionHeaders", type: { name: "Composite", - className: "PageBlobCreateExceptionHeaders", + className: "AppendBlobCreateExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53811,11 +58018,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesHeaders = { - serializedName: "PageBlob_uploadPagesHeaders", + exports2.AppendBlobAppendBlockHeaders = { + serializedName: "AppendBlob_appendBlockHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesHeaders", + className: "AppendBlobAppendBlockHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53845,13 +58052,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53880,6 +58080,20 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53911,11 +58125,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUploadPagesExceptionHeaders = { - serializedName: "PageBlob_uploadPagesExceptionHeaders", + exports2.AppendBlobAppendBlockExceptionHeaders = { + serializedName: "AppendBlob_appendBlockExceptionHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesExceptionHeaders", + className: "AppendBlobAppendBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -53927,11 +58141,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobClearPagesHeaders = { - serializedName: "PageBlob_clearPagesHeaders", + exports2.AppendBlobAppendBlockFromUrlHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlHeaders", type: { name: "Composite", - className: "PageBlobClearPagesHeaders", + className: "AppendBlobAppendBlockFromUrlHeaders", modelProperties: { etag: { serializedName: "etag", @@ -53961,20 +58175,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -53996,6 +58196,41 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54006,11 +58241,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobClearPagesExceptionHeaders = { - serializedName: "PageBlob_clearPagesExceptionHeaders", + exports2.AppendBlobAppendBlockFromUrlExceptionHeaders = { + serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", type: { name: "Composite", - className: "PageBlobClearPagesExceptionHeaders", + className: "AppendBlobAppendBlockFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54018,15 +58253,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var PageBlobUploadPagesFromURLHeaders = { - serializedName: "PageBlob_uploadPagesFromURLHeaders", + exports2.AppendBlobSealHeaders = { + serializedName: "AppendBlob_sealHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesFromURLHeaders", + className: "AppendBlobSealHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54042,25 +58291,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + clientRequestId: { + serializedName: "x-ms-client-request-id", + xmlName: "x-ms-client-request-id", type: { - name: "Number" + name: "String" } }, requestId: { @@ -54084,42 +58319,21 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - isServerEncrypted: { - serializedName: "x-ms-request-server-encrypted", - xmlName: "x-ms-request-server-encrypted", + isSealed: { + serializedName: "x-ms-blob-sealed", + xmlName: "x-ms-blob-sealed", 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" - } } } } }; - var PageBlobUploadPagesFromURLExceptionHeaders = { - serializedName: "PageBlob_uploadPagesFromURLExceptionHeaders", + exports2.AppendBlobSealExceptionHeaders = { + serializedName: "AppendBlob_sealExceptionHeaders", type: { name: "Composite", - className: "PageBlobUploadPagesFromURLExceptionHeaders", + className: "AppendBlobSealExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54131,19 +58345,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesHeaders = { - serializedName: "PageBlob_getPageRangesHeaders", + exports2.BlockBlobUploadHeaders = { + serializedName: "BlockBlob_uploadHeaders", type: { name: "Composite", - className: "PageBlobGetPageRangesHeaders", + className: "BlockBlobUploadHeaders", modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, etag: { serializedName: "etag", xmlName: "etag", @@ -54151,11 +58358,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Number" + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, clientRequestId: { @@ -54179,6 +58393,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -54186,6 +58407,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54196,11 +58438,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesExceptionHeaders = { - serializedName: "PageBlob_getPageRangesExceptionHeaders", + exports2.BlockBlobUploadExceptionHeaders = { + serializedName: "BlockBlob_uploadExceptionHeaders", type: { name: "Composite", - className: "PageBlobGetPageRangesExceptionHeaders", + className: "BlockBlobUploadExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54212,19 +58454,12 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesDiffHeaders = { - serializedName: "PageBlob_getPageRangesDiffHeaders", + exports2.BlockBlobPutBlobFromUrlHeaders = { + serializedName: "BlockBlob_putBlobFromUrlHeaders", type: { name: "Composite", - className: "PageBlobGetPageRangesDiffHeaders", + className: "BlockBlobPutBlobFromUrlHeaders", modelProperties: { - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", - type: { - name: "DateTimeRfc1123" - } - }, etag: { serializedName: "etag", xmlName: "etag", @@ -54232,11 +58467,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - blobContentLength: { - serializedName: "x-ms-blob-content-length", - xmlName: "x-ms-blob-content-length", + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", type: { - name: "Number" + name: "DateTimeRfc1123" + } + }, + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", + type: { + name: "ByteArray" } }, clientRequestId: { @@ -54260,6 +58502,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -54267,6 +58516,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54277,11 +58547,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobGetPageRangesDiffExceptionHeaders = { - serializedName: "PageBlob_getPageRangesDiffExceptionHeaders", + exports2.BlockBlobPutBlobFromUrlExceptionHeaders = { + serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", type: { name: "Composite", - className: "PageBlobGetPageRangesDiffExceptionHeaders", + className: "BlockBlobPutBlobFromUrlExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54289,35 +58559,35 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var PageBlobResizeHeaders = { - serializedName: "PageBlob_resizeHeaders", + exports2.BlockBlobStageBlockHeaders = { + serializedName: "BlockBlob_stageBlockHeaders", type: { name: "Composite", - className: "PageBlobResizeHeaders", + className: "BlockBlobStageBlockHeaders", 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", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "Number" + name: "ByteArray" } }, clientRequestId: { @@ -54348,6 +58618,34 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54358,11 +58656,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobResizeExceptionHeaders = { - serializedName: "PageBlob_resizeExceptionHeaders", + exports2.BlockBlobStageBlockExceptionHeaders = { + serializedName: "BlockBlob_stageBlockExceptionHeaders", type: { name: "Composite", - className: "PageBlobResizeExceptionHeaders", + className: "BlockBlobStageBlockExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54374,31 +58672,24 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUpdateSequenceNumberHeaders = { - serializedName: "PageBlob_updateSequenceNumberHeaders", + exports2.BlockBlobStageBlockFromURLHeaders = { + serializedName: "BlockBlob_stageBlockFromURLHeaders", type: { name: "Composite", - className: "PageBlobUpdateSequenceNumberHeaders", + className: "BlockBlobStageBlockFromURLHeaders", modelProperties: { - etag: { - serializedName: "etag", - xmlName: "etag", - type: { - name: "String" - } - }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentMD5: { + serializedName: "content-md5", + xmlName: "content-md5", type: { - name: "DateTimeRfc1123" + name: "ByteArray" } }, - blobSequenceNumber: { - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", + xMsContentCrc64: { + serializedName: "x-ms-content-crc64", + xmlName: "x-ms-content-crc64", type: { - name: "Number" + name: "ByteArray" } }, clientRequestId: { @@ -54429,6 +58720,27 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", @@ -54439,11 +58751,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobUpdateSequenceNumberExceptionHeaders = { - serializedName: "PageBlob_updateSequenceNumberExceptionHeaders", + exports2.BlockBlobStageBlockFromURLExceptionHeaders = { + serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", type: { name: "Composite", - className: "PageBlobUpdateSequenceNumberExceptionHeaders", + className: "BlockBlobStageBlockFromURLExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54451,15 +58763,29 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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" + } } } } }; - var PageBlobCopyIncrementalHeaders = { - serializedName: "PageBlob_copyIncrementalHeaders", + exports2.BlockBlobCommitBlockListHeaders = { + serializedName: "BlockBlob_commitBlockListHeaders", type: { name: "Composite", - className: "PageBlobCopyIncrementalHeaders", + className: "BlockBlobCommitBlockListHeaders", modelProperties: { etag: { serializedName: "etag", @@ -54468,11 +58794,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + 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: "DateTimeRfc1123" + name: "ByteArray" } }, clientRequestId: { @@ -54496,6 +58836,13 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, + versionId: { + serializedName: "x-ms-version-id", + xmlName: "x-ms-version-id", + type: { + name: "String" + } + }, date: { serializedName: "date", xmlName: "date", @@ -54503,19 +58850,25 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "DateTimeRfc1123" } }, - copyId: { - serializedName: "x-ms-copy-id", - xmlName: "x-ms-copy-id", + 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" } }, - copyStatus: { - serializedName: "x-ms-copy-status", - xmlName: "x-ms-copy-status", + encryptionScope: { + serializedName: "x-ms-encryption-scope", + xmlName: "x-ms-encryption-scope", type: { - name: "Enum", - allowedValues: ["pending", "success", "aborted", "failed"] + name: "String" } }, errorCode: { @@ -54528,11 +58881,11 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var PageBlobCopyIncrementalExceptionHeaders = { - serializedName: "PageBlob_copyIncrementalExceptionHeaders", + exports2.BlockBlobCommitBlockListExceptionHeaders = { + serializedName: "BlockBlob_commitBlockListExceptionHeaders", type: { name: "Composite", - className: "PageBlobCopyIncrementalExceptionHeaders", + className: "BlockBlobCommitBlockListExceptionHeaders", modelProperties: { errorCode: { serializedName: "x-ms-error-code", @@ -54544,12 +58897,19 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobCreateHeaders = { - serializedName: "AppendBlob_createHeaders", + exports2.BlockBlobGetBlockListHeaders = { + serializedName: "BlockBlob_getBlockListHeaders", type: { name: "Composite", - className: "AppendBlobCreateHeaders", + className: "BlockBlobGetBlockListHeaders", modelProperties: { + lastModified: { + serializedName: "last-modified", + xmlName: "last-modified", + type: { + name: "DateTimeRfc1123" + } + }, etag: { serializedName: "etag", xmlName: "etag", @@ -54557,18 +58917,18 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - lastModified: { - serializedName: "last-modified", - xmlName: "last-modified", + contentType: { + serializedName: "content-type", + xmlName: "content-type", type: { - name: "DateTimeRfc1123" + name: "String" } }, - contentMD5: { - serializedName: "content-md5", - xmlName: "content-md5", + blobContentLength: { + serializedName: "x-ms-blob-content-length", + xmlName: "x-ms-blob-content-length", type: { - name: "ByteArray" + name: "Number" } }, clientRequestId: { @@ -54592,13 +58952,6 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; name: "String" } }, - versionId: { - serializedName: "x-ms-version-id", - xmlName: "x-ms-version-id", - type: { - name: "String" - } - }, date: { serializedName: "date", xmlName: "date", @@ -54606,27 +58959,22 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; 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", + 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", @@ -54637,1182 +58985,899 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var AppendBlobCreateExceptionHeaders = { - serializedName: "AppendBlob_createExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobCreateExceptionHeaders", - 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" } } }; - var 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.comp10 = { + parameterPath: "comp", + mapper: { + defaultValue: "lease", + isConstant: true, + serializedName: "comp", + type: { + name: "String" } } }; - var 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.action = { + parameterPath: "action", + mapper: { + defaultValue: "acquire", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.duration = { + parameterPath: ["options", "duration"], + mapper: { + serializedName: "x-ms-lease-duration", + xmlName: "x-ms-lease-duration", + type: { + name: "Number" } } }; - var AppendBlobAppendBlockFromUrlExceptionHeaders = { - serializedName: "AppendBlob_appendBlockFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "AppendBlobAppendBlockFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.proposedLeaseId = { + parameterPath: ["options", "proposedLeaseId"], + mapper: { + serializedName: "x-ms-proposed-lease-id", + xmlName: "x-ms-proposed-lease-id", + type: { + name: "String" } } }; - var 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.action1 = { + parameterPath: "action", + mapper: { + defaultValue: "release", + isConstant: true, + serializedName: "x-ms-lease-action", + type: { + name: "String" } } }; - var 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.leaseId1 = { + parameterPath: "leaseId", + mapper: { + serializedName: "x-ms-lease-id", + required: true, + xmlName: "x-ms-lease-id", + type: { + name: "String" } } }; - var 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", + 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: "String" + 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" + } } }; - var 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.snapshot = { + parameterPath: ["options", "snapshot"], + mapper: { + serializedName: "snapshot", + xmlName: "snapshot", + type: { + name: "String" } } }; - var 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.versionId = { + parameterPath: ["options", "versionId"], + mapper: { + serializedName: "versionid", + xmlName: "versionid", + type: { + name: "String" } } }; - var BlockBlobPutBlobFromUrlExceptionHeaders = { - serializedName: "BlockBlob_putBlobFromUrlExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobPutBlobFromUrlExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - type: { - name: "String" - } - } + exports2.range = { + parameterPath: ["options", "range"], + mapper: { + serializedName: "x-ms-range", + xmlName: "x-ms-range", + type: { + name: "String" } } }; - var 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.rangeGetContentMD5 = { + parameterPath: ["options", "rangeGetContentMD5"], + mapper: { + serializedName: "x-ms-range-get-content-md5", + xmlName: "x-ms-range-get-content-md5", + type: { + name: "Boolean" } } }; - var 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.rangeGetContentCRC64 = { + parameterPath: ["options", "rangeGetContentCRC64"], + mapper: { + serializedName: "x-ms-range-get-content-crc64", + xmlName: "x-ms-range-get-content-crc64", + type: { + name: "Boolean" } } }; - var 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.encryptionKey = { + parameterPath: ["options", "cpkInfo", "encryptionKey"], + mapper: { + serializedName: "x-ms-encryption-key", + xmlName: "x-ms-encryption-key", + type: { + name: "String" } } }; - var BlockBlobStageBlockFromURLExceptionHeaders = { - serializedName: "BlockBlob_stageBlockFromURLExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobStageBlockFromURLExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var 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.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" } } }; - var 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.blobCacheControl = { + parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], + mapper: { + serializedName: "x-ms-blob-cache-control", + xmlName: "x-ms-blob-cache-control", + type: { + name: "String" } } }; - var 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.blobContentType = { + parameterPath: ["options", "blobHttpHeaders", "blobContentType"], + mapper: { + serializedName: "x-ms-blob-content-type", + xmlName: "x-ms-blob-content-type", + type: { + name: "String" } } }; - var BlockBlobGetBlockListExceptionHeaders = { - serializedName: "BlockBlob_getBlockListExceptionHeaders", - type: { - name: "Composite", - className: "BlockBlobGetBlockListExceptionHeaders", - modelProperties: { - errorCode: { - serializedName: "x-ms-error-code", - xmlName: "x-ms-error-code", - 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" } } }; - var Mappers = /* @__PURE__ */ Object.freeze({ - __proto__: null, - AccessPolicy, - AppendBlobAppendBlockExceptionHeaders, - AppendBlobAppendBlockFromUrlExceptionHeaders, - AppendBlobAppendBlockFromUrlHeaders, - AppendBlobAppendBlockHeaders, - AppendBlobCreateExceptionHeaders, - AppendBlobCreateHeaders, - AppendBlobSealExceptionHeaders, - AppendBlobSealHeaders, - ArrowConfiguration, - ArrowField, - BlobAbortCopyFromURLExceptionHeaders, - BlobAbortCopyFromURLHeaders, - BlobAcquireLeaseExceptionHeaders, - BlobAcquireLeaseHeaders, - BlobBreakLeaseExceptionHeaders, - BlobBreakLeaseHeaders, - BlobChangeLeaseExceptionHeaders, - BlobChangeLeaseHeaders, - BlobCopyFromURLExceptionHeaders, - BlobCopyFromURLHeaders, - BlobCreateSnapshotExceptionHeaders, - BlobCreateSnapshotHeaders, - BlobDeleteExceptionHeaders, - BlobDeleteHeaders, - BlobDeleteImmutabilityPolicyExceptionHeaders, - BlobDeleteImmutabilityPolicyHeaders, - BlobDownloadExceptionHeaders, - BlobDownloadHeaders, - BlobFlatListSegment, - BlobGetAccountInfoExceptionHeaders, - BlobGetAccountInfoHeaders, - BlobGetPropertiesExceptionHeaders, - BlobGetPropertiesHeaders, - BlobGetTagsExceptionHeaders, - BlobGetTagsHeaders, - BlobHierarchyListSegment, - BlobItemInternal, - BlobName, - BlobPrefix, - BlobPropertiesInternal, - BlobQueryExceptionHeaders, - BlobQueryHeaders, - BlobReleaseLeaseExceptionHeaders, - BlobReleaseLeaseHeaders, - BlobRenewLeaseExceptionHeaders, - BlobRenewLeaseHeaders, - BlobServiceProperties, - BlobServiceStatistics, - BlobSetExpiryExceptionHeaders, - BlobSetExpiryHeaders, - BlobSetHttpHeadersExceptionHeaders, - BlobSetHttpHeadersHeaders, - BlobSetImmutabilityPolicyExceptionHeaders, - BlobSetImmutabilityPolicyHeaders, - BlobSetLegalHoldExceptionHeaders, - BlobSetLegalHoldHeaders, - BlobSetMetadataExceptionHeaders, - BlobSetMetadataHeaders, - BlobSetTagsExceptionHeaders, - BlobSetTagsHeaders, - BlobSetTierExceptionHeaders, - BlobSetTierHeaders, - BlobStartCopyFromURLExceptionHeaders, - BlobStartCopyFromURLHeaders, - BlobTag, - BlobTags, - BlobUndeleteExceptionHeaders, - BlobUndeleteHeaders, - Block, - BlockBlobCommitBlockListExceptionHeaders, - BlockBlobCommitBlockListHeaders, - BlockBlobGetBlockListExceptionHeaders, - BlockBlobGetBlockListHeaders, - BlockBlobPutBlobFromUrlExceptionHeaders, - BlockBlobPutBlobFromUrlHeaders, - BlockBlobStageBlockExceptionHeaders, - BlockBlobStageBlockFromURLExceptionHeaders, - BlockBlobStageBlockFromURLHeaders, - BlockBlobStageBlockHeaders, - BlockBlobUploadExceptionHeaders, - BlockBlobUploadHeaders, - BlockList, - BlockLookupList, - ClearRange, - ContainerAcquireLeaseExceptionHeaders, - ContainerAcquireLeaseHeaders, - ContainerBreakLeaseExceptionHeaders, - ContainerBreakLeaseHeaders, - ContainerChangeLeaseExceptionHeaders, - ContainerChangeLeaseHeaders, - ContainerCreateExceptionHeaders, - ContainerCreateHeaders, - ContainerDeleteExceptionHeaders, - ContainerDeleteHeaders, - ContainerFilterBlobsExceptionHeaders, - ContainerFilterBlobsHeaders, - ContainerGetAccessPolicyExceptionHeaders, - ContainerGetAccessPolicyHeaders, - ContainerGetAccountInfoExceptionHeaders, - ContainerGetAccountInfoHeaders, - ContainerGetPropertiesExceptionHeaders, - ContainerGetPropertiesHeaders, - ContainerItem, - ContainerListBlobFlatSegmentExceptionHeaders, - ContainerListBlobFlatSegmentHeaders, - ContainerListBlobHierarchySegmentExceptionHeaders, - ContainerListBlobHierarchySegmentHeaders, - ContainerProperties, - ContainerReleaseLeaseExceptionHeaders, - ContainerReleaseLeaseHeaders, - ContainerRenameExceptionHeaders, - ContainerRenameHeaders, - ContainerRenewLeaseExceptionHeaders, - ContainerRenewLeaseHeaders, - ContainerRestoreExceptionHeaders, - ContainerRestoreHeaders, - ContainerSetAccessPolicyExceptionHeaders, - ContainerSetAccessPolicyHeaders, - ContainerSetMetadataExceptionHeaders, - ContainerSetMetadataHeaders, - ContainerSubmitBatchExceptionHeaders, - ContainerSubmitBatchHeaders, - CorsRule, - DelimitedTextConfiguration, - FilterBlobItem, - FilterBlobSegment, - GeoReplication, - JsonTextConfiguration, - KeyInfo, - ListBlobsFlatSegmentResponse, - ListBlobsHierarchySegmentResponse, - ListContainersSegmentResponse, - Logging, - Metrics, - PageBlobClearPagesExceptionHeaders, - PageBlobClearPagesHeaders, - PageBlobCopyIncrementalExceptionHeaders, - PageBlobCopyIncrementalHeaders, - PageBlobCreateExceptionHeaders, - PageBlobCreateHeaders, - PageBlobGetPageRangesDiffExceptionHeaders, - PageBlobGetPageRangesDiffHeaders, - PageBlobGetPageRangesExceptionHeaders, - PageBlobGetPageRangesHeaders, - PageBlobResizeExceptionHeaders, - PageBlobResizeHeaders, - PageBlobUpdateSequenceNumberExceptionHeaders, - PageBlobUpdateSequenceNumberHeaders, - PageBlobUploadPagesExceptionHeaders, - PageBlobUploadPagesFromURLExceptionHeaders, - PageBlobUploadPagesFromURLHeaders, - PageBlobUploadPagesHeaders, - PageList, - PageRange, - QueryFormat, - QueryRequest, - QuerySerialization, - RetentionPolicy, - ServiceFilterBlobsExceptionHeaders, - ServiceFilterBlobsHeaders, - ServiceGetAccountInfoExceptionHeaders, - ServiceGetAccountInfoHeaders, - ServiceGetPropertiesExceptionHeaders, - ServiceGetPropertiesHeaders, - ServiceGetStatisticsExceptionHeaders, - ServiceGetStatisticsHeaders, - ServiceGetUserDelegationKeyExceptionHeaders, - ServiceGetUserDelegationKeyHeaders, - ServiceListContainersSegmentExceptionHeaders, - ServiceListContainersSegmentHeaders, - ServiceSetPropertiesExceptionHeaders, - ServiceSetPropertiesHeaders, - ServiceSubmitBatchExceptionHeaders, - ServiceSubmitBatchHeaders, - SignedIdentifier, - StaticWebsite, - StorageError, - UserDelegationKey - }); - var contentType = { - parameterPath: ["options", "contentType"], + exports2.blobContentEncoding = { + parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Content-Type", + serializedName: "x-ms-blob-content-encoding", + xmlName: "x-ms-blob-content-encoding", type: { name: "String" } } }; - var blobServiceProperties = { - parameterPath: "blobServiceProperties", - mapper: BlobServiceProperties - }; - var accept = { - parameterPath: "accept", + exports2.blobContentLanguage = { + parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", + serializedName: "x-ms-blob-content-language", + xmlName: "x-ms-blob-content-language", type: { name: "String" } } }; - var url2 = { - parameterPath: "url", + exports2.blobContentDisposition = { + parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], mapper: { - serializedName: "url", - required: true, - xmlName: "url", + serializedName: "x-ms-blob-content-disposition", + xmlName: "x-ms-blob-content-disposition", type: { name: "String" } - }, - skipEncoding: true + } }; - var restype = { - parameterPath: "restype", + exports2.comp12 = { + parameterPath: "comp", mapper: { - defaultValue: "service", + defaultValue: "immutabilityPolicies", isConstant: true, - serializedName: "restype", + serializedName: "comp", type: { name: "String" } } }; - var comp = { + 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: "properties", + defaultValue: "legalhold", isConstant: true, serializedName: "comp", type: { @@ -55820,132 +59885,235 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var timeoutInSeconds = { - parameterPath: ["options", "timeoutInSeconds"], + exports2.legalHold = { + parameterPath: "legalHold", mapper: { - constraints: { - InclusiveMinimum: 0 - }, - serializedName: "timeout", - xmlName: "timeout", + serializedName: "x-ms-legal-hold", + required: true, + xmlName: "x-ms-legal-hold", type: { - name: "Number" + name: "Boolean" } } }; - var version = { - parameterPath: "version", + 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: "2024-11-04", + defaultValue: "snapshot", isConstant: true, - serializedName: "x-ms-version", + serializedName: "comp", type: { name: "String" } } }; - var requestId = { - parameterPath: ["options", "requestId"], + exports2.tier = { + parameterPath: ["options", "tier"], mapper: { - serializedName: "x-ms-client-request-id", - xmlName: "x-ms-client-request-id", + 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" } } }; - var accept1 = { - parameterPath: "accept", + exports2.sourceIfNoneMatch = { + parameterPath: [ + "options", + "sourceModifiedAccessConditions", + "sourceIfNoneMatch" + ], mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", + serializedName: "x-ms-source-if-none-match", + xmlName: "x-ms-source-if-none-match", type: { name: "String" } } }; - var comp1 = { - parameterPath: "comp", + exports2.sourceIfTags = { + parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], mapper: { - defaultValue: "stats", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-source-if-tags", + xmlName: "x-ms-source-if-tags", type: { name: "String" } } }; - var comp2 = { - parameterPath: "comp", + exports2.copySource = { + parameterPath: "copySource", mapper: { - defaultValue: "list", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { name: "String" } } }; - var prefix = { - parameterPath: ["options", "prefix"], + exports2.blobTagsString = { + parameterPath: ["options", "blobTagsString"], mapper: { - serializedName: "prefix", - xmlName: "prefix", + serializedName: "x-ms-tags", + xmlName: "x-ms-tags", type: { name: "String" } } }; - var marker = { - parameterPath: ["options", "marker"], + exports2.sealBlob = { + parameterPath: ["options", "sealBlob"], mapper: { - serializedName: "marker", - xmlName: "marker", + 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" } } }; - var maxPageSize = { - parameterPath: ["options", "maxPageSize"], + exports2.sourceContentMD5 = { + parameterPath: ["options", "sourceContentMD5"], mapper: { - constraints: { - InclusiveMinimum: 1 - }, - serializedName: "maxresults", - xmlName: "maxresults", + serializedName: "x-ms-source-content-md5", + xmlName: "x-ms-source-content-md5", type: { - name: "Number" + name: "ByteArray" } } }; - var include = { - parameterPath: ["options", "include"], + exports2.copySourceAuthorization = { + parameterPath: ["options", "copySourceAuthorization"], mapper: { - serializedName: "include", - xmlName: "include", - xmlElementName: "ListContainersIncludeType", + serializedName: "x-ms-copy-source-authorization", + xmlName: "x-ms-copy-source-authorization", type: { - name: "Sequence", - element: { - type: { - name: "Enum", - allowedValues: ["metadata", "deleted", "system"] - } - } + name: "String" } - }, - collectionFormat: "CSV" + } }; - var keyInfo = { - parameterPath: "keyInfo", - mapper: KeyInfo + 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" + } + } }; - var comp3 = { + exports2.comp15 = { parameterPath: "comp", mapper: { - defaultValue: "userdelegationkey", + defaultValue: "copy", isConstant: true, serializedName: "comp", type: { @@ -55953,32 +60121,32 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var restype1 = { - parameterPath: "restype", + exports2.copyActionAbortConstant = { + parameterPath: "copyActionAbortConstant", mapper: { - defaultValue: "account", + defaultValue: "abort", isConstant: true, - serializedName: "restype", + serializedName: "x-ms-copy-action", type: { name: "String" } } }; - var body = { - parameterPath: "body", + exports2.copyId = { + parameterPath: "copyId", mapper: { - serializedName: "body", + serializedName: "copyid", required: true, - xmlName: "body", + xmlName: "copyid", type: { - name: "Stream" + name: "String" } } }; - var comp4 = { + exports2.comp16 = { parameterPath: "comp", mapper: { - defaultValue: "batch", + defaultValue: "tier", isConstant: true, serializedName: "comp", type: { @@ -55986,32 +60154,53 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var contentLength = { - parameterPath: "contentLength", + exports2.tier1 = { + parameterPath: "tier", mapper: { - serializedName: "Content-Length", + serializedName: "x-ms-access-tier", required: true, - xmlName: "Content-Length", + xmlName: "x-ms-access-tier", type: { - name: "Number" + name: "Enum", + allowedValues: [ + "P4", + "P6", + "P10", + "P15", + "P20", + "P30", + "P40", + "P50", + "P60", + "P70", + "P80", + "Hot", + "Cool", + "Archive", + "Cold" + ] } } }; - var multipartContentType = { - parameterPath: "multipartContentType", + exports2.queryRequest = { + parameterPath: ["options", "queryRequest"], + mapper: mappers_js_1.QueryRequest + }; + exports2.comp17 = { + parameterPath: "comp", mapper: { - serializedName: "Content-Type", - required: true, - xmlName: "Content-Type", + defaultValue: "query", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - var comp5 = { + exports2.comp18 = { parameterPath: "comp", mapper: { - defaultValue: "blobs", + defaultValue: "tags", isConstant: true, serializedName: "comp", type: { @@ -56019,152 +60208,218 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var where = { - parameterPath: ["options", "where"], + exports2.tags = { + parameterPath: ["options", "tags"], + mapper: mappers_js_1.BlobTags + }; + exports2.transactionalContentMD5 = { + parameterPath: ["options", "transactionalContentMD5"], mapper: { - serializedName: "where", - xmlName: "where", + 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" } } }; - var restype2 = { - parameterPath: "restype", + exports2.blobContentLength = { + parameterPath: "blobContentLength", mapper: { - defaultValue: "container", + 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: "restype", + serializedName: "Content-Type", type: { name: "String" } } }; - var metadata = { - parameterPath: ["options", "metadata"], + exports2.body1 = { + parameterPath: "body", mapper: { - serializedName: "x-ms-meta", - xmlName: "x-ms-meta", - headerCollectionPrefix: "x-ms-meta-", + serializedName: "body", + required: true, + xmlName: "body", type: { - name: "Dictionary", - value: { type: { name: "String" } } + name: "Stream" } } }; - var access = { - parameterPath: ["options", "access"], + exports2.accept2 = { + parameterPath: "accept", mapper: { - serializedName: "x-ms-blob-public-access", - xmlName: "x-ms-blob-public-access", + defaultValue: "application/xml", + isConstant: true, + serializedName: "Accept", type: { - name: "Enum", - allowedValues: ["container", "blob"] + 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" } } }; - var defaultEncryptionScope = { + exports2.ifSequenceNumberLessThanOrEqualTo = { parameterPath: [ "options", - "containerEncryptionScope", - "defaultEncryptionScope" + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThanOrEqualTo" ], mapper: { - serializedName: "x-ms-default-encryption-scope", - xmlName: "x-ms-default-encryption-scope", + serializedName: "x-ms-if-sequence-number-le", + xmlName: "x-ms-if-sequence-number-le", type: { - name: "String" + name: "Number" } } }; - var preventEncryptionScopeOverride = { + exports2.ifSequenceNumberLessThan = { parameterPath: [ "options", - "containerEncryptionScope", - "preventEncryptionScopeOverride" + "sequenceNumberAccessConditions", + "ifSequenceNumberLessThan" ], mapper: { - serializedName: "x-ms-deny-encryption-scope-override", - xmlName: "x-ms-deny-encryption-scope-override", + serializedName: "x-ms-if-sequence-number-lt", + xmlName: "x-ms-if-sequence-number-lt", type: { - name: "Boolean" + name: "Number" } } }; - var leaseId = { - parameterPath: ["options", "leaseAccessConditions", "leaseId"], + exports2.ifSequenceNumberEqualTo = { + parameterPath: [ + "options", + "sequenceNumberAccessConditions", + "ifSequenceNumberEqualTo" + ], mapper: { - serializedName: "x-ms-lease-id", - xmlName: "x-ms-lease-id", + serializedName: "x-ms-if-sequence-number-eq", + xmlName: "x-ms-if-sequence-number-eq", type: { - name: "String" + name: "Number" } } }; - var ifModifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifModifiedSince"], + exports2.pageWrite1 = { + parameterPath: "pageWrite", mapper: { - serializedName: "If-Modified-Since", - xmlName: "If-Modified-Since", + defaultValue: "clear", + isConstant: true, + serializedName: "x-ms-page-write", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - var ifUnmodifiedSince = { - parameterPath: ["options", "modifiedAccessConditions", "ifUnmodifiedSince"], + exports2.sourceUrl = { + parameterPath: "sourceUrl", mapper: { - serializedName: "If-Unmodified-Since", - xmlName: "If-Unmodified-Since", + serializedName: "x-ms-copy-source", + required: true, + xmlName: "x-ms-copy-source", type: { - name: "DateTimeRfc1123" + name: "String" } } }; - var comp6 = { - parameterPath: "comp", + exports2.sourceRange = { + parameterPath: "sourceRange", mapper: { - defaultValue: "metadata", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-source-range", + required: true, + xmlName: "x-ms-source-range", type: { name: "String" } } }; - var comp7 = { - parameterPath: "comp", + exports2.sourceContentCrc64 = { + parameterPath: ["options", "sourceContentCrc64"], mapper: { - defaultValue: "acl", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-source-content-crc64", + xmlName: "x-ms-source-content-crc64", type: { - name: "String" + name: "ByteArray" } } }; - var containerAcl = { - parameterPath: ["options", "containerAcl"], + exports2.range1 = { + parameterPath: "range", mapper: { - serializedName: "containerAcl", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier", + serializedName: "x-ms-range", + required: true, + xmlName: "x-ms-range", type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SignedIdentifier" - } - } + name: "String" } } }; - var comp8 = { + exports2.comp20 = { parameterPath: "comp", mapper: { - defaultValue: "undelete", + defaultValue: "pagelist", isConstant: true, serializedName: "comp", type: { @@ -56172,62 +60427,64 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var deletedContainerName = { - parameterPath: ["options", "deletedContainerName"], + exports2.prevsnapshot = { + parameterPath: ["options", "prevsnapshot"], mapper: { - serializedName: "x-ms-deleted-container-name", - xmlName: "x-ms-deleted-container-name", + serializedName: "prevsnapshot", + xmlName: "prevsnapshot", type: { name: "String" } } }; - var deletedContainerVersion = { - parameterPath: ["options", "deletedContainerVersion"], + exports2.prevSnapshotUrl = { + parameterPath: ["options", "prevSnapshotUrl"], mapper: { - serializedName: "x-ms-deleted-container-version", - xmlName: "x-ms-deleted-container-version", + serializedName: "x-ms-previous-snapshot-url", + xmlName: "x-ms-previous-snapshot-url", type: { name: "String" } } }; - var comp9 = { - parameterPath: "comp", + exports2.sequenceNumberAction = { + parameterPath: "sequenceNumberAction", mapper: { - defaultValue: "rename", - isConstant: true, - serializedName: "comp", + serializedName: "x-ms-sequence-number-action", + required: true, + xmlName: "x-ms-sequence-number-action", type: { - name: "String" + name: "Enum", + allowedValues: ["max", "update", "increment"] } } }; - var sourceContainerName = { - parameterPath: "sourceContainerName", + exports2.comp21 = { + parameterPath: "comp", mapper: { - serializedName: "x-ms-source-container-name", - required: true, - xmlName: "x-ms-source-container-name", + defaultValue: "incrementalcopy", + isConstant: true, + serializedName: "comp", type: { name: "String" } } }; - var sourceLeaseId = { - parameterPath: ["options", "sourceLeaseId"], + exports2.blobType1 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-source-lease-id", - xmlName: "x-ms-source-lease-id", + defaultValue: "AppendBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var comp10 = { + exports2.comp22 = { parameterPath: "comp", mapper: { - defaultValue: "lease", + defaultValue: "appendblock", isConstant: true, serializedName: "comp", type: { @@ -56235,9496 +60492,12211 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; } } }; - var action = { - parameterPath: "action", + exports2.maxSize = { + parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], mapper: { - defaultValue: "acquire", - isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "x-ms-blob-condition-maxsize", + xmlName: "x-ms-blob-condition-maxsize", type: { - name: "String" + name: "Number" } } }; - var duration = { - parameterPath: ["options", "duration"], + exports2.appendPosition = { + parameterPath: [ + "options", + "appendPositionAccessConditions", + "appendPosition" + ], mapper: { - serializedName: "x-ms-lease-duration", - xmlName: "x-ms-lease-duration", + serializedName: "x-ms-blob-condition-appendpos", + xmlName: "x-ms-blob-condition-appendpos", type: { name: "Number" } } }; - var proposedLeaseId = { - parameterPath: ["options", "proposedLeaseId"], + exports2.sourceRange1 = { + parameterPath: ["options", "sourceRange"], mapper: { - serializedName: "x-ms-proposed-lease-id", - xmlName: "x-ms-proposed-lease-id", + serializedName: "x-ms-source-range", + xmlName: "x-ms-source-range", type: { name: "String" } } }; - var action1 = { - parameterPath: "action", + exports2.comp23 = { + parameterPath: "comp", mapper: { - defaultValue: "release", + defaultValue: "seal", isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "comp", type: { name: "String" } } }; - var leaseId1 = { - parameterPath: "leaseId", + exports2.blobType2 = { + parameterPath: "blobType", mapper: { - serializedName: "x-ms-lease-id", - required: true, - xmlName: "x-ms-lease-id", + defaultValue: "BlockBlob", + isConstant: true, + serializedName: "x-ms-blob-type", type: { name: "String" } } }; - var action2 = { - parameterPath: "action", + exports2.copySourceBlobProperties = { + parameterPath: ["options", "copySourceBlobProperties"], mapper: { - defaultValue: "renew", - isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "x-ms-copy-source-blob-properties", + xmlName: "x-ms-copy-source-blob-properties", type: { - name: "String" + name: "Boolean" } } }; - var action3 = { - parameterPath: "action", + exports2.comp24 = { + parameterPath: "comp", mapper: { - defaultValue: "break", + defaultValue: "block", isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "comp", type: { name: "String" } } }; - var breakPeriod = { - parameterPath: ["options", "breakPeriod"], + exports2.blockId = { + parameterPath: "blockId", mapper: { - serializedName: "x-ms-lease-break-period", - xmlName: "x-ms-lease-break-period", + serializedName: "blockid", + required: true, + xmlName: "blockid", type: { - name: "Number" + name: "String" } } }; - var action4 = { - parameterPath: "action", + exports2.blocks = { + parameterPath: "blocks", + mapper: mappers_js_1.BlockLookupList + }; + exports2.comp25 = { + parameterPath: "comp", mapper: { - defaultValue: "change", + defaultValue: "blocklist", isConstant: true, - serializedName: "x-ms-lease-action", + serializedName: "comp", type: { name: "String" } } }; - var proposedLeaseId1 = { - parameterPath: "proposedLeaseId", + exports2.listType = { + parameterPath: "listType", mapper: { - serializedName: "x-ms-proposed-lease-id", + defaultValue: "committed", + serializedName: "blocklisttype", required: true, - xmlName: "x-ms-proposed-lease-id", + xmlName: "blocklisttype", type: { - name: "String" + name: "Enum", + allowedValues: ["committed", "uncommitted", "all"] } } }; - var 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" - ] - } - } + } +}); + +// 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 } }, - collectionFormat: "CSV" + 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 delimiter = { - parameterPath: "delimiter", - mapper: { - serializedName: "delimiter", - required: true, - xmlName: "delimiter", - type: { - name: "String" + 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 snapshot = { - parameterPath: ["options", "snapshot"], - mapper: { - serializedName: "snapshot", - xmlName: "snapshot", - type: { - name: "String" + 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 versionId = { - parameterPath: ["options", "versionId"], - mapper: { - serializedName: "versionid", - xmlName: "versionid", - type: { - name: "String" + 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 range = { - parameterPath: ["options", "range"], - mapper: { - serializedName: "x-ms-range", - xmlName: "x-ms-range", - type: { - name: "String" + 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); } - }; - var rangeGetContentMD5 = { - parameterPath: ["options", "rangeGetContentMD5"], - mapper: { - serializedName: "x-ms-range-get-content-md5", - xmlName: "x-ms-range-get-content-md5", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var rangeGetContentCRC64 = { - parameterPath: ["options", "rangeGetContentCRC64"], - mapper: { - serializedName: "x-ms-range-get-content-crc64", - xmlName: "x-ms-range-get-content-crc64", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var encryptionKey = { - parameterPath: ["options", "cpkInfo", "encryptionKey"], - mapper: { - serializedName: "x-ms-encryption-key", - xmlName: "x-ms-encryption-key", - type: { - name: "String" - } + /** + * Restores a previously-deleted container. + * @param options The options parameters. + */ + restore(options) { + return this.client.sendOperationRequest({ options }, restoreOperationSpec); } - }; - var encryptionKeySha256 = { - parameterPath: ["options", "cpkInfo", "encryptionKeySha256"], - mapper: { - serializedName: "x-ms-encryption-key-sha256", - xmlName: "x-ms-encryption-key-sha256", - type: { - name: "String" - } + /** + * 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); } - }; - var encryptionAlgorithm = { - parameterPath: ["options", "cpkInfo", "encryptionAlgorithm"], - mapper: { - serializedName: "x-ms-encryption-algorithm", - xmlName: "x-ms-encryption-algorithm", - type: { - name: "String" - } + /** + * 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); } - }; - var ifMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifMatch"], - mapper: { - serializedName: "If-Match", - xmlName: "If-Match", - type: { - name: "String" - } + /** + * 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); } - }; - var ifNoneMatch = { - parameterPath: ["options", "modifiedAccessConditions", "ifNoneMatch"], - mapper: { - serializedName: "If-None-Match", - xmlName: "If-None-Match", - type: { - name: "String" - } + /** + * [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); } - }; - var ifTags = { - parameterPath: ["options", "modifiedAccessConditions", "ifTags"], - mapper: { - serializedName: "x-ms-if-tags", - xmlName: "x-ms-if-tags", - type: { - name: "String" - } + /** + * [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); } - }; - var deleteSnapshots = { - parameterPath: ["options", "deleteSnapshots"], - mapper: { - serializedName: "x-ms-delete-snapshots", - xmlName: "x-ms-delete-snapshots", - type: { - name: "Enum", - allowedValues: ["include", "only"] - } + /** + * [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); } - }; - var blobDeleteType = { - parameterPath: ["options", "blobDeleteType"], - mapper: { - serializedName: "deletetype", - xmlName: "deletetype", - type: { - name: "String" - } + /** + * [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); } - }; - var comp11 = { - parameterPath: "comp", - mapper: { - defaultValue: "expiry", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var expiryOptions = { - parameterPath: "expiryOptions", - mapper: { - serializedName: "x-ms-expiry-option", - required: true, - xmlName: "x-ms-expiry-option", - type: { - name: "String" - } + /** + * [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); } - }; - var expiresOn = { - parameterPath: ["options", "expiresOn"], - mapper: { - serializedName: "x-ms-expiry-time", - xmlName: "x-ms-expiry-time", - type: { - name: "String" - } + /** + * [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); } - }; - var blobCacheControl = { - parameterPath: ["options", "blobHttpHeaders", "blobCacheControl"], - mapper: { - serializedName: "x-ms-blob-cache-control", - xmlName: "x-ms-blob-cache-control", - type: { - name: "String" - } + /** + * Returns the sku name and account kind + * @param options The options parameters. + */ + getAccountInfo(options) { + return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); } }; - var blobContentType = { - parameterPath: ["options", "blobHttpHeaders", "blobContentType"], - mapper: { - serializedName: "x-ms-blob-content-type", - xmlName: "x-ms-blob-content-type", - type: { - name: "String" + 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 blobContentMD5 = { - parameterPath: ["options", "blobHttpHeaders", "blobContentMD5"], - mapper: { - serializedName: "x-ms-blob-content-md5", - xmlName: "x-ms-blob-content-md5", - type: { - name: "ByteArray" + 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 blobContentEncoding = { - parameterPath: ["options", "blobHttpHeaders", "blobContentEncoding"], - mapper: { - serializedName: "x-ms-blob-content-encoding", - xmlName: "x-ms-blob-content-encoding", - type: { - name: "String" + 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 blobContentLanguage = { - parameterPath: ["options", "blobHttpHeaders", "blobContentLanguage"], - mapper: { - serializedName: "x-ms-blob-content-language", - xmlName: "x-ms-blob-content-language", - type: { - name: "String" + 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 blobContentDisposition = { - parameterPath: ["options", "blobHttpHeaders", "blobContentDisposition"], - mapper: { - serializedName: "x-ms-blob-content-disposition", - xmlName: "x-ms-blob-content-disposition", - type: { - name: "String" + 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 comp12 = { - parameterPath: "comp", - mapper: { - defaultValue: "immutabilityPolicies", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 immutabilityPolicyExpiry = { - parameterPath: ["options", "immutabilityPolicyExpiry"], - mapper: { - serializedName: "x-ms-immutability-policy-until-date", - xmlName: "x-ms-immutability-policy-until-date", - type: { - name: "DateTimeRfc1123" + 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 immutabilityPolicyMode = { - parameterPath: ["options", "immutabilityPolicyMode"], - mapper: { - serializedName: "x-ms-immutability-policy-mode", - xmlName: "x-ms-immutability-policy-mode", - type: { - name: "Enum", - allowedValues: ["Mutable", "Unlocked", "Locked"] + 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 comp13 = { - parameterPath: "comp", - mapper: { - defaultValue: "legalhold", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 legalHold = { - parameterPath: "legalHold", - mapper: { - serializedName: "x-ms-legal-hold", - required: true, - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" + 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 encryptionScope = { - parameterPath: ["options", "encryptionScope"], - mapper: { - serializedName: "x-ms-encryption-scope", - xmlName: "x-ms-encryption-scope", - type: { - name: "String" + 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 comp14 = { - parameterPath: "comp", - mapper: { - defaultValue: "snapshot", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 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" - ] + 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 rehydratePriority = { - parameterPath: ["options", "rehydratePriority"], - mapper: { - serializedName: "x-ms-rehydrate-priority", - xmlName: "x-ms-rehydrate-priority", - type: { - name: "Enum", - allowedValues: ["High", "Standard"] + var breakLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 202: { + headersMapper: Mappers.ContainerBreakLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerBreakLeaseExceptionHeaders } - } - }; - var sourceIfModifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfModifiedSince" + }, + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - mapper: { - serializedName: "x-ms-source-if-modified-since", - xmlName: "x-ms-source-if-modified-since", - type: { - name: "DateTimeRfc1123" - } - } - }; - var sourceIfUnmodifiedSince = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfUnmodifiedSince" + urlParameters: [Parameters.url], + headerParameters: [ + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.action3, + Parameters.breakPeriod ], - mapper: { - serializedName: "x-ms-source-if-unmodified-since", - xmlName: "x-ms-source-if-unmodified-since", - type: { - name: "DateTimeRfc1123" - } - } + isXML: true, + serializer: xmlSerializer }; - var sourceIfMatch = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfMatch"], - mapper: { - serializedName: "x-ms-source-if-match", - xmlName: "x-ms-source-if-match", - type: { - name: "String" + var changeLeaseOperationSpec = { + path: "/{containerName}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.ContainerChangeLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.ContainerChangeLeaseExceptionHeaders } - } - }; - var sourceIfNoneMatch = { - parameterPath: [ - "options", - "sourceModifiedAccessConditions", - "sourceIfNoneMatch" + }, + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.restype2, + Parameters.comp10 ], - mapper: { - serializedName: "x-ms-source-if-none-match", - xmlName: "x-ms-source-if-none-match", - type: { - name: "String" - } - } + 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 sourceIfTags = { - parameterPath: ["options", "sourceModifiedAccessConditions", "sourceIfTags"], - mapper: { - serializedName: "x-ms-source-if-tags", - xmlName: "x-ms-source-if-tags", - type: { - name: "String" + 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 copySource = { - parameterPath: "copySource", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + 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 blobTagsString = { - parameterPath: ["options", "blobTagsString"], - mapper: { - serializedName: "x-ms-tags", - xmlName: "x-ms-tags", - type: { - name: "String" + 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 }; - var sealBlob = { - parameterPath: ["options", "sealBlob"], - mapper: { - serializedName: "x-ms-seal-blob", - xmlName: "x-ms-seal-blob", - type: { - name: "Boolean" - } + } +}); + +// 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; } - }; - var legalHold1 = { - parameterPath: ["options", "legalHold"], - mapper: { - serializedName: "x-ms-legal-hold", - xmlName: "x-ms-legal-hold", - type: { - name: "Boolean" - } + /** + * 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); } - }; - var xMsRequiresSync = { - parameterPath: "xMsRequiresSync", - mapper: { - defaultValue: "true", - isConstant: true, - serializedName: "x-ms-requires-sync", - type: { - name: "String" - } + /** + * 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); } - }; - var sourceContentMD5 = { - parameterPath: ["options", "sourceContentMD5"], - mapper: { - serializedName: "x-ms-source-content-md5", - xmlName: "x-ms-source-content-md5", - type: { - name: "ByteArray" - } + /** + * 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); } - }; - var copySourceAuthorization = { - parameterPath: ["options", "copySourceAuthorization"], - mapper: { - serializedName: "x-ms-copy-source-authorization", - xmlName: "x-ms-copy-source-authorization", - type: { - name: "String" - } + /** + * Undelete a blob that was previously soft deleted + * @param options The options parameters. + */ + undelete(options) { + return this.client.sendOperationRequest({ options }, undeleteOperationSpec); } - }; - var 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"] - } + /** + * 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); } - }; - var comp15 = { - parameterPath: "comp", - mapper: { - defaultValue: "copy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * The Set HTTP Headers operation sets system properties on the blob + * @param options The options parameters. + */ + setHttpHeaders(options) { + return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); } - }; - var copyActionAbortConstant = { - parameterPath: "copyActionAbortConstant", - mapper: { - defaultValue: "abort", - isConstant: true, - serializedName: "x-ms-copy-action", - type: { - name: "String" - } + /** + * 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); } - }; - var copyId = { - parameterPath: "copyId", - mapper: { - serializedName: "copyid", - required: true, - xmlName: "copyid", - type: { - name: "String" - } + /** + * 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); } - }; - var comp16 = { - parameterPath: "comp", - mapper: { - defaultValue: "tier", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var 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" - ] - } + /** + * 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); } - }; - var queryRequest = { - parameterPath: ["options", "queryRequest"], - mapper: QueryRequest - }; - var comp17 = { - parameterPath: "comp", - mapper: { - defaultValue: "query", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var comp18 = { - parameterPath: "comp", - mapper: { - defaultValue: "tags", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * [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); } - }; - var tags = { - parameterPath: ["options", "tags"], - mapper: BlobTags - }; - var transactionalContentMD5 = { - parameterPath: ["options", "transactionalContentMD5"], - mapper: { - serializedName: "Content-MD5", - xmlName: "Content-MD5", - type: { - name: "ByteArray" - } + /** + * [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); } - }; - var transactionalContentCrc64 = { - parameterPath: ["options", "transactionalContentCrc64"], - mapper: { - serializedName: "x-ms-content-crc64", - xmlName: "x-ms-content-crc64", - type: { - name: "ByteArray" - } + /** + * [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); } - }; - var blobType = { - parameterPath: "blobType", - mapper: { - defaultValue: "PageBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" - } + /** + * [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); } - }; - var blobContentLength = { - parameterPath: "blobContentLength", - mapper: { - serializedName: "x-ms-blob-content-length", - required: true, - xmlName: "x-ms-blob-content-length", - type: { - name: "Number" - } + /** + * 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); } - }; - var blobSequenceNumber = { - parameterPath: ["options", "blobSequenceNumber"], - mapper: { - defaultValue: 0, - serializedName: "x-ms-blob-sequence-number", - xmlName: "x-ms-blob-sequence-number", - type: { - name: "Number" - } + /** + * 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); } - }; - var contentType1 = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/octet-stream", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String" - } + /** + * 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); } - }; - var body1 = { - parameterPath: "body", - mapper: { - serializedName: "body", - required: true, - xmlName: "body", - type: { - name: "Stream" - } + /** + * 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); } - }; - var accept2 = { - parameterPath: "accept", - mapper: { - defaultValue: "application/xml", - isConstant: true, - serializedName: "Accept", - type: { - name: "String" - } + /** + * 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); } - }; - var comp19 = { - parameterPath: "comp", - mapper: { - defaultValue: "page", - isConstant: true, - serializedName: "comp", - type: { - name: "String" - } + /** + * 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); } - }; - var pageWrite = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "update", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" - } + /** + * 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); } }; - var ifSequenceNumberLessThanOrEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThanOrEqualTo" - ], - mapper: { - serializedName: "x-ms-if-sequence-number-le", - xmlName: "x-ms-if-sequence-number-le", - type: { - name: "Number" + 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 } - } - }; - var ifSequenceNumberLessThan = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberLessThan" + }, + queryParameters: [ + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.versionId ], - mapper: { - serializedName: "x-ms-if-sequence-number-lt", - xmlName: "x-ms-if-sequence-number-lt", - type: { - name: "Number" - } - } - }; - var ifSequenceNumberEqualTo = { - parameterPath: [ - "options", - "sequenceNumberAccessConditions", - "ifSequenceNumberEqualTo" + 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 ], - mapper: { - serializedName: "x-ms-if-sequence-number-eq", - xmlName: "x-ms-if-sequence-number-eq", - type: { - name: "Number" - } - } + isXML: true, + serializer: xmlSerializer }; - var pageWrite1 = { - parameterPath: "pageWrite", - mapper: { - defaultValue: "clear", - isConstant: true, - serializedName: "x-ms-page-write", - type: { - name: "String" + 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 sourceUrl = { - parameterPath: "sourceUrl", - mapper: { - serializedName: "x-ms-copy-source", - required: true, - xmlName: "x-ms-copy-source", - type: { - name: "String" + 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 sourceRange = { - parameterPath: "sourceRange", - mapper: { - serializedName: "x-ms-source-range", - required: true, - xmlName: "x-ms-source-range", - type: { - name: "String" + 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 sourceContentCrc64 = { - parameterPath: ["options", "sourceContentCrc64"], - mapper: { - serializedName: "x-ms-source-content-crc64", - xmlName: "x-ms-source-content-crc64", - type: { - name: "ByteArray" + 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 range1 = { - parameterPath: "range", - mapper: { - serializedName: "x-ms-range", - required: true, - xmlName: "x-ms-range", - type: { - name: "String" + 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 comp20 = { - parameterPath: "comp", - mapper: { - defaultValue: "pagelist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 prevsnapshot = { - parameterPath: ["options", "prevsnapshot"], - mapper: { - serializedName: "prevsnapshot", - xmlName: "prevsnapshot", - type: { - name: "String" + 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 prevSnapshotUrl = { - parameterPath: ["options", "prevSnapshotUrl"], - mapper: { - serializedName: "x-ms-previous-snapshot-url", - xmlName: "x-ms-previous-snapshot-url", - type: { - name: "String" + 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 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"] + 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 comp21 = { - parameterPath: "comp", - mapper: { - defaultValue: "incrementalcopy", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blobType1 = { - parameterPath: "blobType", - mapper: { - defaultValue: "AppendBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 comp22 = { - parameterPath: "comp", - mapper: { - defaultValue: "appendblock", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 maxSize = { - parameterPath: ["options", "appendPositionAccessConditions", "maxSize"], - mapper: { - serializedName: "x-ms-blob-condition-maxsize", - xmlName: "x-ms-blob-condition-maxsize", - type: { - name: "Number" + var changeLeaseOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", + responses: { + 200: { + headersMapper: Mappers.BlobChangeLeaseHeaders + }, + default: { + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlobChangeLeaseExceptionHeaders } - } - }; - var appendPosition = { - parameterPath: [ - "options", - "appendPositionAccessConditions", - "appendPosition" + }, + 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 ], - mapper: { - serializedName: "x-ms-blob-condition-appendpos", - xmlName: "x-ms-blob-condition-appendpos", - type: { - name: "Number" + 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 sourceRange1 = { - parameterPath: ["options", "sourceRange"], - mapper: { - serializedName: "x-ms-source-range", - xmlName: "x-ms-source-range", - type: { - name: "String" + 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 comp23 = { - parameterPath: "comp", - mapper: { - defaultValue: "seal", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blobType2 = { - parameterPath: "blobType", - mapper: { - defaultValue: "BlockBlob", - isConstant: true, - serializedName: "x-ms-blob-type", - type: { - name: "String" + 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 copySourceBlobProperties = { - parameterPath: ["options", "copySourceBlobProperties"], - mapper: { - serializedName: "x-ms-copy-source-blob-properties", - xmlName: "x-ms-copy-source-blob-properties", - type: { - name: "Boolean" + 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 comp24 = { - parameterPath: "comp", - mapper: { - defaultValue: "block", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 blockId = { - parameterPath: "blockId", - mapper: { - serializedName: "blockid", - required: true, - xmlName: "blockid", - type: { - name: "String" + 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 blocks = { - parameterPath: "blocks", - mapper: BlockLookupList + 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 comp25 = { - parameterPath: "comp", - mapper: { - defaultValue: "blocklist", - isConstant: true, - serializedName: "comp", - type: { - name: "String" + 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 listType = { - parameterPath: "listType", - mapper: { - defaultValue: "committed", - serializedName: "blocklisttype", - required: true, - xmlName: "blocklisttype", - type: { - name: "Enum", - allowedValues: ["committed", "uncommitted", "all"] + 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 }; - var ServiceImpl = class { + } +}); + +// 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 Service class. + * Initialize a new instance of the class PageBlob 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. + * 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. */ - setProperties(blobServiceProperties2, options) { - return this.client.sendOperationRequest({ blobServiceProperties: blobServiceProperties2, options }, setPropertiesOperationSpec); + create(contentLength, blobContentLength, options) { + return this.client.sendOperationRequest({ contentLength, blobContentLength, options }, createOperationSpec); } /** - * gets the properties of a storage account's Blob service, including properties for Storage Analytics - * and CORS (Cross-Origin Resource Sharing) rules. + * 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. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec$2); + uploadPages(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, uploadPagesOperationSpec); } /** - * 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. + * 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. */ - getStatistics(options) { - return this.client.sendOperationRequest({ options }, getStatisticsOperationSpec); + clearPages(contentLength, options) { + return this.client.sendOperationRequest({ contentLength, options }, clearPagesOperationSpec); } /** - * The List Containers Segment operation returns a list of the containers under the specified account + * 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. */ - listContainersSegment(options) { - return this.client.sendOperationRequest({ options }, listContainersSegmentOperationSpec); + uploadPagesFromURL(sourceUrl, sourceRange, contentLength, range, options) { + return this.client.sendOperationRequest({ sourceUrl, sourceRange, contentLength, range, options }, uploadPagesFromURLOperationSpec); } /** - * Retrieves a user delegation key for the Blob service. This is only a valid operation when using - * bearer token authentication. - * @param keyInfo Key information + * 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. */ - getUserDelegationKey(keyInfo2, options) { - return this.client.sendOperationRequest({ keyInfo: keyInfo2, options }, getUserDelegationKeyOperationSpec); + getPageRanges(options) { + return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); } /** - * Returns the sku name and account kind + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$2); + getPageRangesDiff(options) { + return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); } /** - * 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 + * 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. */ - submitBatch(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec$1); + resize(blobContentLength, options) { + return this.client.sendOperationRequest({ blobContentLength, options }, resizeOperationSpec); } /** - * 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. + * 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. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec$1); + 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); } }; - var xmlSerializer$5 = coreClient__namespace.createSerializer( + exports2.PageBlobImpl = PageBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var setPropertiesOperationSpec = { - path: "/", + var createOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 202: { - headersMapper: ServiceSetPropertiesHeaders + 201: { + headersMapper: Mappers.PageBlobCreateHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCreateExceptionHeaders } }, - requestBody: blobServiceProperties, - queryParameters: [ - restype, - comp, - timeoutInSeconds + 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 ], - urlParameters: [url2], + 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: [ - contentType, - accept, - version, - requestId + 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: "xml", - serializer: xmlSerializer$5 + mediaType: "binary", + serializer: xmlSerializer }; - var getPropertiesOperationSpec$2 = { - path: "/", - httpMethod: "GET", + var clearPagesOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceProperties, - headersMapper: ServiceGetPropertiesHeaders + 201: { + headersMapper: Mappers.PageBlobClearPagesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobClearPagesExceptionHeaders } }, - queryParameters: [ - restype, - comp, - timeoutInSeconds - ], - urlParameters: [url2], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var getStatisticsOperationSpec = { - path: "/", - httpMethod: "GET", + var uploadPagesFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: BlobServiceStatistics, - headersMapper: ServiceGetStatisticsHeaders + 201: { + headersMapper: Mappers.PageBlobUploadPagesFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetStatisticsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUploadPagesFromURLExceptionHeaders } }, - queryParameters: [ - restype, - timeoutInSeconds, - comp1 - ], - urlParameters: [url2], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp19], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var listContainersSegmentOperationSpec = { - path: "/", + var getPageRangesOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "GET", responses: { 200: { - bodyMapper: ListContainersSegmentResponse, - headersMapper: ServiceListContainersSegmentHeaders + bodyMapper: Mappers.PageList, + headersMapper: Mappers.PageBlobGetPageRangesHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceListContainersSegmentExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobGetPageRangesExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - include + Parameters.timeoutInSeconds, + Parameters.marker, + Parameters.maxPageSize, + Parameters.snapshot, + Parameters.comp20 ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var getUserDelegationKeyOperationSpec = { - path: "/", - httpMethod: "POST", + var getPageRangesDiffOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { 200: { - bodyMapper: UserDelegationKey, - headersMapper: ServiceGetUserDelegationKeyHeaders + bodyMapper: Mappers.PageList, + headersMapper: Mappers.PageBlobGetPageRangesDiffHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetUserDelegationKeyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobGetPageRangesDiffExceptionHeaders } }, - requestBody: keyInfo, queryParameters: [ - restype, - timeoutInSeconds, - comp3 + Parameters.timeoutInSeconds, + Parameters.marker, + Parameters.maxPageSize, + Parameters.snapshot, + Parameters.comp20, + Parameters.prevsnapshot ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.range, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.prevSnapshotUrl ], isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var getAccountInfoOperationSpec$2 = { - path: "/", - httpMethod: "GET", + var resizeOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { 200: { - headersMapper: ServiceGetAccountInfoHeaders + headersMapper: Mappers.PageBlobResizeHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceGetAccountInfoExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobResizeExceptionHeaders } }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], + queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + 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$5 + serializer: xmlSerializer }; - var submitBatchOperationSpec$1 = { - path: "/", - httpMethod: "POST", + var updateSequenceNumberOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ServiceSubmitBatchHeaders + 200: { + headersMapper: Mappers.PageBlobUpdateSequenceNumberHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceSubmitBatchExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobUpdateSequenceNumberExceptionHeaders } }, - requestBody: body, - queryParameters: [timeoutInSeconds, comp4], - urlParameters: [url2], + queryParameters: [Parameters.comp, Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.blobSequenceNumber, + Parameters.sequenceNumberAction ], isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var filterBlobsOperationSpec$1 = { - path: "/", - httpMethod: "GET", + var copyIncrementalOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ServiceFilterBlobsHeaders + 202: { + headersMapper: Mappers.PageBlobCopyIncrementalHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ServiceFilterBlobsExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.PageBlobCopyIncrementalExceptionHeaders } }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where - ], - urlParameters: [url2], + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp21], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1 + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.ifModifiedSince, + Parameters.ifUnmodifiedSince, + Parameters.ifMatch, + Parameters.ifNoneMatch, + Parameters.ifTags, + Parameters.copySource ], isXML: true, - serializer: xmlSerializer$5 + serializer: xmlSerializer }; - var ContainerImpl = class { + } +}); + +// 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 Container class. + * Initialize a new instance of the class AppendBlob 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$2); - } - /** - * 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$1); - } - /** - * 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$1); - } - /** - * 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$1); - } - /** - * 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. + * The Create Append Blob operation creates a new append blob. + * @param contentLength The length of the request. * @param options The options parameters. */ - rename(sourceContainerName2, options) { - return this.client.sendOperationRequest({ sourceContainerName: sourceContainerName2, options }, renameOperationSpec); + create(contentLength, options) { + return this.client.sendOperationRequest({ contentLength, options }, createOperationSpec); } /** - * The Batch operation allows multiple API calls to be embedded into a single HTTP request. + * 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 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(contentLength2, multipartContentType2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, multipartContentType: multipartContentType2, body: body2, options }, submitBatchOperationSpec); + appendBlock(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, appendBlockOperationSpec); } /** - * 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. + * 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. */ - filterBlobs(options) { - return this.client.sendOperationRequest({ options }, filterBlobsOperationSpec); + appendBlockFromUrl(sourceUrl, contentLength, options) { + return this.client.sendOperationRequest({ sourceUrl, contentLength, options }, appendBlockFromUrlOperationSpec); } /** - * [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 + * 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. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec$1); + 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; /** - * [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. + * Initialize a new instance of the class BlockBlob class. + * @param client Reference to the service client */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec$1); + constructor(client) { + this.client = client; } /** - * [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. + * 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. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec$1); + upload(contentLength, body, options) { + return this.client.sendOperationRequest({ contentLength, body, options }, uploadOperationSpec); } /** - * [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 + * 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. */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec$1); + putBlobFromUrl(contentLength, copySource, options) { + return this.client.sendOperationRequest({ contentLength, copySource, options }, putBlobFromUrlOperationSpec); } /** - * [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. + * 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. */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec$1); + stageBlock(blockId, contentLength, body, options) { + return this.client.sendOperationRequest({ blockId, contentLength, body, options }, stageBlockOperationSpec); } /** - * [Update] The List Blobs operation returns a list of the blobs under the specified container + * 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. */ - listBlobFlatSegment(options) { - return this.client.sendOperationRequest({ options }, listBlobFlatSegmentOperationSpec); + stageBlockFromURL(blockId, contentLength, sourceUrl, options) { + return this.client.sendOperationRequest({ blockId, contentLength, sourceUrl, options }, stageBlockFromURLOperationSpec); } /** - * [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. + * 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. */ - listBlobHierarchySegment(delimiter2, options) { - return this.client.sendOperationRequest({ delimiter: delimiter2, options }, listBlobHierarchySegmentOperationSpec); + commitBlockList(blocks, options) { + return this.client.sendOperationRequest({ blocks, options }, commitBlockListOperationSpec); } /** - * Returns the sku name and account kind + * 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. */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec$1); + getBlockList(listType, options) { + return this.client.sendOperationRequest({ listType, options }, getBlockListOperationSpec); } }; - var xmlSerializer$4 = coreClient__namespace.createSerializer( + exports2.BlockBlobImpl = BlockBlobImpl; + var xmlSerializer = coreClient.createSerializer( Mappers, /* isXml */ true ); - var createOperationSpec$2 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - access, - defaultEncryptionScope, - preventEncryptionScopeOverride - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getPropertiesOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", + var uploadOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerGetPropertiesHeaders + 201: { + headersMapper: Mappers.BlockBlobUploadHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerGetPropertiesExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobUploadExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], + requestBody: Parameters.body1, + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - leaseId + 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, - serializer: xmlSerializer$4 + contentType: "application/xml; charset=utf-8", + mediaType: "binary", + serializer: xmlSerializer }; - var deleteOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "DELETE", + var putBlobFromUrlOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 202: { - headersMapper: ContainerDeleteHeaders + 201: { + headersMapper: Mappers.BlockBlobPutBlobFromUrlHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerDeleteExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobPutBlobFromUrlExceptionHeaders } }, - queryParameters: [timeoutInSeconds, restype2], - urlParameters: [url2], + queryParameters: [Parameters.timeoutInSeconds], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince + 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$4 + serializer: xmlSerializer }; - var setMetadataOperationSpec$1 = { - path: "/{containerName}", + var stageBlockOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerSetMetadataHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerSetMetadataExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockExceptionHeaders } }, + requestBody: Parameters.body1, queryParameters: [ - timeoutInSeconds, - restype2, - comp6 + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince + 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, - serializer: xmlSerializer$4 + contentType: "application/xml; charset=utf-8", + mediaType: "binary", + serializer: xmlSerializer }; - var getAccessPolicyOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", + var stageBlockFromURLOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "PUT", responses: { - 200: { - bodyMapper: { - type: { - name: "Sequence", - element: { - type: { name: "Composite", className: "SignedIdentifier" } - } - }, - serializedName: "SignedIdentifiers", - xmlName: "SignedIdentifiers", - xmlIsWrapped: true, - xmlElementName: "SignedIdentifier" - }, - headersMapper: ContainerGetAccessPolicyHeaders + 201: { + headersMapper: Mappers.BlockBlobStageBlockFromURLHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccessPolicyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobStageBlockFromURLExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp7 + Parameters.timeoutInSeconds, + Parameters.comp24, + Parameters.blockId ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - leaseId + 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$4 + serializer: xmlSerializer }; - var setAccessPolicyOperationSpec = { - path: "/{containerName}", + var commitBlockListOperationSpec = { + path: "/{containerName}/{blob}", httpMethod: "PUT", responses: { - 200: { - headersMapper: ContainerSetAccessPolicyHeaders + 201: { + headersMapper: Mappers.BlockBlobCommitBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerSetAccessPolicyExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobCommitBlockListExceptionHeaders } }, - requestBody: containerAcl, - queryParameters: [ - timeoutInSeconds, - restype2, - comp7 - ], - urlParameters: [url2], + requestBody: Parameters.blocks, + queryParameters: [Parameters.timeoutInSeconds, Parameters.comp25], + urlParameters: [Parameters.url], headerParameters: [ - contentType, - accept, - version, - requestId, - access, - leaseId, - ifModifiedSince, - ifUnmodifiedSince + 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$4 + serializer: xmlSerializer }; - var restoreOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", + var getBlockListOperationSpec = { + path: "/{containerName}/{blob}", + httpMethod: "GET", responses: { - 201: { - headersMapper: ContainerRestoreHeaders + 200: { + bodyMapper: Mappers.BlockList, + headersMapper: Mappers.BlockBlobGetBlockListHeaders }, default: { - bodyMapper: StorageError, - headersMapper: ContainerRestoreExceptionHeaders + bodyMapper: Mappers.StorageError, + headersMapper: Mappers.BlockBlobGetBlockListExceptionHeaders } }, queryParameters: [ - timeoutInSeconds, - restype2, - comp8 + Parameters.timeoutInSeconds, + Parameters.snapshot, + Parameters.comp25, + Parameters.listType ], - urlParameters: [url2], + urlParameters: [Parameters.url], headerParameters: [ - version, - requestId, - accept1, - deletedContainerName, - deletedContainerVersion + Parameters.version, + Parameters.requestId, + Parameters.accept1, + Parameters.leaseId, + Parameters.ifTags ], isXML: true, - serializer: xmlSerializer$4 + serializer: xmlSerializer }; - var renameOperationSpec = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenameHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenameExceptionHeaders + } +}); + +// 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 defaults = { + 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 = { + ...defaults, + ...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, pipeline) { + this.url = (0, utils_common_js_1.escapeURLPath)(url2); + this.accountName = (0, utils_common_js_1.getAccountNameFromUrl)(url2); + this.pipeline = pipeline; + this.storageClientContext = new StorageContextClient_js_1.StorageContextClient(this.url, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + this.isHttps = (0, utils_common_js_1.iEqual)((0, utils_common_js_1.getURLScheme)(this.url) || "", "https"); + this.credential = (0, Pipeline_js_1.getCredentialFromPipeline)(pipeline); + 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"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp9 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - sourceContainerName, - sourceLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var submitBatchOperationSpec = { - path: "/{containerName}", - httpMethod: "POST", - responses: { - 202: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: ContainerSubmitBatchHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerSubmitBatchExceptionHeaders + if (this.create) { + permissions.push("c"); } - }, - requestBody: body, - queryParameters: [ - timeoutInSeconds, - comp4, - restype2 - ], - urlParameters: [url2], - headerParameters: [ - accept, - version, - requestId, - contentLength, - multipartContentType - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$4 - }; - var filterBlobsOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: FilterBlobSegment, - headersMapper: ContainerFilterBlobsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerFilterBlobsExceptionHeaders + if (this.write) { + permissions.push("w"); } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - comp5, - where, - restype2 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var acquireLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: ContainerAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerAcquireLeaseExceptionHeaders + if (this.delete) { + permissions.push("d"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var releaseLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerReleaseLeaseExceptionHeaders + if (this.deleteVersion) { + permissions.push("x"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var renewLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerRenewLeaseExceptionHeaders + if (this.list) { + permissions.push("l"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var breakLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: ContainerBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerBreakLeaseExceptionHeaders + if (this.tag) { + permissions.push("t"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var changeLeaseOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: ContainerChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerChangeLeaseExceptionHeaders + if (this.move) { + permissions.push("m"); } - }, - queryParameters: [ - timeoutInSeconds, - restype2, - comp10 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobFlatSegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsFlatSegmentResponse, - headersMapper: ContainerListBlobFlatSegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobFlatSegmentExceptionHeaders + if (this.execute) { + permissions.push("e"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var listBlobHierarchySegmentOperationSpec = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: ListBlobsHierarchySegmentResponse, - headersMapper: ContainerListBlobHierarchySegmentHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders + if (this.setImmutabilityPolicy) { + permissions.push("i"); } - }, - queryParameters: [ - timeoutInSeconds, - comp2, - prefix, - marker, - maxPageSize, - restype2, - include1, - delimiter - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 - }; - var getAccountInfoOperationSpec$1 = { - path: "/{containerName}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: ContainerGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: ContainerGetAccountInfoExceptionHeaders + if (this.permanentDelete) { + permissions.push("y"); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$4 + if (this.filterByTags) { + permissions.push("f"); + } + return permissions.join(""); + } }; - var BlobImpl = class { + 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 { /** - * Initialize a new instance of the class Blob class. - * @param client Reference to the service client + * Azure Storage account name; readonly. */ - constructor(client) { - this.client = client; - } + accountName; /** - * 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. + * Azure Storage user delegation key; readonly. */ - download(options) { - return this.client.sendOperationRequest({ options }, downloadOperationSpec); - } + userDelegationKey; /** - * 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. + * Key value in Buffer type. */ - getProperties(options) { - return this.client.sendOperationRequest({ options }, getPropertiesOperationSpec); - } + key; /** - * 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. + * Creates an instance of UserDelegationKeyCredential. + * @param accountName - + * @param userDelegationKey - */ - delete(options) { - return this.client.sendOperationRequest({ options }, deleteOperationSpec); + constructor(accountName, userDelegationKey) { + this.accountName = accountName; + this.userDelegationKey = userDelegationKey; + this.key = Buffer.from(userDelegationKey.value, "base64"); } /** - * Undelete a blob that was previously soft deleted - * @param options The options parameters. + * Generates a hash signature for an HTTP request or for a SAS. + * + * @param stringToSign - */ - undelete(options) { - return this.client.sendOperationRequest({ options }, undeleteOperationSpec); + 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 { /** - * Sets the time a blob will expire and be deleted. - * @param expiryOptions Required. Indicates mode of the expiry time - * @param options The options parameters. + * The storage API version. */ - setExpiry(expiryOptions2, options) { - return this.client.sendOperationRequest({ expiryOptions: expiryOptions2, options }, setExpiryOperationSpec); - } + version; /** - * The Set HTTP Headers operation sets system properties on the blob - * @param options The options parameters. + * Optional. The allowed HTTP protocol(s). */ - setHttpHeaders(options) { - return this.client.sendOperationRequest({ options }, setHttpHeadersOperationSpec); - } + protocol; /** - * The Set Immutability Policy operation sets the immutability policy on the blob - * @param options The options parameters. + * Optional. The start time for this SAS token. */ - setImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, setImmutabilityPolicyOperationSpec); - } + startsOn; /** - * The Delete Immutability Policy operation deletes the immutability policy on the blob - * @param options The options parameters. + * Optional only when identifier is provided. The expiry time for this SAS token. */ - deleteImmutabilityPolicy(options) { - return this.client.sendOperationRequest({ options }, deleteImmutabilityPolicyOperationSpec); - } + expiresOn; /** - * 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. + * Optional only when identifier is provided. + * Please refer to {@link AccountSASPermissions}, {@link BlobSASPermissions}, or {@link ContainerSASPermissions} for + * more details. */ - setLegalHold(legalHold2, options) { - return this.client.sendOperationRequest({ legalHold: legalHold2, options }, setLegalHoldOperationSpec); - } + permissions; /** - * 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. + * Optional. The storage services being accessed (only for Account SAS). Please refer to {@link AccountSASServices} + * for more details. */ - setMetadata(options) { - return this.client.sendOperationRequest({ options }, setMetadataOperationSpec); - } + services; /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. + * Optional. The storage resource types being accessed (only for Account SAS). Please refer to + * {@link AccountSASResourceTypes} for more details. */ - acquireLease(options) { - return this.client.sendOperationRequest({ options }, acquireLeaseOperationSpec); - } + resourceTypes; /** - * [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. + * Optional. The signed identifier (only for {@link BlobSASSignatureValues}). + * + * @see https://learn.microsoft.com/rest/api/storageservices/establishing-a-stored-access-policy */ - releaseLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, releaseLeaseOperationSpec); - } + identifier; /** - * [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. + * 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. */ - renewLease(leaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, options }, renewLeaseOperationSpec); + 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; + } + } } /** - * [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. + * Encodes all SAS query parameters into a string that can be appended to a URL. + * */ - changeLease(leaseId2, proposedLeaseId2, options) { - return this.client.sendOperationRequest({ leaseId: leaseId2, proposedLeaseId: proposedLeaseId2, options }, changeLeaseOperationSpec); + 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("&"); } /** - * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete - * operations - * @param options The options parameters. + * A private helper method used to filter and append query key/value pairs into an array. + * + * @param queries - + * @param key - + * @param value - */ - breakLease(options) { - return this.client.sendOperationRequest({ options }, breakLeaseOperationSpec); + tryAppendQueryParameter(queries, key, value) { + if (!value) { + return; + } + key = encodeURIComponent(key); + value = encodeURIComponent(value); + if (key.length > 0 && value.length > 0) { + queries.push(`${key}=${value}`); + } } - /** - * 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); + }; + 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); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, startCopyFromURLOperationSpec); + if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { + throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - /** - * 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(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyFromURLOperationSpec); + 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); + } + } } - /** - * 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(copyId2, options) { - return this.client.sendOperationRequest({ copyId: copyId2, options }, abortCopyFromURLOperationSpec); + 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); + } + } } - /** - * 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(tier2, options) { - return this.client.sendOperationRequest({ tier: tier2, options }, setTierOperationSpec); + 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."); + } } - /** - * Returns the sku name and account kind - * @param options The options parameters. - */ - getAccountInfo(options) { - return this.client.sendOperationRequest({ options }, getAccountInfoOperationSpec); + 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."); } - /** - * 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); + let resource = "c"; + if (blobSASSignatureValues.blobName) { + resource = "b"; } - /** - * 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); + 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(); + } } - /** - * 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); + 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."); } - }; - var xmlSerializer$3 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var downloadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobDownloadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDownloadExceptionHeaders + let resource = "c"; + let timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - rangeGetContentMD5, - rangeGetContentCRC64, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getPropertiesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "HEAD", - responses: { - 200: { - headersMapper: BlobGetPropertiesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetPropertiesExceptionHeaders + } + 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(); } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 202: { - headersMapper: BlobDeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - blobDeleteType - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - deleteSnapshots - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var undeleteOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobUndeleteHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobUndeleteExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp8], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setExpiryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetExpiryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetExpiryExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp11], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - expiryOptions, - expiresOn - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setHttpHeadersOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetHttpHeadersHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetHttpHeadersExceptionHeaders + } + 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(); } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetImmutabilityPolicyExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifUnmodifiedSince, - immutabilityPolicyExpiry, - immutabilityPolicyMode - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var deleteImmutabilityPolicyOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "DELETE", - responses: { - 200: { - headersMapper: BlobDeleteImmutabilityPolicyHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp12], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setLegalHoldOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetLegalHoldHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetLegalHoldExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp13], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - legalHold - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setMetadataOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetMetadataHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetMetadataExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp6], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var acquireLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobAcquireLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAcquireLeaseExceptionHeaders + } + 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, + timestamp2, + 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 timestamp2 = blobSASSignatureValues.snapshotTime; + if (blobSASSignatureValues.blobName) { + resource = "b"; + if (blobSASSignatureValues.snapshotTime) { + resource = "bs"; + } else if (blobSASSignatureValues.versionId) { + resource = "bv"; + timestamp2 = blobSASSignatureValues.versionId; } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action, - duration, - proposedLeaseId, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var releaseLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobReleaseLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobReleaseLeaseExceptionHeaders + } + 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(); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action1, - leaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var renewLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobRenewLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobRenewLeaseExceptionHeaders + } + 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, + timestamp2, + 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; } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action2, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var changeLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobChangeLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobChangeLeaseExceptionHeaders + if (!leaseId) { + leaseId = (0, core_util_1.randomUUID)(); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - leaseId1, - action4, - proposedLeaseId1, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var breakLeaseOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobBreakLeaseHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobBreakLeaseExceptionHeaders + 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."); } - }, - queryParameters: [timeoutInSeconds, comp10], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - action3, - breakPeriod, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var createSnapshotOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlobCreateSnapshotHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCreateSnapshotExceptionHeaders + 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."); } - }, - queryParameters: [timeoutInSeconds, comp14], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var startCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobStartCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobStartCopyFromURLExceptionHeaders + 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."); } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - tier, - rehydratePriority, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sealBlob, - legalHold1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var copyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: BlobCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobCopyFromURLExceptionHeaders + 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."); } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - copySource, - blobTagsString, - legalHold1, - xMsRequiresSync, - sourceContentMD5, - copySourceAuthorization, - copySourceTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var abortCopyFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobAbortCopyFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobAbortCopyFromURLExceptionHeaders + 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."); } - }, - queryParameters: [ - timeoutInSeconds, - comp15, - copyId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - copyActionAbortConstant - ], - isXML: true, - serializer: xmlSerializer$3 + 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)); + }); + } }; - var setTierOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: BlobSetTierHeaders - }, - 202: { - headersMapper: BlobSetTierHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTierExceptionHeaders + 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; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp16 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags, - rehydratePriority, - tier1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var getAccountInfoOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - headersMapper: BlobGetAccountInfoHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetAccountInfoExceptionHeaders + this.offset += data.length; + if (this.onProgress) { + this.onProgress({ loadedBytes: this.offset - this.start }); } - }, - queryParameters: [ - comp, - timeoutInSeconds, - restype1 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1 - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var queryOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - 206: { - bodyMapper: { - type: { name: "Stream" }, - serializedName: "parsedResponse" - }, - headersMapper: BlobQueryHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobQueryExceptionHeaders + if (!this.push(data)) { + this.source.pause(); } - }, - requestBody: queryRequest, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp17 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 - }; - var getTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlobTags, - headersMapper: BlobGetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobGetTagsExceptionHeaders + }; + 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; } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - versionId, - comp18 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer$3 - }; - var setTagsOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 204: { - headersMapper: BlobSetTagsHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlobSetTagsExceptionHeaders + 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}`)); } - }, - requestBody: tags, - queryParameters: [ - timeoutInSeconds, - versionId, - comp18 - ], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - leaseId, - ifTags, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer$3 + }; + _destroy(error3, callback) { + this.removeSourceEventHandlers(); + this.source.destroy(); + callback(error3 === null ? void 0 : error3); + } }; - var PageBlobImpl = class { + 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; + } /** - * Initialize a new instance of the class PageBlob class. - * @param client Reference to the service client + * Returns the value that was specified + * for the Content-Encoding request header. + * + * @readonly */ - constructor(client) { - this.client = client; + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * 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. + * Returns the value that was specified + * for the Content-Language request header. + * + * @readonly */ - create(contentLength2, blobContentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, blobContentLength: blobContentLength2, options }, createOperationSpec$1); + get contentLanguage() { + return this.originalResponse.contentLanguage; } /** - * 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. + * The current sequence number for a + * page blob. This header is not returned for block blobs or append blobs. + * + * @readonly */ - uploadPages(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadPagesOperationSpec); + get blobSequenceNumber() { + return this.originalResponse.blobSequenceNumber; } /** - * 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. + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly */ - clearPages(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, clearPagesOperationSpec); + get blobType() { + return this.originalResponse.blobType; } /** - * 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. + * The number of bytes present in the + * response body. + * + * @readonly */ - uploadPagesFromURL(sourceUrl2, sourceRange2, contentLength2, range2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, sourceRange: sourceRange2, contentLength: contentLength2, range: range2, options }, uploadPagesFromURLOperationSpec); + get contentLength() { + return this.originalResponse.contentLength; } /** - * 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. + * 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 */ - getPageRanges(options) { - return this.client.sendOperationRequest({ options }, getPageRangesOperationSpec); + get contentMD5() { + return this.originalResponse.contentMD5; } /** - * 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. + * Indicates the range of bytes returned if + * the client requested a subset of the file by setting the Range request + * header. + * + * @readonly */ - getPageRangesDiff(options) { - return this.client.sendOperationRequest({ options }, getPageRangesDiffOperationSpec); + get contentRange() { + return this.originalResponse.contentRange; } /** - * 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. + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly */ - resize(blobContentLength2, options) { - return this.client.sendOperationRequest({ blobContentLength: blobContentLength2, options }, resizeOperationSpec); + get contentType() { + return this.originalResponse.contentType; } /** - * 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. + * 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 */ - updateSequenceNumber(sequenceNumberAction2, options) { - return this.client.sendOperationRequest({ sequenceNumberAction: sequenceNumberAction2, options }, updateSequenceNumberOperationSpec); + get copyCompletedOn() { + return this.originalResponse.copyCompletedOn; } /** - * 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. + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly */ - copyIncremental(copySource2, options) { - return this.client.sendOperationRequest({ copySource: copySource2, options }, copyIncrementalOperationSpec); + get copyId() { + return this.originalResponse.copyId; } - }; - var xmlSerializer$2 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec$1 = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - blobType, - blobContentLength, - blobSequenceNumber - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$2 - }; - var clearPagesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobClearPagesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobClearPagesExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - pageWrite1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var uploadPagesFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: PageBlobUploadPagesFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUploadPagesFromURLExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp19], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - pageWrite, - ifSequenceNumberLessThanOrEqualTo, - ifSequenceNumberLessThan, - ifSequenceNumberEqualTo, - sourceUrl, - sourceRange, - sourceContentCrc64, - range1 - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20 - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var getPageRangesDiffOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: PageList, - headersMapper: PageBlobGetPageRangesDiffHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobGetPageRangesDiffExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - marker, - maxPageSize, - snapshot, - comp20, - prevsnapshot - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - range, - ifMatch, - ifNoneMatch, - ifTags, - prevSnapshotUrl - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var resizeOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobResizeHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobResizeExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - blobContentLength - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var updateSequenceNumberOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: PageBlobUpdateSequenceNumberHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders - } - }, - queryParameters: [comp, timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - blobSequenceNumber, - sequenceNumberAction - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var copyIncrementalOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 202: { - headersMapper: PageBlobCopyIncrementalHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: PageBlobCopyIncrementalExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp21], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - ifTags, - copySource - ], - isXML: true, - serializer: xmlSerializer$2 - }; - var AppendBlobImpl = class { /** - * Initialize a new instance of the class AppendBlob class. - * @param client Reference to the service client + * 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 */ - constructor(client) { - this.client = client; + get copyProgress() { + return this.originalResponse.copyProgress; } /** - * The Create Append Blob operation creates a new append blob. - * @param contentLength The length of the request. - * @param options The options parameters. + * 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 */ - create(contentLength2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, options }, createOperationSpec); + get copySource() { + return this.originalResponse.copySource; } /** - * 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. + * State of the copy operation + * identified by 'x-ms-copy-id'. Possible values include: 'pending', + * 'success', 'aborted', 'failed' + * + * @readonly */ - appendBlock(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, appendBlockOperationSpec); + get copyStatus() { + return this.originalResponse.copyStatus; } /** - * 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. + * Only appears when + * x-ms-copy-status is failed or pending. Describes cause of fatal or + * non-fatal copy operation failure. + * + * @readonly */ - appendBlockFromUrl(sourceUrl2, contentLength2, options) { - return this.client.sendOperationRequest({ sourceUrl: sourceUrl2, contentLength: contentLength2, options }, appendBlockFromUrlOperationSpec); + get copyStatusDescription() { + return this.originalResponse.copyStatusDescription; } /** - * 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. + * When a blob is leased, + * specifies whether the lease is of infinite or fixed duration. Possible + * values include: 'infinite', 'fixed'. + * + * @readonly */ - seal(options) { - return this.client.sendOperationRequest({ options }, sealOperationSpec); + 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; } - }; - var xmlSerializer$1 = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var createOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobCreateHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobCreateExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - blobTagsString, - legalHold1, - blobType1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var appendBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - maxSize, - appendPosition - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer$1 - }; - var appendBlockFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: AppendBlobAppendBlockFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp22], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - transactionalContentMD5, - sourceUrl, - sourceContentCrc64, - maxSize, - appendPosition, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var sealOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 200: { - headersMapper: AppendBlobSealHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: AppendBlobSealExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds, comp23], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - ifMatch, - ifNoneMatch, - appendPosition - ], - isXML: true, - serializer: xmlSerializer$1 - }; - var BlockBlobImpl = class { /** - * Initialize a new instance of the class BlockBlob class. - * @param client Reference to the service client + * If a client request id header is sent in the request, this header will be present in the + * response with the same value. + * + * @readonly */ - constructor(client) { - this.client = client; + get clientRequestId() { + return this.originalResponse.clientRequestId; } /** - * 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. + * Indicates the version of the Blob service used + * to execute the request. + * + * @readonly */ - upload(contentLength2, body2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, body: body2, options }, uploadOperationSpec); + get version() { + return this.originalResponse.version; } /** - * 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. + * Indicates the versionId of the downloaded blob version. + * + * @readonly */ - putBlobFromUrl(contentLength2, copySource2, options) { - return this.client.sendOperationRequest({ contentLength: contentLength2, copySource: copySource2, options }, putBlobFromUrlOperationSpec); + get versionId() { + return this.originalResponse.versionId; } /** - * 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. + * Indicates whether version of this blob is a current version. + * + * @readonly */ - stageBlock(blockId2, contentLength2, body2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, body: body2, options }, stageBlockOperationSpec); + get isCurrentVersion() { + return this.originalResponse.isCurrentVersion; } /** - * 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. + * 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 */ - stageBlockFromURL(blockId2, contentLength2, sourceUrl2, options) { - return this.client.sendOperationRequest({ blockId: blockId2, contentLength: contentLength2, sourceUrl: sourceUrl2, options }, stageBlockFromURLOperationSpec); + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } /** - * 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. + * 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) */ - commitBlockList(blocks2, options) { - return this.client.sendOperationRequest({ blocks: blocks2, options }, commitBlockListOperationSpec); + get contentCrc64() { + return this.originalResponse.contentCrc64; } /** - * 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. + * Object Replication Policy Id of the destination blob. + * + * @readonly */ - getBlockList(listType2, options) { - return this.client.sendOperationRequest({ listType: listType2, options }, getBlockListOperationSpec); + get objectReplicationDestinationPolicyId() { + return this.originalResponse.objectReplicationDestinationPolicyId; } - }; - var xmlSerializer = coreClient__namespace.createSerializer( - Mappers, - /* isXml */ - true - ); - var uploadOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobUploadHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobUploadExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2, - blobType2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var putBlobFromUrlOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobPutBlobFromUrlHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders - } - }, - queryParameters: [timeoutInSeconds], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - encryptionScope, - tier, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceIfTags, - copySource, - blobTagsString, - sourceContentMD5, - copySourceAuthorization, - copySourceTags, - transactionalContentMD5, - blobType2, - copySourceBlobProperties - ], - isXML: true, - serializer: xmlSerializer - }; - var stageBlockOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockExceptionHeaders - } - }, - requestBody: body1, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - transactionalContentMD5, - transactionalContentCrc64, - contentType1, - accept2 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "binary", - serializer: xmlSerializer - }; - var stageBlockFromURLOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobStageBlockFromURLHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobStageBlockFromURLExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - comp24, - blockId - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - contentLength, - leaseId, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - encryptionScope, - sourceIfModifiedSince, - sourceIfUnmodifiedSince, - sourceIfMatch, - sourceIfNoneMatch, - sourceContentMD5, - copySourceAuthorization, - sourceUrl, - sourceContentCrc64, - sourceRange1 - ], - isXML: true, - serializer: xmlSerializer - }; - var commitBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "PUT", - responses: { - 201: { - headersMapper: BlockBlobCommitBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobCommitBlockListExceptionHeaders - } - }, - requestBody: blocks, - queryParameters: [timeoutInSeconds, comp25], - urlParameters: [url2], - headerParameters: [ - contentType, - accept, - version, - requestId, - metadata, - leaseId, - ifModifiedSince, - ifUnmodifiedSince, - encryptionKey, - encryptionKeySha256, - encryptionAlgorithm, - ifMatch, - ifNoneMatch, - ifTags, - blobCacheControl, - blobContentType, - blobContentMD5, - blobContentEncoding, - blobContentLanguage, - blobContentDisposition, - immutabilityPolicyExpiry, - immutabilityPolicyMode, - encryptionScope, - tier, - blobTagsString, - legalHold1, - transactionalContentMD5, - transactionalContentCrc64 - ], - isXML: true, - contentType: "application/xml; charset=utf-8", - mediaType: "xml", - serializer: xmlSerializer - }; - var getBlockListOperationSpec = { - path: "/{containerName}/{blob}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: BlockList, - headersMapper: BlockBlobGetBlockListHeaders - }, - default: { - bodyMapper: StorageError, - headersMapper: BlockBlobGetBlockListExceptionHeaders - } - }, - queryParameters: [ - timeoutInSeconds, - snapshot, - comp25, - listType - ], - urlParameters: [url2], - headerParameters: [ - version, - requestId, - accept1, - leaseId, - ifTags - ], - isXML: true, - serializer: xmlSerializer - }; - var StorageClient$1 = class StorageClient extends coreHttpCompat__namespace.ExtendedServiceClient { /** - * 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 + * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * + * @readonly */ - constructor(url3, options) { - var _a, _b; - if (url3 === void 0) { - throw new Error("'url' cannot be null"); - } - if (!options) { - options = {}; - } - const defaults = { - requestContentType: "application/json; charset=utf-8" - }; - const packageDetails = `azsdk-js-azure-storage-blob/12.25.0`; - const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: { - userAgentPrefix - }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{url}" }); - super(optionsWithDefaults); - this.url = url3; - this.version = options.version || "2024-11-04"; - this.service = new ServiceImpl(this); - this.container = new ContainerImpl(this); - this.blob = new BlobImpl(this); - this.pageBlob = new PageBlobImpl(this); - this.appendBlob = new AppendBlobImpl(this); - this.blockBlob = new BlockBlobImpl(this); + get objectReplicationSourceProperties() { + return this.originalResponse.objectReplicationSourceProperties; } - }; - var StorageContextClient = class extends StorageClient$1 { - async sendOperationRequest(operationArguments, operationSpec) { - const operationSpecToSend = Object.assign({}, operationSpec); - if (operationSpecToSend.path === "/{containerName}" || operationSpecToSend.path === "/{containerName}/{blob}") { - operationSpecToSend.path = ""; - } - return super.sendOperationRequest(operationArguments, operationSpecToSend); + /** + * If this blob has been sealed. + * + * @readonly + */ + get isSealed() { + return this.originalResponse.isSealed; } - }; - var StorageClient = class { /** - * Creates an instance of StorageClient. - * @param url - url to resource - * @param pipeline - request policy pipeline. + * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. + * + * @readonly */ - constructor(url3, pipeline) { - this.url = escapeURLPath(url3); - this.accountName = getAccountNameFromUrl(url3); - this.pipeline = pipeline; - this.storageClientContext = new StorageContextClient(this.url, getCoreClientOptions(pipeline)); - this.isHttps = iEqual(getURLScheme(this.url) || "", "https"); - this.credential = getCredentialFromPipeline(pipeline); - const storageClientContext = this.storageClientContext; - storageClientContext.requestContentType = void 0; + get immutabilityPolicyExpiresOn() { + return this.originalResponse.immutabilityPolicyExpiresOn; } - }; - var tracingClient = coreTracing.createTracingClient({ - packageName: "@azure/storage-blob", - packageVersion: SDK_VERSION, - namespace: "Microsoft.Storage" - }); - var BlobSASPermissions = class _BlobSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + /** + * Indicates immutability policy mode. + * + * @readonly + */ + get immutabilityPolicyMode() { + return this.originalResponse.immutabilityPolicyMode; } /** - * 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. + * Indicates if a legal hold is present on the blob. * - * @param permissions - + * @readonly */ - 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; + get legalHold() { + return this.originalResponse.legalHold; } /** - * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * The response body as a browser Blob. + * Always undefined in node.js. * - * @param permissionLike - + * @readonly */ - 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; + get contentAsBlob() { + return this.originalResponse.blobBody; } /** - * Converts the given permissions to a string. Using this method will guarantee the permissions are in an - * order accepted by the service. + * The response body as a node.js Readable stream. + * Always undefined in the browser. * - * @returns A string which represents the BlobSASPermissions + * It will automatically retry when internal read stream unexpected ends. + * + * @readonly */ - toString() { - const permissions = []; - if (this.read) { - permissions.push("r"); + 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."); } - if (this.add) { - permissions.push("a"); + 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; } - if (this.create) { - permissions.push("c"); + 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."); } - if (this.write) { - permissions.push("w"); + } + 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."); } - if (this.delete) { - permissions.push("d"); + 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 pairs2 = await _AvroParser.readArray(stream2, readPairMethod, options); + const dict = {}; + for (const pair of pairs2) { + dict[pair.key] = pair.value; } - if (this.deleteVersion) { - permissions.push("x"); + 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); + } } - if (this.tag) { - permissions.push("t"); + 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(schema2) { + if (typeof schema2 === "string") { + return _AvroType.fromStringSchema(schema2); + } else if (Array.isArray(schema2)) { + return _AvroType.fromArraySchema(schema2); + } else { + return _AvroType.fromObjectSchema(schema2); } - if (this.move) { - permissions.push("m"); + } + static fromStringSchema(schema2) { + switch (schema2) { + 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(schema2); + default: + throw new Error(`Unexpected Avro type ${schema2}`); } - if (this.execute) { - permissions.push("e"); + } + static fromArraySchema(schema2) { + return new AvroUnionType(schema2.map(_AvroType.fromSchema)); + } + static fromObjectSchema(schema2) { + const type2 = schema2.type; + try { + return _AvroType.fromStringSchema(type2); + } catch { } - if (this.setImmutabilityPolicy) { - permissions.push("i"); + switch (type2) { + case AvroComplex.RECORD: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.name) { + throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); + } + const fields = {}; + if (!schema2.fields) { + throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); + } + for (const field of schema2.fields) { + fields[field.name] = _AvroType.fromSchema(field.type); + } + return new AvroRecordType(fields, schema2.name); + case AvroComplex.ENUM: + if (schema2.aliases) { + throw new Error(`aliases currently is not supported, schema: ${schema2}`); + } + if (!schema2.symbols) { + throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); + } + return new AvroEnumType(schema2.symbols); + case AvroComplex.MAP: + if (!schema2.values) { + throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); + } + return new AvroMapType(_AvroType.fromSchema(schema2.values)); + case AvroComplex.ARRAY: + // Unused today + case AvroComplex.FIXED: + // Unused today + default: + throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); } - if (this.permanentDelete) { - permissions.push("y"); + } + }; + 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"); } - return permissions.join(""); } }; - var ContainerSASPermissions = class _ContainerSASPermissions { - constructor() { - this.read = false; - this.add = false; - this.create = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.tag = false; - this.move = false; - this.execute = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; - this.filterByTags = false; + var AvroEnumType = class extends AvroType { + _symbols; + constructor(symbols) { + super(); + this._symbols = symbols; } - /** - * 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}`); + // 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(types) { + super(); + this._types = types; + } + 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 containerSASPermissions; + return record; } - /** - * 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; + }; + } +}); + +// 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."); } - if (permissionLike.create) { - containerSASPermissions.create = true; + 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"); } - if (permissionLike.write) { - containerSASPermissions.write = true; + this._syncMarker = await AvroParser_js_1.AvroParser.readFixedBytes(this._headerStream, AvroConstants_js_1.AVRO_SYNC_MARKER_SIZE, { + abortSignal: options.abortSignal + }); + const schema2 = JSON.parse(this._metadata[AvroConstants_js_1.AVRO_SCHEMA_KEY]); + this._itemType = AvroParser_js_1.AvroType.fromSchema(schema2); + if (this._blockOffset === 0) { + this._blockOffset = this._initialBlockOffset + this._dataStream.position; } - if (permissionLike.delete) { - containerSASPermissions.delete = true; + 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--; + } } - if (permissionLike.list) { - containerSASPermissions.list = true; + } + hasNext() { + return !this._initialized || this._itemsRemainingInBlock > 0; + } + async *parseObjects(options = {}) { + if (!this._initialized) { + await this.initialize(options); } - if (permissionLike.deleteVersion) { - containerSASPermissions.deleteVersion = true; + 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; } - if (permissionLike.tag) { - containerSASPermissions.tag = true; + } + }; + 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); } - if (permissionLike.move) { - containerSASPermissions.move = true; + 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 (permissionLike.execute) { - containerSASPermissions.execute = true; + if (size < 0) { + throw new Error(`size parameter should be positive: ${size}`); } - if (permissionLike.setImmutabilityPolicy) { - containerSASPermissions.setImmutabilityPolicy = true; + if (size === 0) { + return new Uint8Array(); } - if (permissionLike.permanentDelete) { - containerSASPermissions.permanentDelete = true; + if (!this._readable.readable) { + throw new Error("Stream no longer readable."); } - if (permissionLike.filterByTags) { - containerSASPermissions.filterByTags = true; + const chunk = this._readable.read(size); + if (chunk) { + this._position += chunk.length; + return this.toUint8Array(chunk); + } else { + return new Promise((resolve6, 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(); + resolve6(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); + } + }); } - return containerSASPermissions; } + }; + 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; /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * Creates an instance of BlobQuickQueryStream. * + * @param source - The current ReadableStream returned from getter + * @param options - */ - 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"); + 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); + }); } - return permissions.join(""); + } + async readInternal() { + this.avroPaused = false; + let avroNext; + do { + avroNext = await this.avroIter.next(); + if (avroNext.done) { + break; + } + const obj = avroNext.value; + const schema2 = obj.$schema; + if (typeof schema2 !== "string") { + throw Error("Missing schema in avro record."); + } + switch (schema2) { + 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 ${schema2} in avro progress record.`); + } + } while (!avroNext.done && !this.avroPaused); } }; - var UserDelegationKeyCredential = class { + 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 { /** - * Creates an instance of UserDelegationKeyCredential. - * @param accountName - - * @param userDelegationKey - + * Indicates that the service supports + * requests for partial file content. + * + * @readonly */ - constructor(accountName, userDelegationKey) { - this.accountName = accountName; - this.userDelegationKey = userDelegationKey; - this.key = Buffer.from(userDelegationKey.value, "base64"); + get acceptRanges() { + return this.originalResponse.acceptRanges; } /** - * Generates a hash signature for an HTTP request or for a SAS. + * Returns if it was previously specified + * for the file. * - * @param stringToSign - + * @readonly */ - computeHMACSHA256(stringToSign) { - return crypto.createHmac("sha256", this.key).update(stringToSign, "utf8").digest("base64"); + get cacheControl() { + return this.originalResponse.cacheControl; } - }; - function ipRangeToString(ipRange) { - return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start; - } - exports2.SASProtocol = void 0; - (function(SASProtocol) { - SASProtocol["Https"] = "https"; - SASProtocol["HttpsAndHttp"] = "https,http"; - })(exports2.SASProtocol || (exports2.SASProtocol = {})); - var SASQueryParameters = class { /** - * Optional. IP range allowed for this SAS. + * Returns the value that was specified + * for the 'x-ms-content-disposition' header and specifies how to process the + * response. * * @readonly */ - get ipRange() { - if (this.ipRangeInner) { - return { - end: this.ipRangeInner.end, - start: this.ipRangeInner.start - }; - } - return void 0; - } - constructor(version2, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2) { - this.version = version2; - 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 = expiresOn2; - this.permissions = permissionsOrOptions; - this.protocol = protocol; - this.startsOn = startsOn; - this.ipRangeInner = ipRange; - this.encryptionScope = encryptionScope2; - this.identifier = identifier; - this.resource = resource; - this.cacheControl = cacheControl; - this.contentDisposition = contentDisposition; - this.contentEncoding = contentEncoding; - this.contentLanguage = contentLanguage; - this.contentType = contentType2; - 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; - } - } + get contentDisposition() { + return this.originalResponse.contentDisposition; } /** - * Encodes all SAS query parameters into a string that can be appended to a URL. + * Returns the value that was specified + * for the Content-Encoding request header. * + * @readonly */ - 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 ? truncatedISO8061Date(this.startsOn, false) : void 0); - break; - case "se": - this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : void 0); - break; - case "sip": - this.tryAppendQueryParameter(queries, param, this.ipRange ? 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 ? truncatedISO8061Date(this.signedStartsOn, false) : void 0); - break; - case "ske": - this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? 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("&"); + get contentEncoding() { + return this.originalResponse.contentEncoding; } /** - * A private helper method used to filter and append query key/value pairs into an array. + * Returns the value that was specified + * for the Content-Language request header. * - * @param queries - - * @param key - - * @param value - + * @readonly */ - tryAppendQueryParameter(queries, key, value) { - if (!value) { - return; - } - key = encodeURIComponent(key); - value = encodeURIComponent(value); - if (key.length > 0 && value.length > 0) { - queries.push(`${key}=${value}`); - } - } - }; - function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; - } - function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; - let userDelegationKeyCredential; - if (sharedKeyCredential === void 0 && accountName !== void 0) { - userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey); - } - if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { - throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); - } - if (version2 >= "2020-12-06") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); - } - } - if (version2 >= "2018-11-09") { - if (sharedKeyCredential !== void 0) { - return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); - } else { - if (version2 >= "2020-02-10") { - return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); - } else { - return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); - } - } - } - if (version2 >= "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.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } - } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? 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(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 timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + get contentLanguage() { + return this.originalResponse.contentLanguage; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + /** + * The blob's type. Possible values include: + * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * + * @readonly + */ + get blobType() { + return this.originalResponse.blobType; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * The number of bytes present in the + * response body. + * + * @readonly + */ + get contentLength() { + return this.originalResponse.contentLength; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - blobSASSignatureValues.identifier, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - 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(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."); + /** + * 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; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * The content type specified for the file. + * The default content type is 'application/octet-stream' + * + * @readonly + */ + get contentType() { + return this.originalResponse.contentType; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + /** + * String identifier for the last attempted Copy + * File operation where this file was the destination file. + * + * @readonly + */ + get copyId() { + return this.originalResponse.copyId; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * 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; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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."); + /** + * 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; } - let resource = "c"; - let timestamp2 = blobSASSignatureValues.snapshotTime; - if (blobSASSignatureValues.blobName) { - resource = "b"; - if (blobSASSignatureValues.snapshotTime) { - resource = "bs"; - } else if (blobSASSignatureValues.versionId) { - resource = "bv"; - timestamp2 = blobSASSignatureValues.versionId; - } + /** + * 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; } - let verifiedPermissions; - if (blobSASSignatureValues.permissions) { - if (blobSASSignatureValues.blobName) { - verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } else { - verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString(); - } + /** + * 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; } - const stringToSign = [ - verifiedPermissions ? verifiedPermissions : "", - blobSASSignatureValues.startsOn ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false) : "", - blobSASSignatureValues.expiresOn ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false) : "", - getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName), - userDelegationKeyCredential.userDelegationKey.signedObjectId, - userDelegationKeyCredential.userDelegationKey.signedTenantId, - userDelegationKeyCredential.userDelegationKey.signedStartsOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedExpiresOn ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false) : "", - userDelegationKeyCredential.userDelegationKey.signedService, - userDelegationKeyCredential.userDelegationKey.signedVersion, - blobSASSignatureValues.preauthorizedAgentObjectId, - void 0, - // agentObjectId - blobSASSignatureValues.correlationId, - blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : "", - blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : "", - blobSASSignatureValues.version, - resource, - timestamp2, - blobSASSignatureValues.encryptionScope, - blobSASSignatureValues.cacheControl, - blobSASSignatureValues.contentDisposition, - blobSASSignatureValues.contentEncoding, - blobSASSignatureValues.contentLanguage, - blobSASSignatureValues.contentType - ].join("\n"); - const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new 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}`); + /** + * Lease state of the blob. Possible + * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * + * @readonly + */ + get leaseState() { + return this.originalResponse.leaseState; } - return elements.join(""); - } - function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version2 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version2 < "2018-11-09") { - throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); + /** + * The current lease status of the + * blob. Possible values include: 'locked', 'unlocked'. + * + * @readonly + */ + get leaseStatus() { + return this.originalResponse.leaseStatus; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { - throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); + /** + * 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; } - if (blobSASSignatureValues.versionId && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); + /** + * The number of committed blocks + * present in the blob. This header is returned only for append blobs. + * + * @readonly + */ + get blobCommittedBlockCount() { + return this.originalResponse.blobCommittedBlockCount; } - if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { - throw RangeError("Must provide 'blobName' when providing 'versionId'."); + /** + * The ETag contains a value that you can use to + * perform operations conditionally, in quotes. + * + * @readonly + */ + get etag() { + return this.originalResponse.etag; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); + /** + * The error code. + * + * @readonly + */ + get errorCode() { + return this.originalResponse.errorCode; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); + /** + * 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 (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); + /** + * 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; } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); + /** + * 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; } - if (version2 < "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."); + /** + * A name-value pair + * to associate with a file storage object. + * + * @readonly + */ + get metadata() { + return this.originalResponse.metadata; } - if (version2 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { - throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); + /** + * 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 (version2 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { - throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); + /** + * 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; } - if (blobSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); + /** + * Indicates the version of the File service used + * to execute the request. + * + * @readonly + */ + get version() { + return this.originalResponse.version; } - blobSASSignatureValues.version = version2; - return blobSASSignatureValues; - } - var BlobLeaseClient = class { /** - * Gets the lease Id. + * 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 leaseId() { - return this._leaseId; + get encryptionKeySha256() { + return this.originalResponse.encryptionKeySha256; } /** - * Gets the url. + * 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 url() { - return this._url; + get blobBody() { + return void 0; } /** - * Creates an instance of BlobLeaseClient. - * @param client - The client to make the lease operation requests. - * @param leaseId - Initial proposed lease id. + * The response body as a node.js Readable stream. + * Always undefined in the browser. + * + * It will parse avor data returned by blob query. + * + * @readonly */ - constructor(client, leaseId2) { - 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 (!leaseId2) { - leaseId2 = coreUtil.randomUUID(); - } - this._leaseId = leaseId2; + get readableStreamBody() { + return core_util_1.isNodeLike ? this.blobDownloadStream : void 0; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob + * The HTTP response. + */ + get _response() { + return this.originalResponse._response; + } + originalResponse; + blobDownloadStream; + /** + * Creates an instance of BlobQueryResponse. * - * @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. + * @param originalResponse - + * @param options - */ - async acquireLease(duration2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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 + } } - return tracingClient.withSpan("BlobLeaseClient-acquireLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.acquireLease({ - abortSignal: options.abortSignal, - duration: duration2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - proposedLeaseId: this._leaseId, - tracingOptions: updatedOptions.tracingOptions - })); + }; + } + } +}); + +// 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, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult } = inputs; + const { operationLocation, resourceLocation, metadata, response } = await init(); + 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 }); - } - /** - * To change the ID of the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(proposedLeaseId2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + 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); } - return tracingClient.withSpan("BlobLeaseClient-changeLease", options, async (updatedOptions) => { - var _a2; - const response = assertResponse(await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId2, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - this._leaseId = proposedLeaseId2; - return response; - }); + updateState === null || updateState === void 0 ? void 0 : updateState(state, 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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - option to configure lease management operations. - * @returns Response data for release lease operation. - */ - async releaseLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + } + 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 _a; + const { location, requestMethod, requestPath, resourceLocationConfig } = inputs; + switch (requestMethod) { + case "PUT": { + return requestPath; } - return tracingClient.withSpan("BlobLeaseClient-releaseLease", options, async (updatedOptions) => { - var _a2; - return assertResponse(await this._containerOrBlobOperation.releaseLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * To renew the lease. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob - * - * @param options - Optional option to configure lease management operations. - * @returns Response data for renew lease operation. - */ - async renewLease(options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + case "DELETE": { + return void 0; } - return tracingClient.withSpan("BlobLeaseClient-renewLease", options, async (updatedOptions) => { - var _a2; - return this._containerOrBlobOperation.renewLease(this._leaseId, { - abortSignal: options.abortSignal, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.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://docs.microsoft.com/en-us/rest/api/storageservices/lease-container - * and - * @see https://docs.microsoft.com/en-us/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(breakPeriod2, options = {}) { - var _a, _b, _c, _d, _e; - if (this._isContainer && (((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone || ((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone || ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.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."); + case "PATCH": { + return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath; + } + default: { + return getDefault(); } - return tracingClient.withSpan("BlobLeaseClient-breakLease", options, async (updatedOptions) => { - var _a2; - const operationOptions = { - abortSignal: options.abortSignal, - breakPeriod: breakPeriod2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - }; - return assertResponse(await this._containerOrBlobOperation.breakLease(operationOptions)); - }); } - }; - var RetriableReadableStream = class extends stream2.Readable { - /** - * 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.retries = 0; - this.sourceDataHandler = (data) => { - if (this.options.doInjectErrorOnce) { - this.options.doInjectErrorOnce = void 0; - this.source.pause(); - this.sourceErrorOrEndHandler(); - this.source.destroy(); - return; + function getDefault() { + switch (resourceLocationConfig) { + case "azure-async-operation": { + return void 0; } - this.offset += data.length; - if (this.onProgress) { - this.onProgress({ loadedBytes: this.offset - this.start }); + case "original-uri": { + return requestPath; } - if (!this.push(data)) { - this.source.pause(); + 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 + }) }; - this.sourceAbortedHandler = () => { - const abortError = new abortController.AbortError("The operation was aborted."); - this.destroy(abortError); + } else if (location !== void 0) { + return { + mode: "ResourceLocation", + operationLocation: location }; - this.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((error4) => { - this.destroy(error4); - }); - } 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}`)); - } + } else if (normalizedRequestMethod === "PUT" && requestPath) { + return { + mode: "Body", + operationLocation: requestPath }; - 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); - } - _destroy(error4, callback) { - this.removeSourceEventHandlers(); - this.source.destroy(); - callback(error4 === null ? void 0 : error4); - } - }; - 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; + } else { + return void 0; } - /** - * 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; + } + 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.`); } - /** - * Returns the value that was specified - * for the Content-Encoding request header. - * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; + 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; + } } - /** - * Returns the value that was specified - * for the Content-Language request header. - * - * @readonly - */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + } + function getStatus(rawResponse) { + var _a; + const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + return transformStatus({ status, statusCode: rawResponse.statusCode }); + } + function getProvisioningState(rawResponse) { + var _a, _b; + const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {}; + 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"; } - /** - * 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; + } + 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; } - /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. - * - * @readonly - */ - get blobType() { - return this.originalResponse.blobType; + 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; } - /** - * The number of bytes present in the - * response body. - * - * @readonly - */ - get contentLength() { - return this.originalResponse.contentLength; + 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; } - /** - * 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; + 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; } - /** - * 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; + return void 0; + } + function getStatusFromInitialResponse(inputs) { + const { response, state, operationLocation } = inputs; + function helper() { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case void 0: + return toOperationStatus(response.rawResponse.statusCode); + case "Body": + return getOperationStatus(response, state); + default: + return "running"; + } } - /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' - * - * @readonly - */ - get contentType() { - return this.originalResponse.contentType; + 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 _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["mode"]; + switch (mode) { + case "OperationLocation": { + return getOperationLocationPollingUrl({ + operationLocation: getOperationLocationHeader(rawResponse), + azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse) + }); + } + case "ResourceLocation": { + return getLocationHeader(rawResponse); + } + case "Body": + default: { + return void 0; + } } - /** - * 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; + } + exports2.getOperationLocation = getOperationLocation; + function getOperationStatus({ rawResponse }, state) { + var _a; + const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a["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}`); } - /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. - * - * @readonly - */ - get copyId() { - return this.originalResponse.copyId; + } + exports2.getOperationStatus = getOperationStatus; + function accessBodyProperty({ flatResponse, rawResponse }, prop) { + var _a, _b; + return (_a = flatResponse === null || flatResponse === void 0 ? void 0 : flatResponse[prop]) !== null && _a !== void 0 ? _a : (_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 = () => ({ /** - * 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 + * 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. */ - get copyProgress() { - return this.originalResponse.copyProgress; + 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, 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, + 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; } - /** - * 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; + setPollerConfig(pollerConfig) { + this.pollerConfig = pollerConfig; } - /** - * 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; + async update(options) { + var _a; + 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 + }); + } + (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state); + return this; } - /** - * 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; + async cancel() { + logger_js_1.logger.error("`cancelOperation` is deprecated because it wasn't implemented"); + return this; } /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. - * - * @readonly + * Serializes the Poller operation. */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + toString() { + return JSON.stringify({ + state: this.state + }); } - /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. - * - * @readonly - */ - get leaseState() { - return this.originalResponse.leaseState; + }; + 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); } - /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. - * - * @readonly - */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + }; + 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 UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`. * - * @readonly - */ - get date() { - return this.originalResponse.date; - } - /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * 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. * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * ```ts + * export class MyPoller extends Poller { + * constructor({ + * // Anything you might need outside of the basics + * }) { + * let state: MyOperationState = { + * privateProperty: private, + * publicProperty: public, + * }; * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The number of tags associated with the blob + * const operation = { + * state, + * update, + * cancel, + * toString + * } * - * @readonly - */ - get tagCount() { - return this.originalResponse.tagCount; - } - /** - * The error code. + * // Sending the operation to the parent's constructor. + * super(operation); * - * @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). + * // You can assign more local properties here. + * } + * } + * ``` * - * @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. + * 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. * - * @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. + * 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: * - * @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. + * ```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); + * } + * } + * ``` * - * @readonly + * @param operation - Must contain the basic properties of `PollOperation`. */ - get lastAccessed() { - return this.originalResponse.lastAccessed; + constructor(operation) { + this.resolveOnUnsuccessful = false; + this.stopped = true; + this.pollProgressCallbacks = []; + this.operation = operation; + this.promise = new Promise((resolve6, reject) => { + this.resolve = resolve6; + this.reject = reject; + }); + this.promise.catch(() => { + }); } /** - * Returns the date and time the blob was created. - * - * @readonly + * Starts a loop that will break only if the poller is done + * or if the poller is stopped. */ - get createdOn() { - return this.originalResponse.createdOn; + async startPolling(pollOptions = {}) { + if (this.stopped) { + this.stopped = false; + } + while (!this.isStopped() && !this.isDone()) { + await this.poll(pollOptions); + await this.delay(); + } } /** - * A name-value pair - * to associate with a file storage object. + * pollOnce does one polling, by calling to the update method of the underlying + * poll operation to make any relevant change effective. * - * @readonly - */ - get metadata() { - return this.originalResponse.metadata; - } - /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get requestId() { - return this.originalResponse.requestId; + async pollOnce(options = {}) { + if (!this.isDone()) { + this.operation = await this.operation.update({ + abortSignal: options.abortSignal, + fireProgress: this.fireProgress.bind(this) + }); + } + this.processUpdatedState(); } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * fireProgress calls the functions passed in via onProgress the method of the poller. * - * @readonly - */ - get clientRequestId() { - return this.originalResponse.clientRequestId; - } - /** - * Indicates the version of the Blob service used - * to execute the request. + * It loops over all of the callbacks received from onProgress, and executes them, sending them + * the current operation state. * - * @readonly + * @param state - The current operation state. */ - get version() { - return this.originalResponse.version; + fireProgress(state) { + for (const callback of this.pollProgressCallbacks) { + callback(state); + } } /** - * Indicates the versionId of the downloaded blob version. - * - * @readonly + * Invokes the underlying operation's cancel method. */ - get versionId() { - return this.originalResponse.versionId; + async cancelOnce(options = {}) { + this.operation = await this.operation.cancel(options); } /** - * Indicates whether version of this blob is a current version. + * 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. * - * @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. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * @param options - Optional properties passed to the operation's update method. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + 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; } - /** - * 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; + 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()); + } } /** - * Object Replication Policy Id of the destination blob. - * - * @readonly + * Returns a promise that will resolve once the underlying operation is completed. */ - get objectReplicationDestinationPolicyId() { - return this.originalResponse.objectReplicationDestinationPolicyId; + async pollUntilDone(pollOptions = {}) { + if (this.stopped) { + this.startPolling(pollOptions).catch(this.reject); + } + this.processUpdatedState(); + return this.promise; } /** - * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. + * Invokes the provided callback after each polling is completed, + * sending the current state of the poller's operation. * - * @readonly + * It returns a method that can be used to stop receiving updates on the given callback function. */ - get objectReplicationSourceProperties() { - return this.originalResponse.objectReplicationSourceProperties; + onProgress(callback) { + this.pollProgressCallbacks.push(callback); + return () => { + this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback); + }; } /** - * If this blob has been sealed. - * - * @readonly + * Returns true if the poller has finished polling. */ - get isSealed() { - return this.originalResponse.isSealed; + isDone() { + const state = this.operation.state; + return Boolean(state.isCompleted || state.isCancelled || state.error); } /** - * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire. - * - * @readonly + * Stops the poller from continuing to poll. */ - get immutabilityPolicyExpiresOn() { - return this.originalResponse.immutabilityPolicyExpiresOn; + stopPolling() { + if (!this.stopped) { + this.stopped = true; + if (this.reject) { + this.reject(new PollerStoppedError("This poller is already stopped")); + } + } } /** - * Indicates immutability policy mode. - * - * @readonly + * Returns true if the poller is stopped. */ - get immutabilityPolicyMode() { - return this.originalResponse.immutabilityPolicyMode; + isStopped() { + return this.stopped; } /** - * Indicates if a legal hold is present on the blob. + * Attempts to cancel the underlying operation. * - * @readonly - */ - get legalHold() { - return this.originalResponse.legalHold; - } - /** - * The response body as a browser Blob. - * Always undefined in node.js. + * It only optionally receives an object with an abortSignal property, from \@azure/abort-controller's AbortSignalLike. * - * @readonly + * If it's called again before it finishes, it will throw an error. + * + * @param options - Optional properties passed to the operation's update method. */ - get contentAsBlob() { - return this.originalResponse.blobBody; + 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; } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * Returns the state of the operation. * - * It will automatically retry when internal read stream unexpected ends. + * 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. * - * @readonly + * 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. */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; + getOperationState() { + return this.operation.state; } /** - * The HTTP response. + * 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. */ - get _response() { - return this.originalResponse._response; + getResult() { + const state = this.operation.state; + return state.result; } /** - * Creates an instance of BlobDownloadResponse. - * - * @param originalResponse - - * @param getter - - * @param offset - - * @param count - - * @param options - + * Returns a serialized version of the poller's operation + * by invoking the operation's toString method. */ - constructor(originalResponse, getter, offset, count, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options); + toString() { + return this.operation.toString(); } }; - var AVRO_SYNC_MARKER_SIZE = 16; - var AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]); - var AVRO_CODEC_KEY = "avro.codec"; - var AVRO_SCHEMA_KEY = "avro.schema"; - var AvroParser = class _AvroParser { - /** - * Reads a fixed number of bytes from the stream. - * - * @param stream - - * @param length - - * @param options - - */ - static async readFixedBytes(stream3, length, options = {}) { - const bytes = await stream3.read(length, { abortSignal: options.abortSignal }); - if (bytes.length !== length) { - throw new Error("Hit stream end."); - } - return bytes; + 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); } /** - * Reads a single byte from the stream. - * - * @param stream - - * @param options - + * The method used by the poller to wait before attempting to update its operation. */ - static async readByte(stream3, options = {}) { - const buf = await _AvroParser.readFixedBytes(stream3, 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(stream3, options = {}) { - let zigZagEncoded = 0; - let significanceInBit = 0; - let byte, haveMoreByte, significanceInFloat; - do { - byte = await _AvroParser.readByte(stream3, 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(stream3, 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(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readInt(stream3, options = {}) { - return _AvroParser.readZigZagLong(stream3, options); - } - static async readNull() { - return null; + delay() { + return new Promise((resolve6) => setTimeout(() => resolve6(), this.config.intervalInMs)); } - static async readBoolean(stream3, options = {}) { - const b = await _AvroParser.readByte(stream3, options); - if (b === 1) { - return true; - } else if (b === 0) { - return false; - } else { - throw new Error("Byte was not a boolean."); + }; + 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; } - } - static async readFloat(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 4, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat32(0, true); - } - static async readDouble(stream3, options = {}) { - const u8arr = await _AvroParser.readFixedBytes(stream3, 8, options); - const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength); - return view.getFloat64(0, true); - } - static async readBytes(stream3, options = {}) { - const size = await _AvroParser.readLong(stream3, options); - if (size < 0) { - throw new Error("Bytes size was negative."); + const operation = makeBlobBeginCopyFromURLPollOperation({ + ...state, + blobClient, + copySource, + startCopyFromURLOptions + }); + super(operation); + if (typeof onProgress === "function") { + this.onProgress(onProgress); } - return stream3.read(size, { abortSignal: options.abortSignal }); - } - static async readString(stream3, options = {}) { - const u8arr = await _AvroParser.readBytes(stream3, options); - const utf8decoder = new TextDecoder(); - return utf8decoder.decode(u8arr); + this.intervalInMs = intervalInMs; } - static async readMapPair(stream3, readItemMethod, options = {}) { - const key = await _AvroParser.readString(stream3, options); - const value = await readItemMethod(stream3, options); - return { key, value }; + delay() { + return (0, core_util_1.delay)(this.intervalInMs); } - static async readMap(stream3, readItemMethod, options = {}) { - const readPairMethod = (s, opts = {}) => { - return _AvroParser.readMapPair(s, readItemMethod, opts); - }; - const pairs2 = await _AvroParser.readArray(stream3, readPairMethod, options); - const dict = {}; - for (const pair of pairs2) { - dict[pair.key] = pair.value; - } - return dict; + }; + exports2.BlobBeginCopyFromUrlPoller = BlobBeginCopyFromUrlPoller; + var cancel = async function cancel2(options = {}) { + const state = this.state; + const { copyId } = state; + if (state.isCompleted) { + return makeBlobBeginCopyFromURLPollOperation(state); } - static async readArray(stream3, readItemMethod, options = {}) { - const items = []; - for (let count = await _AvroParser.readLong(stream3, options); count !== 0; count = await _AvroParser.readLong(stream3, options)) { - if (count < 0) { - await _AvroParser.readLong(stream3, options); - count = -count; - } - while (count--) { - const item = await readItemMethod(stream3, options); - items.push(item); - } - } - return items; + if (!copyId) { + state.isCancelled = true; + return makeBlobBeginCopyFromURLPollOperation(state); } + await state.blobClient.abortCopyFromURL(copyId, { + abortSignal: options.abortSignal + }); + state.isCancelled = true; + return makeBlobBeginCopyFromURLPollOperation(state); }; - 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(schema2) { - if (typeof schema2 === "string") { - return _AvroType.fromStringSchema(schema2); - } else if (Array.isArray(schema2)) { - return _AvroType.fromArraySchema(schema2); - } else { - return _AvroType.fromObjectSchema(schema2); - } - } - static fromStringSchema(schema2) { - switch (schema2) { - 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(schema2); - default: - throw new Error(`Unexpected Avro type ${schema2}`); + 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; } - } - static fromArraySchema(schema2) { - return new AvroUnionType(schema2.map(_AvroType.fromSchema)); - } - static fromObjectSchema(schema2) { - const type2 = schema2.type; + } else if (!state.isCompleted) { try { - return _AvroType.fromStringSchema(type2); - } catch (_a) { - } - switch (type2) { - case AvroComplex.RECORD: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.name) { - throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema2}`); - } - const fields = {}; - if (!schema2.fields) { - throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema2}`); - } - for (const field of schema2.fields) { - fields[field.name] = _AvroType.fromSchema(field.type); - } - return new AvroRecordType(fields, schema2.name); - case AvroComplex.ENUM: - if (schema2.aliases) { - throw new Error(`aliases currently is not supported, schema: ${schema2}`); - } - if (!schema2.symbols) { - throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema2}`); - } - return new AvroEnumType(schema2.symbols); - case AvroComplex.MAP: - if (!schema2.values) { - throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema2}`); - } - return new AvroMapType(_AvroType.fromSchema(schema2.values)); - case AvroComplex.ARRAY: - // Unused today - case AvroComplex.FIXED: - // Unused today - default: - throw new Error(`Unexpected Avro type ${type2} in ${schema2}`); + 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 AvroPrimitiveType = class extends AvroType { - constructor(primitive) { - super(); - this._primitive = primitive; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - switch (this._primitive) { - case AvroPrimitive.NULL: - return AvroParser.readNull(); - case AvroPrimitive.BOOLEAN: - return AvroParser.readBoolean(stream3, options); - case AvroPrimitive.INT: - return AvroParser.readInt(stream3, options); - case AvroPrimitive.LONG: - return AvroParser.readLong(stream3, options); - case AvroPrimitive.FLOAT: - return AvroParser.readFloat(stream3, options); - case AvroPrimitive.DOUBLE: - return AvroParser.readDouble(stream3, options); - case AvroPrimitive.BYTES: - return AvroParser.readBytes(stream3, options); - case AvroPrimitive.STRING: - return AvroParser.readString(stream3, options); - default: - throw new Error("Unknown Avro Primitive"); + var toString3 = function toString4() { + return JSON.stringify({ state: this.state }, (key, value) => { + if (key === "blobClient") { + return void 0; } - } - }; - var AvroEnumType = class extends AvroType { - constructor(symbols) { - super(); - this._symbols = symbols; - } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, options = {}) { - const value = await AvroParser.readInt(stream3, options); - return this._symbols[value]; - } + return value; + }); }; - var AvroUnionType = class extends AvroType { - constructor(types) { - super(); - this._types = types; + function makeBlobBeginCopyFromURLPollOperation(state) { + return { + state: { ...state }, + cancel, + toString: toString3, + 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.`); } - async read(stream3, options = {}) { - const typeIndex = await AvroParser.readInt(stream3, options); - return this._types[typeIndex].read(stream3, options); + 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.`); } - }; - var AvroMapType = class extends AvroType { - constructor(itemType) { - super(); - this._itemType = itemType; + 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(); } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - read(stream3, options = {}) { - const readItemMethod = (s, opts) => { - return this._itemType.read(s, opts); - }; - return AvroParser.readMap(stream3, readItemMethod, options); + /** + * 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); + } + }); } - }; - var AvroRecordType = class extends AvroType { - constructor(fields, name) { - super(); - this._fields = fields; - this._name = name; + /** + * Start execute operations in the queue. + * + */ + async do() { + if (this.operations.length === 0) { + return Promise.resolve(); + } + this.parallelExecute(); + return new Promise((resolve6, reject) => { + this.emitter.on("finish", resolve6); + this.emitter.on("error", (error3) => { + this.state = BatchStates.Error; + reject(error3); + }); + }); } - // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types - async read(stream3, 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(stream3, options); + /** + * 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; } } - return record; } }; - 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; + exports2.Batch = Batch; + } +}); + +// node_modules/@azure/storage-blob/dist/commonjs/utils/utils.js +var require_utils7 = __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((resolve6, 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); + resolve6(); + 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}`)); + } + resolve6(); + }); + stream2.on("error", (msg) => { + clearTimeout(timeout); + reject(msg); + }); + }); } - var AvroReader = class { - get blockOffset() { - return this._blockOffset; - } - get objectIndex() { - return this._objectIndex; - } - 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.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, { - abortSignal: options.abortSignal + async function streamToBuffer2(stream2, buffer, encoding) { + let pos = 0; + const bufferSize = buffer.length; + return new Promise((resolve6, 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; }); - if (!arraysEqual(header, AVRO_INIT_BYTES)) { - throw new Error("Stream is not an Avro file."); - } - this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, { - abortSignal: options.abortSignal + stream2.on("end", () => { + resolve6(pos); }); - const codec = this._metadata[AVRO_CODEC_KEY]; - if (!(codec === void 0 || codec === null || codec === "null")) { - throw new Error("Codecs are not supported"); - } - this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal + stream2.on("error", reject); + }); + } + async function streamToBuffer3(readableStream, encoding) { + return new Promise((resolve6, reject) => { + const chunks = []; + readableStream.on("data", (data) => { + chunks.push(typeof data === "string" ? Buffer.from(data, encoding) : data); }); - const schema2 = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]); - this._itemType = AvroType.fromSchema(schema2); - if (this._blockOffset === 0) { - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - } - this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal + readableStream.on("end", () => { + resolve6(Buffer.concat(chunks)); }); - await 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--; - } - } + readableStream.on("error", reject); + }); + } + async function readStreamToLocalFile(rs, file) { + return new Promise((resolve6, reject) => { + const ws = node_fs_1.default.createWriteStream(file); + rs.on("error", (err) => { + reject(err); + }); + ws.on("error", (err) => { + reject(err); + }); + ws.on("close", resolve6); + 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_utils7(); + 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; } - hasNext() { - return !this._initialized || this._itemsRemainingInBlock > 0; + /** + * The name of the storage container the blob is associated with. + */ + get containerName() { + return this._containerName; } - parseObjects() { - return tslib.__asyncGenerator(this, arguments, function* parseObjects_1(options = {}) { - if (!this._initialized) { - yield tslib.__await(this.initialize(options)); + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + options = options || {}; + let pipeline; + let url2; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; } - while (this.hasNext()) { - const result = yield tslib.__await(this._itemType.read(this._dataStream, { - abortSignal: options.abortSignal - })); - this._itemsRemainingInBlock--; - this._objectIndex++; - if (this._itemsRemainingInBlock === 0) { - const marker2 = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, { - abortSignal: options.abortSignal - })); - this._blockOffset = this._initialBlockOffset + this._dataStream.position; - this._objectIndex = 0; - if (!arraysEqual(this._syncMarker, marker2)) { - throw new Error("Stream is not a valid Avro file."); - } - try { - this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, { - abortSignal: options.abortSignal - })); - } catch (_a) { - this._itemsRemainingInBlock = 0; - } - if (this._itemsRemainingInBlock > 0) { - yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal })); + pipeline = (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); } + pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); } - yield yield tslib.__await(result); + } 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; + pipeline = (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"); } - }); - } - }; - var AvroReadable = class { - }; - var ABORT_ERROR = new abortController.AbortError("Reading from the avro stream was aborted."); - var AvroReadableFromStream = class extends AvroReadable { - toUint8Array(data) { - if (typeof data === "string") { - return Buffer.from(data); + } else { + throw new Error("Expecting non-empty strings for containerName and blobName parameters"); } - return data; - } - constructor(readable) { - super(); - this._readable = readable; - this._position = 0; + super(url2, pipeline); + ({ 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); } - get position() { - return this._position; + /** + * 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); } - async read(size, options = {}) { - var _a; - if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.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((resolve6, 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(); - resolve6(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); - } - }); - } + /** + * 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); } - }; - var BlobQuickQueryStream = class extends stream2.Readable { /** - * Creates an instance of BlobQuickQueryStream. + * Creates a AppendBlobClient object. * - * @param source - The current ReadableStream returned from getter - * @param options - */ - constructor(source, options = {}) { - super(); - this.avroPaused = true; - this.source = source; - this.onProgress = options.onProgress; - this.onError = options.onError; - this.avroReader = new AvroReader(new AvroReadableFromStream(this.source)); - this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal }); + getAppendBlobClient() { + return new AppendBlobClient(this.url, this.pipeline); } - _read() { - if (this.avroPaused) { - this.readInternal().catch((err) => { - this.emit("error", err); - }); - } + /** + * Creates a BlockBlobClient object. + * + */ + getBlockBlobClient() { + return new BlockBlobClient(this.url, this.pipeline); } - async readInternal() { - this.avroPaused = false; - let avroNext; - do { - avroNext = await this.avroIter.next(); - if (avroNext.done) { - break; - } - const obj = avroNext.value; - const schema2 = obj.$schema; - if (typeof schema2 !== "string") { - throw Error("Missing schema in avro record."); - } - switch (schema2) { - 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 ${schema2} in avro progress record.`); - } - } while (!avroNext.done && !this.avroPaused); + /** + * Creates a PageBlobClient object. + * + */ + getPageBlobClient() { + return new PageBlobClient(this.url, this.pipeline); } - }; - var BlobQueryResponse = class { /** - * Indicates that the service supports - * requests for partial file content. + * Reads or downloads a blob from the system, including its metadata and properties. + * You can also call Get Blob to read a snapshot. * - * @readonly + * * 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}`); + * } + * ``` */ - get acceptRanges() { - return this.originalResponse.acceptRanges; + 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 if it was previously specified - * for the file. + * Returns true if the Azure blob resource represented by this client exists; false otherwise. * - * @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. + * 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. * - * @readonly + * @param options - options to Exists operation. */ - get contentDisposition() { - return this.originalResponse.contentDisposition; + 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 the value that was specified - * for the Content-Encoding request header. + * 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 * - * @readonly - */ - get contentEncoding() { - return this.originalResponse.contentEncoding; - } - /** - * Returns the value that was specified - * for the Content-Language request header. + * 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. * - * @readonly + * @param options - Optional options to Get Properties operation. */ - get contentLanguage() { - return this.originalResponse.contentLanguage; + 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) + }; + }); } /** - * The current sequence number for a - * page blob. This header is not returned for block blobs or append blobs. + * 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 * - * @readonly + * @param options - Optional options to Blob Delete operation. */ - get blobSequenceNumber() { - return this.originalResponse.blobSequenceNumber; + 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 + })); + }); } /** - * The blob's type. Possible values include: - * 'BlockBlob', 'PageBlob', 'AppendBlob'. + * 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 * - * @readonly + * @param options - Optional options to Blob Delete operation. */ - get blobType() { - return this.originalResponse.blobType; + 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; + } + }); } /** - * The number of bytes present in the - * response body. + * 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 * - * @readonly + * @param options - Optional options to Blob Undelete operation. */ - get contentLength() { - return this.originalResponse.contentLength; + 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 + })); + }); } /** - * 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. + * Sets system properties on the blob. * - * @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. + * 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 * - * @readonly + * @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. */ - get contentRange() { - return this.originalResponse.contentRange; + 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 + })); + }); } /** - * The content type specified for the file. - * The default content type is 'application/octet-stream' + * Sets user-defined metadata for the specified blob as one or more name-value pairs. * - * @readonly + * 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. */ - get contentType() { - return this.originalResponse.contentType; + 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 + })); + }); } /** - * 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. + * 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 ('_'). * - * @readonly + * @param tags - + * @param options - */ - get copyCompletedOn() { - return void 0; + 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) + })); + }); } /** - * String identifier for the last attempted Copy - * File operation where this file was the destination file. + * Gets the tags associated with the underlying blob. * - * @readonly + * @param options - */ - get copyId() { - return this.originalResponse.copyId; + 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; + }); } /** - * 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. + * Get a {@link BlobLeaseClient} that manages leases on the blob. * - * @readonly + * @param proposeLeaseId - Initial proposed lease Id. + * @returns A new BlobLeaseClient object for managing leases on the blob. */ - get copyProgress() { - return this.originalResponse.copyProgress; + getBlobLeaseClient(proposeLeaseId) { + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** - * 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. + * Creates a read-only snapshot of a blob. + * @see https://learn.microsoft.com/rest/api/storageservices/snapshot-blob * - * @readonly + * @param options - Optional options to the Blob Create Snapshot operation. */ - get copySource() { - return this.originalResponse.copySource; + 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 + })); + }); } /** - * State of the copy operation - * identified by 'x-ms-copy-id'. Possible values include: 'pending', - * 'success', 'aborted', 'failed' + * 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. * - * @readonly + * 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. */ - get copyStatus() { - return this.originalResponse.copyStatus; + 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; } /** - * Only appears when - * x-ms-copy-status is failed or pending. Describes cause of fatal or - * non-fatal copy operation failure. + * 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 * - * @readonly + * @param copyId - Id of the Copy From URL operation. + * @param options - Optional options to the Blob Abort Copy From URL operation. */ - get copyStatusDescription() { - return this.originalResponse.copyStatusDescription; + 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 + })); + }); } /** - * When a blob is leased, - * specifies whether the lease is of infinite or fixed duration. Possible - * values include: 'infinite', 'fixed'. + * 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 * - * @readonly + * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication + * @param options - */ - get leaseDuration() { - return this.originalResponse.leaseDuration; + 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 + })); + }); } /** - * Lease state of the blob. Possible - * values include: 'available', 'leased', 'expired', 'breaking', 'broken'. + * 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 * - * @readonly + * @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. */ - get leaseState() { - return this.originalResponse.leaseState; + 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; + }); } /** - * The current lease status of the - * blob. Possible values include: 'locked', 'unlocked'. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @readonly + * 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. */ - get leaseStatus() { - return this.originalResponse.leaseStatus; + 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."); + } } /** - * A UTC date/time value generated by the service that - * indicates the time at which the response was initiated. + * 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 * - * @readonly + * @param copySource - url to the source Azure Blob/File. + * @param options - Optional options to the Blob Start Copy From URL operation. */ - get date() { - return this.originalResponse.date; + 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 + })); + }); } /** - * The number of committed blocks - * present in the blob. This header is returned only for append blobs. + * Only available for BlobClient constructed with a shared key credential. * - * @readonly - */ - get blobCommittedBlockCount() { - return this.originalResponse.blobCommittedBlockCount; - } - /** - * The ETag contains a value that you can use to - * perform operations conditionally, in quotes. + * 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. * - * @readonly - */ - get etag() { - return this.originalResponse.etag; - } - /** - * The error code. + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-a-service-sas * - * @readonly + * @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. */ - get errorCode() { - return this.originalResponse.errorCode; + generateSasUrl(options) { + return new Promise((resolve6) => { + 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(); + resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); } /** - * 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). + * Only available for BlobClient constructed with a shared key credential. * - * @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. + * 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. * - * @readonly + * @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. */ - get blobContentMD5() { - return this.originalResponse.blobContentMD5; + /* 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; } /** - * 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 + * 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. */ - get lastModified() { - return this.originalResponse.lastModified; + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve6) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + blobName: this._name, + snapshotTime: this._snapshot, + versionId: this._versionId, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); } /** - * A name-value pair - * to associate with a file storage object. + * Only available for BlobClient constructed with a shared key credential. * - * @readonly + * 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. */ - get metadata() { - return this.originalResponse.metadata; + 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; } /** - * This header uniquely identifies the request - * that was made and can be used for troubleshooting the request. + * Delete the immutablility policy on the blob. * - * @readonly + * @param options - Optional options to delete immutability policy on the blob. */ - get requestId() { - return this.originalResponse.requestId; + 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 + })); + }); } /** - * If a client request id header is sent in the request, this header will be present in the - * response with the same value. + * Set immutability policy on the blob. * - * @readonly + * @param options - Optional options to set immutability policy on the blob. */ - get clientRequestId() { - return this.originalResponse.clientRequestId; + 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 + })); + }); } /** - * Indicates the version of the File service used - * to execute the request. + * Set legal hold on the blob. * - * @readonly + * @param options - Optional options to set legal hold on the blob. */ - get version() { - return this.originalResponse.version; + 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 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. + * 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 * - * @readonly + * @param options - Options to the Service Get Account Info operation. + * @returns Response data for the Service Get Account Info operation. */ - get encryptionKeySha256() { - return this.originalResponse.encryptionKeySha256; + 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 { /** - * 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) + * appendBlobsContext provided by protocol layer. */ - get contentCrc64() { - return this.originalResponse.contentCrc64; + appendBlobContext; + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + let pipeline; + let url2; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + pipeline = (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); + } + pipeline = (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; + pipeline = (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, pipeline); + this.appendBlobContext = this.storageClientContext.appendBlob; } /** - * The response body as a browser Blob. - * Always undefined in node.js. + * 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. * - * @readonly + * @param snapshot - The snapshot timestamp. + * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp. */ - get blobBody() { - return void 0; + 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); } /** - * The response body as a node.js Readable stream. - * Always undefined in the browser. + * 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 * - * It will parse avor data returned by blob query. + * @param options - Options to the Append Block Create operation. * - * @readonly - */ - get readableStreamBody() { - return coreUtil.isNode ? this.blobDownloadStream : void 0; - } - /** - * The HTTP response. - */ - get _response() { - return this.originalResponse._response; - } - /** - * Creates an instance of BlobQueryResponse. * - * @param originalResponse - - * @param options - - */ - constructor(originalResponse, options = {}) { - this.originalResponse = originalResponse; - this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options); - } - }; - exports2.BlockBlobTier = void 0; - (function(BlockBlobTier) { - BlockBlobTier["Hot"] = "Hot"; - BlockBlobTier["Cool"] = "Cool"; - BlockBlobTier["Cold"] = "Cold"; - BlockBlobTier["Archive"] = "Archive"; - })(exports2.BlockBlobTier || (exports2.BlockBlobTier = {})); - exports2.PremiumPageBlobTier = void 0; - (function(PremiumPageBlobTier) { - PremiumPageBlobTier["P4"] = "P4"; - PremiumPageBlobTier["P6"] = "P6"; - PremiumPageBlobTier["P10"] = "P10"; - PremiumPageBlobTier["P15"] = "P15"; - PremiumPageBlobTier["P20"] = "P20"; - PremiumPageBlobTier["P30"] = "P30"; - PremiumPageBlobTier["P40"] = "P40"; - PremiumPageBlobTier["P50"] = "P50"; - PremiumPageBlobTier["P60"] = "P60"; - PremiumPageBlobTier["P70"] = "P70"; - PremiumPageBlobTier["P80"] = "P80"; - })(exports2.PremiumPageBlobTier || (exports2.PremiumPageBlobTier = {})); - function toAccessTier(tier2) { - if (tier2 === void 0) { - return void 0; - } - return tier2; - } - 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 = EncryptionAlgorithmAES25; - } - } - exports2.StorageBlobAudience = void 0; - (function(StorageBlobAudience) { - StorageBlobAudience["StorageOAuthScopes"] = "https://storage.azure.com/.default"; - StorageBlobAudience["DiskComputeOAuthScopes"] = "https://disk.compute.azure.com/.default"; - })(exports2.StorageBlobAudience || (exports2.StorageBlobAudience = {})); - function getBlobServiceAccountAudience(storageAccountName) { - return `https://${storageAccountName}.blob.core.windows.net/.default`; - } - 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 Object.assign(Object.assign({}, response), { - pageRange, - clearRange, - _response: Object.assign(Object.assign({}, response._response), { parsedBody: { - pageRange, - clearRange - } }) - }); - } - var BlobBeginCopyFromUrlPoller = class extends coreLro.Poller { - constructor(options) { - const { blobClient, copySource: copySource2, intervalInMs = 15e3, onProgress, resumeFrom, startCopyFromURLOptions } = options; - let state; - if (resumeFrom) { - state = JSON.parse(resumeFrom).state; - } - const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { - blobClient, - copySource: copySource2, - startCopyFromURLOptions - })); - super(operation); - if (typeof onProgress === "function") { - this.onProgress(onProgress); - } - this.intervalInMs = intervalInMs; - } - delay() { - return coreUtil.delay(this.intervalInMs); - } - }; - var cancel = async function cancel2(options = {}) { - const state = this.state; - const { copyId: copyId2 } = state; - if (state.isCompleted) { - return makeBlobBeginCopyFromURLPollOperation(state); - } - if (!copyId2) { - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - } - await state.blobClient.abortCopyFromURL(copyId2, { - abortSignal: options.abortSignal - }); - state.isCancelled = true; - return makeBlobBeginCopyFromURLPollOperation(state); - }; - var update = async function update2(options = {}) { - const state = this.state; - const { blobClient, copySource: copySource2, startCopyFromURLOptions } = state; - if (!state.isStarted) { - state.isStarted = true; - const result = await blobClient.startCopyFromURL(copySource2, 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 toString3 = function toString4() { - return JSON.stringify({ state: this.state }, (key, value) => { - if (key === "blobClient") { - return void 0; - } - return value; - }); - }; - function makeBlobBeginCopyFromURLPollOperation(state) { - return { - state: Object.assign({}, state), - cancel, - toString: toString3, - update - }; - } - 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}-`; - } - var BatchStates; - (function(BatchStates2) { - BatchStates2[BatchStates2["Good"] = 0] = "Good"; - BatchStates2[BatchStates2["Error"] = 1] = "Error"; - })(BatchStates || (BatchStates = {})); - var Batch = class { - /** - * Creates an instance of Batch. - * @param concurrency - + * 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(); + * ``` */ - constructor(concurrency = 5) { - this.actives = 0; - this.completed = 0; - this.offset = 0; - this.operations = []; - this.state = BatchStates.Good; - if (concurrency < 1) { - throw new RangeError("concurrency must be larger than 0"); - } - this.concurrency = concurrency; - this.emitter = new events.EventEmitter(); + 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 + })); + }); } /** - * Add a operation into queue. + * 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 operation - + * @param options - */ - addOperation(operation) { - this.operations.push(async () => { + async createIfNotExists(options = {}) { + const conditions = { ifNoneMatch: constants_js_1.ETagAny }; + return tracing_js_1.tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - this.actives++; - await operation(); - this.actives--; - this.completed++; - this.parallelExecute(); - } catch (error4) { - this.emitter.emit("error", error4); + 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; } }); } /** - * Start execute operations in the queue. + * Seals the append blob, making it read only. * + * @param options - */ - async do() { - if (this.operations.length === 0) { - return Promise.resolve(); - } - this.parallelExecute(); - return new Promise((resolve6, reject) => { - this.emitter.on("finish", resolve6); - this.emitter.on("error", (error4) => { - this.state = BatchStates.Error; - reject(error4); - }); + 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 + })); }); } /** - * Get next operation to be executed. Return null when reaching ends. + * Commits a new block of data to the end of the existing append blob. + * @see https://learn.microsoft.com/rest/api/storageservices/append-block * - */ - 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. + * @param body - Data to be appended. + * @param contentLength - Length of the body in bytes. + * @param options - Options to the Append Block operation. * - */ - 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; - } - } - } - }; - var BuffersStream = class extends stream2.Readable { - /** - * 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 + * 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); + * ``` */ - 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."); - } + 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 + })); + }); } /** - * Internal _read() that will be called when the stream wants to pull more data in. + * 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 size - Optional. The size of data to be read + * @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 - */ - _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++; + 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 pipeline; + let url2; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; + pipeline = 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); + } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { + url2 = urlOrConnectionString; + if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { + options = blobNameOrOptions; + } + pipeline = (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); + } + pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); } else { - this.byteOffsetInCurrentBuffer = end; + throw new Error("Account connection string is only supported in Node.js environment"); } - this.pushedBytesLength += remaining; - i += remaining; + } 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; + pipeline = (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"); } - if (outBuffers.length > 1) { - this.push(Buffer.concat(outBuffers)); - } else if (outBuffers.length === 1) { - this.push(outBuffers[0]); - } + super(url2, pipeline); + this.blockBlobContext = this.storageClientContext.blockBlob; + this._blobContext = this.storageClientContext.blob; } - }; - var maxBufferLength = buffer.constants.MAX_LENGTH; - var PooledBuffer = class { /** - * The size of the data contained in the pooled buffers. + * 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. */ - get size() { - return this._size; - } - constructor(capacity, buffers, totalLength) { - this.buffers = []; - 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); - } + 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); } /** - * 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. + * ONLY AVAILABLE IN NODE.JS RUNTIME. * - * @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. + * 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 - */ - 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); + 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 + }); + }); } /** - * Get the readable stream assembled from all the data in the internal buffers. + * 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); + * ``` */ - getReadableStream() { - return new BuffersStream(this.buffers, this.size); + 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 + })); + }); } - }; - var BufferScheduler = class { /** - * Creates an instance of BufferScheduler. + * 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 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 + * @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. */ - constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) { - this.emitter = new events.EventEmitter(); - this.offset = 0; - this.isStreamEnd = false; - this.isError = false; - this.executingOutgoingHandlers = 0; - this.numBuffers = 0; - this.unresolvedDataArray = []; - this.unresolvedLength = 0; - this.incoming = []; - this.outgoing = []; - 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; + 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 + })); + }); } /** - * Start the scheduler, will return error when stream of any of the outgoingHandlers - * returns error. + * 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 do() { - return new Promise((resolve6, 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 buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.outgoingHandler(() => buffer2.getReadableStream(), buffer2.size, this.offset).then(resolve6).catch(reject); - } else if (this.unresolvedLength >= this.bufferSize) { - return; - } else { - resolve6(); - } - } - }); + 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 + })); }); } /** - * Insert a new data into unresolved array. + * 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 data - + * @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. */ - appendUnresolvedData(data) { - this.unresolvedDataArray.push(data); - this.unresolvedLength += data.length; + 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 + })); + }); } /** - * 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. + * 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. */ - shiftBufferFromUnresolvedDataArray(buffer2) { - if (!buffer2) { - buffer2 = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength); - } else { - buffer2.fill(this.unresolvedDataArray, this.unresolvedLength); - } - this.unresolvedLength -= buffer2.size; - return buffer2; + 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 + })); + }); } /** - * 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 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 * - * @returns Return false when buffers in incoming are not enough, else true. + * @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. */ - resolveData() { - while (this.unresolvedLength >= this.bufferSize) { - let buffer2; - if (this.incoming.length > 0) { - buffer2 = this.incoming.shift(); - this.shiftBufferFromUnresolvedDataArray(buffer2); - } else { - if (this.numBuffers < this.maxBuffers) { - buffer2 = this.shiftBufferFromUnresolvedDataArray(); - this.numBuffers++; - } else { - return false; - } + 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 = []; } - this.outgoing.push(buffer2); - this.triggerOutgoingHandlers(); - } - return true; + if (!res.uncommittedBlocks) { + res.uncommittedBlocks = []; + } + return res; + }); } + // High level functions /** - * Try to trigger a outgoing handler for every buffer in outgoing. Stop when - * concurrency reaches. + * 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 triggerOutgoingHandlers() { - let buffer2; - do { - if (this.executingOutgoingHandlers >= this.concurrency) { - return; - } - buffer2 = this.outgoing.shift(); - if (buffer2) { - this.triggerOutgoingHandler(buffer2); + 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); } - } while (buffer2); + }); } /** - * Trigger a outgoing handler for a buffer shifted from outgoing. + * ONLY AVAILABLE IN BROWSERS. * - * @param buffer - + * 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 triggerOutgoingHandler(buffer2) { - const bufferLength = buffer2.size; - this.executingOutgoingHandlers++; - this.offset += bufferLength; - try { - await this.outgoingHandler(() => buffer2.getReadableStream(), bufferLength, this.offset - bufferLength); - } catch (err) { - this.emitter.emit("error", err); - return; - } - this.executingOutgoingHandlers--; - this.reuseBuffer(buffer2); - this.emitter.emit("checkEnd"); + 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); + }); } /** - * Return buffer used by outgoing handler into incoming. * - * @param buffer - + * 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. */ - reuseBuffer(buffer2) { - this.incoming.push(buffer2); - if (!this.isError && this.resolveData() && !this.isStreamEnd) { - this.readable.resume(); + 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}`); } - } - }; - async function streamToBuffer(stream3, buffer2, offset, end, encoding) { - let pos = 0; - const count = end - offset; - return new Promise((resolve6, reject) => { - const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT); - stream3.on("readable", () => { - if (pos >= count) { - clearTimeout(timeout); - resolve6(); - return; - } - let chunk = stream3.read(); - if (!chunk) { - return; - } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); + 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.`); } - const chunkLength = pos + chunk.length > count ? count - pos : chunk.length; - buffer2.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength); - pos += chunkLength; - }); - stream3.on("end", () => { - clearTimeout(timeout); - if (pos < count) { - reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`)); + 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; + } } - resolve6(); - }); - stream3.on("error", (msg) => { - clearTimeout(timeout); - reject(msg); - }); - }); - } - async function streamToBuffer2(stream3, buffer2, encoding) { - let pos = 0; - const bufferSize = buffer2.length; - return new Promise((resolve6, reject) => { - stream3.on("readable", () => { - let chunk = stream3.read(); - if (!chunk) { - return; + } + 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)); } - if (typeof chunk === "string") { - chunk = Buffer.from(chunk, encoding); + 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}`); } - if (pos + chunk.length > bufferSize) { - reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`)); - return; + 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 + }); + } + }); } - buffer2.fill(chunk, pos, pos + chunk.length); - pos += chunk.length; - }); - stream3.on("end", () => { - resolve6(pos); - }); - stream3.on("error", reject); - }); - } - async function readStreamToLocalFile(rs, file) { - return new Promise((resolve6, reject) => { - const ws = fs__namespace.createWriteStream(file); - rs.on("error", (err) => { - reject(err); - }); - ws.on("error", (err) => { - reject(err); + await batch.do(); + return this.commitBlockList(blockList, updatedOptions); }); - ws.on("close", resolve6); - rs.pipe(ws); - }); - } - var fsStat = util__namespace.promisify(fs__namespace.stat); - var fsCreateReadStream = fs__namespace.createReadStream; - var BlobClient = class _BlobClient extends StorageClient { + } /** - * The name of the blob. + * 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. */ - get name() { - return this._name; + 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 + }); + }); } /** - * The name of the storage container the blob is associated with. + * 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. */ - get containerName() { - return this._containerName; + 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) { - options = options || {}; let pipeline; - let url3; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + let url2; + options = options || {}; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + } 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; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = urlOrConnectionString; + pipeline = (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 = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)((0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; + pipeline = (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(url3, pipeline); - ({ blobName: this._name, containerName: this._containerName } = this.getBlobAndContainerNamesFromUrl()); - this.blobContext = this.storageClientContext.blob; - this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT); - this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID); + super(url2, pipeline); + this.pageBlobContext = this.storageClientContext.pageBlob; } /** - * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp. + * 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 BlobClient object identical to the source but with the specified snapshot timestamp - */ - withSnapshot(snapshot2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), 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(versionId2) { - return new _BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId2.length === 0 ? void 0 : versionId2), 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. - * + * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. */ - getPageBlobClient() { - return new PageBlobClient(this.url, this.pipeline); + 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); } /** - * 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://docs.microsoft.com/en-us/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): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody); - * console.log("Downloaded blob content:", downloaded.toString()); - * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` - * - * Example usage (browser): - * - * ```js - * // Download and convert a blob to a string - * const downloadBlockBlobResponse = await blobClient.download(); - * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody); - * console.log( - * "Downloaded blob content", - * downloaded - * ); + * 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 * - * async function blobToString(blob: Blob): Promise { - * const fileReader = new FileReader(); - * return new Promise((resolve, reject) => { - * fileReader.onloadend = (ev: any) => { - * resolve(ev.target!.result); - * }; - * fileReader.onerror = reject; - * fileReader.readAsText(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 download(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; + async create(size, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-download", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.download({ + (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, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onDownloadProgress: coreUtil.isNode ? void 0 : options.onProgress - // for Node.js, progress is reported by RetriableReadableStream + metadata: options.metadata, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions }, - range: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), - rangeGetContentMD5: options.rangeGetContentMD5, - rangeGetContentCRC64: options.rangeGetContentCrc64, - snapshot: options.snapshot, 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 })); - const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) }); - if (!coreUtil.isNode) { - return wrappedRes; - } - if (options.maxRetryRequests === void 0 || options.maxRetryRequests < 0) { - options.maxRetryRequests = 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(wrappedRes, async (start) => { - var _a2; - 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: (_a2 = options.conditions) === null || _a2 === void 0 ? void 0 : _a2.tagConditions - }, - range: 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(Object.assign({ 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. + * 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 options - options to Exists operation. + * @param size - size of the page blob. + * @param options - */ - async exists(options = {}) { - return tracingClient.withSpan("BlobClient-exists", options, async (updatedOptions) => { + async createIfNotExists(size, options = {}) { + return tracing_js_1.tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { try { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - await this.getProperties({ - abortSignal: options.abortSignal, - customerProvidedKey: options.customerProvidedKey, - conditions: options.conditions, + 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 true; + })); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (e.statusCode === 404) { - return false; - } else if (e.statusCode === 409 && (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg || e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) { - return true; + if (e.details?.errorCode === "BlobAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } 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://docs.microsoft.com/en-us/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. + * 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 options - Optional options to Get Properties operation. + * @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 getProperties(options = {}) { + async uploadPages(body, offset, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-getProperties", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blobContext.getProperties({ + (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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); - return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * 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 options - Optional options to Blob Delete operation. + * @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 delete(options = {}) { + async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { options.conditions = options.conditions || {}; - return tracingClient.withSpan("BlobClient-delete", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.delete({ + 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, - deleteSnapshots: options.deleteSnapshots, + sourceContentMD5: options.sourceContentMD5, + sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * Frees the specified pages from the page blob. + * @see https://learn.microsoft.com/rest/api/storageservices/put-page * - * @param options - Optional options to Blob Delete operation. + * @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 deleteIfExists(options = {}) { - return tracingClient.withSpan("BlobClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = assertResponse(await this.delete(updatedOptions)); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } + 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 + })); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob + * 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 options - Optional options to Blob Undelete operation. + * @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 undelete(options = {}) { - return tracingClient.withSpan("BlobClient-undelete", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.undelete({ + 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); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * 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 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. + * @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 setHTTPHeaders(blobHTTPHeaders, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setHTTPHeaders", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setHttpHeaders({ + 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, - blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - // cpkInfo: options.customerProvidedKey, // CPK is not included in Swagger, should change this back when this issue is fixed in Swagger. + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, + range: (0, Range_js_1.rangeToString)({ offset, count }), + marker, + maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); }); } /** - * Sets user-defined metadata for the specified blob as one or more name-value pairs. + * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel} * - * If no option provided, or no metadata defined in the parameter, the blob - * metadata will be removed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata + * @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 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. + * @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. */ - async setMetadata(metadata2, options = {}) { + listPageRanges(offset = 0, count, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-setMetadata", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setMetadata({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: metadata2, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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 + }); + } + }; } /** - * 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 ('_'). + * 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 tags - - * @param options - + * @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 setTags(tags2, options = {}) { - return tracingClient.withSpan("BlobClient-setTags", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTags({ + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions, - tags: toBlobTags(tags2) + 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); }); } /** - * Gets the tags associated with the underlying blob. + * 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 options - + * @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 getTags(options = {}) { - return tracingClient.withSpan("BlobClient-getTags", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.blobContext.getTags({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + 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 })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} }); - return wrappedResponse; }); } /** - * Get a {@link BlobLeaseClient} that manages leases on the blob. + * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} * - * @param proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the blob. + * + * @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. */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + 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); + } } /** - * Creates a read-only snapshot of a blob. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob + * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects * - * @param options - Optional options to the Blob Create Snapshot operation. + * @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 createSnapshot(options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlobClient-createSnapshot", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.createSnapshot({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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); + } } /** - * 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. + * 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 * - * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. * - * Example using automatic polling: + * ```ts snippet:ClientsListPageBlobsDiff + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * const result = await copyPoller.pollUntilDone(); - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using manual polling: + * const containerName = ""; + * const blobName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const pageBlobClient = containerClient.getPageBlobClient(blobName); * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * while (!poller.isDone()) { - * await poller.poll(); + * 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}`); * } - * const result = copyPoller.getResult(); - * ``` * - * Example using progress updates: + * // 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()); + * } * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * onProgress(state) { - * console.log(`Progress: ${state.copyProgress}`); + * // 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}`); * } - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using a changing polling interval (default 15 seconds): - * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url', { - * intervalInMs: 1000 // poll blob every 1 second for copy progress - * }); - * const result = await copyPoller.pollUntilDone(); - * ``` - * - * Example using copy cancellation: + * } * - * ```js - * const copyPoller = await blobClient.beginCopyFromURL('url'); - * // cancel operation after starting it. - * try { - * await copyPoller.cancelOperation(); - * // calls to get the result now throw PollerCancelledError - * await copyPoller.getResult(); - * } catch (err) { - * if (err.name === 'PollerCancelledError') { - * console.log('The copy was cancelled.'); + * // 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 copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. + * @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. */ - async beginCopyFromURL(copySource2, options = {}) { - const client = { - abortCopyFromURL: (...args) => this.abortCopyFromURL(...args), - getProperties: (...args) => this.getProperties(...args), - startCopyFromURL: (...args) => this.startCopyFromURL(...args) - }; - const poller = new BlobBeginCopyFromUrlPoller({ - blobClient: client, - copySource: copySource2, - intervalInMs: options.intervalInMs, - onProgress: options.onProgress, - resumeFrom: options.resumeFrom, - startCopyFromURLOptions: options + listPageRangesDiff(offset, count, prevSnapshot, options = {}) { + options.conditions = options.conditions || {}; + const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, { + ...options }); - await poller.poll(); - return poller; + 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 + }); + } + }; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob + * 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 copyId - Id of the Copy From URL operation. - * @param options - Optional options to the Blob Abort Copy From URL operation. + * @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 abortCopyFromURL(copyId2, options = {}) { - return tracingClient.withSpan("BlobClient-abortCopyFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.abortCopyFromURL(copyId2, { + 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); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url + * 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 copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication - * @param options - + * @param size - Target size + * @param options - Options to the Page Blob Resize operation. + * @returns Response data for the Page Blob Resize operation. */ - async syncCopyFromURL(copySource2, options = {}) { + async resize(size, options = {}) { options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - return tracingClient.withSpan("BlobClient-syncCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f, _g; - return assertResponse(await this.blobContext.copyFromURL(copySource2, { + 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, - metadata: options.metadata, leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions }, - sourceContentMD5: options.sourceContentMD5, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - immutabilityPolicyExpiry: (_f = options.immutabilityPolicy) === null || _f === void 0 ? void 0 : _f.expiriesOn, - immutabilityPolicyMode: (_g = options.immutabilityPolicy) === null || _g === void 0 ? void 0 : _g.policyMode, - legalHold: options.legalHold, encryptionScope: options.encryptionScope, - copySourceTags: options.copySourceTags, 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier + * Sets a page blob's sequence number. + * @see https://learn.microsoft.com/rest/api/storageservices/set-blob-properties * - * @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. + * @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 setAccessTier(tier2, options = {}) { - return tracingClient.withSpan("BlobClient-setAccessTier", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.blobContext.setTier(toAccessTier(tier2), { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - rehydratePriority: options.rehydratePriority, + modifiedAccessConditions: { + ...options.conditions, + ifTags: options.conditions?.tagConditions + }, tracingOptions: updatedOptions.tracingOptions })); }); } - async downloadToBuffer(param1, param2, param3, param4 = {}) { - var _a; - let buffer2; - let offset = 0; - let count = 0; - let options = param4; - if (param1 instanceof Buffer) { - buffer2 = param1; - offset = param2 || 0; - count = typeof param3 === "number" ? param3 : 0; + /** + * 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_utils7(); + 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(str2) { + return Buffer.byteLength(str2); + } + } +}); + +// 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 index = 0; index < subResponseCount; index++) { + const subResponse = subResponses[index]; + 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[${index}] 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((resolve6) => { + if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { + this.keys[key] = MutexLockStatus.LOCKED; + resolve6(); + } else { + this.onUnlockEvent(key, () => { + this.keys[key] = MutexLockStatus.LOCKED; + resolve6(); + }); + } + }); + } + /** + * Unlock a key. + * + * @param key - + */ + static async unlock(key) { + return new Promise((resolve6) => { + if (this.keys[key] === MutexLockStatus.LOCKED) { + this.emitUnlockEvent(key); + } + delete this.keys[key]; + resolve6(); + }); + } + static keys = {}; + static listeners = {}; + static onUnlockEvent(key, handler) { + if (this.listeners[key] === void 0) { + this.listeners[key] = [handler]; } else { - offset = typeof param1 === "number" ? param1 : 0; - count = typeof param2 === "number" ? param2 : 0; - options = param3 || {}; + this.listeners[key].push(handler); } - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0) { - throw new RangeError("blockSize option must be >= 0"); + } + static emitUnlockEvent(key) { + if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { + const handler = this.listeners[key].shift(); + setImmediate(() => { + handler.call(this); + }); } - if (blockSize === 0) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; + } + }; + 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); } - if (offset < 0) { - throw new RangeError("offset option must be >= 0"); + } + setBatchType(batchType) { + if (!this.batchType) { + this.batchType = batchType; } - if (count && count <= 0) { - throw new RangeError("count option must be greater than 0"); + 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 pipeline = new Pipeline_js_1.Pipeline([]); + pipeline._credential = credential; + pipeline._corePipeline = corePipeline; + return pipeline; + } + appendSubRequestToBody(request) { + 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 + `${request.method.toString()} ${(0, utils_common_js_1.getURLPathAndQuery)(request.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 request.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 path12 = (0, utils_common_js_1.getURLPath)(subRequest.url); + if (!path12 || path12 === "") { + throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); } - if (!options.conditions) { - options.conditions = {}; + } + 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(request) { + batchRequest.appendSubRequestToBody(request); + return { + request, + status: 200, + headers: (0, core_rest_pipeline_1.createHttpHeaders)() + }; } - return tracingClient.withSpan("BlobClient-downloadToBuffer", options, async (updatedOptions) => { - if (!count) { - const response = await this.getProperties(Object.assign(Object.assign({}, 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 (!buffer2) { - try { - buffer2 = Buffer.alloc(count); - } catch (error4) { - 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". ${error4.message}`); + }; + } + function batchHeaderFilterPolicy() { + return { + name: "batchHeaderFilterPolicy", + async sendRequest(request, next) { + let xMsHeaderName = ""; + for (const [name] of request.headers) { + if ((0, utils_common_js_1.iEqual)(name, constants_js_1.HeaderConstants.X_MS_VERSION)) { + xMsHeaderName = name; } } - if (buffer2.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(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 stream3 = response.readableStreamBody; - await streamToBuffer(stream3, buffer2, off - offset, chunkEnd - offset); - transferProgress += chunkEnd - off; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); - } - }); + if (xMsHeaderName !== "") { + request.headers.delete(xMsHeaderName); } - await batch.do(); - return buffer2; - }); + return next(request); + } + }; + } + } +}); + +// 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 pipeline; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { + pipeline = credentialOrPipeline; + } else if (!credentialOrPipeline) { + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } else { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); + } + const storageClientContext = new StorageContextClient_js_1.StorageContextClient(url2, (0, Pipeline_js_1.getCoreClientOptions)(pipeline)); + const path12 = (0, utils_common_js_1.getURLPath)(url2); + if (path12 && path12 !== "/") { + this.serviceOrContainerContext = storageClientContext.container; + } else { + this.serviceOrContainerContext = storageClientContext.service; + } } /** - * 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. + * Creates a {@link BlobBatch}. + * A BlobBatch represents an aggregated set of operations on blobs. */ - async downloadToFile(filePath, offset = 0, count, options = {}) { - return tracingClient.withSpan("BlobClient-downloadToFile", options, async (updatedOptions) => { - const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); - if (response.readableStreamBody) { - await readStreamToLocalFile(response.readableStreamBody, filePath); - } - response.blobDownloadStream = void 0; - return response; - }); + createBatch() { + return new BlobBatch_js_1.BlobBatch(); } - 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 (isIpEndpointStyle(parsedUrl)) { - const pathComponents = parsedUrl.pathname.match("/([^/]*)/([^/]*)(/(.*))?"); - containerName = pathComponents[2]; - blobName = pathComponents[4]; + 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 { - const pathComponents = parsedUrl.pathname.match("/([^/]*)(/(.*))?"); - containerName = pathComponents[1]; - blobName = pathComponents[3]; + await batch.deleteBlob(urlOrBlobClient, credentialOrOptions); } - containerName = decodeURIComponent(containerName); - blobName = decodeURIComponent(blobName); - blobName = blobName.replace(/\\/g, "/"); - if (!containerName) { - throw new Error("Provided containerName is invalid."); + } + 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 { blobName, containerName }; - } catch (error4) { - throw new Error("Unable to extract blobName and containerName with provided information."); } + return this.submitBatch(batch); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob + * Submit batch request which consists of multiple subrequests. * - * @param copySource - url to the source Azure Blob/File. - * @param options - Optional options to the Blob Start Copy From URL operation. - */ - async startCopyFromURL(copySource2, options = {}) { - return tracingClient.withSpan("BlobClient-startCopyFromURL", options, async (updatedOptions) => { - var _a, _b, _c; - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - return assertResponse(await this.blobContext.startCopyFromURL(copySource2, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: options.sourceConditions.ifMatch, - sourceIfModifiedSince: options.sourceConditions.ifModifiedSince, - sourceIfNoneMatch: options.sourceConditions.ifNoneMatch, - sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince, - sourceIfTags: options.sourceConditions.tagConditions - }, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - rehydratePriority: options.rehydratePriority, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), - sealBlob: options.sealBlob, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Only available for BlobClient constructed with a shared key credential. + * Get `blobBatchClient` and other details before running the snippets. + * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` * - * 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. + * Example usage: * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * ```ts snippet:BlobBatchClientSubmitBatch + * import { DefaultAzureCredential } from "@azure/identity"; + * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; * - * @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((resolve6) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString(); - resolve6(appendToURLQuery(this.url, sas)); - }); - } - /** - * Only available for BlobClient constructed with a shared key credential. + * const account = ""; + * const credential = new DefaultAzureCredential(); + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * 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. + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); + * const blobBatchClient = containerClient.getBlobBatchClient(); * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * const batchRequest = new BlobBatch(); + * await batchRequest.deleteBlob("", credential); + * await batchRequest.deleteBlob("", credential, { + * deleteSnapshots: "include", + * }); + * const batchResp = await blobBatchClient.submitBatch(batchRequest); + * console.log(batchResp.subResponsesSucceededCount); + * ``` * - * @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)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); - } - return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).stringToSign; - } - /** - * Delete the immutablility policy on the blob. + * Example using a lease: * - * @param options - Optional options to delete immutability policy on the blob. - */ - async deleteImmutabilityPolicy(options = {}) { - return tracingClient.withSpan("BlobClient-deleteImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.deleteImmutabilityPolicy({ - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Set immutability policy on the blob. + * ```ts snippet:BlobBatchClientSubmitBatchWithLease + * import { DefaultAzureCredential } from "@azure/identity"; + * import { BlobServiceClient, BlobBatch } from "@azure/storage-blob"; * - * @param options - Optional options to set immutability policy on the blob. - */ - async setImmutabilityPolicy(immutabilityPolicy, options = {}) { - return tracingClient.withSpan("BlobClient-setImmutabilityPolicy", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setImmutabilityPolicy({ - immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, - immutabilityPolicyMode: immutabilityPolicy.policyMode, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Set legal hold on the blob. + * const account = ""; + * const credential = new DefaultAzureCredential(); + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * credential, + * ); * - * @param options - Optional options to set legal hold on the blob. + * 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 setLegalHold(legalHoldEnabled, options = {}) { - return tracingClient.withSpan("BlobClient-setLegalHold", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.setLegalHold(legalHoldEnabled, { - tracingOptions: updatedOptions.tracingOptions + 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 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://docs.microsoft.com/en-us/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. + * The name of the container. */ - async getAccountInfo(options = {}) { - return tracingClient.withSpan("BlobClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.blobContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + get containerName() { + return this._containerName; } - }; - var AppendBlobClient = class _AppendBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { + constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { let pipeline; - let url3; + let url2; options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipelineOrContainerName)) { + url2 = urlOrConnectionString; pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); + } 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; + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipelineOrContainerName, options); } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { + url2 = urlOrConnectionString; + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); + const extractedCreds = (0, utils_common_js_1.extractConnectionStringParts)(urlOrConnectionString); if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); + 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 = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + options.proxyOptions = (0, core_rest_pipeline_1.getDefaultProxySettings)(extractedCreds.proxyUri); } - pipeline = newPipeline(sharedKeyCredential, options); + pipeline = (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") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); + url2 = (0, utils_common_js_1.appendToURLPath)(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; + pipeline = (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"); + throw new Error("Expecting non-empty strings for containerName parameter"); } - super(url3, pipeline); - 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(snapshot2) { - return new _AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + super(url2, pipeline); + this._containerName = this.getContainerNameFromUrl(); + this.containerContext = this.storageClientContext.container; } /** - * Creates a 0-length append blob. Call AppendBlock to append data to an append blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 the Append Block Create operation. + * @param options - Options to Container Create operation. * * * Example usage: * - * ```js - * const appendBlobClient = containerClient.getAppendBlobClient(""); - * await appendBlobClient.create(); + * ```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 = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.appendBlobContext.create(0, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - blobTagsString: toBlobTagsString(options.tags), - tracingOptions: updatedOptions.tracingOptions - })); + 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 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://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 = {}) { - const conditions = { ifNoneMatch: ETagAny }; - return tracingClient.withSpan("AppendBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; + return tracing_js_1.tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { try { - const res = assertResponse(await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); + const res = await this.create(updatedOptions); + return { + succeeded: true, + ...res, + _response: res._response + // _response is made non-enumerable + }; } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } - }); - } - /** - * Seals the append blob, making it read only. - * - * @param options - - */ - async seal(options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("AppendBlobClient-seal", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.seal({ - abortSignal: options.abortSignal, - appendPositionAccessConditions: options.conditions, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Commits a new block of data to the end of the existing append blob. - * @see https://docs.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: - * - * ```js - * const content = "Hello World!"; - * - * // Create a new append blob and append data to the blob. - * const newAppendBlobClient = containerClient.getAppendBlobClient(""); - * await newAppendBlobClient.create(); - * await newAppendBlobClient.appendBlock(content, content.length); - * - * // Append data to an existing append blob. - * const existingAppendBlobClient = containerClient.getAppendBlobClient(""); - * await existingAppendBlobClient.appendBlock(content, content.length); - * ``` - */ - async appendBlock(body2, contentLength2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlock", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.appendBlobContext.appendBlock(contentLength2, body2, { - abortSignal: options.abortSignal, - appendPositionAccessConditions: options.conditions, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.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://docs.microsoft.com/en-us/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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("AppendBlobClient-appendBlockFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, { - abortSignal: options.abortSignal, - sourceRange: rangeToString({ offset: sourceOffset, count }), - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - leaseAccessConditions: options.conditions, - appendPositionAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince - }, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - }; - var BlockBlobClient = class _BlockBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline; - let url3; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - if (blobNameOrOptions && typeof blobNameOrOptions !== "string") { - options = blobNameOrOptions; - } - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); + if (e.details?.errorCode === "ContainerAlreadyExists") { + return { + succeeded: false, + ...e.response?.parsedHeaders, + _response: e.response + }; } else { - throw new Error("Account connection string is only supported in Node.js environment"); + throw e; } - } else if (extractedCreds.kind === "SASConnString") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new 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(url3, pipeline); - 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(snapshot2) { - return new _BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); + }); } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. - * - * Quick query for a JSON or CSV formatted blob. - * - * Example usage (Node.js): - * - * ```js - * // Query and convert a blob to a string - * const queryBlockBlobResponse = await blockBlobClient.query("select * from BlobStorage"); - * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString(); - * console.log("Query blob content:", downloaded); + * Returns true if the Azure container resource represented by this client exists; false otherwise. * - * async function streamToBuffer(readableStream) { - * return new Promise((resolve, reject) => { - * const chunks = []; - * readableStream.on("data", (data) => { - * chunks.push(data instanceof Buffer ? data : Buffer.from(data)); - * }); - * readableStream.on("end", () => { - * resolve(Buffer.concat(chunks)); - * }); - * readableStream.on("error", reject); - * }); - * } - * ``` + * 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 query - * @param options - */ - async query(query, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - if (!coreUtil.isNode) { - throw new Error("This operation currently is only supported in Node.js."); - } - return tracingClient.withSpan("BlockBlobClient-query", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this._blobContext.query({ - abortSignal: options.abortSignal, - queryRequest: { - queryType: "SQL", - expression: query, - inputSerialization: toQuerySerialization(options.inputTextConfiguration), - outputSerialization: toQuerySerialization(options.outputTextConfiguration) - }, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - tracingOptions: updatedOptions.tracingOptions - })); - return new BlobQueryResponse(response, { - abortSignal: options.abortSignal, - onProgress: options.onProgress, - onError: options.onError - }); + 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 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}. + * Creates a {@link BlobClient} * - * This is a non-parallel uploading method, please use {@link uploadFile}, - * {@link uploadStream} or {@link uploadBrowserData} for better performance - * with concurrency uploading. + * @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} * - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * @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 * - * @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: * - * ```js + * ```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(body2, contentLength2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-upload", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.upload(contentLength2, body2, { - abortSignal: options.abortSignal, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onUploadProgress: options.onProgress - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: 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 || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-syncUploadFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e, _f; - return assertResponse(await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince, - sourceIfTags: (_f = options.sourceConditions) === null || _f === void 0 ? void 0 : _f.tagConditions - }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags, tracingOptions: updatedOptions.tracingOptions }))); - }); + 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); } /** - * Uploads the specified block to the block blob's "staging area" to be later - * committed by a call to commitBlockList. - * @see https://docs.microsoft.com/rest/api/storageservices/put-block + * Creates a {@link PageBlobClient} * - * @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. + * @param blobName - A page blob name */ - async stageBlock(blockId2, body2, contentLength2, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlock", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlock(blockId2, contentLength2, body2, { - 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 - })); - }); + 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); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url + * 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 * - * @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(blockId2, sourceURL, offset = 0, count, options = {}) { - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-stageBlockFromURL", options, async (updatedOptions) => { - return assertResponse(await this.blockBlobContext.stageBlockFromURL(blockId2, 0, sourceURL, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - sourceRange: offset === 0 && !count ? void 0 : rangeToString({ offset, count }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - 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://docs.microsoft.com/rest/api/storageservices/put-block-list + * 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 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. + * @param options - Options to Container Get Properties operation. */ - async commitBlockList(blocks2, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("BlockBlobClient-commitBlockList", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.blockBlobContext.commitBlockList({ latest: blocks2 }, { + 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, - blobHttpHeaders: options.blobHTTPHeaders, - leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + ...options.conditions, 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://docs.microsoft.com/rest/api/storageservices/get-block-list + * 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 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. + * @param options - Options to Container Delete operation. */ - async getBlockList(listType2, options = {}) { - return tracingClient.withSpan("BlockBlobClient-getBlockList", options, async (updatedOptions) => { - var _a; - const res = assertResponse(await this.blockBlobContext.getBlockList(listType2, { + 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: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), + modifiedAccessConditions: options.conditions, 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. + * 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 data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView - * @param options - + * @param options - Options to Container Delete operation. */ - async uploadData(data, options = {}) { - return tracingClient.withSpan("BlockBlobClient-uploadData", options, async (updatedOptions) => { - if (coreUtil.isNode) { - let buffer2; - if (data instanceof Buffer) { - buffer2 = data; - } else if (data instanceof ArrayBuffer) { - buffer2 = Buffer.from(data); - } else { - data = data; - buffer2 = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + 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 + }; } - return this.uploadSeekableInternal((offset, size) => buffer2.slice(offset, offset + size), buffer2.byteLength, updatedOptions); - } else { - const browserBlob = new Blob([data]); - return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions); + throw e; } }); } /** - * 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 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); - }); - } - /** + * Sets one or more user-defined name-value pairs for the specified container. * - * 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. + * If no option provided, or no metadata defined in the parameter, the container + * metadata will be removed. * - * 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. + * @see https://learn.microsoft.com/rest/api/storageservices/set-container-metadata * - * @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. + * @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 uploadSeekableInternal(bodyFactory, size, options = {}) { - var _a, _b; - let blockSize = (_a = options.blockSize) !== null && _a !== void 0 ? _a : 0; - if (blockSize < 0 || blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) { - throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`); - } - const maxSingleShotSize = (_b = options.maxSingleShotSize) !== null && _b !== void 0 ? _b : BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES; - if (maxSingleShotSize < 0 || maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) { - throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`); - } - if (blockSize === 0) { - if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) { - throw new RangeError(`${size} is too larger to upload to a block blob.`); - } - if (size > maxSingleShotSize) { - blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS); - if (blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) { - blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES; - } - } - } - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } + async setMetadata(metadata, options = {}) { if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadSeekableInternal", options, async (updatedOptions) => { - if (size <= maxSingleShotSize) { - return assertResponse(await this.upload(bodyFactory(0, size), size, updatedOptions)); - } - const numBlocks = Math.floor((size - 1) / blockSize) + 1; - if (numBlocks > 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 <= ${BLOCK_BLOB_MAX_BLOCKS}`); - } - const blockList = []; - const blockIDPrefix = coreUtil.randomUUID(); - let transferProgress = 0; - const batch = new Batch(options.concurrency); - for (let i = 0; i < numBlocks; i++) { - batch.addOperation(async () => { - const blockID = generateBlockID(blockIDPrefix, i); - const start = blockSize * i; - const end = i === numBlocks - 1 ? size : start + blockSize; - const contentLength2 = end - start; - blockList.push(blockID); - await this.stageBlock(blockID, bodyFactory(start, contentLength2), contentLength2, { - abortSignal: options.abortSignal, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += contentLength2; - 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 tracingClient.withSpan("BlockBlobClient-uploadFile", options, async (updatedOptions) => { - const size = (await fsStat(filePath)).size; - return this.uploadSeekableInternal((offset, count) => { - return () => fsCreateReadStream(filePath, { - autoClose: true, - end: count ? offset + count - 1 : Infinity, - start: offset - }); - }, size, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions })); + 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 + })); }); } /** - * ONLY AVAILABLE IN NODE.JS RUNTIME. + * Gets the permissions for the specified container. The permissions indicate + * whether container data may be accessed publicly. * - * Uploads a Node.js Readable stream into block blob. + * 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". * - * PERFORMANCE IMPROVEMENT TIPS: - * * Input stream highWaterMark is better to set a same value with bufferSize - * parameter, which will avoid Buffer.concat() operations. + * @see https://learn.microsoft.com/rest/api/storageservices/get-container-acl * - * @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. + * @param options - Options to Container Get Access Policy operation. */ - async uploadStream(stream3, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) { - if (!options.blobHTTPHeaders) { - options.blobHTTPHeaders = {}; - } + async getAccessPolicy(options = {}) { if (!options.conditions) { options.conditions = {}; } - return tracingClient.withSpan("BlockBlobClient-uploadStream", options, async (updatedOptions) => { - let blockNum = 0; - const blockIDPrefix = coreUtil.randomUUID(); - let transferProgress = 0; - const blockList = []; - const scheduler = new BufferScheduler( - stream3, - bufferSize, - maxConcurrency, - async (body2, length) => { - const blockID = generateBlockID(blockIDPrefix, blockNum); - blockList.push(blockID); - blockNum++; - await this.stageBlock(blockID, body2, length, { - customerProvidedKey: options.customerProvidedKey, - conditions: options.conditions, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - }); - transferProgress += length; - if (options.onProgress) { - options.onProgress({ loadedBytes: transferProgress }); + 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); } - }, - // 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 assertResponse(await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: updatedOptions.tracingOptions }))); - }); - } - }; - var PageBlobClient = class _PageBlobClient extends BlobClient { - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, options) { - let pipeline; - let url3; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - options = blobNameOrOptions; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string" && blobNameOrOptions && typeof blobNameOrOptions === "string") { - const containerName = credentialOrPipelineOrContainerName; - const blobName = blobNameOrOptions; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); + if (identifier.accessPolicy.startsOn) { + accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn); } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); } - } else if (extractedCreds.kind === "SASConnString") { - url3 = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + res.signedIdentifiers.push({ + accessPolicy, + id: identifier.id + }); } - } else { - throw new Error("Expecting non-empty strings for containerName and blobName parameters"); - } - super(url3, pipeline); - this.pageBlobContext = this.storageClientContext.pageBlob; + return res; + }); } /** - * 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. + * Sets the permissions for the specified container. The permissions indicate + * whether blobs in a container may be accessed publicly. * - * @param snapshot - The snapshot timestamp. - * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp. - */ - withSnapshot(snapshot2) { - return new _PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot2.length === 0 ? void 0 : snapshot2), this.pipeline); - } - /** - * Creates a page blob of the specified length. Call uploadPages to upload data - * data to a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-blob + * 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. * - * @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. + * 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 create(size, options = {}) { + async setAccessPolicy(access, containerAcl, options = {}) { options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-create", options, async (updatedOptions) => { - var _a, _b, _c; - return assertResponse(await this.pageBlobContext.create(0, size, { + 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, - blobHttpHeaders: options.blobHTTPHeaders, - blobSequenceNumber: options.blobSequenceNumber, + access, + containerAcl: acl, leaseAccessConditions: options.conditions, - metadata: options.metadata, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - immutabilityPolicyExpiry: (_b = options.immutabilityPolicy) === null || _b === void 0 ? void 0 : _b.expiriesOn, - immutabilityPolicyMode: (_c = options.immutabilityPolicy) === null || _c === void 0 ? void 0 : _c.policyMode, - legalHold: options.legalHold, - tier: toAccessTier(options.tier), - blobTagsString: toBlobTagsString(options.tags), + modifiedAccessConditions: options.conditions, 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://docs.microsoft.com/rest/api/storageservices/put-blob + * Get a {@link BlobLeaseClient} that manages leases on the container. * - * @param size - size of the page blob. - * @param options - + * @param proposeLeaseId - Initial proposed lease Id. + * @returns A new BlobLeaseClient object for managing leases on the container. */ - async createIfNotExists(size, options = {}) { - return tracingClient.withSpan("PageBlobClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; - try { - const conditions = { ifNoneMatch: ETagAny }; - const res = assertResponse(await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }))); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "BlobAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } - }); + getBlobLeaseClient(proposeLeaseId) { + return new BlobLeaseClient_js_1.BlobLeaseClient(this, proposeLeaseId); } /** - * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * Creates a new block blob, or updates the content of an existing block blob. * - * @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(body2, offset, count, options = {}) { - options.conditions = options.conditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.uploadPages(count, body2, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - requestOptions: { - onUploadProgress: options.onProgress - }, - range: 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://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-url + * 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}. * - * @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 - + * 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 uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) { - options.conditions = options.conditions || {}; - options.sourceConditions = options.sourceConditions || {}; - ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps); - return tracingClient.withSpan("PageBlobClient-uploadPagesFromURL", options, async (updatedOptions) => { - var _a, _b, _c, _d, _e; - return assertResponse(await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), { - abortSignal: options.abortSignal, - sourceContentMD5: options.sourceContentMD5, - sourceContentCrc64: options.sourceContentCrc64, - leaseAccessConditions: options.conditions, - sequenceNumberAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - sourceModifiedAccessConditions: { - sourceIfMatch: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifMatch, - sourceIfModifiedSince: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifModifiedSince, - sourceIfNoneMatch: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch, - sourceIfUnmodifiedSince: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.ifUnmodifiedSince - }, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), - tracingOptions: updatedOptions.tracingOptions - })); + 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 + }; }); } /** - * Frees the specified pages from the page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/put-page + * 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 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. + * @param blobName - + * @param options - Options to Blob Delete operation. + * @returns Block blob deletion response data. */ - async clearPages(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-clearPages", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.clearPages(0, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - sequenceNumberAccessConditions: options.conditions, - cpkInfo: options.customerProvidedKey, - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); + 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); }); } /** - * Returns the list of valid page ranges for a page blob or snapshot of a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * 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 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. + * @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 getPageRanges(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-getPageRanges", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRanges({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), + 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 })); - return rangeResponseFromModel(response); + 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; }); } /** - * 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://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * 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 offset - Starting byte position of the page ranges. - * @param count - Number of bytes to get. + * @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 PageBlob Get Page Ranges Segment operation. + * @param options - Options to Container List Blob Hierarchy Segment operation. */ - async listPageRangesSegment(offset = 0, count, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRanges({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - range: rangeToString({ offset, count }), - marker: marker2, - maxPageSize: options.maxPageSize, + 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 {@link PageBlobGetPageRangesResponseModel} + * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse * - * @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 + * the list of blobs to be returned with the next listing 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 + * 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 Page Ranges operation. + * @param options - Options to list blobs operation. */ - listPageRangeItemSegments() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1(offset = 0, count, marker2, options = {}) { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 PageRangeInfo} objects + * Returns an AsyncIterableIterator of {@link BlobItem} 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. + * @param options - Options to list blobs operation. */ - listPageRangeItems() { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1(offset = 0, count, options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 of page ranges for a page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * Returns an async iterable iterator to list all the blobs + * under the specified account. * - * .byPage() returns an async iterable iterator to list of page ranges for a page blob. + * .byPage() returns an async iterable iterator to list the blobs in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobs_Multiple + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRanges()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRanges(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * const blobs = containerClient.listBlobsFlat(); + * for await (const blob of blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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: * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 }); + * // Example using paging with a marker + * i = 1; + * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; - * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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 = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // Prints 10 blob names + * if (response.segment.blobItems) { + * for (const blob of response.segment.blobItems) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` - * @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. + * + * @param options - Options to list blobs. * @returns An asyncIterableIterator that supports paging. */ - listPageRanges(offset = 0, count, options = {}) { - options.conditions = options.conditions || {}; - const iter = this.listPageRangeItems(offset, count, options); + 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 @@ -65742,205 +72714,202 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + return this.listSegments(settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.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 tracingClient.withSpan("PageBlobClient-getPageRangesDiff", options, async (updatedOptions) => { - var _a; - const result = assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevsnapshot: prevSnapshot, - range: rangeToString({ offset, count }), - tracingOptions: updatedOptions.tracingOptions - })); - return 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://docs.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, marker2, options = {}) { - return tracingClient.withSpan("PageBlobClient-getPageRangesDiffSegment", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.getPageRangesDiff({ - abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, - leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevsnapshot: prevSnapshotOrUrl, - range: rangeToString({ - offset, - count - }), - marker: marker2, - maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - }); - } - /** - * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel} - * + * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse * - * @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 delimiter - The character or string used to define the virtual hierarchy * @param marker - A string value that identifies the portion of - * the get of page ranges to be returned with the next getting operation. The + * the list of blobs to be returned with the next listing 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 + * 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 the Page Blob Get Page Ranges Diff operation. + * @param options - Options to list blobs operation. */ - listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() { - let getPageRangeItemSegmentsResponse; - if (!!marker2 || marker2 === void 0) { - do { - getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker2, options)); - marker2 = getPageRangeItemSegmentsResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse)); - } while (marker2); - } - }); + 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 of {@link PageRangeInfo} objects + * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} 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. + * @param delimiter - The character or string used to define the virtual hierarchy + * @param options - Options to list blobs operation. */ - listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) { - return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const getPageRangesSegment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment)))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + 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 of page ranges that differ between a specified snapshot and this page blob. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * Returns an async iterable iterator to list all the blobs by hierarchy. + * under the specified account. * - * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob. + * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages. * - * Example using `for await` syntax: + * ```ts snippet:ReadmeSampleListBlobsByHierarchy + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * ```js - * // Get the pageBlobClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("").getPageBlobClient("");` - * let i = 1; - * for await (const pageRange of pageBlobClient.listPageRangesDiff()) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); - * } - * ``` + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * Example using `iter.next()`: + * const containerName = ""; + * const containerClient = blobServiceClient.getContainerClient(containerName); * - * ```js + * // Example using `for await` syntax * let i = 1; - * let iter = pageBlobClient.listPageRangesDiff(); - * let pageRangeItem = await iter.next(); - * while (!pageRangeItem.done) { - * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`); - * pageRangeItem = await iter.next(); + * 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 `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) { - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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 paging with a marker: + * // 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}`); + * } + * } * - * ```js - * let i = 1; - * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 }); + * // Example using paging with a marker + * i = 1; + * let iterator = containerClient.listBlobsByHierarchy("/").byPage({ maxPageSize: 2 }); * let response = (await iterator.next()).value; - * - * // Prints 2 page ranges - * for (const pageRange of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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 = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = containerClient + * .listBlobsByHierarchy("/") + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; - * - * // Prints 10 page ranges - * for (const blob of response) { - * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`); + * // 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 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. + * + * @param delimiter - The character or string used to define the virtual hierarchy + * @param options - Options to list blobs operation. */ - listPageRangesDiff(offset, count, prevSnapshot, options = {}) { - options.conditions = options.conditions || {}; - const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options)); + 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 */ - next() { + async next() { return iter.next(); }, /** @@ -65953,1194 +72922,1181 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options)); + return this.listHierarchySegments(delimiter, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...updatedOptions + }); } }; } /** - * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks. - * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges + * The Filter Blobs operation enables callers to list blobs in the container whose tags + * match a given search expression. * - * @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. + * @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 getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl2, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-GetPageRangesDiffForManagedDisks", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.pageBlobContext.getPageRangesDiff({ + 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, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - prevSnapshotUrl: prevSnapshotUrl2, - range: rangeToString({ offset, count }), + where: tagFilterSqlExpression, + marker, + maxPageSize: options.maxPageSize, tracingOptions: updatedOptions.tracingOptions })); - return rangeResponseFromModel(response); + 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; }); } /** - * Resizes the page blob to the specified size (which must be a multiple of 512). - * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties + * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse. * - * @param size - Target size - * @param options - Options to the Page Blob Resize operation. - * @returns Response data for the Page Blob Resize operation. + * @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 resize(size, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-resize", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.resize(size, { - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - encryptionScope: options.encryptionScope, - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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); + } } /** - * Sets a page blob's sequence number. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties + * 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 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. + * @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. */ - async updateSequenceNumber(sequenceNumberAction2, sequenceNumber, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("PageBlobClient-updateSequenceNumber", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction2, { - abortSignal: options.abortSignal, - blobSequenceNumber: sequenceNumber, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), - tracingOptions: updatedOptions.tracingOptions - })); - }); + 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 + }); + } + }; } /** - * 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://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob - * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots + * 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 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. + * @param options - Options to the Service Get Account Info operation. + * @returns Response data for the Service Get Account Info operation. */ - async startCopyIncremental(copySource2, options = {}) { - return tracingClient.withSpan("PageBlobClient-startCopyIncremental", options, async (updatedOptions) => { - var _a; - return assertResponse(await this.pageBlobContext.copyIncremental(copySource2, { + 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, - modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), tracingOptions: updatedOptions.tracingOptions })); }); } - }; - async function getBodyAsText(batchResponse) { - let buffer2 = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES); - const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer2); - buffer2 = buffer2.slice(0, responseLength); - return buffer2.toString(); - } - function utf8ByteLength(str2) { - return Buffer.byteLength(str2); - } - var HTTP_HEADER_DELIMITER = ": "; - var SPACE_DELIMITER = " "; - var NOT_FOUND = -1; - var BatchResponseParser = class { - 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}${HTTP_LINE_ENDING}`; - this.batchResponseEnding = `--${this.responseBatchBoundary}--`; - } - // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response - async parseBatchResponse() { - if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) { - throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`); - } - const responseBodyAsText = await 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 index = 0; index < subResponseCount; index++) { - const subResponse = subResponses[index]; - const deserializedSubResponse = {}; - deserializedSubResponse.headers = coreHttpCompat.toHttpHeadersLike(coreRestPipeline.createHttpHeaders()); - const responseLines = subResponse.split(`${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(HeaderConstants.CONTENT_ID)) { - contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]); - } - if (responseLine.startsWith(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] === 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; + 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 { - logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`); + containerName = parsedUrl.pathname.split("/")[1]; } - if (subRespFailed) { - subResponsesFailedCount++; - } else { - subResponsesSucceededCount++; + 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."); } - return { - subResponses: deserializedSubResponses, - subResponsesSucceededCount, - subResponsesFailedCount - }; } - }; - 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. + * Only available for ContainerClient constructed with a shared key credential. * - * @param key - lock key + * 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. */ - static async lock(key) { + generateSasUrl(options) { return new Promise((resolve6) => { - if (this.keys[key] === void 0 || this.keys[key] === MutexLockStatus.UNLOCKED) { - this.keys[key] = MutexLockStatus.LOCKED; - resolve6(); - } else { - this.onUnlockEvent(key, () => { - this.keys[key] = MutexLockStatus.LOCKED; - resolve6(); - }); + 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(); + resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); }); } /** - * Unlock a key. + * Only available for ContainerClient constructed with a shared key credential. * - * @param key - + * 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. */ - static async unlock(key) { - return new Promise((resolve6) => { - if (this.keys[key] === MutexLockStatus.LOCKED) { - this.emitUnlockEvent(key); - } - delete this.keys[key]; - resolve6(); - }); - } - static onUnlockEvent(key, handler) { - if (this.listeners[key] === void 0) { - this.listeners[key] = [handler]; - } else { - this.listeners[key].push(handler); - } - } - static emitUnlockEvent(key) { - if (this.listeners[key] !== void 0 && this.listeners[key].length > 0) { - const handler = this.listeners[key].shift(); - setImmediate(() => { - handler.call(this); - }); + /* 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"); } - } - }; - Mutex.keys = {}; - Mutex.listeners = {}; - var BlobBatch = class { - constructor() { - this.batch = "batch"; - this.batchRequest = new InnerBatchRequest(); + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + ...options + }, this.credential).stringToSign; } /** - * 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 + * 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. */ - getMultiPartContentType() { - return this.batchRequest.getMultipartContentType(); + generateUserDelegationSasUrl(options, userDelegationKey) { + return new Promise((resolve6) => { + const sas = (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParameters)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).toString(); + resolve6((0, utils_common_js_1.appendToURLQuery)(this.url, sas)); + }); } /** - * Get assembled HTTP request body for sub requests. + * 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. */ - getHttpRequestBody() { - return this.batchRequest.getHttpRequestBody(); + generateUserDelegationSasStringToSign(options, userDelegationKey) { + return (0, BlobSASSignatureValues_js_1.generateBlobSASQueryParametersInternal)({ + containerName: this._containerName, + ...options + }, userDelegationKey, this.accountName).stringToSign; } /** - * Get sub requests that are added into the batch request. + * 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. */ - getSubRequests() { - return this.batchRequest.getSubRequests(); + getBlobBatchClient() { + return new BlobBatchClient_js_1.BlobBatchClient(this.url, this.pipeline); } - async addSubRequestInternal(subRequest, assembleSubRequestFunc) { - await Mutex.lock(this.batch); - try { - this.batchRequest.preAddSubRequest(subRequest); - await assembleSubRequestFunc(); - this.batchRequest.postAddSubRequest(subRequest); - } finally { - await Mutex.unlock(this.batch); + }; + 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; } - 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.`); + /** + * 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; } - } - async deleteBlob(urlOrBlobClient, credentialOrOptions, options) { - let url3; - let credential; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrOptions instanceof StorageSharedKeyCredential || credentialOrOptions instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrOptions))) { - url3 = urlOrBlobClient; - credential = credentialOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url3 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - options = credentialOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + if (permissionLike.write) { + accountSASPermissions.write = true; } - if (!options) { - options = {}; + if (permissionLike.delete) { + accountSASPermissions.delete = true; } - return tracingClient.withSpan("BatchDeleteRequest-addSubRequest", options, async (updatedOptions) => { - this.setBatchType("delete"); - await this.addSubRequestInternal({ - url: url3, - credential - }, async () => { - await new BlobClient(url3, this.batchRequest.createPipeline(credential)).delete(updatedOptions); - }); - }); - } - async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) { - let url3; - let credential; - let tier2; - if (typeof urlOrBlobClient === "string" && (coreUtil.isNode && credentialOrTier instanceof StorageSharedKeyCredential || credentialOrTier instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrTier))) { - url3 = urlOrBlobClient; - credential = credentialOrTier; - tier2 = tierOrOptions; - } else if (urlOrBlobClient instanceof BlobClient) { - url3 = urlOrBlobClient.url; - credential = urlOrBlobClient.credential; - tier2 = credentialOrTier; - options = tierOrOptions; - } else { - throw new RangeError("Invalid arguments. Either url and credential, or BlobClient need be provided."); + if (permissionLike.deleteVersion) { + accountSASPermissions.deleteVersion = true; } - if (!options) { - options = {}; + if (permissionLike.filter) { + accountSASPermissions.filter = true; } - return tracingClient.withSpan("BatchSetTierRequest-addSubRequest", options, async (updatedOptions) => { - this.setBatchType("setAccessTier"); - await this.addSubRequestInternal({ - url: url3, - credential - }, async () => { - await new BlobClient(url3, this.batchRequest.createPipeline(credential)).setAccessTier(tier2, updatedOptions); - }); - }); - } - }; - var InnerBatchRequest = class { - constructor() { - this.operationCount = 0; - this.body = ""; - const tempGuid = coreUtil.randomUUID(); - this.boundary = `batch_${tempGuid}`; - this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${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 = coreRestPipeline.createEmptyPipeline(); - corePipeline.addPolicy(coreClient.serializationPolicy({ - stringifyXML: coreXml.stringifyXML, - serializerOptions: { - xml: { - xmlCharKey: "#" - } - } - }), { phase: "Serialize" }); - corePipeline.addPolicy(batchHeaderFilterPolicy()); - corePipeline.addPolicy(batchRequestAssemblePolicy(this), { afterPhase: "Sign" }); - if (coreAuth.isTokenCredential(credential)) { - corePipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential, - scopes: StorageOAuthScopes, - challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnTenantChallenge } - }), { phase: "Sign" }); - } else if (credential instanceof StorageSharedKeyCredential) { - corePipeline.addPolicy(storageSharedKeyCredentialPolicy({ - accountName: credential.accountName, - accountKey: credential.accountKey - }), { phase: "Sign" }); + if (permissionLike.tag) { + accountSASPermissions.tag = true; } - const pipeline = new Pipeline([]); - pipeline._credential = credential; - pipeline._corePipeline = corePipeline; - return pipeline; - } - appendSubRequestToBody(request) { - this.body += [ - this.subRequestPrefix, - // sub request constant prefix - `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`, - // sub request's content ID - "", - // empty line after sub request's content ID - `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}` - // sub request start line with method - ].join(HTTP_LINE_ENDING); - for (const [name, value] of request.headers) { - this.body += `${name}: ${value}${HTTP_LINE_ENDING}`; + if (permissionLike.list) { + accountSASPermissions.list = true; } - this.body += HTTP_LINE_ENDING; - } - preAddSubRequest(subRequest) { - if (this.operationCount >= BATCH_MAX_REQUEST) { - throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`); + if (permissionLike.add) { + accountSASPermissions.add = true; } - const path12 = getURLPath(subRequest.url); - if (!path12 || path12 === "") { - throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`); + if (permissionLike.create) { + accountSASPermissions.create = true; } - } - 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}${HTTP_LINE_ENDING}`; - } - getMultipartContentType() { - return this.multipartContentType; - } - getSubRequests() { - return this.subRequests; - } - }; - function batchRequestAssemblePolicy(batchRequest) { - return { - name: "batchRequestAssemblePolicy", - async sendRequest(request) { - batchRequest.appendSubRequestToBody(request); - return { - request, - status: 200, - headers: coreRestPipeline.createHttpHeaders() - }; + if (permissionLike.update) { + accountSASPermissions.update = true; } - }; - } - function batchHeaderFilterPolicy() { - return { - name: "batchHeaderFilterPolicy", - async sendRequest(request, next) { - let xMsHeaderName = ""; - for (const [name] of request.headers) { - if (iEqual(name, HeaderConstants.X_MS_VERSION)) { - xMsHeaderName = name; - } - } - if (xMsHeaderName !== "") { - request.headers.delete(xMsHeaderName); - } - return next(request); + if (permissionLike.process) { + accountSASPermissions.process = true; } - }; - } - var BlobBatchClient = class { - constructor(url3, credentialOrPipeline, options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } else if (!credentialOrPipeline) { - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - pipeline = newPipeline(credentialOrPipeline, options); + if (permissionLike.setImmutabilityPolicy) { + accountSASPermissions.setImmutabilityPolicy = true; } - const storageClientContext = new StorageContextClient(url3, getCoreClientOptions(pipeline)); - const path12 = getURLPath(url3); - if (path12 && path12 !== "/") { - this.serviceOrContainerContext = storageClientContext.container; - } else { - this.serviceOrContainerContext = storageClientContext.service; + if (permissionLike.permanentDelete) { + accountSASPermissions.permanentDelete = true; } + return accountSASPermissions; } /** - * Creates a {@link BlobBatch}. - * A BlobBatch represents an aggregated set of operations on blobs. + * 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. */ - createBatch() { - return new BlobBatch(); - } - async deleteBlobs(urlsOrBlobClients, credentialOrOptions, options) { - const batch = new 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(); - 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); - } + permanentDelete = false; /** - * Submit batch request which consists of multiple subrequests. - * - * Get `blobBatchClient` and other details before running the snippets. - * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient` - * - * Example usage: - * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.deleteBlob(urlInString0, credential0); - * await batchRequest.deleteBlob(urlInString1, credential1, { - * deleteSnapshots: "include" - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` - * - * Example using a lease: + * Produces the SAS permissions string for an Azure Storage account. + * Call this method to set AccountSASSignatureValues Permissions field. * - * ```js - * let batchRequest = new BlobBatch(); - * await batchRequest.setBlobAccessTier(blockBlobClient0, "Cool"); - * await batchRequest.setBlobAccessTier(blockBlobClient1, "Cool", { - * conditions: { leaseId: leaseId } - * }); - * const batchResp = await blobBatchClient.submitBatch(batchRequest); - * console.log(batchResp.subResponsesSucceededCount); - * ``` + * Using this method will guarantee the resource types are in + * an order accepted by the service. * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * - * @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."); + toString() { + const permissions = []; + if (this.read) { + permissions.push("r"); } - return tracingClient.withSpan("BlobBatchClient-submitBatch", options, async (updatedOptions) => { - const batchRequestBody = batchRequest.getHttpRequestBody(); - const rawBatchResponse = assertResponse(await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign({}, updatedOptions))); - const batchResponseParser = new 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; - }); + 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(""); } }; - var ContainerClient = class extends StorageClient { + 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 { /** - * The name of the container. + * 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 - */ - get containerName() { - return this._containerName; - } - constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, options) { - let pipeline; - let url3; - options = options || {}; - if (isPipelineLike(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = credentialOrPipelineOrContainerName; - } else if (coreUtil.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential || credentialOrPipelineOrContainerName instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipelineOrContainerName)) { - url3 = urlOrConnectionString; - pipeline = newPipeline(credentialOrPipelineOrContainerName, options); - } else if (!credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName !== "string") { - url3 = urlOrConnectionString; - pipeline = newPipeline(new AnonymousCredential(), options); - } else if (credentialOrPipelineOrContainerName && typeof credentialOrPipelineOrContainerName === "string") { - const containerName = credentialOrPipelineOrContainerName; - const extractedCreds = extractConnectionStringParts(urlOrConnectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - url3 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); - } - pipeline = newPipeline(sharedKeyCredential, options); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); - } - } else if (extractedCreds.kind === "SASConnString") { - url3 = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) + "?" + extractedCreds.accountSas; - pipeline = newPipeline(new AnonymousCredential(), options); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); + 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}`); } - } else { - throw new Error("Expecting non-empty strings for containerName parameter"); } - super(url3, pipeline); - this._containerName = this.getContainerNameFromUrl(); - this.containerContext = this.storageClientContext.container; + return accountSASResourceTypes; } /** - * Creates a new container under the specified account. If the container with - * the same name already exists, the operation fails. - * @see https://docs.microsoft.com/en-us/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. - * + * 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. * - * Example usage: + * @see https://learn.microsoft.com/rest/api/storageservices/constructing-an-account-sas * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * const createContainerResponse = await containerClient.create(); - * console.log("Container was created successfully", createContainerResponse.requestId); - * ``` */ - async create(options = {}) { - return tracingClient.withSpan("ContainerClient-create", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.create(updatedOptions)); - }); + 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 a new container under the specified account. If the container with - * the same name already exists, it is not changed. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container - * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata + * 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 options - + * @param services - */ - async createIfNotExists(options = {}) { - return tracingClient.withSpan("ContainerClient-createIfNotExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = await this.create(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerAlreadyExists") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } else { - throw e; - } + 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; } /** - * 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 - + * Permission to access blob resources granted. */ - async exists(options = {}) { - return 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; - } - }); - } + blob = false; /** - * Creates a {@link BlobClient} - * - * @param blobName - A blob name - * @returns A new BlobClient object for the given blob name. + * Permission to access file resources granted. */ - getBlobClient(blobName) { - return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } + file = false; /** - * Creates an {@link AppendBlobClient} - * - * @param blobName - An append blob name + * Permission to access queue resources granted. */ - getAppendBlobClient(blobName) { - return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } + queue = false; /** - * Creates a {@link BlockBlobClient} - * - * @param blobName - A block blob name - * - * - * Example usage: - * - * ```js - * const content = "Hello world!"; - * - * const blockBlobClient = containerClient.getBlockBlobClient(""); - * const uploadBlobResponse = await blockBlobClient.upload(content, content.length); - * ``` + * Permission to access table resources granted. */ - getBlockBlobClient(blobName) { - return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); - } + table = false; /** - * Creates a {@link PageBlobClient} + * Converts the given services to a string. * - * @param blobName - A page blob name */ - getPageBlobClient(blobName) { - return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline); + 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; /** - * 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://docs.microsoft.com/en-us/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. + * Creates an instance of BlobServiceClient from connection string. * - * @param options - Options to Container Get Properties operation. + * @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. */ - async getProperties(options = {}) { - if (!options.conditions) { - options.conditions = {}; + 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 pipeline = (0, Pipeline_js_1.newPipeline)(sharedKeyCredential, options); + return new _BlobServiceClient(extractedCreds.url, pipeline); + } else { + throw new Error("Account connection string is only supported in Node.js environment"); + } + } else if (extractedCreds.kind === "SASConnString") { + const pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); + } else { + throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } - return tracingClient.withSpan("ContainerClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), { tracingOptions: updatedOptions.tracingOptions }))); - }); + } + constructor(url2, credentialOrPipeline, options) { + let pipeline; + if ((0, Pipeline_js_1.isPipelineLike)(credentialOrPipeline)) { + pipeline = 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)) { + pipeline = (0, Pipeline_js_1.newPipeline)(credentialOrPipeline, options); + } else { + pipeline = (0, Pipeline_js_1.newPipeline)(new AnonymousCredential_js_1.AnonymousCredential(), options); + } + super(url2, pipeline); + this.serviceContext = this.storageClientContext.service; } /** - * Marks the specified container for deletion. The container and any blobs - * contained within it are later deleted during garbage collection. - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * Creates a {@link ContainerClient} object * - * @param options - Options to Container Delete operation. + * @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(""); + * ``` */ - async delete(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - return tracingClient.withSpan("ContainerClient-delete", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.delete({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); - }); + getContainerClient(containerName) { + return new ContainerClient_js_1.ContainerClient((0, utils_common_js_1.appendToURLPath)(this.url, encodeURIComponent(containerName)), this.pipeline); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-container + * Create a Blob container. @see https://learn.microsoft.com/rest/api/storageservices/create-container * - * @param options - Options to Container Delete operation. + * @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 deleteIfExists(options = {}) { - return tracingClient.withSpan("ContainerClient-deleteIfExists", options, async (updatedOptions) => { - var _a, _b; - try { - const res = await this.delete(updatedOptions); - return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response }); - } catch (e) { - if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === "ContainerNotFound") { - return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response }); - } - throw e; - } + 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 + }; }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata + * Deletes a Blob container. * - * @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. + * @param containerName - Name of the container to delete. + * @param options - Options to configure Container Delete operation. + * @returns Container deletion response. */ - async setMetadata(metadata2, 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 tracingClient.withSpan("ContainerClient-setMetadata", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.setMetadata({ - abortSignal: options.abortSignal, - leaseAccessConditions: options.conditions, - metadata: metadata2, - modifiedAccessConditions: options.conditions, - tracingOptions: updatedOptions.tracingOptions - })); + async deleteContainer(containerName, options = {}) { + return tracing_js_1.tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { + const containerClient = this.getContainerClient(containerName); + return containerClient.delete(updatedOptions); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl - * - * @param options - Options to Container Get Access Policy operation. - */ - async getAccessPolicy(options = {}) { - if (!options.conditions) { - options.conditions = {}; - } - return tracingClient.withSpan("ContainerClient-getAccessPolicy", options, async (updatedOptions) => { - const response = 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; + * 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 }; }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl + * 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 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. + * @param options - Options to the Service Get Properties operation. + * @returns Response data for the Service Get Properties operation. */ - async setAccessPolicy(access2, containerAcl2, options = {}) { - options.conditions = options.conditions || {}; - return tracingClient.withSpan("ContainerClient-setAccessPolicy", options, async (updatedOptions) => { - const acl = []; - for (const identifier of containerAcl2 || []) { - acl.push({ - accessPolicy: { - expiresOn: identifier.accessPolicy.expiresOn ? truncatedISO8061Date(identifier.accessPolicy.expiresOn) : "", - permissions: identifier.accessPolicy.permissions, - startsOn: identifier.accessPolicy.startsOn ? truncatedISO8061Date(identifier.accessPolicy.startsOn) : "" - }, - id: identifier.id - }); - } - return assertResponse(await this.containerContext.setAccessPolicy({ + 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, - access: access2, - containerAcl: acl, - leaseAccessConditions: options.conditions, - modifiedAccessConditions: options.conditions, tracingOptions: updatedOptions.tracingOptions })); }); } /** - * Get a {@link BlobLeaseClient} that manages leases on the container. + * 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 proposeLeaseId - Initial proposed lease Id. - * @returns A new BlobLeaseClient object for managing leases on the container. + * @param properties - + * @param options - Options to the Service Set Properties operation. + * @returns Response data for the Service Set Properties operation. */ - getBlobLeaseClient(proposeLeaseId) { - return new BlobLeaseClient(this, proposeLeaseId); + 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 + })); + }); } /** - * 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://docs.microsoft.com/rest/api/storageservices/put-blob + * 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 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. + * @param options - Options to the Service Get Statistics operation. + * @returns Response data for the Service Get Statistics operation. */ - async uploadBlockBlob(blobName, body2, contentLength2, options = {}) { - return tracingClient.withSpan("ContainerClient-uploadBlockBlob", options, async (updatedOptions) => { - const blockBlobClient = this.getBlockBlobClient(blobName); - const response = await blockBlobClient.upload(body2, contentLength2, updatedOptions); - return { - blockBlobClient, - response - }; + 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 + })); }); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob + * 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 blobName - - * @param options - Options to Blob Delete operation. - * @returns Block blob deletion response data. + * @param options - Options to the Service Get Account Info operation. + * @returns Response data for the Service Get Account Info operation. */ - async deleteBlob(blobName, options = {}) { - return tracingClient.withSpan("ContainerClient-deleteBlob", options, async (updatedOptions) => { - let blobClient = this.getBlobClient(blobName); - if (options.versionId) { - blobClient = blobClient.withVersion(options.versionId); - } - return blobClient.delete(updatedOptions); + 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 + })); }); } /** - * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * 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 to be returned with the next list operation. - * @param options - Options to Container List Blob Flat Segment operation. + * @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 listBlobFlatSegment(marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobFlatSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobFlat(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }) }) }); - return wrappedResponse; + 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 + })); }); } /** - * 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://docs.microsoft.com/rest/api/storageservices/list-blobs + * 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 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. + * @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 listBlobHierarchySegment(delimiter2, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-listBlobHierarchySegment", options, async (updatedOptions) => { - var _a; - const response = assertResponse(await this.containerContext.listBlobHierarchySegment(delimiter2, Object.assign(Object.assign({ marker: marker2 }, options), { tracingOptions: updatedOptions.tracingOptions }))); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: Object.assign(Object.assign({}, response._response), { parsedBody: ConvertInternalResponseOfListBlobHierarchy(response._response.parsedBody) }), segment: Object.assign(Object.assign({}, response.segment), { blobItems: response.segment.blobItems.map((blobItemInternal) => { - const blobItem = Object.assign(Object.assign({}, blobItemInternal), { name: BlobNameToString(blobItemInternal.name), tags: toTags(blobItemInternal.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInternal.objectReplicationMetadata) }); - return blobItem; - }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => { - const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) }); - return blobPrefix; - }) }) }); + 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 ContainerListBlobFlatSegmentResponse + * 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 + * 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 + * 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. + * @param options - Options to find blobs by tags. */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listBlobsFlatSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker2, options)); - marker2 = listBlobsFlatSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse)); - } while (marker2); - } - }); + 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 of {@link BlobItem} objects + * Returns an AsyncIterableIterator for blobs. * - * @param options - Options to list blobs operation. + * @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. */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_1, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsFlatSegmentResponse = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } - } - }); + 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 list all the 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. * - * Example using `for await` syntax: + * @see https://learn.microsoft.com/rest/api/storageservices/get-blob-service-properties * - * ```js - * // Get the containerClient before you run these snippets, - * // Can be obtained from `blobServiceClient.getContainerClient("");` - * let i = 1; - * for await (const blob of containerClient.listBlobsFlat()) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * ``` + * ```ts snippet:BlobServiceClientFindBlobsByTags + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `iter.next()`: + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * ```js + * // Use for await to iterate the blobs * let i = 1; - * let iter = containerClient.listBlobsFlat(); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { + * console.log(`Blob ${i++}: ${blob.name}`); * } - * ``` * - * Example using `byPage()`: + * // 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()); + * } * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) { - * for (const blob of response.segment.blobItems) { + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 }); + * // 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 - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * 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.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 }); + * iterator = blobServiceClient + * .findBlobsByTags("tagkey='tagvalue'") + * .byPage({ continuationToken: marker, maxPageSize: 10 }); * response = (await iterator.next()).value; * - * // Prints 10 blob names - * for (const blob of response.segment.blobItems) { - * console.log(`Blob ${i++}: ${blob.name}`); + * // Prints blob names + * if (response.blobs) { + * for (const blob of response.blobs) { + * console.log(`Blob ${i++}: ${blob.name}`); + * } * } * ``` * - * @param options - Options to list blobs. - * @returns An asyncIterableIterator that supports paging. + * @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. */ - listBlobsFlat(options = {}) { - const include2 = []; - if (options.includeCopy) { - include2.push("copy"); - } - if (options.includeDeleted) { - include2.push("deleted"); - } - if (options.includeMetadata) { - include2.push("metadata"); - } - if (options.includeSnapshots) { - include2.push("snapshots"); - } - if (options.includeVersions) { - include2.push("versions"); - } - if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); - } - if (options.includeTags) { - include2.push("tags"); - } - if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include2.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; - } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItems(updatedOptions); + findBlobsByTags(tagFilterSqlExpression, options = {}) { + const listSegmentOptions = { + ...options + }; + const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); return { /** * The next method, part of the iteration protocol @@ -67158,387 +74114,136 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions)); + return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, { + maxPageSize: settings.maxPageSize, + ...listSegmentOptions + }); } }; } /** - * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse + * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses * - * @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. - */ - listHierarchySegments(delimiter_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1(delimiter2, marker2, options = {}) { - let listBlobsHierarchySegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter2, marker2, options)); - marker2 = listBlobsHierarchySegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse)); - } while (marker2); - } - }); - } - /** - * 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. - */ - listItemsByHierarchy(delimiter_1) { - return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1(delimiter2, options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listHierarchySegments(delimiter2, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const listBlobsHierarchySegmentResponse = _c; - const segment = listBlobsHierarchySegmentResponse.segment; - if (segment.blobPrefixes) { - for (const prefix2 of segment.blobPrefixes) { - yield yield tslib.__await(Object.assign({ kind: "prefix" }, prefix2)); - } - } - for (const blob of segment.blobItems) { - yield yield tslib.__await(Object.assign({ kind: "blob" }, blob)); - } - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; - } - } - }); - } - /** - * 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. - * - * Example using `for await` syntax: - * - * ```js - * for await (const item of containerClient.listBlobsByHierarchy("/")) { - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let iter = containerClient.listBlobsByHierarchy("/", { prefix: "prefix1/" }); - * let entity = await iter.next(); - * while (!entity.done) { - * let item = entity.value; - * if (item.kind === "prefix") { - * console.log(`\tBlobPrefix: ${item.name}`); - * } else { - * console.log(`\tBlobItem: name - ${item.name}`); - * } - * entity = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * console.log("Listing blobs by hierarchy by page"); - * for await (const response of containerClient.listBlobsByHierarchy("/").byPage()) { - * const segment = response.segment; - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` - * - * Example using paging with a max page size: - * - * ```js - * console.log("Listing blobs by hierarchy by page, specifying a prefix and a max page size"); - * - * let i = 1; - * for await (const response of containerClient - * .listBlobsByHierarchy("/", { prefix: "prefix2/sub1/" }) - * .byPage({ maxPageSize: 2 })) { - * console.log(`Page ${i++}`); - * const segment = response.segment; - * - * if (segment.blobPrefixes) { - * for (const prefix of segment.blobPrefixes) { - * console.log(`\tBlobPrefix: ${prefix.name}`); - * } - * } - * - * for (const blob of response.segment.blobItems) { - * console.log(`\tBlobItem: name - ${blob.name}`); - * } - * } - * ``` - * - * @param delimiter - The character or string used to define the virtual hierarchy - * @param options - Options to list blobs operation. + * 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. */ - listBlobsByHierarchy(delimiter2, options = {}) { - if (delimiter2 === "") { - throw new RangeError("delimiter should contain one or more characters"); - } - const include2 = []; - if (options.includeCopy) { - include2.push("copy"); - } - if (options.includeDeleted) { - include2.push("deleted"); - } - if (options.includeMetadata) { - include2.push("metadata"); - } - if (options.includeSnapshots) { - include2.push("snapshots"); - } - if (options.includeVersions) { - include2.push("versions"); - } - if (options.includeUncommitedBlobs) { - include2.push("uncommittedblobs"); - } - if (options.includeTags) { - include2.push("tags"); - } - if (options.includeDeletedWithVersions) { - include2.push("deletedwithversions"); - } - if (options.includeImmutabilityPolicy) { - include2.push("immutabilitypolicy"); - } - if (options.includeLegalHold) { - include2.push("legalhold"); - } - if (options.prefix === "") { - options.prefix = void 0; + 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); } - const updatedOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - const iter = this.listItemsByHierarchy(delimiter2, 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(delimiter2, settings.continuationToken, Object.assign({ 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, marker2, options = {}) { - return tracingClient.withSpan("ContainerClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.containerContext.filterBlobs({ - abortSignal: options.abortSignal, - where: tagFilterSqlExpression, - marker: marker2, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); - return wrappedResponse; - }); - } - /** - * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse. + * Returns an AsyncIterableIterator for Container Items * - * @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. + * @param options - Options to list containers operation. */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } - }); + async *listItems(options = {}) { + let marker; + for await (const segment of this.listSegments(marker, options)) { + yield* segment.containerItems; + } } /** - * Returns an AsyncIterableIterator for blobs. + * Returns an async iterable iterator to list all the containers + * under the specified account. * - * @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. - */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_3, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_3_1) { - e_3 = { error: e_3_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_3) throw e_3.error; - } - } - }); - } - /** - * 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 containers in pages. * - * .byPage() returns an async iterable iterator to list the blobs in pages. + * ```ts snippet:BlobServiceClientListContainers + * import { BlobServiceClient } from "@azure/storage-blob"; + * import { DefaultAzureCredential } from "@azure/identity"; * - * Example using `for await` syntax: + * const account = ""; + * const blobServiceClient = new BlobServiceClient( + * `https://${account}.blob.core.windows.net`, + * new DefaultAzureCredential(), + * ); * - * ```js + * // Use for await to iterate the containers * let i = 1; - * for await (const blob of containerClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${blob.name}`); + * for await (const container of blobServiceClient.listContainers()) { + * console.log(`Container ${i++}: ${container.name}`); * } - * ``` * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = containerClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); + * // 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()); * } - * ``` - * - * Example using `byPage()`: * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } + * // 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}`); * } * } - * ``` * - * Example using paging with a marker: - * - * ```js - * let i = 1; - * let iterator = containerClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 2 }); + * // Use paging with a marker + * i = 1; + * let iterator = blobServiceClient.listContainers().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}`); + * // 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 = containerClient - * .findBlobsByTags("tagkey='tagvalue'") + * iterator = blobServiceClient + * .listContainers() * .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}`); + * // Prints 10 container names + * if (response.containerItems) { + * for (const container of response.containerItems) { + * console.log(`Container ${i++}: ${container.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. + * @param options - Options to list containers. + * @returns An asyncIterableIterator that supports paging. */ - findBlobsByTags(tagFilterSqlExpression, options = {}) { - const listSegmentOptions = Object.assign({}, options); - const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions); + 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 @@ -67556,6115 +74261,6656 @@ ${key}:${decodeURIComponent(lowercaseQueries[key])}`; * Return an AsyncIterableIterator that works a page at a time */ byPage: (settings = {}) => { - return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + return this.listSegments(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://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information + * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential). * - * @param options - Options to the Service Get Account Info operation. - * @returns Response data for the Service Get Account Info operation. + * 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 getAccountInfo(options = {}) { - return tracingClient.withSpan("ContainerClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.containerContext.getAccountInfo({ + 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; }); } - getContainerNameFromUrl() { - let containerName; + /** + * 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.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"); + }; + } +}); + +// 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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 core14 = __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); + core14.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 _a; + const blobClient = new storage_blob_1.BlobClient(signedUploadURL); + const blockBlobClient = blobClient.getBlockBlobClient(); + const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 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 { - const parsedUrl = new URL(this.url); - if (parsedUrl.hostname.split(".")[1] === "blob") { - containerName = parsedUrl.pathname.split("/")[1]; - } else if (isIpEndpointStyle(parsedUrl)) { - containerName = parsedUrl.pathname.split("/")[2]; - } else { - containerName = parsedUrl.pathname.split("/")[1]; + uploadProgress.startDisplayTimer(); + core14.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) { + core14.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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 = retry3; + exports2.retryTypedResponse = retryTypedResponse; + exports2.retryHttpClientResponse = retryHttpClientResponse; + var core14 = __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((resolve6) => setTimeout(resolve6, milliseconds)); + }); + } + function retry3(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; + } } - containerName = decodeURIComponent(containerName); - if (!containerName) { - throw new Error("Provided containerName is invalid."); + if (statusCode) { + isRetryable = isRetryableStatusCode(statusCode); + errorMessage = `Cache service responded with ${statusCode}`; } - return containerName; - } catch (error4) { - throw new Error("Unable to extract containerName with provided information."); + core14.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); + if (!isRetryable) { + core14.debug(`${name} - Error is not retryable`); + break; + } + yield sleep(delay2); + attempt++; } - } - /** - * 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://docs.microsoft.com/en-us/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((resolve6) => { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + 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 retry3( + 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; + } } - const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString(); - resolve6(appendToURLQuery(this.url, sas)); - }); + ); + }); + } + 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 retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); + }); + } + } +}); + +// node_modules/@azure/abort-controller/dist/index.js +var require_dist4 = __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); } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas + * Status of whether aborted or not. * - * @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. + * @readonly */ - /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/ - generateSasStringToSign(options) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw new RangeError("Can only generate the SAS when the client is initialized with a shared key credential"); + get aborted() { + if (!abortedMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } - return generateBlobSASQueryParametersInternal(Object.assign({ containerName: this._containerName }, options), this.credential).stringToSign; + return abortedMap.get(this); } /** - * Creates a BlobBatchClient object to conduct batch operations. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch + * Creates a new AbortSignal instance that will never be aborted. * - * @returns A new BlobBatchClient object for this container. + * @readonly */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); - } - }; - var AccountSASPermissions = class _AccountSASPermissions { - constructor() { - this.read = false; - this.write = false; - this.delete = false; - this.deleteVersion = false; - this.list = false; - this.add = false; - this.create = false; - this.update = false; - this.process = false; - this.tag = false; - this.filter = false; - this.setImmutabilityPolicy = false; - this.permanentDelete = false; + static get none() { + return new _AbortSignal(); } /** - * Parse initializes the AccountSASPermissions fields from a string. + * Added new "abort" event listener, only support "abort" event. * - * @param permissions - + * @param _type - Only support "abort" event + * @param listener - The listener to be added */ - 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}`); - } + addEventListener(_type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } - return accountSASPermissions; + const listeners = listenersMap.get(this); + listeners.push(listener); } /** - * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it - * and boolean values for them. + * Remove "abort" event listener, only support "abort" event. * - * @param permissionLike - + * @param _type - Only support "abort" event + * @param listener - The listener to be removed */ - 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; + removeEventListener(_type, listener) { + if (!listenersMap.has(this)) { + throw new TypeError("Expected `this` to be an instance of AbortSignal."); } - if (permissionLike.permanentDelete) { - accountSASPermissions.permanentDelete = true; + const listeners = listenersMap.get(this); + const index = listeners.indexOf(listener); + if (index > -1) { + listeners.splice(index, 1); } - return accountSASPermissions; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas - * + * Dispatches a synthetic event to the AbortSignal. */ - 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(""); + dispatchEvent(_event) { + throw new Error("This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes."); } }; - var AccountSASResourceTypes = class _AccountSASResourceTypes { - constructor() { - this.service = false; - this.container = false; - this.object = false; + function abortSignal(signal) { + if (signal.aborted) { + return; } - /** - * 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}`); + 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(); + }); } } - return accountSASResourceTypes; } /** - * Converts the given resource types to a string. - * - * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas + * The AbortSignal associated with this controller that will signal aborted + * when the abort method is called on this controller. * + * @readonly */ - toString() { - const resourceTypes = []; - if (this.service) { - resourceTypes.push("s"); - } - if (this.container) { - resourceTypes.push("c"); - } - if (this.object) { - resourceTypes.push("o"); - } - return resourceTypes.join(""); - } - }; - var AccountSASServices = class _AccountSASServices { - constructor() { - this.blob = false; - this.file = false; - this.queue = false; - this.table = false; + get signal() { + return this._signal; } /** - * 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 - + * Signal that any operations passed this controller's associated abort signal + * to cancel any remaining work and throw an `AbortError`. */ - 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; + abort() { + abortSignal(this._signal); } /** - * Converts the given services to a string. - * + * Creates a new AbortSignal instance that will abort after the provided ms. + * @param ms - Elapsed time in milliseconds to trigger an abort. */ - 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"); + static timeout(ms) { + const signal = new AbortSignal2(); + const timer = setTimeout(abortSignal, ms, signal); + if (typeof timer.unref === "function") { + timer.unref(); } - return services.join(""); + return signal; } }; - function generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) { - return generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential).sasQueryParameters; - } - function generateAccountSASQueryParametersInternal(accountSASSignatureValues, sharedKeyCredential) { - const version2 = accountSASSignatureValues.version ? accountSASSignatureValues.version : SERVICE_VERSION; - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.setImmutabilityPolicy && version2 < "2020-08-04") { - throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.deleteVersion && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'x' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.permanentDelete && version2 < "2019-10-10") { - throw RangeError("'version' must be >= '2019-10-10' when provided 'y' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.tag && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 't' permission."); - } - if (accountSASSignatureValues.permissions && accountSASSignatureValues.permissions.filter && version2 < "2019-12-12") { - throw RangeError("'version' must be >= '2019-12-12' when provided 'f' permission."); - } - if (accountSASSignatureValues.encryptionScope && version2 < "2020-12-06") { - throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); - } - const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString()); - const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString(); - const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString(); - let stringToSign; - if (version2 >= "2020-12-06") { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version2, - accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : "", - "" - // Account SAS requires an additional newline character - ].join("\n"); - } else { - stringToSign = [ - sharedKeyCredential.accountName, - parsedPermissions, - parsedServices, - parsedResourceTypes, - accountSASSignatureValues.startsOn ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false) : "", - truncatedISO8061Date(accountSASSignatureValues.expiresOn, false), - accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : "", - accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : "", - version2, - "" - // Account SAS requires an additional newline character - ].join("\n"); + 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]; + } }; } - const signature = sharedKeyCredential.computeHMACSHA256(stringToSign); - return { - sasQueryParameters: new SASQueryParameters(version2, 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 + 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); }; - } - var BlobServiceClient = class _BlobServiceClient extends StorageClient { - /** - * - * 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 = extractConnectionStringParts(connectionString); - if (extractedCreds.kind === "AccountConnString") { - if (coreUtil.isNode) { - const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey); - if (!options.proxyOptions) { - options.proxyOptions = coreRestPipeline.getDefaultProxySettings(extractedCreds.proxyUri); - } - const pipeline = newPipeline(sharedKeyCredential, options); - return new _BlobServiceClient(extractedCreds.url, pipeline); - } else { - throw new Error("Account connection string is only supported in Node.js environment"); + 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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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); } - } else if (extractedCreds.kind === "SASConnString") { - const pipeline = newPipeline(new AnonymousCredential(), options); - return new _BlobServiceClient(extractedCreds.url + "?" + extractedCreds.accountSas, pipeline); - } else { - throw new Error("Connection string must be either an Account connection string or a SAS connection string"); } - } - constructor(url3, credentialOrPipeline, options) { - let pipeline; - if (isPipelineLike(credentialOrPipeline)) { - pipeline = credentialOrPipeline; - } else if (coreUtil.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential || credentialOrPipeline instanceof AnonymousCredential || coreAuth.isTokenCredential(credentialOrPipeline)) { - pipeline = newPipeline(credentialOrPipeline, options); - } else { - pipeline = newPipeline(new AnonymousCredential(), options); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); } - super(url3, pipeline); - this.serviceContext = this.storageClientContext.service; + 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 core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var storage_blob_1 = require_commonjs15(); + var buffer = __importStar2(require("buffer")); + var fs13 = __importStar2(require("fs")); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var utils = __importStar2(require_cacheUtils()); + var constants_1 = require_constants7(); + var requestUtils_1 = require_requestUtils(); + var abort_controller_1 = require_dist4(); + function pipeResponseToStream(response, output) { + return __awaiter2(this, void 0, void 0, function* () { + const pipeline = util.promisify(stream2.pipeline); + yield pipeline(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(); } /** - * Creates a {@link ContainerClient} object - * - * @param containerName - A container name - * @returns A new ContainerClient object for the given container name. - * - * Example usage: + * Progress to the next segment. Only call this method when the previous segment + * is complete. * - * ```js - * const containerClient = blobServiceClient.getContainerClient(""); - * ``` + * @param segmentSize the length of the next segment */ - getContainerClient(containerName) { - return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline); + nextSegment(segmentSize) { + this.segmentOffset = this.segmentOffset + this.segmentSize; + this.segmentIndex = this.segmentIndex + 1; + this.segmentSize = segmentSize; + this.receivedBytes = 0; + core14.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); } /** - * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container + * Sets the number of bytes received for the current segment. * - * @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. + * @param receivedBytes the number of bytes received */ - async createContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-createContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(containerName); - const containerCreateResponse = await containerClient.create(updatedOptions); - return { - containerClient, - containerCreateResponse - }; - }); + setReceivedBytes(receivedBytes) { + this.receivedBytes = receivedBytes; } /** - * Deletes a Blob container. - * - * @param containerName - Name of the container to delete. - * @param options - Options to configure Container Delete operation. - * @returns Container deletion response. + * Returns the total number of bytes transferred. */ - async deleteContainer(containerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-deleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(containerName); - return containerClient.delete(updatedOptions); - }); + getTransferredBytes() { + return this.segmentOffset + this.receivedBytes; } /** - * 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. + * Returns true if the download is complete. */ - async undeleteContainer(deletedContainerName2, deletedContainerVersion2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-undeleteContainer", options, async (updatedOptions) => { - const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName2); - const containerContext = containerClient["storageClientContext"].container; - const containerUndeleteResponse = assertResponse(await containerContext.restore({ - deletedContainerName: deletedContainerName2, - deletedContainerVersion: deletedContainerVersion2, - tracingOptions: updatedOptions.tracingOptions - })); - return { containerClient, containerUndeleteResponse }; - }); + isDone() { + return this.getTransferredBytes() === this.contentLength; } /** - * Rename an existing Blob Container. - * - * @param sourceContainerName - The name of the source container. - * @param destinationContainerName - The new name of the container. - * @param options - Options to configure Container Rename operation. + * Prints the current download stats. Once the download completes, this will print one + * last line and then stop. */ - /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */ - // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready. - async renameContainer(sourceContainerName2, destinationContainerName, options = {}) { - return tracingClient.withSpan("BlobServiceClient-renameContainer", options, async (updatedOptions) => { - var _a; - const containerClient = this.getContainerClient(destinationContainerName); - const containerContext = containerClient["storageClientContext"].container; - const containerRenameResponse = assertResponse(await containerContext.rename(sourceContainerName2, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }))); - return { containerClient, containerRenameResponse }; - }); + 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); + core14.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); + if (this.isDone()) { + this.displayedComplete = true; + } } /** - * Gets the properties of a storage account’s Blob service, including properties - * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. - * @see https://docs.microsoft.com/en-us/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. + * Returns a function used to handle TransferProgressEvents. */ - async getProperties(options = {}) { - return tracingClient.withSpan("BlobServiceClient-getProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getProperties({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + onProgress() { + return (progress) => { + this.setReceivedBytes(progress.loadedBytes); + }; } /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties + * Starts the timer that displays the stats. * - * @param properties - - * @param options - Options to the Service Set Properties operation. - * @returns Response data for the Service Set Properties operation. + * @param delayInMs the delay between each write */ - async setProperties(properties, options = {}) { - return tracingClient.withSpan("BlobServiceClient-setProperties", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.setProperties(properties, { - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + startDisplayTimer(delayInMs = 1e3) { + const displayCallback = () => { + this.display(); + if (!this.isDone()) { + this.timeoutHandle = setTimeout(displayCallback, delayInMs); + } + }; + this.timeoutHandle = setTimeout(displayCallback, delayInMs); } /** - * 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://docs.microsoft.com/en-us/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. + * 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. */ - async getStatistics(options = {}) { - return tracingClient.withSpan("BlobServiceClient-getStatistics", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getStatistics({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions - })); - }); + stopDisplayTimer() { + if (this.timeoutHandle) { + clearTimeout(this.timeoutHandle); + this.timeoutHandle = void 0; + } + this.display(); } - /** - * 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://docs.microsoft.com/en-us/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 tracingClient.withSpan("BlobServiceClient-getAccountInfo", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.getAccountInfo({ - abortSignal: options.abortSignal, - tracingOptions: updatedOptions.tracingOptions + }; + exports2.DownloadProgress = DownloadProgress; + function downloadCacheHttpClient(archiveLocation, archivePath) { + return __awaiter2(this, void 0, void 0, function* () { + const writeStream = fs13.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(); + core14.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 { + core14.debug("Unable to validate download, no Content-Length header"); + } + }); + } + function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { + return __awaiter2(this, void 0, void 0, function* () { + var _a; + const archiveDescriptor = yield fs13.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 >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 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 _a; + 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 = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; + if (contentLength < 0) { + core14.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 = fs13.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)) { + fs13.writeFileSync(fd, result); + } + } + } finally { + downloadProgress.stopDisplayTimer(); + fs13.closeSync(fd); + } + } + }); + } + var promiseWithTimeout = (timeoutMs, promise) => __awaiter2(void 0, void 0, void 0, function* () { + let timeoutHandle; + const timeoutPromise = new Promise((resolve6) => { + timeoutHandle = setTimeout(() => resolve6("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]; + } }; } - /** - * Returns a list of the containers under the specified account. - * @see https://docs.microsoft.com/en-us/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(marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-listContainersSegment", options, async (updatedOptions) => { - return assertResponse(await this.serviceContext.listContainersSegment(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker: marker2 }, options), { include: typeof options.include === "string" ? [options.include] : options.include, tracingOptions: updatedOptions.tracingOptions }))); - }); + 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 core14 = __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; + core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core14.debug(`Upload concurrency: ${result.uploadConcurrency}`); + core14.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; + } + core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); + core14.debug(`Download concurrency: ${result.downloadConcurrency}`); + core14.debug(`Request timeout (ms): ${result.timeoutInMs}`); + core14.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); + core14.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); + core14.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.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"; + } + 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_package2 = __commonJS({ + "node_modules/@actions/cache/package.json"(exports2, module2) { + module2.exports = { + name: "@actions/cache", + version: "5.0.1", + 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.0", + "@protobuf-ts/runtime-rpc": "^2.11.1", + "@actions/http-client": "^3.0.0", + "@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" } - /** - * 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, marker2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-findBlobsByTagsSegment", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.filterBlobs({ - abortSignal: options.abortSignal, - where: tagFilterSqlExpression, - marker: marker2, - maxPageSize: options.maxPageSize, - tracingOptions: updatedOptions.tracingOptions - })); - const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => { - var _a; - let tagValue = ""; - if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) { - tagValue = blob.tags.blobTagSet[0].value; - } - return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue }); - }) }); - return wrappedResponse; - }); + }; + } +}); + +// 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_package2(); + 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]; + } }; } - /** - * 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. - */ - findBlobsByTagsSegments(tagFilterSqlExpression_1, marker_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1(tagFilterSqlExpression, marker2, options = {}) { - let response; - if (!!marker2 || marker2 === void 0) { - do { - response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker2, options)); - response.blobs = response.blobs || []; - marker2 = response.continuationToken; - yield yield tslib.__await(response); - } while (marker2); - } + 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(resolve6) { + resolve6(value); }); } - /** - * 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. - */ - findBlobsByTagsItems(tagFilterSqlExpression_1) { - return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1(tagFilterSqlExpression, options = {}) { - var _a, e_1, _b, _c; - let marker2; + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { try { - for (var _d = true, _e = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs))); - } - } catch (e_1_1) { - e_1 = { error: e_1_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_1) throw e_1.error; - } + step(generator.next(value)); + } catch (e) { + reject(e); } - }); - } - /** - * 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://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const blob of blobServiceClient.findBlobsByTags("tagkey='tagvalue'")) { - * console.log(`Blob ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.findBlobsByTags("tagkey='tagvalue'"); - * let blobItem = await iter.next(); - * while (!blobItem.done) { - * console.log(`Blob ${i++}: ${blobItem.value.name}`); - * blobItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.findBlobsByTags("tagkey='tagvalue'").byPage({ maxPageSize: 20 })) { - * if (response.blobs) { - * for (const blob of response.blobs) { - * console.log(`Blob ${i++}: ${blob.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let 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 = Object.assign({}, 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, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } - }; + } + function step(result) { + result.done ? resolve6(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 = saveCache3; + var core14 = __importStar2(require_core()); + var http_client_1 = require_lib(); + var auth_1 = require_auth(); + var fs13 = __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 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."); } - /** - * 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. - */ - listSegments(marker_1) { - return tslib.__asyncGenerator(this, arguments, function* listSegments_1(marker2, options = {}) { - let listContainersSegmentResponse; - if (!!marker2 || marker2 === void 0) { - do { - listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker2, options)); - listContainersSegmentResponse.containerItems = listContainersSegmentResponse.containerItems || []; - marker2 = listContainersSegmentResponse.continuationToken; - yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse)); - } while (marker2); + const url2 = `${baseUrl}_apis/artifactcache/${resource}`; + core14.debug(`Resource Url: ${url2}`); + return url2; + } + function createAcceptHeader(type2, apiVersion) { + return `${type2};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* () { + 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 (core14.isDebug()) { + yield printCachesListForDiagnostics(keys[0], httpClient, version); } - }); - } - /** - * Returns an AsyncIterableIterator for Container Items - * - * @param options - Options to list containers operation. - */ - listItems() { - return tslib.__asyncGenerator(this, arguments, function* listItems_1(options = {}) { - var _a, e_2, _b, _c; - let marker2; - try { - for (var _d = true, _e = tslib.__asyncValues(this.listSegments(marker2, options)), _f; _f = yield tslib.__await(_e.next()), _a = _f.done, !_a; _d = true) { - _c = _f.value; - _d = false; - const segment = _c; - yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems))); - } - } catch (e_2_1) { - e_2 = { error: e_2_1 }; - } finally { - try { - if (!_d && !_a && (_b = _e.return)) yield tslib.__await(_b.call(_e)); - } finally { - if (e_2) throw e_2.error; + return null; + } + if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { + 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."); + } + core14.setSecret(cacheDownloadUrl); + core14.debug(`Cache Result:`); + core14.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) { + core14.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) || []) { + core14.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}`); } } - }); - } - /** - * 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. - * - * Example using `for await` syntax: - * - * ```js - * let i = 1; - * for await (const container of blobServiceClient.listContainers()) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * ``` - * - * Example using `iter.next()`: - * - * ```js - * let i = 1; - * const iter = blobServiceClient.listContainers(); - * let containerItem = await iter.next(); - * while (!containerItem.done) { - * console.log(`Container ${i++}: ${containerItem.value.name}`); - * containerItem = await iter.next(); - * } - * ``` - * - * Example using `byPage()`: - * - * ```js - * // passing optional maxPageSize in the page settings - * let i = 1; - * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) { - * if (response.containerItems) { - * for (const container of response.containerItems) { - * console.log(`Container ${i++}: ${container.name}`); - * } - * } - * } - * ``` - * - * Example using paging with a marker: - * - * ```js - * let 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 include2 = []; - if (options.includeDeleted) { - include2.push("deleted"); } - if (options.includeMetadata) { - include2.push("metadata"); + }); + } + 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); } - if (options.includeSystem) { - include2.push("system"); + }); + } + 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* () { + core14.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.`); } - const listSegmentOptions = Object.assign(Object.assign({}, options), include2.length > 0 ? { include: include2 } : {}); - 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, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions)); + }); + } + 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 = fs13.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()]; + core14.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, () => fs13.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 { + fs13.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 saveCache3(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."); } - }; - } - /** - * 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://docs.microsoft.com/en-us/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, expiresOn2, options = {}) { - return tracingClient.withSpan("BlobServiceClient-getUserDelegationKey", options, async (updatedOptions) => { - const response = assertResponse(await this.serviceContext.getUserDelegationKey({ - startsOn: truncatedISO8061Date(startsOn, false), - expiresOn: truncatedISO8061Date(expiresOn2, 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 = Object.assign({ _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://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch - * - * @returns A new BlobBatchClient object for this service. - */ - getBlobBatchClient() { - return new BlobBatchClient(this.url, this.pipeline); + yield (0, uploadUtils_1.uploadCacheArchiveSDK)(signedUploadURL, archivePath, options); + } else { + const httpClient = createHttpClient(); + core14.debug("Upload cache"); + yield uploadFile(httpClient, cacheId, archivePath, options); + core14.debug("Commiting cache"); + const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.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.`); + } + core14.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"; } - /** - * 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://docs.microsoft.com/en-us/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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); + 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.`); + } } - if (expiresOn2 === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + 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; } - const sas = generateAccountSASQueryParameters(Object.assign({ - permissions, - expiresOn: expiresOn2, - resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).toString(); - return 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://docs.microsoft.com/en-us/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(expiresOn2, permissions = AccountSASPermissions.parse("r"), resourceTypes = "sco", options = {}) { - if (!(this.credential instanceof StorageSharedKeyCredential)) { - throw RangeError("Can only generate the account SAS when the client is initialized with a shared key credential"); + 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 (expiresOn2 === void 0) { - const now = /* @__PURE__ */ new Date(); - expiresOn2 = new Date(now.getTime() + 3600 * 1e3); + } + 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; } - return generateAccountSASQueryParametersInternal(Object.assign({ - permissions, - expiresOn: expiresOn2, - resourceTypes, - services: AccountSASServices.parse("b").toString() - }, options), this.credential).stringToSign; } - }; - exports2.KnownEncryptionAlgorithmType = void 0; - (function(KnownEncryptionAlgorithmType) { - KnownEncryptionAlgorithmType["AES256"] = "AES256"; - })(exports2.KnownEncryptionAlgorithmType || (exports2.KnownEncryptionAlgorithmType = {})); - Object.defineProperty(exports2, "RestError", { - enumerable: true, - get: function() { - return coreRestPipeline.RestError; + if (parts.length) { + if (i) + parts.push(fromCharCodes(chunk.slice(0, i))); + return parts.join(""); } - }); - exports2.AccountSASPermissions = AccountSASPermissions; - exports2.AccountSASResourceTypes = AccountSASResourceTypes; - exports2.AccountSASServices = AccountSASServices; - exports2.AnonymousCredential = AnonymousCredential; - exports2.AnonymousCredentialPolicy = AnonymousCredentialPolicy; - exports2.AppendBlobClient = AppendBlobClient; - exports2.BaseRequestPolicy = BaseRequestPolicy; - exports2.BlobBatch = BlobBatch; - exports2.BlobBatchClient = BlobBatchClient; - exports2.BlobClient = BlobClient; - exports2.BlobLeaseClient = BlobLeaseClient; - exports2.BlobSASPermissions = BlobSASPermissions; - exports2.BlobServiceClient = BlobServiceClient; - exports2.BlockBlobClient = BlockBlobClient; - exports2.ContainerClient = ContainerClient; - exports2.ContainerSASPermissions = ContainerSASPermissions; - exports2.Credential = Credential; - exports2.CredentialPolicy = CredentialPolicy; - exports2.PageBlobClient = PageBlobClient; - exports2.Pipeline = Pipeline; - exports2.SASQueryParameters = SASQueryParameters; - exports2.StorageBrowserPolicy = StorageBrowserPolicy; - exports2.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory; - exports2.StorageOAuthScopes = StorageOAuthScopes; - exports2.StorageRetryPolicy = StorageRetryPolicy; - exports2.StorageRetryPolicyFactory = StorageRetryPolicyFactory; - exports2.StorageSharedKeyCredential = StorageSharedKeyCredential; - exports2.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy; - exports2.generateAccountSASQueryParameters = generateAccountSASQueryParameters; - exports2.generateBlobSASQueryParameters = generateBlobSASQueryParameters; - exports2.getBlobServiceAccountAudience = getBlobServiceAccountAudience; - exports2.isPipelineLike = isPipelineLike; - exports2.logger = logger; - exports2.newPipeline = newPipeline; + return fromCharCodes(chunk.slice(0, i)); + } + exports2.utf8read = utf8read; } }); -// node_modules/@actions/cache/lib/internal/shared/errors.js -var require_errors2 = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/errors.js"(exports2) { +// 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.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(", ")}`; + 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]; } - super(message); - this.files = files; - this.name = "FilesNotFoundError"; } - }; - exports2.FilesNotFoundError = FilesNotFoundError; - var InvalidResponseError = class extends Error { - constructor(message) { - super(message); - this.name = "InvalidResponseError"; + let middleByte = this.buf[this.pos++]; + lowBits |= (middleByte & 15) << 28; + highBits = (middleByte & 112) >> 4; + if ((middleByte & 128) == 0) { + this.assertBounds(); + return [lowBits, highBits]; } - }; - exports2.InvalidResponseError = InvalidResponseError; - var CacheNotFoundError = class extends Error { - constructor(message = "Cache not found") { - super(message); - this.name = "CacheNotFoundError"; + 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]; + } } - }; - 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"; + 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; } - }; - 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"; + b = this.buf[this.pos++]; + result |= (b & 127) << 7; + if ((b & 128) == 0) { + this.assertBounds(); + return result; } - }; - 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"; + b = this.buf[this.pos++]; + result |= (b & 127) << 14; + if ((b & 128) == 0) { + this.assertBounds(); + return result; } - }; - exports2.UsageError = UsageError; - UsageError.isUsageErrorMessage = (msg) => { - if (!msg) - return false; - return msg.includes("insufficient usage"); - }; + 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/@actions/cache/lib/internal/uploadUtils.js -var require_uploadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/uploadUtils.js"(exports2) { +// 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"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.uploadCacheArchiveSDK = exports2.UploadProgress = void 0; - var core14 = __importStar4(require_core()); - var storage_blob_1 = require_dist7(); - var errors_1 = require_errors2(); - var UploadProgress = class { - constructor(contentLength) { - this.contentLength = contentLength; - this.sentBytes = 0; - this.displayedComplete = false; - this.startTime = Date.now(); - } + 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 { /** - * Sets the number of bytes sent - * - * @param sentBytes the number of bytes sent + * Create a new instance with the given bits. */ - setSentBytes(sentBytes) { - this.sentBytes = sentBytes; + constructor(lo, hi) { + this.lo = lo | 0; + this.hi = hi | 0; } /** - * Returns the total number of bytes transferred. + * Is this instance equal to 0? */ - getTransferredBytes() { - return this.sentBytes; + isZero() { + return this.lo == 0 && this.hi == 0; } /** - * Returns true if the upload is complete. + * Convert to a native number. */ - isDone() { - return this.getTransferredBytes() === this.contentLength; + 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 { /** - * Prints the current upload stats. Once the upload completes, this will print one - * last line and then stop. + * Create instance from a `string`, `number` or `bigint`. */ - 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); - core14.info(`Sent ${transferredBytes} of ${this.contentLength} (${percentage}%), ${uploadSpeed} MBs/sec`); - if (this.isDone()) { - this.displayedComplete = true; - } + 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); } /** - * Returns a function used to handle TransferProgressEvents. + * Convert to decimal string. */ - onProgress() { - return (progress) => { - this.setSentBytes(progress.loadedBytes); - }; + toString() { + return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); } /** - * Starts the timer that displays the stats. - * - * @param delayInMs the delay between each write + * Convert to native bigint. */ - startDisplayTimer(delayInMs = 1e3) { - const displayCallback = () => { - this.display(); - if (!this.isDone()) { - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - }; - this.timeoutHandle = setTimeout(displayCallback, delayInMs); + 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 { /** - * 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. + * Create instance from a `string`, `number` or `bigint`. */ - stopDisplayTimer() { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - this.timeoutHandle = void 0; - } - this.display(); - } - }; - exports2.UploadProgress = UploadProgress; - function uploadCacheArchiveSDK(signedUploadURL, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const blobClient = new storage_blob_1.BlobClient(signedUploadURL); - const blockBlobClient = blobClient.getBlockBlobClient(); - const uploadProgress = new UploadProgress((_a = options === null || options === void 0 ? void 0 : options.archiveSizeBytes) !== null && _a !== void 0 ? _a : 0); - const uploadOptions = { - blockSize: options === null || options === void 0 ? void 0 : options.uploadChunkSize, - concurrency: options === null || options === void 0 ? void 0 : options.uploadConcurrency, - maxSingleShotSize: 128 * 1024 * 1024, - onProgress: uploadProgress.onProgress() - }; - try { - uploadProgress.startDisplayTimer(); - core14.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 (error4) { - core14.warning(`uploadCacheArchiveSDK: internal error uploading cache archive: ${error4.message}`); - throw error4; - } finally { - uploadProgress.stopDisplayTimer(); - } - }); - } - exports2.uploadCacheArchiveSDK = uploadCacheArchiveSDK; - } -}); - -// node_modules/@actions/cache/lib/internal/requestUtils.js -var require_requestUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/requestUtils.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.retryHttpClientResponse = exports2.retryTypedResponse = exports2.retry = exports2.isRetryableStatusCode = exports2.isServerErrorStatusCode = exports2.isSuccessStatusCode = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib3(); - var constants_1 = require_constants7(); - function isSuccessStatusCode(statusCode) { - if (!statusCode) { - return false; - } - return statusCode >= 200 && statusCode < 300; - } - exports2.isSuccessStatusCode = isSuccessStatusCode; - function isServerErrorStatusCode(statusCode) { - if (!statusCode) { - return true; - } - return statusCode >= 500; - } - exports2.isServerErrorStatusCode = isServerErrorStatusCode; - 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); - } - exports2.isRetryableStatusCode = isRetryableStatusCode; - function sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, milliseconds)); - }); - } - function retry3(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay, onError = void 0) { - return __awaiter4(this, void 0, void 0, function* () { - let errorMessage = ""; - let attempt = 1; - while (attempt <= maxAttempts) { - let response = void 0; - let statusCode = void 0; - let isRetryable = false; - try { - response = yield method(); - } catch (error4) { - if (onError) { - response = onError(error4); - } - isRetryable = true; - errorMessage = error4.message; - } - if (response) { - statusCode = getStatusCode(response); - if (!isServerErrorStatusCode(statusCode)) { - return response; - } - } - if (statusCode) { - isRetryable = isRetryableStatusCode(statusCode); - errorMessage = `Cache service responded with ${statusCode}`; - } - core14.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`); - if (!isRetryable) { - core14.debug(`${name} - Error is not retryable`); - break; - } - yield sleep(delay2); - attempt++; - } - throw Error(`${name} failed: ${errorMessage}`); - }); - } - exports2.retry = retry3; - function retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3( - 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. - (error4) => { - if (error4 instanceof http_client_1.HttpClientError) { - return { - statusCode: error4.statusCode, - result: null, - headers: {}, - error: error4 - }; - } else { - return void 0; - } + 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)); } - ); - }); - } - exports2.retryTypedResponse = retryTypedResponse; - function retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay2 = constants_1.DefaultRetryDelay) { - return __awaiter4(this, void 0, void 0, function* () { - return yield retry3(name, method, (response) => response.message.statusCode, maxAttempts, delay2); - }); - } - exports2.retryHttpClientResponse = retryHttpClientResponse; - } -}); - -// node_modules/@actions/cache/lib/internal/downloadUtils.js -var require_downloadUtils = __commonJS({ - "node_modules/@actions/cache/lib/internal/downloadUtils.js"(exports2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + 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); } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + /** + * Do we have a minus sign? + */ + isNegative() { + return (this.hi & HALF_2_PWR_32) !== 0; } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + /** + * 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); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.downloadCacheStorageSDK = exports2.downloadCacheHttpClientConcurrent = exports2.downloadCacheHttpClient = exports2.DownloadProgress = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib3(); - var storage_blob_1 = require_dist7(); - var buffer = __importStar4(require("buffer")); - var fs13 = __importStar4(require("fs")); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(require("util")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var requestUtils_1 = require_requestUtils(); - var abort_controller_1 = require_dist5(); - function pipeResponseToStream(response, output) { - return __awaiter4(this, void 0, void 0, function* () { - const pipeline = util.promisify(stream2.pipeline); - yield pipeline(response.message, output); - }); + 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; } - 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(); + 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 + }); } /** - * Progress to the next segment. Only call this method when the previous segment - * is complete. - * - * @param segmentSize the length of the next segment + * Reads a tag - field number and wire type. */ - nextSegment(segmentSize) { - this.segmentOffset = this.segmentOffset + this.segmentSize; - this.segmentIndex = this.segmentIndex + 1; - this.segmentSize = segmentSize; - this.receivedBytes = 0; - core14.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`); + 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]; } /** - * Sets the number of bytes received for the current segment. - * - * @param receivedBytes the number of bytes received + * Skip one element on the wire and return the skipped data. + * Supports WireType.StartGroup since v2.0.0-alpha.23. */ - setReceivedBytes(receivedBytes) { - this.receivedBytes = receivedBytes; + 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); } /** - * Returns the total number of bytes transferred. + * Throws error if position in byte array is out of range. */ - getTransferredBytes() { - return this.segmentOffset + this.receivedBytes; + assertBounds() { + if (this.pos > this.len) + throw new RangeError("premature EOF"); } /** - * Returns true if the download is complete. + * Read a `int32` field, a signed 32 bit varint. */ - isDone() { - return this.getTransferredBytes() === this.contentLength; + int32() { + return this.uint32() | 0; } /** - * Prints the current download stats. Once the download completes, this will print one - * last line and then stop. + * Read a `sint32` field, a signed, zigzag-encoded 32-bit varint. */ - 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); - core14.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`); - if (this.isDone()) { - this.displayedComplete = true; - } + sint32() { + let zze = this.uint32(); + return zze >>> 1 ^ -(zze & 1); } /** - * Returns a function used to handle TransferProgressEvents. + * Read a `int64` field, a signed 64-bit varint. */ - onProgress() { - return (progress) => { - this.setReceivedBytes(progress.loadedBytes); - }; + int64() { + return new pb_long_1.PbLong(...this.varint64()); } /** - * Starts the timer that displays the stats. - * - * @param delayInMs the delay between each write + * Read a `uint64` field, an unsigned 64-bit varint. */ - startDisplayTimer(delayInMs = 1e3) { - const displayCallback = () => { - this.display(); - if (!this.isDone()) { - this.timeoutHandle = setTimeout(displayCallback, delayInMs); - } - }; - this.timeoutHandle = setTimeout(displayCallback, delayInMs); + uint64() { + return new pb_long_1.PbULong(...this.varint64()); } /** - * 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. + * Read a `sint64` field, a signed, zig-zag-encoded 64-bit varint. */ - stopDisplayTimer() { - if (this.timeoutHandle) { - clearTimeout(this.timeoutHandle); - this.timeoutHandle = void 0; - } - this.display(); + 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); } - }; - exports2.DownloadProgress = DownloadProgress; - function downloadCacheHttpClient(archiveLocation, archivePath) { - return __awaiter4(this, void 0, void 0, function* () { - const writeStream = fs13.createWriteStream(archivePath); - const httpClient = new http_client_1.HttpClient("actions/cache"); - const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCache", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.get(archiveLocation); - })); - downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => { - downloadResponse.message.destroy(); - core14.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 { - core14.debug("Unable to validate download, no Content-Length header"); - } - }); - } - exports2.downloadCacheHttpClient = downloadCacheHttpClient; - function downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - const archiveDescriptor = yield fs13.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", () => __awaiter4(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: () => __awaiter4(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 = () => __awaiter4(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 >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 10)) { - yield waitAndWrite(); - } - } - while (actives > 0) { - yield waitAndWrite(); - } - } finally { - httpClient.dispose(); - yield archiveDescriptor.close(); - } - }); - } - exports2.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent; - function downloadSegmentRetry(httpClient, archiveLocation, offset, count) { - return __awaiter4(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 __awaiter4(this, void 0, void 0, function* () { - const partRes = yield (0, requestUtils_1.retryHttpClientResponse)("downloadCachePart", () => __awaiter4(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) { - var _a; - return __awaiter4(this, void 0, void 0, function* () { - 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 = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1; - if (contentLength < 0) { - core14.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 = fs13.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)) { - fs13.writeFileSync(fd, result); - } - } - } finally { - downloadProgress.stopDisplayTimer(); - fs13.closeSync(fd); - } - } - }); - } - exports2.downloadCacheStorageSDK = downloadCacheStorageSDK; - var promiseWithTimeout = (timeoutMs, promise) => __awaiter4(void 0, void 0, void 0, function* () { - let timeoutHandle; - const timeoutPromise = new Promise((resolve6) => { - timeoutHandle = setTimeout(() => resolve6("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 __createBinding4 = 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]; - } }; + /** + * Read a `bool` field, a variant. + */ + bool() { + let [lo, hi] = this.varint64(); + return lo !== 0 || hi !== 0; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + /** + * Read a `fixed32` field, an unsigned, fixed-length 32-bit integer. + */ + fixed32() { + return this.view.getUint32((this.pos += 4) - 4, true); } - __setModuleDefault4(result, mod); - return result; - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.getDownloadOptions = exports2.getUploadOptions = void 0; - var core14 = __importStar4(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; - } + /** + * Read a `sfixed32` field, a signed, fixed-length 32-bit integer. + */ + sfixed32() { + return this.view.getInt32((this.pos += 4) - 4, true); } - 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; - core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core14.debug(`Upload concurrency: ${result.uploadConcurrency}`); - core14.debug(`Upload chunk size: ${result.uploadChunkSize}`); - return result; - } - exports2.getUploadOptions = getUploadOptions; - 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; - } + /** + * Read a `fixed64` field, an unsigned, fixed-length 64 bit integer. + */ + fixed64() { + return new pb_long_1.PbULong(this.sfixed32(), this.sfixed32()); } - const segmentDownloadTimeoutMins = process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]; - if (segmentDownloadTimeoutMins && !isNaN(Number(segmentDownloadTimeoutMins)) && isFinite(Number(segmentDownloadTimeoutMins))) { - result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1e3; + /** + * Read a `fixed64` field, a signed, fixed-length 64-bit integer. + */ + sfixed64() { + return new pb_long_1.PbLong(this.sfixed32(), this.sfixed32()); } - core14.debug(`Use Azure SDK: ${result.useAzureSdk}`); - core14.debug(`Download concurrency: ${result.downloadConcurrency}`); - core14.debug(`Request timeout (ms): ${result.timeoutInMs}`); - core14.debug(`Cache segment download timeout mins env var: ${process.env["SEGMENT_DOWNLOAD_TIMEOUT_MINS"]}`); - core14.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`); - core14.debug(`Lookup only: ${result.lookupOnly}`); - return result; - } - exports2.getDownloadOptions = getDownloadOptions; + /** + * 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/@actions/cache/lib/internal/config.js -var require_config = __commonJS({ - "node_modules/@actions/cache/lib/internal/config.js"(exports2) { +// 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.getCacheServiceURL = exports2.getCacheServiceVersion = exports2.isGhes = void 0; - 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.assertFloat32 = exports2.assertUInt32 = exports2.assertInt32 = exports2.assertNever = exports2.assert = void 0; + function assert(condition, msg) { + if (!condition) { + throw new Error(msg); + } } - exports2.isGhes = isGhes; - function getCacheServiceVersion() { - if (isGhes()) - return "v1"; - return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; + exports2.assert = assert; + function assertNever2(value, msg) { + throw new Error(msg !== null && msg !== void 0 ? msg : "Unexpected object: " + value); } - exports2.getCacheServiceVersion = getCacheServiceVersion; - 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}`); - } + 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.getCacheServiceURL = getCacheServiceURL; - } -}); - -// node_modules/@actions/cache/package.json -var require_package2 = __commonJS({ - "node_modules/@actions/cache/package.json"(exports2, module2) { - module2.exports = { - name: "@actions/cache", - version: "4.1.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": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", - "@protobuf-ts/runtime-rpc": "^2.11.1", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", - "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.0", - semver: "^6.3.1" - }, - devDependencies: { - "@types/node": "^22.13.9", - "@types/semver": "^6.0.0", - "@protobuf-ts/plugin": "^2.9.4", - typescript: "^5.2.2" - } - }; + 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/@actions/cache/lib/internal/shared/user-agent.js -var require_user_agent = __commonJS({ - "node_modules/@actions/cache/lib/internal/shared/user-agent.js"(exports2) { +// 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.getUserAgentString = void 0; - var packageJson = require_package2(); - function getUserAgentString() { - return `@actions/cache-${packageJson.version}`; + 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.getUserAgentString = getUserAgentString; - } -}); - -// node_modules/@actions/cache/lib/internal/cacheHttpClient.js -var require_cacheHttpClient = __commonJS({ - "node_modules/@actions/cache/lib/internal/cacheHttpClient.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + exports2.binaryWriteOptions = binaryWriteOptions; + var BinaryWriter = class { + constructor(textEncoder) { + this.stack = []; + this.textEncoder = textEncoder !== null && textEncoder !== void 0 ? textEncoder : new TextEncoder(); + this.chunks = []; + this.buf = []; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + /** + * 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; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + /** + * 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; } - return new (P || (P = Promise))(function(resolve6, 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); - } + /** + * 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, type2) { + return this.uint32((fieldNo << 3 | type2) >>> 0); + } + /** + * Write a chunk of raw bytes. + */ + raw(chunk) { + if (this.buf.length) { + this.chunks.push(new Uint8Array(this.buf)); + this.buf = []; } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + 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; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + 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.saveCache = exports2.reserveCache = exports2.downloadCache = exports2.getCacheEntry = void 0; - var core14 = __importStar4(require_core()); - var http_client_1 = require_lib3(); - var auth_1 = require_auth2(); - var fs13 = __importStar4(require("fs")); - var url_1 = require("url"); - var utils = __importStar4(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 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}`; - core14.debug(`Resource Url: ${url2}`); - return url2; - } - function createAcceptHeader(type2, apiVersion) { - return `${type2};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 __awaiter4(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 resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("getCacheEntry", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.getJson(getCacheApiUrl(resource)); - })); - if (response.statusCode === 204) { - if (core14.isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version); - } - return null; - } - if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) { - 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."); - } - core14.setSecret(cacheDownloadUrl); - core14.debug(`Cache Result:`); - core14.debug(JSON.stringify(cacheResult)); - return cacheResult; - }); + 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.getCacheEntry = getCacheEntry; - function printCachesListForDiagnostics(key, httpClient, version) { - return __awaiter4(this, void 0, void 0, function* () { - const resource = `caches?key=${encodeURIComponent(key)}`; - const response = yield (0, requestUtils_1.retryTypedResponse)("listCache", () => __awaiter4(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) { - core14.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) || []) { - core14.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}`); - } - } - } - }); + exports2.jsonReadOptions = jsonReadOptions; + function jsonWriteOptions(options) { + return options ? Object.assign(Object.assign({}, defaultsWrite), options) : defaultsWrite; } - function downloadCache(archiveLocation, archivePath, options) { - return __awaiter4(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); - } + exports2.jsonWriteOptions = jsonWriteOptions; + function mergeJsonOptions(a, b) { + var _a, _b; + let c = Object.assign(Object.assign({}, a), b); + c.typeRegistry = [...(_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : [], ...(_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 { - yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath); + sb.push(next); } - }); - } - exports2.downloadCache = downloadCache; - function reserveCache(key, paths, options) { - return __awaiter4(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", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl("caches"), reserveCacheRequest); - })); - return response; - }); - } - exports2.reserveCache = reserveCache; - function getContentRange(start, end) { - return `bytes ${start}-${end}/*`; + } + return sb.join(""); } - function uploadChunk(httpClient, resourceUrl, openStream, start, end) { - return __awaiter4(this, void 0, void 0, function* () { - core14.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})`, () => __awaiter4(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.`); - } - }); + 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 _a, _b, _c, _d; + field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : 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; } - function uploadFile(httpClient, cacheId, archivePath, options) { - return __awaiter4(this, void 0, void 0, function* () { - const fileSize = utils.getArchiveFileSizeInBytes(archivePath); - const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`); - const fd = fs13.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()]; - core14.debug("Awaiting all uploads"); - let offset = 0; - try { - yield Promise.all(parallelUploads.map(() => __awaiter4(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, () => fs13.createReadStream(archivePath, { - fd, - start, - end, - autoClose: false - }).on("error", (error4) => { - throw new Error(`Cache upload failed because file read failed with ${error4.message}`); - }), start, end); - } - }))); - } finally { - fs13.closeSync(fd); - } - return; - }); + exports2.normalizeFieldInfo = normalizeFieldInfo; + function readFieldOptions(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; } - function commitCache(httpClient, cacheId, filesize) { - return __awaiter4(this, void 0, void 0, function* () { - const commitCacheRequest = { size: filesize }; - return yield (0, requestUtils_1.retryTypedResponse)("commitCache", () => __awaiter4(this, void 0, void 0, function* () { - return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest); - })); - }); + exports2.readFieldOptions = readFieldOptions; + function readFieldOption(messageType, fieldName, extensionName, extensionType) { + var _a; + const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; + if (!options) { + return void 0; + } + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; + } + return extensionType ? extensionType.fromJson(optionVal) : optionVal; } - function saveCache3(cacheId, archivePath, signedUploadURL, options) { - return __awaiter4(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(); - core14.debug("Upload cache"); - yield uploadFile(httpClient, cacheId, archivePath, options); - core14.debug("Commiting cache"); - const cacheSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.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.`); - } - core14.info("Cache saved successfully"); - } - }); + 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.saveCache = saveCache3; + exports2.readMessageOption = readMessageOption; } }); -// 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) { +// 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.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"; + 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; } - return t; } - exports2.typeofJsonValue = typeofJsonValue; - function isJsonObject(value) { - return value !== null && typeof value == "object" && !Array.isArray(value); + exports2.isOneofGroup = isOneofGroup; + function getOneofValue(oneof, kind) { + return oneof[kind]; } - exports2.isJsonObject = isJsonObject; + 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/base64.js -var require_base642 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/base64.js"(exports2) { +// 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.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.`); + exports2.ReflectionTypeCheck = void 0; + var reflection_info_1 = require_reflection_info(); + var oneof_1 = require_oneof(); + var ReflectionTypeCheck = class { + constructor(info6) { + var _a; + this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; + } + 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; + } } } - 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; + 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; } - 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; + 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; } - if (groupPos) { - base64 += encTable[p]; - base64 += "="; - if (groupPos == 1) - base64 += "="; + message(arg, type2, allowExcessProperties, depth) { + if (allowExcessProperties) { + return type2.isAssignable(arg, depth); + } + return type2.is(arg, depth); } - 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; + messages(arg, type2, 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 (!type2.isAssignable(arg[i], depth - 1)) + return false; + } else { + for (let i = 0; i < arg.length && i < depth; i++) + if (!type2.is(arg[i], depth - 1)) + return false; + } + return true; + } + scalar(arg, type2, longType) { + let argType = typeof arg; + switch (type2) { + 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); } } - if (parts.length) { - if (i) - parts.push(fromCharCodes(chunk.slice(0, i))); - return parts.join(""); + scalars(arg, type2, 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], type2, longType)) + return false; + } + return true; } - return fromCharCodes(chunk.slice(0, i)); - } - exports2.utf8read = utf8read; + mapKeys(map2, type2, depth) { + let keys = Object.keys(map2); + switch (type2) { + 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)), type2, depth); + case reflection_info_1.ScalarType.BOOL: + return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type2, depth); + default: + return this.scalars(keys, type2, depth, reflection_info_1.LongType.STRING); + } + } + }; + exports2.ReflectionTypeCheck = ReflectionTypeCheck; } }); -// 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) { +// 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.WireType = exports2.mergeBinaryOptions = exports2.UnknownFieldHandler = void 0; - var UnknownFieldHandler; - (function(UnknownFieldHandler2) { - UnknownFieldHandler2.symbol = 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.reflectionLongConvert = void 0; + var reflection_info_1 = require_reflection_info(); + function reflectionLongConvert(long, type2) { + switch (type2) { + case reflection_info_1.LongType.BIGINT: + return long.toBigInt(); + case reflection_info_1.LongType.NUMBER: + return long.toNumber(); + default: + return long.toString(); + } } - 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 = {})); + exports2.reflectionLongConvert = reflectionLongConvert; } }); -// 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) { +// 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.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]; - } + 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(info6) { + this.info = info6; } - 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; + prepare() { + var _a; + if (this.fMap === void 0) { + this.fMap = {}; + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + for (const field of fieldsInput) { + this.fMap[field.name] = field; + this.fMap[field.jsonName] = field; + this.fMap[field.localName] = field; + } } } - 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; + // 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}`); } } - 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; + /** + * 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; + } + } } } - 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; + /** + * Returns `false` for unrecognized string representations. + * + * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). + */ + enum(type2, json2, fieldName, ignoreUnknownFields) { + if (type2[0] == "google.protobuf.NullValue") + assert_1.assert(json2 === null || json2 === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); + if (json2 === null) + return 0; + switch (typeof json2) { + case "number": + assert_1.assert(Number.isInteger(json2), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json2}.`); + return json2; + case "string": + let localEnumName = json2; + if (type2[2] && json2.substring(0, type2[2].length) === type2[2]) + localEnumName = json2.substring(type2[2].length); + let enumNumber = type2[1][localEnumName]; + if (typeof enumNumber === "undefined" && ignoreUnknownFields) { + return false; + } + assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json2}".`); + return enumNumber; } - return partial; + assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json2}".`); } - 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; + scalar(json2, type2, longType, fieldName) { + let e; + try { + switch (type2) { + // 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 (json2 === null) + return 0; + if (json2 === "NaN") + return Number.NaN; + if (json2 === "Infinity") + return Number.POSITIVE_INFINITY; + if (json2 === "-Infinity") + return Number.NEGATIVE_INFINITY; + if (json2 === "") { + e = "empty string"; + break; + } + if (typeof json2 == "string" && json2.trim().length !== json2.length) { + e = "extra whitespace"; + break; + } + if (typeof json2 != "string" && typeof json2 != "number") { + break; + } + let float2 = Number(json2); + if (Number.isNaN(float2)) { + e = "not a number"; + break; + } + if (!Number.isFinite(float2)) { + e = "too large or small"; + break; + } + if (type2 == reflection_info_1.ScalarType.FLOAT) + assert_1.assertFloat32(float2); + return float2; + // 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 (json2 === null) + return 0; + let int32; + if (typeof json2 == "number") + int32 = json2; + else if (json2 === "") + e = "empty string"; + else if (typeof json2 == "string") { + if (json2.trim().length !== json2.length) + e = "extra whitespace"; + else + int32 = Number(json2); + } + if (int32 === void 0) + break; + if (type2 == 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 (json2 === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); + if (typeof json2 != "number" && typeof json2 != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json2), longType); + case reflection_info_1.ScalarType.FIXED64: + case reflection_info_1.ScalarType.UINT64: + if (json2 === null) + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); + if (typeof json2 != "number" && typeof json2 != "string") + break; + return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json2), longType); + // bool: + case reflection_info_1.ScalarType.BOOL: + if (json2 === null) + return false; + if (typeof json2 !== "boolean") + break; + return json2; + // string: + case reflection_info_1.ScalarType.STRING: + if (json2 === null) + return ""; + if (typeof json2 !== "string") { + e = "extra whitespace"; + break; + } + try { + encodeURIComponent(json2); + } catch (e2) { + e2 = "invalid UTF8"; + break; + } + return json2; + // 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 (json2 === null || json2 === "") + return new Uint8Array(0); + if (typeof json2 !== "string") + break; + return base64_1.base64decode(json2); + } + } catch (error3) { + e = error3.message; } - 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; + this.assert(false, fieldName + (e ? " - " + e : ""), json2); } - 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; + }; + exports2.ReflectionJsonReader = ReflectionJsonReader; } }); -// 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) { +// 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.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; + 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(info6) { + var _a; + this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; } /** - * Convert to a native number. + * Converts the message to a JSON object, based on the field descriptors. */ - 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; + write(message, options) { + const json2 = {}, source = message; + for (const field of this.fields) { + if (!field.oneof) { + let jsonValue2 = this.field(field, source[field.localName], options); + if (jsonValue2 !== void 0) + json2[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); + json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; + } + return json2; } - }; - 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)); + 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; } - 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); + 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; } - throw new Error("unknown value " + typeof value); + 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; } /** - * Convert to decimal string. + * Returns `null` as the default for google.protobuf.NullValue. */ - toString() { - return BI ? this.toBigInt().toString() : goog_varint_1.int64toString(this.lo, this.hi); + enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { + if (type2[0] == "google.protobuf.NullValue") + return !emitDefaultValues && !optional ? void 0 : null; + if (value === void 0) { + assert_1.assert(optional); + return void 0; + } + if (value === 0 && !emitDefaultValues && !optional) + return void 0; + assert_1.assert(typeof value == "number"); + assert_1.assert(Number.isInteger(value)); + if (enumAsInteger || !type2[1].hasOwnProperty(value)) + return value; + if (type2[2]) + return type2[2] + type2[1][value]; + return type2[1][value]; } - /** - * 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); + message(type2, value, fieldName, options) { + if (value === void 0) + return options.emitDefaultValues ? null : void 0; + return type2.internalJsonWrite(value, options); + } + scalar(type2, value, fieldName, optional, emitDefaultValues) { + if (value === void 0) { + assert_1.assert(optional); + return void 0; + } + const ed = emitDefaultValues || optional; + switch (type2) { + // 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.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); + 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(type2, longType = reflection_info_1.LongType.STRING) { + switch (type2) { + 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; } - /** - * Do we have a minus sign? - */ - isNegative() { - return (this.hi & HALF_2_PWR_32) !== 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(info6) { + this.info = info6; } - /** - * 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); + prepare() { + var _a; + if (!this.fieldNoToField) { + const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; + this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); + } } /** - * Convert to decimal string. + * 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. */ - toString() { - if (BI) - return this.toBigInt().toString(); - if (this.isNegative()) { - let n = this.negate(); - return "-" + goog_varint_1.int64toString(n.lo, n.hi); + 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; + } } - return goog_varint_1.int64toString(this.lo, this.hi); } /** - * Convert to native bigint. + * Read a map field, expecting key field = 1, value field = 2 */ - toBigInt() { - assertBi(BI); - BI.V.setInt32(0, this.lo, true); - BI.V.setInt32(4, this.hi, true); - return BI.V.getBigInt64(0, true); + 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, type2, longType) { + switch (type2) { + 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.PbLong = PbLong; - PbLong.ZERO = new PbLong(0, 0); + exports2.ReflectionBinaryReader = ReflectionBinaryReader; } }); -// 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) { +// 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.BinaryReader = exports2.binaryReadOptions = void 0; + 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 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 - }); + var ReflectionBinaryWriter = class { + constructor(info6) { + this.info = info6; } - /** - * 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]; + prepare() { + if (!this.fields) { + const fieldsInput = this.info.fields ? this.info.fields.concat() : []; + this.fields = fieldsInput.sort((a, b) => a.no - b.no); + } } /** - * Skip one element on the wire and return the skipped data. - * Supports WireType.StartGroup since v2.0.0-alpha.23. + * Writes the message to binary format. */ - skip(wireType) { - let start = this.pos; - switch (wireType) { - case binary_format_contract_1.WireType.Varint: - while (this.buf[this.pos++] & 128) { - } + 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 binary_format_contract_1.WireType.Bit64: - this.pos += 4; - case binary_format_contract_1.WireType.Bit32: - this.pos += 4; + case reflection_info_1.ScalarType.BOOL: + assert_1.assert(key == "true" || key == "false"); + keyValue = key == "true"; break; - case binary_format_contract_1.WireType.LengthDelimited: - let len = this.uint32(); - this.pos += len; + } + 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 binary_format_contract_1.WireType.StartGroup: - let t; - while ((t = this.tag()[1]) !== binary_format_contract_1.WireType.EndGroup) { - this.skip(t); - } + 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; - 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()); + writer.join(); } - /** - * Read a `fixed64` field, a signed, fixed-length 64-bit integer. - */ - sfixed64() { - return new pb_long_1.PbLong(this.sfixed32(), this.sfixed32()); + message(writer, options, handler, fieldNo, value) { + if (value === void 0) + return; + handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); + writer.join(); } /** - * Read a `float` field, 32-bit floating point number. + * Write a single scalar value. */ - float() { - return this.view.getFloat32((this.pos += 4) - 4, true); + scalar(writer, type2, fieldNo, value, emitDefault) { + let [wireType, method, isDefault] = this.scalarInfo(type2, value); + if (!isDefault || emitDefault) { + writer.tag(fieldNo, wireType); + writer[method](value); + } } /** - * Read a `double` field, a 64-bit floating point number. + * Write an array of scalar values in packed format. */ - double() { - return this.view.getFloat64((this.pos += 8) - 8, true); + packed(writer, type2, fieldNo, value) { + if (!value.length) + return; + assert_1.assert(type2 !== reflection_info_1.ScalarType.BYTES && type2 !== reflection_info_1.ScalarType.STRING); + writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); + writer.fork(); + let [, method] = this.scalarInfo(type2); + for (let i = 0; i < value.length; i++) + writer[method](value[i]); + writer.join(); } /** - * Read a `bytes` field, length-delimited arbitrary data. + * 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. */ - bytes() { - let len = this.uint32(); - let start = this.pos; - this.pos += len; - this.assertBounds(); - return this.buf.subarray(start, start + len); + scalarInfo(type2, value) { + let t = binary_format_contract_1.WireType.Varint; + let m; + let i = value === void 0; + let d = value === 0; + switch (type2) { + 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]; } - /** - * Read a `string` field, length-delimited data converted to UTF-8 text. - */ - string() { - return this.textDecoder.decode(this.bytes()); + }; + 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(type2) { + const msg = type2.messagePrototype ? Object.create(type2.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type2 }); + for (let field of type2.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; + } } - }; - exports2.BinaryReader = BinaryReader; + return msg; + } + exports2.reflectionCreate = reflectionCreate; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/assert.js -var require_assert = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/assert.js"(exports2) { +// 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.assertFloat32 = exports2.assertUInt32 = exports2.assertInt32 = exports2.assertNever = exports2.assert = void 0; - function assert(condition, msg) { - if (!condition) { - throw new Error(msg); + exports2.reflectionMergePartial = void 0; + function reflectionMergePartial(info6, target, source) { + let fieldValue, input = source, output; + for (let field of info6.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.assert = assert; - function assertNever2(value, msg) { - throw new Error(msg !== null && msg !== void 0 ? msg : "Unexpected object: " + value); + 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(info6, a, b) { + if (a === b) + return true; + if (!a || !b) + return false; + for (let field of info6.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.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.reflectionEquals = reflectionEquals; + var objectValues = Object.values; + function primitiveEq(type2, a, b) { + if (a === b) + return true; + if (type2 !== 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; } - 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); + function repeatedPrimitiveEq(type2, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!primitiveEq(type2, a[i], b[i])) + return false; + return true; } - 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); + function repeatedMsgEq(type2, a, b) { + if (a.length !== b.length) + return false; + for (let i = 0; i < a.length; i++) + if (!type2.equals(a[i], b[i])) + return false; + return true; } - 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) { +// 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.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 = []; + 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); } - /** - * 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; + create(value) { + let message = reflection_create_1.reflectionCreate(this); + if (value !== void 0) { + reflection_merge_partial_1.reflectionMergePartial(this, message, value); } - 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); + return message; } /** - * Writes a tag (field number and wire type). - * - * Equivalent to `uint32( (fieldNo << 3 | type) >>> 0 )`. + * Clone the message. * - * Generated code should compute the tag ahead of time and call `uint32()`. - */ - tag(fieldNo, type2) { - return this.uint32((fieldNo << 3 | type2) >>> 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. + * Unknown fields are discarded. */ - double(value) { - let chunk = new Uint8Array(8); - new DataView(chunk.buffer).setFloat64(0, value, true); - return this.raw(chunk); + clone(message) { + let copy = this.create(); + reflection_merge_partial_1.reflectionMergePartial(this, copy, message); + return copy; } /** - * Write a `fixed32` value, an unsigned, fixed-length 32-bit integer. + * 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`. */ - fixed32(value) { - assert_1.assertUInt32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setUint32(0, value, true); - return this.raw(chunk); + equals(a, b) { + return reflection_equals_1.reflectionEquals(this, a, b); } /** - * Write a `sfixed32` value, a signed, fixed-length 32-bit integer. + * 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)? */ - sfixed32(value) { - assert_1.assertInt32(value); - let chunk = new Uint8Array(4); - new DataView(chunk.buffer).setInt32(0, value, true); - return this.raw(chunk); + is(arg, depth = this.defaultCheckDepth) { + return this.refTypeCheck.is(arg, depth, false); } /** - * Write a `sint32` value, a signed, zigzag-encoded 32-bit varint. + * Is the given value assignable to our message type, + * regardless of [excess properties](https://www.typescriptlang.org/docs/handbook/interfaces.html#excess-property-checks)? */ - sint32(value) { - assert_1.assertInt32(value); - value = (value << 1 ^ value >> 31) >>> 0; - goog_varint_1.varint32write(value, this.buf); - return this; + isAssignable(arg, depth = this.defaultCheckDepth) { + return this.refTypeCheck.is(arg, depth, true); } /** - * Write a `fixed64` value, a signed, fixed-length 64-bit integer. + * Copy partial data into the target message. */ - 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); + mergePartial(target, source) { + reflection_merge_partial_1.reflectionMergePartial(this, target, source); } /** - * Write a `fixed64` value, an unsigned, fixed-length 64 bit integer. + * Create a new message from binary format. */ - 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); + fromBinary(data, options) { + let opt = binary_reader_1.binaryReadOptions(options); + return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt); } /** - * Write a `int64` value, a signed 64-bit varint. + * Read a new message from a JSON value. */ - int64(value) { - let long = pb_long_1.PbLong.from(value); - goog_varint_1.varint64write(long.lo, long.hi, this.buf); - return this; + fromJson(json2, options) { + return this.internalJsonRead(json2, json_format_contract_1.jsonReadOptions(options)); } /** - * Write a `sint64` value, a signed, zig-zag-encoded 64-bit varint. + * Read a new message from a JSON string. + * This is equivalent to `T.fromJson(JSON.parse(json))`. */ - 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; + fromJsonString(json2, options) { + let value = JSON.parse(json2); + return this.fromJson(value, options); } /** - * Write a `uint64` value, an unsigned 64-bit varint. + * Write the message to canonical JSON value. */ - 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 _a, _b; - let c = Object.assign(Object.assign({}, a), b); - c.typeRegistry = [...(_a = a === null || a === void 0 ? void 0 : a.typeRegistry) !== null && _a !== void 0 ? _a : [], ...(_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 = 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); + 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 _a; + let value = this.toJson(message, options); + return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 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(json2, options, target) { + if (json2 !== null && typeof json2 == "object" && !Array.isArray(json2)) { + let message = target !== null && target !== void 0 ? target : this.create(); + this.refJsonReader.read(json2, message, options); + return message; } + throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json2)}.`); } - return sb.join(""); - } - exports2.lowerCamelCase = lowerCamelCase; + /** + * 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-info.js -var require_reflection_info = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-info.js"(exports2) { +// 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.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 _a, _b, _c, _d; - field.localName = (_a = field.localName) !== null && _a !== void 0 ? _a : 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 _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readFieldOptions = readFieldOptions; - function readFieldOption(messageType, fieldName, extensionName, extensionType) { - var _a; - const options = (_a = messageType.fields.find((m, i) => m.localName == fieldName || i == fieldName)) === null || _a === void 0 ? void 0 : _a.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.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.readMessageOption = readMessageOption; + exports2.containsMessageType = containsMessageType; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js -var require_oneof = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/oneof.js"(exports2) { +// 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.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")) { + exports2.listEnumNumbers = exports2.listEnumNames = exports2.listEnumValues = exports2.isEnumObject = void 0; + function isEnumObject(arg) { + if (typeof arg != "object" || arg === null) { 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]; + if (!arg.hasOwnProperty(0)) { + return false; } - oneof.oneofKind = kind; - if (value !== void 0) { - oneof[kind] = value; + 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.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.isEnumObject = isEnumObject; + function listEnumValues(enumObject) { + if (!isEnumObject(enumObject)) + throw new Error("not a typescript enum object"); + let values = []; + for (let [name, number] of Object.entries(enumObject)) + if (typeof number == "number") + values.push({ name, number }); + return values; } - exports2.setUnknownOneofValue = setUnknownOneofValue; - function clearOneofValue(oneof) { - if (oneof.oneofKind !== void 0) { - delete oneof[oneof.oneofKind]; - } - oneof.oneofKind = void 0; + exports2.listEnumValues = listEnumValues; + function listEnumNames(enumObject) { + return listEnumValues(enumObject).map((val) => val.name); } - exports2.clearOneofValue = clearOneofValue; - function getSelectedOneofValue(oneof) { - if (oneof.oneofKind === void 0) { - return void 0; - } - return oneof[oneof.oneofKind]; + exports2.listEnumNames = listEnumNames; + function listEnumNumbers(enumObject) { + return listEnumValues(enumObject).map((val) => val.number).filter((num, index, arr) => arr.indexOf(num) == index); } - exports2.getSelectedOneofValue = getSelectedOneofValue; + exports2.listEnumNumbers = listEnumNumbers; } }); -// 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) { +// 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 }); - exports2.ReflectionTypeCheck = void 0; + 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(); - var oneof_1 = require_oneof(); - var ReflectionTypeCheck = class { - constructor(info6) { - var _a; - this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; - } - 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, type2, allowExcessProperties, depth) { - if (allowExcessProperties) { - return type2.isAssignable(arg, depth); - } - return type2.is(arg, depth); - } - messages(arg, type2, 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 (!type2.isAssignable(arg[i], depth - 1)) - return false; - } else { - for (let i = 0; i < arg.length && i < depth; i++) - if (!type2.is(arg[i], depth - 1)) - return false; - } - return true; + 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 _a, _b, _c; + let m = method; + m.service = service; + m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : 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 _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; + } + exports2.readMethodOptions = readMethodOptions; + function readMethodOption(service, methodName, extensionName, extensionType) { + var _a; + const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; + if (!options) { + return void 0; } - scalar(arg, type2, longType) { - let argType = typeof arg; - switch (type2) { - 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); - } + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; } - scalars(arg, type2, 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], type2, longType)) - return false; - } - return true; + return extensionType ? extensionType.fromJson(optionVal) : optionVal; + } + exports2.readMethodOption = readMethodOption; + function readServiceOption(service, extensionName, extensionType) { + const options = service.options; + if (!options) { + return void 0; } - mapKeys(map2, type2, depth) { - let keys = Object.keys(map2); - switch (type2) { - 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)), type2, depth); - case reflection_info_1.ScalarType.BOOL: - return this.scalars(keys.slice(0, depth).map((k) => k == "true" ? true : k == "false" ? false : k), type2, depth); - default: - return this.scalars(keys, type2, depth, reflection_info_1.LongType.STRING); - } + const optionVal = options[extensionName]; + if (optionVal === void 0) { + return optionVal; } - }; - exports2.ReflectionTypeCheck = ReflectionTypeCheck; + return extensionType ? extensionType.fromJson(optionVal) : optionVal; + } + exports2.readServiceOption = readServiceOption; } }); -// 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) { +// 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.reflectionLongConvert = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionLongConvert(long, type2) { - switch (type2) { - case reflection_info_1.LongType.BIGINT: - return long.toBigInt(); - case reflection_info_1.LongType.NUMBER: - return long.toNumber(); - default: - return long.toString(); + 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.reflectionLongConvert = reflectionLongConvert; + }; + exports2.ServiceType = ServiceType; } }); -// 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) { +// 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.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(info6) { - this.info = info6; + 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 : {}; } - prepare() { - var _a; - if (this.fMap === void 0) { - this.fMap = {}; - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - for (const field of fieldsInput) { - this.fMap[field.name] = field; - this.fMap[field.jsonName] = field; - this.fMap[field.localName] = field; - } + toString() { + const l = [this.name + ": " + this.message]; + if (this.code) { + l.push(""); + l.push("Code: " + this.code); } - } - // 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}`); + if (this.serviceName && this.methodName) { + l.push("Method: " + this.serviceName + "/" + this.methodName); } - } - /** - * 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 val2; - switch (field.V.kind) { - case "message": - val2 = field.V.T().internalJsonRead(jsonObjValue, options); - break; - case "enum": - val2 = this.enum(field.V.T(), jsonObjValue, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - break; - case "scalar": - val2 = this.scalar(jsonObjValue, field.V.T, field.V.L, field.name); - break; - } - this.assert(val2 !== 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] = val2; - } - } 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 val2; - switch (field.kind) { - case "message": - val2 = field.T().internalJsonRead(jsonItem, options); - break; - case "enum": - val2 = this.enum(field.T(), jsonItem, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - break; - case "scalar": - val2 = this.scalar(jsonItem, field.T, field.L, field.name); - break; - } - this.assert(val2 !== void 0, field.name, jsonValue); - fieldArr.push(val2); - } - } 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 val2 = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); - if (val2 === false) - continue; - target[localName] = val2; - break; - case "scalar": - if (jsonValue === null) - continue; - target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); - break; - } + 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"); } - /** - * Returns `false` for unrecognized string representations. - * - * google.protobuf.NullValue accepts only JSON `null` (or the old `"NULL_VALUE"`). - */ - enum(type2, json2, fieldName, ignoreUnknownFields) { - if (type2[0] == "google.protobuf.NullValue") - assert_1.assert(json2 === null || json2 === "NULL_VALUE", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} only accepts null.`); - if (json2 === null) - return 0; - switch (typeof json2) { - case "number": - assert_1.assert(Number.isInteger(json2), `Unable to parse field ${this.info.typeName}#${fieldName}, enum can only be integral number, got ${json2}.`); - return json2; - case "string": - let localEnumName = json2; - if (type2[2] && json2.substring(0, type2[2].length) === type2[2]) - localEnumName = json2.substring(type2[2].length); - let enumNumber = type2[1][localEnumName]; - if (typeof enumNumber === "undefined" && ignoreUnknownFields) { - return false; - } - assert_1.assert(typeof enumNumber == "number", `Unable to parse field ${this.info.typeName}#${fieldName}, enum ${type2[0]} has no value for "${json2}".`); - return enumNumber; - } - assert_1.assert(false, `Unable to parse field ${this.info.typeName}#${fieldName}, cannot parse enum value from ${typeof json2}".`); - } - scalar(json2, type2, longType, fieldName) { - let e; - try { - switch (type2) { - // 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 (json2 === null) - return 0; - if (json2 === "NaN") - return Number.NaN; - if (json2 === "Infinity") - return Number.POSITIVE_INFINITY; - if (json2 === "-Infinity") - return Number.NEGATIVE_INFINITY; - if (json2 === "") { - e = "empty string"; - break; - } - if (typeof json2 == "string" && json2.trim().length !== json2.length) { - e = "extra whitespace"; - break; - } - if (typeof json2 != "string" && typeof json2 != "number") { - break; - } - let float2 = Number(json2); - if (Number.isNaN(float2)) { - e = "not a number"; - break; - } - if (!Number.isFinite(float2)) { - e = "too large or small"; - break; - } - if (type2 == reflection_info_1.ScalarType.FLOAT) - assert_1.assertFloat32(float2); - return float2; - // 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 (json2 === null) - return 0; - let int32; - if (typeof json2 == "number") - int32 = json2; - else if (json2 === "") - e = "empty string"; - else if (typeof json2 == "string") { - if (json2.trim().length !== json2.length) - e = "extra whitespace"; - else - int32 = Number(json2); - } - if (int32 === void 0) - break; - if (type2 == 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 (json2 === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.ZERO, longType); - if (typeof json2 != "number" && typeof json2 != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbLong.from(json2), longType); - case reflection_info_1.ScalarType.FIXED64: - case reflection_info_1.ScalarType.UINT64: - if (json2 === null) - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.ZERO, longType); - if (typeof json2 != "number" && typeof json2 != "string") - break; - return reflection_long_convert_1.reflectionLongConvert(pb_long_1.PbULong.from(json2), longType); - // bool: - case reflection_info_1.ScalarType.BOOL: - if (json2 === null) - return false; - if (typeof json2 !== "boolean") - break; - return json2; - // string: - case reflection_info_1.ScalarType.STRING: - if (json2 === null) - return ""; - if (typeof json2 !== "string") { - e = "extra whitespace"; - break; - } - try { - encodeURIComponent(json2); - } catch (e2) { - e2 = "invalid UTF8"; - break; - } - return json2; - // 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 (json2 === null || json2 === "") - return new Uint8Array(0); - if (typeof json2 !== "string") - break; - return base64_1.base64decode(json2); - } - } catch (error4) { - e = error4.message; + }; + 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(defaults, options) { + if (!options) + return defaults; + let o = {}; + copy(defaults, o); + copy(options, o); + for (let key of Object.keys(options)) { + let val = options[key]; + switch (key) { + case "jsonOptions": + o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); + break; + case "binaryOptions": + o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); + break; + case "meta": + o.meta = {}; + copy(defaults.meta, o.meta); + copy(options.meta, o.meta); + break; + case "interceptors": + o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val) : val.concat(); + break; } - this.assert(false, fieldName + (e ? " - " + e : ""), json2); } - }; - exports2.ReflectionJsonReader = ReflectionJsonReader; + 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/build/commonjs/reflection-json-writer.js -var require_reflection_json_writer = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-json-writer.js"(exports2) { +// 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.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(info6) { - var _a; - this.fields = (_a = info6.fields) !== null && _a !== void 0 ? _a : []; - } + 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 { /** - * Converts the message to a JSON object, based on the field descriptors. + * @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. */ - write(message, options) { - const json2 = {}, source = message; - for (const field of this.fields) { - if (!field.oneof) { - let jsonValue2 = this.field(field, source[field.localName], options); - if (jsonValue2 !== void 0) - json2[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); - json2[options.useProtoFieldName ? field.name : field.jsonName] = jsonValue; + constructor(preventUnhandledRejectionWarning = true) { + this._state = DeferredState.PENDING; + this._promise = new Promise((resolve6, reject) => { + this._resolve = resolve6; + this._reject = reject; + }); + if (preventUnhandledRejectionWarning) { + this._promise.catch((_) => { + }); } - return json2; } - 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 val2 = this.scalar(field.V.T, entryValue, field.name, false, true); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - break; - case "message": - const messageType = field.V.T(); - for (const [entryKey, entryValue] of Object.entries(value)) { - const val2 = this.message(messageType, entryValue, field.name, options); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - 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 val2 = this.enum(enumInfo, entryValue, field.name, false, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonObj[entryKey.toString()] = val2; - } - 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 val2 = this.scalar(field.T, value[i], field.name, field.opt, true); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - 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 val2 = this.enum(enumInfo, value[i], field.name, field.opt, true, options.enumAsInteger); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - break; - case "message": - const messageType = field.T(); - for (let i = 0; i < value.length; i++) { - const val2 = this.message(messageType, value[i], field.name, options); - assert_1.assert(val2 !== void 0); - jsonArr.push(val2); - } - 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; + /** + * Get the current state of the promise. + */ + get state() { + return this._state; } /** - * Returns `null` as the default for google.protobuf.NullValue. + * Get the deferred promise. */ - enum(type2, value, fieldName, optional, emitDefaultValues, enumAsInteger) { - if (type2[0] == "google.protobuf.NullValue") - return !emitDefaultValues && !optional ? void 0 : null; - if (value === void 0) { - assert_1.assert(optional); - return void 0; - } - if (value === 0 && !emitDefaultValues && !optional) - return void 0; - assert_1.assert(typeof value == "number"); - assert_1.assert(Number.isInteger(value)); - if (enumAsInteger || !type2[1].hasOwnProperty(value)) - return value; - if (type2[2]) - return type2[2] + type2[1][value]; - return type2[1][value]; + get promise() { + return this._promise; } - message(type2, value, fieldName, options) { - if (value === void 0) - return options.emitDefaultValues ? null : void 0; - return type2.internalJsonWrite(value, options); + /** + * 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; } - scalar(type2, value, fieldName, optional, emitDefaultValues) { - if (value === void 0) { - assert_1.assert(optional); - return void 0; - } - const ed = emitDefaultValues || optional; - switch (type2) { - // 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); - } + /** + * 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.ReflectionJsonWriter = ReflectionJsonWriter; + exports2.Deferred = Deferred; } }); -// 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) { +// 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.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(type2, longType = reflection_info_1.LongType.STRING) { - switch (type2) { - 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.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: [] }; } - } - 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(info6) { - this.info = info6; + // --- RpcOutputStream callback API + onNext(callback) { + return this.addLis(callback, this._lis.nxt); } - prepare() { - var _a; - if (!this.fieldNoToField) { - const fieldsInput = (_a = this.info.fields) !== null && _a !== void 0 ? _a : []; - this.fieldNoToField = new Map(fieldsInput.map((field) => [field.no, field])); - } + 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 /** - * Reads a message from binary format into the target message. + * 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. * - * Repeated fields are appended. Map entries are added, overwriting - * existing keys. + * 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. * - * If a message field is already present, it will be merged with the - * new data. + * Triggers onNext and onError callbacks. */ - 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; - } - } + 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(); } /** - * Read a map field, expecting key field = 1, value field = 2 + * Closes the stream successfully. Throws if stream is closed. + * + * Triggers onNext and onComplete callbacks. */ - mapEntry(field, reader, options) { - let length = reader.uint32(); - let end = reader.pos + length; - let key = void 0; - let val2 = 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": - val2 = this.scalar(reader, field.V.T, field.V.L); - break; - case "enum": - val2 = reader.int32(); - break; - case "message": - val2 = 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 (val2 === void 0) - switch (field.V.kind) { - case "scalar": - val2 = reflection_scalar_default_1.reflectionScalarDefault(field.V.T, field.V.L); - break; - case "enum": - val2 = 0; - break; - case "message": - val2 = field.V.T().create(); - break; + 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; } - return [key, val2]; + }; } - scalar(reader, type2, longType) { - switch (type2) { - 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); + // "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.ReflectionBinaryReader = ReflectionBinaryReader; + exports2.RpcOutputStreamController = RpcOutputStreamController; } }); -// 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) { +// 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"; - 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(info6) { - this.info = info6; - } - prepare() { - if (!this.fields) { - const fieldsInput = this.info.fields ? this.info.fields.concat() : []; - this.fields = fieldsInput.sort((a, b) => a.no - b.no); - } + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - /** - * 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, val2] of Object.entries(value)) - this.mapEntry(writer, options, field, key, val2); - break; + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } } - 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; + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - writer.join(); - } - message(writer, options, handler, fieldNo, value) { - if (value === void 0) - return; - handler.internalBinaryWrite(value, writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited).fork(), options); - writer.join(); - } - /** - * Write a single scalar value. - */ - scalar(writer, type2, fieldNo, value, emitDefault) { - let [wireType, method, isDefault] = this.scalarInfo(type2, value); - if (!isDefault || emitDefault) { - writer.tag(fieldNo, wireType); - writer[method](value); + function step(result) { + result.done ? resolve6(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + this.headers = headers; + this.response = response; + this.status = status; + this.trailers = trailers; } /** - * Write an array of scalar values in packed format. + * If you are only interested in the final outcome of this call, + * you can await it to receive a `FinishedUnaryCall`. */ - packed(writer, type2, fieldNo, value) { - if (!value.length) - return; - assert_1.assert(type2 !== reflection_info_1.ScalarType.BYTES && type2 !== reflection_info_1.ScalarType.STRING); - writer.tag(fieldNo, binary_format_contract_1.WireType.LengthDelimited); - writer.fork(); - let [, method] = this.scalarInfo(type2); - for (let i = 0; i < value.length; i++) - writer[method](value[i]); - writer.join(); + then(onfulfilled, onrejected) { + return this.promiseFinished().then((value) => onfulfilled ? Promise.resolve(onfulfilled(value)) : value, (reason) => onrejected ? Promise.resolve(onrejected(reason)) : Promise.reject(reason)); } - /** - * 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(type2, value) { - let t = binary_format_contract_1.WireType.Varint; - let m; - let i = value === void 0; - let d = value === 0; - switch (type2) { - 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]; + 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.ReflectionBinaryWriter = ReflectionBinaryWriter; + exports2.UnaryCall = UnaryCall; } }); -// 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) { +// 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"; - 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(type2) { - const msg = type2.messagePrototype ? Object.create(type2.messagePrototype) : Object.defineProperty({}, message_type_contract_1.MESSAGE_TYPE, { value: type2 }); - for (let field of type2.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.request = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - return msg; - } - exports2.reflectionCreate = reflectionCreate; + /** + * 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/build/commonjs/reflection-merge-partial.js -var require_reflection_merge_partial = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-merge-partial.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionMergePartial = void 0; - function reflectionMergePartial(info6, target, source) { - let fieldValue, input = source, output; - for (let field of info6.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - } else { - fieldValue = input[name]; - output = target; - if (fieldValue == void 0) { - continue; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - 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; + function step(result) { + result.done ? resolve6(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + 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)); } - } - exports2.reflectionMergePartial = reflectionMergePartial; + 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/build/commonjs/reflection-equals.js -var require_reflection_equals = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/reflection-equals.js"(exports2) { +// 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"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.reflectionEquals = void 0; - var reflection_info_1 = require_reflection_info(); - function reflectionEquals(info6, a, b) { - if (a === b) - return true; - if (!a || !b) - return false; - for (let field of info6.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; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { + this.method = method; + this.requestHeaders = requestHeaders; + this.requests = request; + this.headers = headers; + this.responses = response; + this.status = status; + this.trailers = trailers; } - return true; - } - exports2.reflectionEquals = reflectionEquals; - var objectValues = Object.values; - function primitiveEq(type2, a, b) { - if (a === b) - return true; - if (type2 !== 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(type2, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!primitiveEq(type2, a[i], b[i])) - return false; - return true; - } - function repeatedMsgEq(type2, a, b) { - if (a.length !== b.length) - return false; - for (let i = 0; i < a.length; i++) - if (!type2.equals(a[i], b[i])) - return false; - return true; - } + /** + * 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/build/commonjs/message-type.js -var require_message_type = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/message-type.js"(exports2) { +// 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"; - 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); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - create(value) { - let message = reflection_create_1.reflectionCreate(this); - if (value !== void 0) { - reflection_merge_partial_1.reflectionMergePartial(this, message, value); + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - return message; - } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve6(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 { /** - * Clone the message. - * - * Unknown fields are discarded. + * Initialize with mock data. Omitted fields have default value. */ - clone(message) { - let copy = this.create(); - reflection_merge_partial_1.reflectionMergePartial(this, copy, message); - return copy; + 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 : {}; } /** - * 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`. + * Sent message(s) during the last operation. */ - equals(a, b) { - return reflection_equals_1.reflectionEquals(this, a, b); + get sentMessages() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.sent; + } else if (typeof this.lastInput == "object") { + return [this.lastInput.single]; + } + return []; } /** - * 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)? + * Sending message(s) completed? */ - is(arg, depth = this.defaultCheckDepth) { - return this.refTypeCheck.is(arg, depth, false); + get sendComplete() { + if (this.lastInput instanceof TestInputStream) { + return this.lastInput.completed; + } else if (typeof this.lastInput == "object") { + return true; + } + return 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); + // Creates a promise for response headers from the mock data. + promiseHeaders() { + var _a; + const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _TestTransport.defaultHeaders; + return headers instanceof rpc_error_1.RpcError ? Promise.reject(headers) : Promise.resolve(headers); } - /** - * Copy partial data into the target message. - */ - mergePartial(target, source) { - reflection_merge_partial_1.reflectionMergePartial(this, target, source); + // 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); } /** - * Create a new message from binary format. + * 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. */ - fromBinary(data, options) { - let opt = binary_reader_1.binaryReadOptions(options); - return this.internalBinaryRead(opt.readerFactory(data), data.byteLength, opt); + 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(); + }); } - /** - * Read a new message from a JSON value. - */ - fromJson(json2, options) { - return this.internalJsonRead(json2, json_format_contract_1.jsonReadOptions(options)); + // Creates a promise for response status from the mock data. + promiseStatus() { + var _a; + const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _TestTransport.defaultStatus; + return status instanceof rpc_error_1.RpcError ? Promise.reject(status) : Promise.resolve(status); } - /** - * Read a new message from a JSON string. - * This is equivalent to `T.fromJson(JSON.parse(json))`. - */ - fromJsonString(json2, options) { - let value = JSON.parse(json2); - return this.fromJson(value, options); + // Creates a promise for response trailers from the mock data. + promiseTrailers() { + var _a; + const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _TestTransport.defaultTrailers; + return trailers instanceof rpc_error_1.RpcError ? Promise.reject(trailers) : Promise.resolve(trailers); } - /** - * Write the message to canonical JSON value. - */ - toJson(message, options) { - return this.internalJsonWrite(message, json_format_contract_1.jsonWriteOptions(options)); + maybeSuppressUncaught(...promise) { + if (this.suppressUncaughtRejections) { + for (let p of promise) { + p.catch(() => { + }); + } + } } - /** - * Convert the message to canonical JSON string. - * This is equivalent to `JSON.stringify(T.toJson(t))` - */ - toJsonString(message, options) { + mergeOptions(options) { + return rpc_options_1.mergeRpcOptions({}, options); + } + unary(method, input, options) { var _a; - let value = this.toJson(message, options); - return JSON.stringify(value, null, (_a = options === null || options === void 0 ? void 0 : options.prettySpaces) !== null && _a !== void 0 ? _a : 0); + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { + }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { + }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; + const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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((resolve6, reject) => { + if (abort === null || abort === void 0 ? void 0 : abort.aborted) { + reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + } else { + const id = setTimeout(() => resolve6(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 _a, _b, _c, _d; + if (kind == "unary") { + let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); + for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).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); } - /** - * Write the message to binary format. - */ - toBinary(message, options) { - let opt = binary_writer_1.binaryWriteOptions(options); - return this.internalBinaryWrite(message, opt.writerFactory(), opt).finish(); + 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; } /** - * This is an internal method. If you just want to read a message from - * JSON, use `fromJson()` or `fromJsonString()`. + * Set the call cancelled. * - * 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. + * Invokes all callbacks registered with onCancel() and + * sets `cancelled = true`. */ - internalJsonRead(json2, options, target) { - if (json2 !== null && typeof json2 == "object" && !Array.isArray(json2)) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refJsonReader.read(json2, message, options); - return message; + notifyCancelled() { + if (!this._cancelled) { + this._cancelled = true; + for (let l of this._listeners) { + l(); + } } - throw new Error(`Unable to parse message ${this.typeName} from JSON ${json_typings_1.typeofJsonValue(json2)}.`); } /** - * 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. + * Send response headers. */ - internalJsonWrite(message, options) { - return this.refJsonWriter.write(message, options); + sendResponseHeaders(data) { + this._sendRH(data); } /** - * This is an internal method. If you just want to write a message - * in binary format, use `toBinary()`. + * Is the call cancelled? * - * Serializes the message in binary format and appends it to the given - * writer. Returns passed writer. + * 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. */ - internalBinaryWrite(message, writer, options) { - this.refBinWriter.write(message, writer, options); - return writer; + get cancelled() { + return this._cancelled; } /** - * 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. + * Add a callback for cancellation. */ - internalBinaryRead(reader, length, options, target) { - let message = target !== null && target !== void 0 ? target : this.create(); - this.refBinReader.read(reader, message, options, length); - return message; + onCancel(callback) { + const l = this._listeners; + l.push(callback); + return () => { + let i = l.indexOf(callback); + if (i >= 0) + l.splice(i, 1); + }; } }; - 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, number] of Object.entries(enumObject)) - if (typeof number == "number") - values.push({ name, number }); - return values; - } - exports2.listEnumValues = listEnumValues; - function listEnumNames(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.name); - } - exports2.listEnumNames = listEnumNames; - function listEnumNumbers(enumObject) { - return listEnumValues(enumObject).map((val2) => val2.number).filter((num, index, arr) => arr.indexOf(num) == index); - } - exports2.listEnumNumbers = listEnumNumbers; + exports2.ServerCallContextController = ServerCallContextController; } }); -// node_modules/@protobuf-ts/runtime/build/commonjs/index.js -var require_commonjs11 = __commonJS({ - "node_modules/@protobuf-ts/runtime/build/commonjs/index.js"(exports2) { +// 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 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 service_type_1 = require_service_type(); + Object.defineProperty(exports2, "ServiceType", { enumerable: true, get: function() { + return service_type_1.ServiceType; } }); - 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_info_1 = require_reflection_info2(); + Object.defineProperty(exports2, "readMethodOptions", { enumerable: true, get: function() { + return reflection_info_1.readMethodOptions; } }); - var reflection_json_reader_1 = require_reflection_json_reader(); - Object.defineProperty(exports2, "ReflectionJsonReader", { enumerable: true, get: function() { - return reflection_json_reader_1.ReflectionJsonReader; + Object.defineProperty(exports2, "readMethodOption", { enumerable: true, get: function() { + return reflection_info_1.readMethodOption; } }); - var reflection_json_writer_1 = require_reflection_json_writer(); - Object.defineProperty(exports2, "ReflectionJsonWriter", { enumerable: true, get: function() { - return reflection_json_writer_1.ReflectionJsonWriter; + Object.defineProperty(exports2, "readServiceOption", { enumerable: true, get: function() { + return reflection_info_1.readServiceOption; } }); - 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 rpc_error_1 = require_rpc_error(); + Object.defineProperty(exports2, "RpcError", { enumerable: true, get: function() { + return rpc_error_1.RpcError; } }); - var oneof_1 = require_oneof(); - Object.defineProperty(exports2, "isOneofGroup", { enumerable: true, get: function() { - return oneof_1.isOneofGroup; + var rpc_options_1 = require_rpc_options(); + Object.defineProperty(exports2, "mergeRpcOptions", { enumerable: true, get: function() { + return rpc_options_1.mergeRpcOptions; } }); - Object.defineProperty(exports2, "setOneofValue", { enumerable: true, get: function() { - return oneof_1.setOneofValue; + var rpc_output_stream_1 = require_rpc_output_stream(); + Object.defineProperty(exports2, "RpcOutputStreamController", { enumerable: true, get: function() { + return rpc_output_stream_1.RpcOutputStreamController; } }); - Object.defineProperty(exports2, "getOneofValue", { enumerable: true, get: function() { - return oneof_1.getOneofValue; + var test_transport_1 = require_test_transport(); + Object.defineProperty(exports2, "TestTransport", { enumerable: true, get: function() { + return test_transport_1.TestTransport; } }); - Object.defineProperty(exports2, "clearOneofValue", { enumerable: true, get: function() { - return oneof_1.clearOneofValue; + var deferred_1 = require_deferred(); + Object.defineProperty(exports2, "Deferred", { enumerable: true, get: function() { + return deferred_1.Deferred; } }); - Object.defineProperty(exports2, "getSelectedOneofValue", { enumerable: true, get: function() { - return oneof_1.getSelectedOneofValue; + Object.defineProperty(exports2, "DeferredState", { enumerable: true, get: function() { + return deferred_1.DeferredState; } }); - var enum_object_1 = require_enum_object(); - Object.defineProperty(exports2, "listEnumValues", { enumerable: true, get: function() { - return enum_object_1.listEnumValues; + var duplex_streaming_call_1 = require_duplex_streaming_call(); + Object.defineProperty(exports2, "DuplexStreamingCall", { enumerable: true, get: function() { + return duplex_streaming_call_1.DuplexStreamingCall; } }); - Object.defineProperty(exports2, "listEnumNames", { enumerable: true, get: function() { - return enum_object_1.listEnumNames; + var client_streaming_call_1 = require_client_streaming_call(); + Object.defineProperty(exports2, "ClientStreamingCall", { enumerable: true, get: function() { + return client_streaming_call_1.ClientStreamingCall; } }); - Object.defineProperty(exports2, "listEnumNumbers", { enumerable: true, get: function() { - return enum_object_1.listEnumNumbers; + var server_streaming_call_1 = require_server_streaming_call(); + Object.defineProperty(exports2, "ServerStreamingCall", { enumerable: true, get: function() { + return server_streaming_call_1.ServerStreamingCall; } }); - Object.defineProperty(exports2, "isEnumObject", { enumerable: true, get: function() { - return enum_object_1.isEnumObject; + var unary_call_1 = require_unary_call(); + Object.defineProperty(exports2, "UnaryCall", { enumerable: true, get: function() { + return unary_call_1.UnaryCall; } }); - var lower_camel_case_1 = require_lower_camel_case(); - Object.defineProperty(exports2, "lowerCamelCase", { enumerable: true, get: function() { - return lower_camel_case_1.lowerCamelCase; + var rpc_interceptor_1 = require_rpc_interceptor(); + Object.defineProperty(exports2, "stackIntercept", { enumerable: true, get: function() { + return rpc_interceptor_1.stackIntercept; } }); - var assert_1 = require_assert(); - Object.defineProperty(exports2, "assert", { enumerable: true, get: function() { - return assert_1.assert; + Object.defineProperty(exports2, "stackDuplexStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackDuplexStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertNever", { enumerable: true, get: function() { - return assert_1.assertNever; + Object.defineProperty(exports2, "stackClientStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackClientStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertInt32", { enumerable: true, get: function() { - return assert_1.assertInt32; + Object.defineProperty(exports2, "stackServerStreamingInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackServerStreamingInterceptors; } }); - Object.defineProperty(exports2, "assertUInt32", { enumerable: true, get: function() { - return assert_1.assertUInt32; + Object.defineProperty(exports2, "stackUnaryInterceptors", { enumerable: true, get: function() { + return rpc_interceptor_1.stackUnaryInterceptors; } }); - Object.defineProperty(exports2, "assertFloat32", { enumerable: true, get: function() { - return assert_1.assertFloat32; + 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/@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) { +// 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.readServiceOption = exports2.readMethodOption = exports2.readMethodOptions = exports2.normalizeMethodInfo = void 0; - var runtime_1 = require_commonjs11(); - function normalizeMethodInfo(method, service) { - var _a, _b, _c; - let m = method; - m.service = service; - m.localName = (_a = m.localName) !== null && _a !== void 0 ? _a : 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 _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.options; - return options && options[extensionName] ? extensionType.fromJson(options[extensionName]) : void 0; - } - exports2.readMethodOptions = readMethodOptions; - function readMethodOption(service, methodName, extensionName, extensionType) { - var _a; - const options = (_a = service.methods.find((m, i) => m.localName === methodName || i === methodName)) === null || _a === void 0 ? void 0 : _a.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; + 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*/ + } + ]); } - const optionVal = options[extensionName]; - if (optionVal === void 0) { - return optionVal; + 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; } - 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 : {}; + 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.ServiceType = ServiceType; + exports2.CacheScope = new CacheScope$Type(); } }); -// 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) { +// 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.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 : {}; + 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 } + ]); } - 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}`); + 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 l.join("\n"); + 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.RpcError = RpcError; + exports2.CacheMetadata = new CacheMetadata$Type(); } }); -// 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) { +// 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.mergeRpcOptions = void 0; - var runtime_1 = require_commonjs11(); - function mergeRpcOptions(defaults, options) { - if (!options) - return defaults; - let o = {}; - copy(defaults, o); - copy(options, o); - for (let key of Object.keys(options)) { - let val2 = options[key]; - switch (key) { - case "jsonOptions": - o.jsonOptions = runtime_1.mergeJsonOptions(defaults.jsonOptions, o.jsonOptions); - break; - case "binaryOptions": - o.binaryOptions = runtime_1.mergeBinaryOptions(defaults.binaryOptions, o.binaryOptions); - break; - case "meta": - o.meta = {}; - copy(defaults.meta, o.meta); - copy(options.meta, o.meta); - break; - case "interceptors": - o.interceptors = defaults.interceptors ? defaults.interceptors.concat(val2) : val2.concat(); - break; - } + 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*/ + } + ]); } - 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; + 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; } - } - } -}); - -// 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((resolve6, reject) => { - this._resolve = resolve6; - this._reject = reject; - }); - if (preventUnhandledRejectionWarning) { - this._promise.catch((_) => { - }); + 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; } - /** - * Get the current state of the promise. - */ - get state() { - return this._state; - } - /** - * Get the deferred promise. - */ - get promise() { - return this._promise; + 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; } - /** - * 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; + }; + 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*/ + } + ]); } - /** - * 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; + 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; } - /** - * Resolve the promise. Ignore if not pending. - */ - resolvePending(val2) { - if (this._state === DeferredState.PENDING) - this.resolve(val2); + 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; } - /** - * Reject the promise. Ignore if not pending. - */ - rejectPending(reason) { - if (this._state === DeferredState.PENDING) - this.reject(reason); + 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.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_commonjs11(); - var RpcOutputStreamController = class { + exports2.CreateCacheEntryResponse = new CreateCacheEntryResponse$Type(); + var FinalizeCacheEntryUploadRequest$Type = class extends runtime_5.MessageType { constructor() { - this._lis = { - nxt: [], - msg: [], - err: [], - cmp: [] - }; - this._closed = false; - this._itState = { q: [] }; + 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*/ + } + ]); } - // --- RpcOutputStream callback API - onNext(callback) { - return this.addLis(callback, this._lis.nxt); + 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; } - onMessage(callback) { - return this.addLis(callback, this._lis.msg); + 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; } - onError(callback) { - return this.addLis(callback, this._lis.err); + 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; } - onComplete(callback) { - return this.addLis(callback, this._lis.cmp); + }; + 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; } - addLis(callback, list) { - list.push(callback); - return () => { - let i = list.indexOf(callback); - if (i >= 0) - list.splice(i, 1); - }; + 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; } - // remove all listeners - clearLis() { - for (let l of Object.values(this._lis)) - l.splice(0, l.length); + }; + 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*/ + } + ]); } - // --- Controller API - /** - * Is this stream already closed by a completion or error? - */ - get closed() { - return this._closed !== false; + 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; } - /** - * 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, error4, complete) { - runtime_1.assert((message ? 1 : 0) + (error4 ? 1 : 0) + (complete ? 1 : 0) <= 1, "only one emission at a time"); - if (message) - this.notifyMessage(message); - if (error4) - this.notifyError(error4); - if (complete) - this.notifyComplete(); + 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; } - /** - * 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)); + 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; } - /** - * Closes the stream with an error. Throws if stream is closed. - * - * Triggers onNext and onError callbacks. - */ - notifyError(error4) { - runtime_1.assert(!this.closed, "stream is closed"); - this._closed = error4; - this.pushIt(error4); - this._lis.err.forEach((l) => l(error4)); - this._lis.nxt.forEach((l) => l(void 0, error4, false)); - this.clearLis(); + }; + 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*/ + } + ]); } - /** - * 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(); + 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; } - /** - * 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; + 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); } - }; - } - // "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); } + 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.RpcOutputStreamController = RpcOutputStreamController; + 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/@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) { +// 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"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + 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); } - /** - * 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)); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toJson(request, { + 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 + })); } - promiseFinished() { - return __awaiter4(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 - }; + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { + 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 + })); } - }; - 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + GetCacheEntryDownloadURL(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { + 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 + })); } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.request = request; - this.headers = headers; - this.responses = response; - this.status = status; - this.trailers = trailers; + exports2.CacheServiceClientJSON = CacheServiceClientJSON; + var CacheServiceClientProtobuf = class { + constructor(rpc) { + this.rpc = rpc; + this.CreateCacheEntry.bind(this); + this.FinalizeCacheEntryUpload.bind(this); + this.GetCacheEntryDownloadURL.bind(this); } - /** - * 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)); + CreateCacheEntry(request) { + const data = cache_1.CreateCacheEntryRequest.toBinary(request); + const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); + return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); } - promiseFinished() { - return __awaiter4(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 - }; - }); + FinalizeCacheEntryUpload(request) { + const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); + 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(request) { + const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); + 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.ServerStreamingCall = ServerStreamingCall; + exports2.CacheServiceClientProtobuf = CacheServiceClientProtobuf; } }); -// 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) { +// node_modules/@actions/cache/lib/internal/shared/util.js +var require_util9 = __commonJS({ + "node_modules/@actions/cache/lib/internal/shared/util.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - this.headers = headers; - this.response = response; - this.status = status; - this.trailers = trailers; + 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)}`); } - /** - * 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)); + } + function maskSecretUrls(body) { + if (typeof body !== "object" || body === null) { + (0, core_1.debug)("body is not an object or is null"); + return; } - promiseFinished() { - return __awaiter4(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 - }; - }); + if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { + maskSigUrl(body.signed_upload_url); } - }; - exports2.ClientStreamingCall = ClientStreamingCall; + if ("signed_download_url" in body && typeof body.signed_download_url === "string") { + maskSigUrl(body.signed_download_url); + } + } } }); -// 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) { +// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -73692,47 +80938,192 @@ var require_duplex_streaming_call = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.DuplexStreamingCall = void 0; - var DuplexStreamingCall = class { - constructor(method, requestHeaders, request, headers, response, status, trailers) { - this.method = method; - this.requestHeaders = requestHeaders; - this.requests = request; - 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)); + 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_util9(); + var CacheServiceClient = class { + constructor(userAgent, 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(userAgent, [ + new auth_1.BearerCredentialHandler(token) + ]); } - promiseFinished() { - return __awaiter4(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 + // 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((resolve6) => setTimeout(resolve6, 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); + } }; - exports2.DuplexStreamingCall = DuplexStreamingCall; + 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/@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) { +// node_modules/@actions/cache/lib/internal/tar.js +var require_tar = __commonJS({ + "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { "use strict"; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -73760,3344 +81151,3358 @@ var require_test_transport = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.TestTransport = void 0; - var rpc_error_1 = require_rpc_error(); - var runtime_1 = require_commonjs11(); - 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 _a; - const headers = (_a = this.data.headers) !== null && _a !== void 0 ? _a : _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 __awaiter4(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); + exports2.listTar = listTar; + exports2.extractTar = extractTar2; + exports2.createTar = createTar; + var exec_1 = require_exec(); + var io6 = __importStar2(require_io()); + var fs_1 = require("fs"); + var path12 = __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 }; } - } 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 (error4) { - stream2.notifyError(error4); - return; - } - if (this.data.response instanceof rpc_error_1.RpcError) { - stream2.notifyError(this.data.response); - return; + break; } - for (let msg of messages) { - stream2.notifyMessage(msg); - try { - yield delay2(this.betweenResponseDelay, abort)(void 0); - } catch (error4) { - stream2.notifyError(error4); - return; + case "darwin": { + const gnuTar = yield io6.which("gtar", false); + if (gnuTar) { + return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; + } else { + return { + path: yield io6.which("tar", true), + type: constants_1.ArchiveToolType.BSD + }; } } - 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 _a; - const status = (_a = this.data.status) !== null && _a !== void 0 ? _a : _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 _a; - const trailers = (_a = this.data.trailers) !== null && _a !== void 0 ? _a : _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(() => { - }); + default: + break; + } + return { + path: yield io6.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, type2, 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 (type2) { + case "create": + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); + break; + case "extract": + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path12.sep}`, "g"), "/")); + break; + case "list": + args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path12.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; } } - } - mergeOptions(options) { - return rpc_options_1.mergeRpcOptions({}, options); - } - unary(method, input, options) { - var _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, headersPromise = this.promiseHeaders().then(delay2(this.headerDelay, options.abort)), responsePromise = headersPromise.catch((_) => { - }).then(delay2(this.responseDelay, options.abort)).then((_) => this.promiseSingleResponse(method)), statusPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => this.promiseStatus()), trailersPromise = responsePromise.catch((_) => { - }).then(delay2(this.afterResponseDelay, options.abort)).then((_) => 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 _a; - const requestHeaders = (_a = options.meta) !== null && _a !== void 0 ? _a : {}, 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((resolve6, reject) => { - if (abort === null || abort === void 0 ? void 0 : abort.aborted) { - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + return args; + }); + } + function getCommands(compressionMethod_1, type_1) { + return __awaiter2(this, arguments, void 0, function* (compressionMethod, type2, archivePath = "") { + let args; + const tarPath = yield getTarPath(); + const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); + const compressionArgs = type2 !== "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 && type2 !== "create") { + args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; } else { - const id = setTimeout(() => resolve6(v), ms); - if (abort) { - abort.addEventListener("abort", (ev) => { - clearTimeout(id); - reject(new rpc_error_1.RpcError("user cancel", "CANCELLED")); + args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; + } + if (BSD_TAR_ZSTD) { + return args; + } + return [args.join(" ")]; + }); + } + function getWorkingDirectory() { + var _a; + return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : 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(`\\${path12.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(`\\${path12.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(`\\${path12.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(`\\${path12.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}`); } } }); } - 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)); - } - }; + function listTar(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const commands = yield getCommands(compressionMethod, "list", archivePath); + yield execCommands(commands); + }); + } + function extractTar2(archivePath, compressionMethod) { + return __awaiter2(this, void 0, void 0, function* () { + const workingDirectory = getWorkingDirectory(); + yield io6.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)(path12.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); + const commands = yield getCommands(compressionMethod, "create"); + yield execCommands(commands, archiveFolder); + }); + } } }); -// 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) { +// node_modules/@actions/cache/lib/cache.js +var require_cache4 = __commonJS({ + "node_modules/@actions/cache/lib/cache.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_commonjs11(); - function stackIntercept(kind, transport, method, options, input) { - var _a, _b, _c, _d; - if (kind == "unary") { - let tail = (mtd, inp, opt) => transport.unary(mtd, inp, opt); - for (const curr of ((_a = options.interceptors) !== null && _a !== void 0 ? _a : []).filter((i) => i.interceptUnary).reverse()) { - const next = tail; - tail = (mtd, inp, opt) => curr.interceptUnary(next, mtd, inp, opt); - } - return tail(method, input, options); + 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]; + } }; } - 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); + 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]); } - return tail(method, input, options); + __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(resolve6) { + resolve6(value); + }); } - 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 new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - 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); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - return tail(method, options); + function step(result) { + result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; + exports2.isFeatureAvailable = isFeatureAvailable; + exports2.restoreCache = restoreCache3; + exports2.saveCache = saveCache3; + var core14 = __importStar2(require_core()); + var path12 = __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 ValidationError = class _ValidationError extends Error { + constructor(message) { + super(message); + this.name = "ValidationError"; + Object.setPrototypeOf(this, _ValidationError.prototype); + } + }; + exports2.ValidationError = ValidationError; + var ReserveCacheError = class _ReserveCacheError extends Error { + constructor(message) { + super(message); + this.name = "ReserveCacheError"; + Object.setPrototypeOf(this, _ReserveCacheError.prototype); + } + }; + exports2.ReserveCacheError = ReserveCacheError; + 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`); } - runtime_1.assertNever(kind); } - exports2.stackIntercept = stackIntercept; - function stackUnaryInterceptors(transport, method, input, options) { - return stackIntercept("unary", transport, method, options, input); + 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.`); + } } - exports2.stackUnaryInterceptors = stackUnaryInterceptors; - function stackServerStreamingInterceptors(transport, method, input, options) { - return stackIntercept("serverStreaming", transport, method, options, input); + 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"]; + } } - exports2.stackServerStreamingInterceptors = stackServerStreamingInterceptors; - function stackClientStreamingInterceptors(transport, method, options) { - return stackIntercept("clientStreaming", transport, method, options); + function restoreCache3(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)(); + core14.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + switch (cacheServiceVersion) { + case "v2": + return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); + case "v1": + default: + return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); + } + }); } - exports2.stackClientStreamingInterceptors = stackClientStreamingInterceptors; - function stackDuplexStreamingInterceptors(transport, method, options) { - return stackIntercept("duplex", transport, method, options); + function restoreCacheV1(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core14.debug("Resolved Keys:"); + core14.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 { + const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { + compressionMethod, + enableCrossOsArchive + }); + if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { + return void 0; + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core14.info("Lookup only - skipping download"); + return cacheEntry.cacheKey; + } + archivePath = path12.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core14.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) { + core14.error(`Failed to restore: ${error3.message}`); + } else { + core14.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); + } + } + return void 0; + }); } - 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(); + function restoreCacheV2(paths_1, primaryKey_1, restoreKeys_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { + options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); + restoreKeys = restoreKeys || []; + const keys = [primaryKey, ...restoreKeys]; + core14.debug("Resolved Keys:"); + core14.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 request = { + key: primaryKey, + restoreKeys, + version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) + }; + const response = yield twirpClient.GetCacheEntryDownloadURL(request); + if (!response.ok) { + core14.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); + return void 0; + } + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core14.info(`Cache hit for restore-key: ${response.matchedKey}`); + } else { + core14.info(`Cache hit for: ${response.matchedKey}`); + } + if (options === null || options === void 0 ? void 0 : options.lookupOnly) { + core14.info("Lookup only - skipping download"); + return response.matchedKey; + } + archivePath = path12.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive path: ${archivePath}`); + core14.debug(`Starting download of archive to: ${archivePath}`); + yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + yield (0, tar_1.extractTar)(archivePath, compressionMethod); + core14.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) { + core14.error(`Failed to restore: ${error3.message}`); + } else { + core14.warning(`Failed to restore: ${error3.message}`); + } + } + } finally { + try { + if (archivePath) { + yield utils.unlinkFile(archivePath); + } + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } - } - /** - * 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_commonjs12 = __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_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ + return void 0; + }); + } + function saveCache3(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + core14.debug(`Cache service version: ${cacheServiceVersion}`); + checkPaths(paths); + checkKey(key); + 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 _a, _b, _c, _d, _e; + const compressionMethod = yield utils.getCompressionMethod(); + let cacheId = -1; + const cachePaths = yield utils.resolvePaths(paths); + core14.debug("Cache Paths:"); + core14.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 = path12.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); } - ]); - } - 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); + const fileSizeLimit = 10 * 1024 * 1024 * 1024; + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.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.`); + } + core14.debug("Reserving Cache"); + const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { + compressionMethod, + enableCrossOsArchive, + cacheSize: archiveFileSize + }); + if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); + } + core14.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 === ReserveCacheError.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); + } else { + core14.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); } } - 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(); + return cacheId; + }); + } + function saveCacheV2(paths_1, key_1, options_1) { + return __awaiter2(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) { + 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); + core14.debug("Cache Paths:"); + core14.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 = path12.join(archiveFolder, utils.getCacheFileName(compressionMethod)); + core14.debug(`Archive Path: ${archivePath}`); + try { + yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); + if (core14.isDebug()) { + yield (0, tar_1.listTar)(archivePath, compressionMethod); + } + const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); + core14.debug(`File Size: ${archiveFileSize}`); + options.archiveSizeBytes = archiveFileSize; + core14.debug("Reserving Cache"); + const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const request = { + key, + version + }; + let signedUploadUrl; + try { + const response = yield twirpClient.CreateCacheEntry(request); + if (!response.ok) { + if (response.message) { + core14.warning(`Cache reservation failed: ${response.message}`); + } + throw new Error(response.message || "Response was not ok"); + } + signedUploadUrl = response.signedUploadUrl; + } catch (error3) { + core14.debug(`Failed to reserve cache: ${error3}`); + throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); + } + core14.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); + core14.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 === ReserveCacheError.name) { + core14.info(`Failed to save: ${typedError.message}`); + } else if (typedError.name === FinalizeCacheError.name) { + core14.warning(typedError.message); + } else { + if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { + core14.error(`Failed to save: ${typedError.message}`); + } else { + core14.warning(`Failed to save: ${typedError.message}`); + } + } + } finally { + try { + yield utils.unlinkFile(archivePath); + } catch (error3) { + core14.debug(`Failed to delete archive: ${error3}`); + } + } + return cacheId; + }); + } } }); -// 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) { +// node_modules/jsonschema/lib/helpers.js +var require_helpers3 = __commonJS({ + "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.CacheMetadata = void 0; - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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 } - ]); + var uri = require("url"); + var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path12, name, argument) { + if (Array.isArray(path12)) { + this.path = path12; + this.property = path12.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else if (path12 !== void 0) { + this.property = path12; } - 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; + if (message) { + this.message = 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; + if (schema2) { + var id = schema2.$id || schema2.id; + this.schema = id || schema2; } - 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; + if (instance !== void 0) { + this.instance = instance; } + this.name = name; + this.argument = argument; + this.stack = this.toString(); }; - exports2.CacheMetadata = new CacheMetadata$Type(); - } -}); - -// node_modules/@actions/cache/lib/generated/results/api/v1/cache.js -var require_cache2 = __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_commonjs12(); - var runtime_1 = require_commonjs11(); - var runtime_2 = require_commonjs11(); - var runtime_3 = require_commonjs11(); - var runtime_4 = require_commonjs11(); - var runtime_5 = require_commonjs11(); - 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*/ - } - ]); + ValidationError.prototype.toString = function toString3() { + return this.property + " " + this.message; + }; + var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema2, options, ctx) { + this.instance = instance; + this.schema = schema2; + 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); } - 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; + this.errors.push(err); + if (this.throwFirst) { + throw new ValidatorResultError(this); + } else if (this.throwError) { + throw err; } - 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; + 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); } - 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; + }; + function stringizer(v, i) { + return i + ": " + v.toString() + "\n"; + } + ValidatorResult.prototype.toString = function toString3(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 (Error.captureStackTrace) { + 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, schema2) { + this.message = msg; + this.schema = schema2; + Error.call(this, msg); + Error.captureStackTrace(this, SchemaError2); }; - 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*/ - } - ]); + SchemaError.prototype = Object.create( + Error.prototype, + { + constructor: { value: SchemaError, enumerable: false }, + name: { value: "SchemaError", enumerable: false } } - 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; + ); + var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path12, base, schemas) { + this.schema = schema2; + this.options = options; + if (Array.isArray(path12)) { + this.path = path12; + this.propertyPath = path12.reduce(function(sum, item) { + return sum + makeSuffix(item); + }, "instance"); + } else { + this.propertyPath = path12; } - 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); - } + this.base = base; + this.schemas = schemas; + }; + SchemaContext.prototype.resolve = function resolve6(target) { + return uri.resolve(this.base, target); + }; + SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { + var path12 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); + var id = schema2.$id || schema2.id; + var base = uri.resolve(this.base, id || ""); + var ctx = new SchemaContext(schema2, this.options, path12, base, Object.create(this.schemas)); + if (id && !ctx.schemas[base]) { + ctx.schemas[base] = schema2; + } + 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 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; + 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; }; - 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*/ - } - ]); + var makeSuffix = exports2.makeSuffix = function makeSuffix2(key) { + key = key.toString(); + if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { + return "." + key; } - 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; + if (key.match(/^\d+$/)) { + return "[" + key + "]"; } - 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 "[" + 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; } - return message; + if (a.length !== b.length) { + return false; + } + return a.every(function(v, i) { + return deepCompareStrict(a[i], b[i]); + }); } - 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; + 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; }; - 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*/ - } - ]); + 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); + } } - 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; + } + 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]); + } } - 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); - } + } + function deepMerge(target, src) { + var array = Array.isArray(src); + var dst = array && [] || {}; + if (array) { + 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)); } - return message; + Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); } - 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; + 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; }; - 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; + function pathEncoder(v) { + return "/" + encodeURIComponent(v).replace(/~/g, "%7E"); + } + exports2.encodePath = function encodePointer(a) { + return a.map(pathEncoder).join(""); + }; + exports2.getDecimalPlaces = function getDecimalPlaces(number) { + var decimalPlaces = 0; + if (isNaN(number)) return decimalPlaces; + if (typeof number !== "number") { + number = Number(number); } - 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); - } + var parts = number.toString().split("e"); + if (parts.length === 2) { + if (parts[1][0] !== "-") { + return decimalPlaces; + } else { + decimalPlaces = Number(parts[1].slice(1)); } - 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; + var decimalParts = parts[0].split("."); + if (decimalParts.length === 2) { + decimalPlaces += decimalParts[1].length; } + return decimalPlaces; }; - 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*/ - } - ]); + exports2.isSchema = function isSchema(val) { + return typeof val === "object" && val || typeof val === "boolean"; + }; + } +}); + +// node_modules/jsonschema/lib/attribute.js +var require_attribute = __commonJS({ + "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { + "use strict"; + var helpers = require_helpers3(); + 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, schema2, options, ctx) { + if (instance === void 0) { + return null; } - 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; + var result = new ValidatorResult(instance, schema2, options, ctx); + var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; + if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { + var list = types.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 + }); } - 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 result; + }; + function testSchemaNoThrow(instance, options, ctx, callback, schema2) { + var throwError2 = options.throwError; + var throwAll = options.throwAll; + options.throwError = false; + options.throwAll = false; + var res = this.validateSchema(instance, schema2, options, ctx); + options.throwError = throwError2; + options.throwAll = throwAll; + if (!res.valid && callback instanceof Function) { + callback(res); + } + return res.valid; + } + validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + if (!Array.isArray(schema2.anyOf)) { + throw new SchemaError("anyOf must be an array"); + } + if (!schema2.anyOf.some( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); } + ) + )) { + var list = schema2.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); } - 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; + result.addError({ + name: "anyOf", + argument: list, + message: "is not any of " + list.join(",") + }); } + return result; }; - 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_cache2(); - var CacheServiceClientJSON = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + validators.allOf = function validateAllOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toJson(request, { - 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 - })); + if (!Array.isArray(schema2.allOf)) { + throw new SchemaError("allOf must be an array"); } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toJson(request, { - 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 - })); + var result = new ValidatorResult(instance, schema2, options, ctx); + var self2 = this; + schema2.allOf.forEach(function(v, i) { + var valid3 = self2.validateSchema(instance, v, options, ctx); + if (!valid3.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: valid3.errors.length, valid: valid3 }, + message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" + }); + result.importErrors(valid3); + } + }); + return result; + }; + validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toJson(request, { - useProtoFieldName: true, - emitDefaultValues: false + if (!Array.isArray(schema2.oneOf)) { + throw new SchemaError("oneOf must be an array"); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + var inner = new ValidatorResult(instance, schema2, options, ctx); + var count = schema2.oneOf.filter( + testSchemaNoThrow.bind( + this, + instance, + options, + ctx, + function(res) { + inner.importErrors(res); + } + ) + ).length; + var list = schema2.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(",") }); - 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 - })); } + return result; }; - exports2.CacheServiceClientJSON = CacheServiceClientJSON; - var CacheServiceClientProtobuf = class { - constructor(rpc) { - this.rpc = rpc; - this.CreateCacheEntry.bind(this); - this.FinalizeCacheEntryUpload.bind(this); - this.GetCacheEntryDownloadURL.bind(this); + validators.if = function validateIf(instance, schema2, options, ctx) { + if (instance === void 0) return null; + if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); + var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); + var result = new ValidatorResult(instance, schema2, options, ctx); + var res; + if (ifValid) { + if (schema2.then === void 0) return; + if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); + res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); + result.importErrors(res); + } else { + if (schema2.else === void 0) return; + if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); + res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); + result.importErrors(res); } - CreateCacheEntry(request) { - const data = cache_1.CreateCacheEntryRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "CreateCacheEntry", "application/protobuf", data); - return promise.then((data2) => cache_1.CreateCacheEntryResponse.fromBinary(data2)); + return result; + }; + function getEnumerableProperty(object, key) { + if (Object.hasOwnProperty.call(object, key)) return object[key]; + if (!(key in object)) return; + while (object = Object.getPrototypeOf(object)) { + if (Object.propertyIsEnumerable.call(object, key)) return object[key]; } - FinalizeCacheEntryUpload(request) { - const data = cache_1.FinalizeCacheEntryUploadRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "FinalizeCacheEntryUpload", "application/protobuf", data); - return promise.then((data2) => cache_1.FinalizeCacheEntryUploadResponse.fromBinary(data2)); + } + validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var subschema = schema2.propertyNames !== void 0 ? schema2.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); + } } - GetCacheEntryDownloadURL(request) { - const data = cache_1.GetCacheEntryDownloadURLRequest.toBinary(request); - const promise = this.rpc.request("github.actions.results.api.v1.CacheService", "GetCacheEntryDownloadURL", "application/protobuf", data); - return promise.then((data2) => cache_1.GetCacheEntryDownloadURLResponse.fromBinary(data2)); + return result; + }; + validators.properties = function validateProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var properties = schema2.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; }; - 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.maskSecretUrls = exports2.maskSigUrl = void 0; - var core_1 = require_core(); - function maskSigUrl(url2) { - if (!url2) + function testAdditionalProperty(instance, schema2, options, ctx, property, result) { + if (!this.types.object(instance)) return; + if (schema2.properties && schema2.properties[property] !== void 0) { 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)); + } + if (schema2.additionalProperties === false) { + result.addError({ + name: "additionalProperties", + argument: property, + message: "is not allowed to have the additional property " + JSON.stringify(property) + }); + } else { + var additionalProperties = schema2.additionalProperties || {}; + if (typeof options.preValidateProperty == "function") { + options.preValidateProperty(instance, property, additionalProperties, options, ctx); } - } catch (error4) { - (0, core_1.debug)(`Failed to parse URL: ${url2} ${error4 instanceof Error ? error4.message : String(error4)}`); + 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); } } - 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; + validators.patternProperties = function validatePatternProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var patternProperties = schema2.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, schema2, options, ctx, property, result); + } } - if ("signed_upload_url" in body && typeof body.signed_upload_url === "string") { - maskSigUrl(body.signed_upload_url); + return result; + }; + validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + if (schema2.patternProperties) { + return null; } - if ("signed_download_url" in body && typeof body.signed_download_url === "string") { - maskSigUrl(body.signed_download_url); + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in instance) { + testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); } - } - exports2.maskSecretUrls = maskSecretUrls; - } -}); - -// 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 __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + return result; + }; + validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length >= schema2.minProperties)) { + result.addError({ + name: "minProperties", + argument: schema2.minProperties, + message: "does not meet minimum property length of " + schema2.minProperties }); } - return new (P || (P = Promise))(function(resolve6, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } + return result; + }; + validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var keys = Object.keys(instance); + if (!(keys.length <= schema2.maxProperties)) { + result.addError({ + name: "maxProperties", + argument: schema2.maxProperties, + message: "does not meet maximum property length of " + schema2.maxProperties + }); + } + return result; + }; + validators.items = function validateItems(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.items === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + instance.every(function(value, i) { + if (Array.isArray(schema2.items)) { + var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; + } else { + var items = schema2.items; } - function rejected(value) { - try { - step(generator["throw"](value)); - } catch (e) { - reject(e); - } + if (items === void 0) { + return true; } - function step(result) { - result.done ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + if (items === false) { + result.addError({ + name: "items", + message: "additionalItems not permitted" + }); + return false; } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + 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; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.internalCacheTwirpClient = void 0; - 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_auth2(); - var http_client_1 = require_lib3(); - var cache_twirp_client_1 = require_cache_twirp_client(); - var util_1 = require_util10(); - var CacheServiceClient = class { - constructor(userAgent, 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; + validators.contains = function validateContains(instance, schema2, options, ctx) { + var self2 = this; + if (!this.types.array(instance)) return; + if (schema2.contains === void 0) return; + if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); + var result = new ValidatorResult(instance, schema2, options, ctx); + var count = instance.some(function(value, i) { + var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); + return res.errors.length === 0; + }); + if (count === false) { + result.addError({ + name: "contains", + argument: schema2.contains, + message: "must contain an item matching given schema" + }); + } + return result; + }; + validators.minimum = function validateMinimum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { + if (!(instance > schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than " + schema2.minimum + }); } - if (baseRetryIntervalMilliseconds) { - this.baseRetryIntervalMilliseconds = baseRetryIntervalMilliseconds; + } else { + if (!(instance >= schema2.minimum)) { + result.addError({ + name: "minimum", + argument: schema2.minimum, + message: "must be greater than or equal to " + schema2.minimum + }); } - if (retryMultiplier) { - this.retryMultiplier = retryMultiplier; + } + return result; + }; + validators.maximum = function validateMaximum(instance, schema2, options, ctx) { + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { + if (!(instance < schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than " + schema2.maximum + }); + } + } else { + if (!(instance <= schema2.maximum)) { + result.addError({ + name: "maximum", + argument: schema2.maximum, + message: "must be less than or equal to " + schema2.maximum + }); } - this.httpClient = new http_client_1.HttpClient(userAgent, [ - 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 __awaiter4(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(() => __awaiter4(this, void 0, void 0, function* () { - return this.httpClient.post(url2, JSON.stringify(data), headers); - })); - return body; - } catch (error4) { - throw new Error(`Failed to ${method}: ${error4.message}`); - } + return result; + }; + validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMinimum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid3 = instance > schema2.exclusiveMinimum; + if (!valid3) { + result.addError({ + name: "exclusiveMinimum", + argument: schema2.exclusiveMinimum, + message: "must be strictly greater than " + schema2.exclusiveMinimum + }); + } + return result; + }; + validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { + if (typeof schema2.exclusiveMaximum === "boolean") return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var valid3 = instance < schema2.exclusiveMaximum; + if (!valid3) { + result.addError({ + name: "exclusiveMaximum", + argument: schema2.exclusiveMaximum, + message: "must be strictly less than " + schema2.exclusiveMaximum + }); + } + return result; + }; + var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { + if (!this.types.number(instance)) return; + var validationArgument = schema2[validationType]; + if (validationArgument == 0) { + throw new SchemaError(validationType + " cannot be zero"); + } + var result = new ValidatorResult(instance, schema2, 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, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); + }; + validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { + return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); + }; + validators.required = function validateRequired(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (instance === void 0 && schema2.required === true) { + result.addError({ + name: "required", + message: "is required" }); - } - retryableRequest(operation) { - return __awaiter4(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 (error4) { - if (error4 instanceof SyntaxError) { - (0, core_1.debug)(`Raw Body: ${rawBody}`); - } - if (error4 instanceof errors_1.UsageError) { - throw error4; - } - if (errors_1.NetworkError.isNetworkErrorCode(error4 === null || error4 === void 0 ? void 0 : error4.code)) { - throw new errors_1.NetworkError(error4 === null || error4 === void 0 ? void 0 : error4.code); - } - isRetryable = true; - errorMessage = error4.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++; + } else if (this.types.object(instance) && Array.isArray(schema2.required)) { + schema2.required.forEach(function(n) { + if (getEnumerableProperty(instance, n) === void 0) { + result.addError({ + name: "required", + argument: n, + message: "requires property " + JSON.stringify(n) + }); } - throw new Error(`Request failed`); }); } - isSuccessStatusCode(statusCode) { - if (!statusCode) - return false; - return statusCode >= 200 && statusCode < 300; + return result; + }; + validators.pattern = function validatePattern(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var pattern = schema2.pattern; + try { + var regexp = new RegExp(pattern, "u"); + } catch (_e) { + regexp = new RegExp(pattern); } - 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); + if (!instance.match(regexp)) { + result.addError({ + name: "pattern", + argument: schema2.pattern, + message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) + }); } - sleep(milliseconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, milliseconds)); + return result; + }; + validators.format = function validateFormat(instance, schema2, options, ctx) { + if (instance === void 0) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { + result.addError({ + name: "format", + argument: schema2.format, + message: "does not conform to the " + JSON.stringify(schema2.format) + " format" }); } - 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); + return result; + }; + validators.minLength = function validateMinLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length >= schema2.minLength)) { + result.addError({ + name: "minLength", + argument: schema2.minLength, + message: "does not meet minimum length of " + schema2.minLength + }); } + return result; }; - 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); - } - exports2.internalCacheTwirpClient = internalCacheTwirpClient; - } -}); - -// node_modules/@actions/cache/lib/internal/tar.js -var require_tar = __commonJS({ - "node_modules/@actions/cache/lib/internal/tar.js"(exports2) { - "use strict"; - var __createBinding4 = 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]; - } }; + validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { + if (!this.types.string(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + var hsp = instance.match(/[\uDC00-\uDFFF]/g); + var length = instance.length - (hsp ? hsp.length : 0); + if (!(length <= schema2.maxLength)) { + result.addError({ + name: "maxLength", + argument: schema2.maxLength, + message: "does not meet maximum length of " + schema2.maxLength + }); } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + return result; + }; + validators.minItems = function validateMinItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length >= schema2.minItems)) { + result.addError({ + name: "minItems", + argument: schema2.minItems, + message: "does not meet minimum length of " + schema2.minItems + }); } - __setModuleDefault4(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); + validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!(instance.length <= schema2.maxItems)) { + result.addError({ + name: "maxItems", + argument: schema2.maxItems, + message: "does not meet maximum length of " + schema2.maxItems }); } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); + return result; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.createTar = exports2.extractTar = exports2.listTar = void 0; - var exec_1 = require_exec(); - var io6 = __importStar4(require_io3()); - var fs_1 = require("fs"); - var path12 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var constants_1 = require_constants7(); - var IS_WINDOWS = process.platform === "win32"; - function getTarPath() { - return __awaiter4(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 io6.which("gtar", false); - if (gnuTar) { - return { path: gnuTar, type: constants_1.ArchiveToolType.GNU }; - } else { - return { - path: yield io6.which("tar", true), - type: constants_1.ArchiveToolType.BSD - }; - } - } - default: - break; + 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 { - path: yield io6.which("tar", true), - type: constants_1.ArchiveToolType.GNU - }; - }); + } + return true; } - function getTarArgs(tarPath, compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - 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 (type2) { - case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "--files-from", constants_1.ManifestFilename); - break; - case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path12.sep}`, "g"), "/")); - break; - case "list": - args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path12.sep}`, "g"), "/"), "-P"); - break; + validators.uniqueItems = function validateUniqueItems(instance, schema2, options, ctx) { + if (schema2.uniqueItems !== true) return; + if (!this.types.array(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!instance.every(testArrays)) { + result.addError({ + name: "uniqueItems", + message: "contains duplicate item" + }); + } + return result; + }; + validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { + if (!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema2, options, ctx); + for (var property in schema2.dependencies) { + if (instance[property] === void 0) { + continue; } - 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; - } + var dep = schema2.dependencies[property]; + var childContext = ctx.makeChild(dep, property); + if (typeof dep == "string") { + dep = [dep]; } - return args; - }); - } - function getCommands(compressionMethod, type2, archivePath = "") { - return __awaiter4(this, void 0, void 0, function* () { - let args; - const tarPath = yield getTarPath(); - const tarArgs = yield getTarArgs(tarPath, compressionMethod, type2, archivePath); - const compressionArgs = type2 !== "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 && type2 !== "create") { - args = [[...compressionArgs].join(" "), [...tarArgs].join(" ")]; + 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 { - args = [[...tarArgs].join(" "), [...compressionArgs].join(" ")]; - } - if (BSD_TAR_ZSTD) { - return args; + 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 [args.join(" ")]; - }); - } - function getWorkingDirectory() { - var _a; - return (_a = process.env["GITHUB_WORKSPACE"]) !== null && _a !== void 0 ? _a : process.cwd(); - } - function getDecompressionProgram(tarPath, compressionMethod, archivePath) { - return __awaiter4(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(`\\${path12.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(`\\${path12.sep}`, "g"), "/") - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -d"' : "unzstd"]; - default: - return ["-z"]; + } + return result; + }; + validators["enum"] = function validateEnum(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + if (!Array.isArray(schema2["enum"])) { + throw new SchemaError("enum expects an array", schema2); + } + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { + result.addError({ + name: "enum", + argument: schema2["enum"], + message: "is not one of enum values: " + schema2["enum"].map(String).join(",") + }); + } + return result; + }; + validators["const"] = function validateEnum(instance, schema2, options, ctx) { + if (instance === void 0) { + return null; + } + var result = new ValidatorResult(instance, schema2, options, ctx); + if (!helpers.deepCompareStrict(schema2["const"], instance)) { + result.addError({ + name: "const", + argument: schema2["const"], + message: "does not exactly match expected constant: " + schema2["const"] + }); + } + return result; + }; + validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { + var self2 = this; + if (instance === void 0) return null; + var result = new ValidatorResult(instance, schema2, options, ctx); + var notTypes = schema2.not || schema2.disallow; + if (!notTypes) return null; + if (!Array.isArray(notTypes)) notTypes = [notTypes]; + notTypes.forEach(function(type2) { + if (self2.testType(instance, schema2, options, ctx, type2)) { + var id = type2 && (type2.$id || type2.id); + var schemaId = id || type2; + 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 urilib = require("url"); + var helpers = require_helpers3(); + module2.exports.SchemaScanResult = SchemaScanResult; + function SchemaScanResult(found, ref) { + this.id = found; + this.ref = ref; } - function getCompressionProgram(tarPath, compressionMethod) { - return __awaiter4(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(`\\${path12.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(`\\${path12.sep}`, "g"), "/"), - constants_1.TarFilename - ] : ["--use-compress-program", IS_WINDOWS ? '"zstd -T0"' : "zstdmt"]; - default: - return ["-z"]; + module2.exports.scan = function scan(base, schema2) { + function scanSchema(baseuri, schema3) { + if (!schema3 || typeof schema3 != "object") return; + if (schema3.$ref) { + var resolvedUri = urilib.resolve(baseuri, schema3.$ref); + ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; + return; } - }); - } - function execCommands(commands, cwd) { - return __awaiter4(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 (error4) { - throw new Error(`${command.split(" ")[0]} failed with error: ${error4 === null || error4 === void 0 ? void 0 : error4.message}`); + var id = schema3.$id || schema3.id; + var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; + if (ourBase) { + if (ourBase.indexOf("#") < 0) ourBase += "#"; + if (found[ourBase]) { + if (!helpers.deepCompareStrict(found[ourBase], schema3)) { + throw new Error("Schema <" + ourBase + "> already exists with different definition"); + } + return found[ourBase]; + } + found[ourBase] = schema3; + if (ourBase[ourBase.length - 1] == "#") { + found[ourBase.substring(0, ourBase.length - 1)] = schema3; } } - }); - } - function listTar(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const commands = yield getCommands(compressionMethod, "list", archivePath); - yield execCommands(commands); - }); - } - exports2.listTar = listTar; - function extractTar2(archivePath, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - const workingDirectory = getWorkingDirectory(); - yield io6.mkdirP(workingDirectory); - const commands = yield getCommands(compressionMethod, "extract", archivePath); - yield execCommands(commands); - }); - } - exports2.extractTar = extractTar2; - function createTar(archiveFolder, sourceDirectories, compressionMethod) { - return __awaiter4(this, void 0, void 0, function* () { - (0, fs_1.writeFileSync)(path12.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join("\n")); - const commands = yield getCommands(compressionMethod, "create"); - yield execCommands(commands, archiveFolder); - }); - } - exports2.createTar = createTar; + scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); + scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); + scanSchema(ourBase + "/additionalItems", schema3.additionalItems); + scanObject(ourBase + "/properties", schema3.properties); + scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); + scanObject(ourBase + "/definitions", schema3.definitions); + scanObject(ourBase + "/patternProperties", schema3.patternProperties); + scanObject(ourBase + "/dependencies", schema3.dependencies); + scanArray(ourBase + "/disallow", schema3.disallow); + scanArray(ourBase + "/allOf", schema3.allOf); + scanArray(ourBase + "/anyOf", schema3.anyOf); + scanArray(ourBase + "/oneOf", schema3.oneOf); + scanSchema(ourBase + "/not", schema3.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, schema2); + return new SchemaScanResult(found, ref); + }; } }); -// node_modules/@actions/cache/lib/cache.js -var require_cache3 = __commonJS({ - "node_modules/@actions/cache/lib/cache.js"(exports2) { +// node_modules/jsonschema/lib/validator.js +var require_validator = __commonJS({ + "node_modules/jsonschema/lib/validator.js"(exports2, module2) { "use strict"; - var __createBinding4 = 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]; - } }; + var urilib = require("url"); + var attribute = require_attribute(); + var helpers = require_helpers3(); + 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(types); + 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(schema2, base) { + var self2 = this; + if (!schema2) { + return null; } - Object.defineProperty(o, k2, desc); - }) : (function(o, m, k, k2) { - if (k2 === void 0) k2 = k; - o[k2] = m[k]; - })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); + var scan = scanSchema(base || anonymousBase, schema2); + var ourUri = base || schema2.$id || schema2.id; + for (var uri in scan.id) { + this.schemas[uri] = scan.id[uri]; } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); + for (var uri in scan.ref) { + this.unresolvedRefs.push(uri); } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); + this.unresolvedRefs = this.unresolvedRefs.filter(function(uri2) { + return typeof self2.schemas[uri2] === "undefined"; }); + return this.schemas[ourUri]; }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.saveCache = exports2.restoreCache = exports2.isFeatureAvailable = exports2.FinalizeCacheError = exports2.ReserveCacheError = exports2.ValidationError = void 0; - var core14 = __importStar4(require_core()); - var path12 = __importStar4(require("path")); - var utils = __importStar4(require_cacheUtils()); - var cacheHttpClient = __importStar4(require_cacheHttpClient()); - var cacheTwirpClient = __importStar4(require_cacheTwirpClient()); - var config_1 = require_config(); - var tar_1 = require_tar(); - var http_client_1 = require_lib3(); - var ValidationError = class _ValidationError extends Error { - constructor(message) { - super(message); - this.name = "ValidationError"; - Object.setPrototypeOf(this, _ValidationError.prototype); + 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]); } }; - exports2.ValidationError = ValidationError; - var ReserveCacheError = class _ReserveCacheError extends Error { - constructor(message) { - super(message); - this.name = "ReserveCacheError"; - Object.setPrototypeOf(this, _ReserveCacheError.prototype); + Validator3.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { + if (!schemas || typeof schemas != "object") return; + for (var p in schemas) { + this.addSubSchema(baseuri, schemas[p]); } }; - exports2.ReserveCacheError = ReserveCacheError; - var FinalizeCacheError = class _FinalizeCacheError extends Error { - constructor(message) { - super(message); - this.name = "FinalizeCacheError"; - Object.setPrototypeOf(this, _FinalizeCacheError.prototype); - } + Validator3.prototype.setSchemas = function setSchemas(schemas) { + this.schemas = schemas; }; - 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.`); + Validator3.prototype.getSchema = function getSchema(urn) { + return this.schemas[urn]; + }; + Validator3.prototype.validate = function validate(instance, schema2, options, ctx) { + if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { + throw new SchemaError("Expected `schema` to be an object or boolean"); } - } - 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"]; + if (!options) { + options = {}; } - } - exports2.isFeatureAvailable = isFeatureAvailable; - function restoreCache3(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - switch (cacheServiceVersion) { - case "v2": - return yield restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - case "v1": - default: - return yield restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive); - } - }); - } - exports2.restoreCache = restoreCache3; - function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.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 { - const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, { - compressionMethod, - enableCrossOsArchive - }); - if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) { - return void 0; - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); - return cacheEntry.cacheKey; - } - archivePath = path12.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); - return cacheEntry.cacheKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); - } else { - core14.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); - } - } - return void 0; - }); - } - function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - options = Object.assign(Object.assign({}, options), { useAzureSdk: true }); - restoreKeys = restoreKeys || []; - const keys = [primaryKey, ...restoreKeys]; - core14.debug("Resolved Keys:"); - core14.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 request = { - key: primaryKey, - restoreKeys, - version: utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive) - }; - const response = yield twirpClient.GetCacheEntryDownloadURL(request); - if (!response.ok) { - core14.debug(`Cache not found for version ${request.version} of keys: ${keys.join(", ")}`); - return void 0; - } - const isRestoreKeyMatch = request.key !== response.matchedKey; - if (isRestoreKeyMatch) { - core14.info(`Cache hit for restore-key: ${response.matchedKey}`); - } else { - core14.info(`Cache hit for: ${response.matchedKey}`); - } - if (options === null || options === void 0 ? void 0 : options.lookupOnly) { - core14.info("Lookup only - skipping download"); - return response.matchedKey; - } - archivePath = path12.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive path: ${archivePath}`); - core14.debug(`Starting download of archive to: ${archivePath}`); - yield cacheHttpClient.downloadCache(response.signedDownloadUrl, archivePath, options); - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - yield (0, tar_1.extractTar)(archivePath, compressionMethod); - core14.info("Cache restored successfully"); - return response.matchedKey; - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to restore: ${error4.message}`); - } else { - core14.warning(`Failed to restore: ${error4.message}`); - } - } - } finally { - try { - if (archivePath) { - yield utils.unlinkFile(archivePath); - } - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); - } + var id = schema2.$id || schema2.id; + var base = urilib.resolve(options.base || anonymousBase, id || ""); + if (!ctx) { + ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); + if (!ctx.schemas[base]) { + ctx.schemas[base] = schema2; } - return void 0; - }); - } - function saveCache3(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); - core14.debug(`Cache service version: ${cacheServiceVersion}`); - checkPaths(paths); - checkKey(key); - switch (cacheServiceVersion) { - case "v2": - return yield saveCacheV2(paths, key, options, enableCrossOsArchive); - case "v1": - default: - return yield saveCacheV1(paths, key, options, enableCrossOsArchive); + var found = scanSchema(base, schema2); + 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, schema2, options, ctx); + result.addError("is required, but is undefined"); + return result; + } + var result = this.validateSchema(instance, schema2, options, ctx); + if (!result) { + throw new Error("Result undefined"); + } else if (options.throwAll && result.errors.length) { + throw new ValidatorResultError(result); + } + return result; + }; + function shouldResolve(schema2) { + var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; + if (typeof ref == "string") return ref; + return false; } - exports2.saveCache = saveCache3; - function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { - var _a, _b, _c, _d, _e; - return __awaiter4(this, void 0, void 0, function* () { - const compressionMethod = yield utils.getCompressionMethod(); - let cacheId = -1; - const cachePaths = yield utils.resolvePaths(paths); - core14.debug("Cache Paths:"); - core14.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 = path12.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const fileSizeLimit = 10 * 1024 * 1024 * 1024; - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.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.`); - } - core14.debug("Reserving Cache"); - const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, { - compressionMethod, - enableCrossOsArchive, - cacheSize: archiveFileSize - }); - if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.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 { - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`); - } - core14.debug(`Saving Cache (ID: ${cacheId})`); - yield cacheHttpClient.saveCache(cacheId, archivePath, "", options); - } catch (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); - } - } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); - } + Validator3.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { + var result = new ValidatorResult(instance, schema2, options, ctx); + if (typeof schema2 === "boolean") { + if (schema2 === true) { + schema2 = {}; + } else if (schema2 === false) { + schema2 = { type: [] }; } - return cacheId; - }); - } - function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { - return __awaiter4(this, void 0, void 0, function* () { - 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); - core14.debug("Cache Paths:"); - core14.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.`); + } else if (!schema2) { + throw new Error("schema is undefined"); + } + if (schema2["extends"]) { + if (Array.isArray(schema2["extends"])) { + var schemaobj = { schema: schema2, ctx }; + schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); + schema2 = schemaobj.schema; + schemaobj.schema = null; + schemaobj.ctx = null; + schemaobj = null; + } else { + schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); } - const archiveFolder = yield utils.createTempDirectory(); - const archivePath = path12.join(archiveFolder, utils.getCacheFileName(compressionMethod)); - core14.debug(`Archive Path: ${archivePath}`); - try { - yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod); - if (core14.isDebug()) { - yield (0, tar_1.listTar)(archivePath, compressionMethod); - } - const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath); - core14.debug(`File Size: ${archiveFileSize}`); - options.archiveSizeBytes = archiveFileSize; - core14.debug("Reserving Cache"); - const version = utils.getCacheVersion(paths, compressionMethod, enableCrossOsArchive); - const request = { - key, - version - }; - let signedUploadUrl; - try { - const response = yield twirpClient.CreateCacheEntry(request); - if (!response.ok) { - if (response.message) { - core14.warning(`Cache reservation failed: ${response.message}`); - } - throw new Error(response.message || "Response was not ok"); - } - signedUploadUrl = response.signedUploadUrl; - } catch (error4) { - core14.debug(`Failed to reserve cache: ${error4}`); - throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`); - } - core14.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); - core14.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 (error4) { - const typedError = error4; - if (typedError.name === ValidationError.name) { - throw error4; - } else if (typedError.name === ReserveCacheError.name) { - core14.info(`Failed to save: ${typedError.message}`); - } else if (typedError.name === FinalizeCacheError.name) { - core14.warning(typedError.message); - } else { - if (typedError instanceof http_client_1.HttpClientError && typeof typedError.statusCode === "number" && typedError.statusCode >= 500) { - core14.error(`Failed to save: ${typedError.message}`); - } else { - core14.warning(`Failed to save: ${typedError.message}`); - } + } + var switchSchema = shouldResolve(schema2); + if (switchSchema) { + var resolved = this.resolve(schema2, 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 schema2) { + if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { + var validatorErr = null; + var validator = this.attributes[key]; + if (validator) { + validatorErr = validator.call(this, instance, schema2, options, ctx); + } else if (options.allowUnknownAttributes === false) { + throw new SchemaError("Unsupported attribute: " + key, schema2); } - } finally { - try { - yield utils.unlinkFile(archivePath); - } catch (error4) { - core14.debug(`Failed to delete archive: ${error4}`); + if (validatorErr) { + result.importErrors(validatorErr); } } - return cacheId; - }); - } - } -}); - -// node_modules/jsonschema/lib/helpers.js -var require_helpers3 = __commonJS({ - "node_modules/jsonschema/lib/helpers.js"(exports2, module2) { - "use strict"; - var uri = require("url"); - var ValidationError = exports2.ValidationError = function ValidationError2(message, instance, schema2, path12, name, argument) { - if (Array.isArray(path12)) { - this.path = path12; - this.property = path12.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else if (path12 !== void 0) { - this.property = path12; - } - if (message) { - this.message = message; - } - if (schema2) { - var id = schema2.$id || schema2.id; - this.schema = id || schema2; } - if (instance !== void 0) { - this.instance = instance; + if (typeof options.rewrite == "function") { + var value = options.rewrite.call(this, instance, schema2, options, ctx); + result.instance = value; } - this.name = name; - this.argument = argument; - this.stack = this.toString(); + return result; }; - ValidationError.prototype.toString = function toString3() { - return this.property + " " + this.message; + Validator3.prototype.schemaTraverser = function schemaTraverser(schemaobj, s) { + schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); }; - var ValidatorResult = exports2.ValidatorResult = function ValidatorResult2(instance, schema2, options, ctx) { - this.instance = instance; - this.schema = schema2; - 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; + Validator3.prototype.superResolve = function superResolve(schema2, ctx) { + var ref = shouldResolve(schema2); + if (ref) { + return this.resolve(schema2, ref, ctx).subschema; + } + return schema2; }; - 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); + Validator3.prototype.resolve = function resolve6(schema2, switchSchema, ctx) { + switchSchema = ctx.resolve(switchSchema); + if (ctx.schemas[switchSchema]) { + return { subschema: ctx.schemas[switchSchema], switchSchema }; } - this.errors.push(err); - if (this.throwFirst) { - throw new ValidatorResultError(this); - } else if (this.throwError) { - throw err; + var parsed = urilib.parse(switchSchema); + var fragment = parsed && 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 + ">", schema2); } - 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); + var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); + if (subschema === void 0) { + throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); } + return { subschema, switchSchema }; }; - function stringizer(v, i) { - return i + ": " + v.toString() + "\n"; - } - ValidatorResult.prototype.toString = function toString3(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 (Error.captureStackTrace) { - Error.captureStackTrace(this, ValidatorResultError); + Validator3.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { + if (type2 === void 0) { + return; + } else if (type2 === null) { + throw new SchemaError('Unexpected null in "type" keyword'); } - 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, schema2) { - this.message = msg; - this.schema = schema2; - Error.call(this, msg); - Error.captureStackTrace(this, SchemaError2); - }; - SchemaError.prototype = Object.create( - Error.prototype, - { - constructor: { value: SchemaError, enumerable: false }, - name: { value: "SchemaError", enumerable: false } + if (typeof this.types[type2] == "function") { + return this.types[type2].call(this, instance); } - ); - var SchemaContext = exports2.SchemaContext = function SchemaContext2(schema2, options, path12, base, schemas) { - this.schema = schema2; - this.options = options; - if (Array.isArray(path12)) { - this.path = path12; - this.propertyPath = path12.reduce(function(sum, item) { - return sum + makeSuffix(item); - }, "instance"); - } else { - this.propertyPath = path12; + if (type2 && typeof type2 == "object") { + var res = this.validateSchema(instance, type2, options, ctx); + return res === void 0 || !(res && res.errors.length); } - this.base = base; - this.schemas = schemas; + return true; }; - SchemaContext.prototype.resolve = function resolve6(target) { - return uri.resolve(this.base, target); + var types = Validator3.prototype.types = {}; + types.string = function testString(instance) { + return typeof instance == "string"; }; - SchemaContext.prototype.makeChild = function makeChild(schema2, propertyName) { - var path12 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); - var id = schema2.$id || schema2.id; - var base = uri.resolve(this.base, id || ""); - var ctx = new SchemaContext(schema2, this.options, path12, base, Object.create(this.schemas)); - if (id && !ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - return ctx; + types.number = function testNumber(instance) { + return typeof instance == "number" && isFinite(instance); }; - 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]+$/ + types.integer = function testInteger(instance) { + return typeof instance == "number" && instance % 1 === 0; }; - 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); - } + types.boolean = function testBoolean(instance) { + return typeof instance == "boolean"; + }; + types.array = function testArray(instance) { + return Array.isArray(instance); + }; + types["null"] = function testNull(instance) { + return instance === null; + }; + types.date = function testDate(instance) { + return instance instanceof Date; + }; + types.any = function testAny(instance) { return true; }; - var makeSuffix = exports2.makeSuffix = function makeSuffix2(key) { - key = key.toString(); - if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { - return "." + key; + types.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_lib4 = __commonJS({ + "node_modules/jsonschema/lib/index.js"(exports2, module2) { + "use strict"; + var Validator3 = module2.exports.Validator = require_validator(); + module2.exports.ValidatorResult = require_helpers3().ValidatorResult; + module2.exports.ValidatorResultError = require_helpers3().ValidatorResultError; + module2.exports.ValidationError = require_helpers3().ValidationError; + module2.exports.SchemaError = require_helpers3().SchemaError; + module2.exports.SchemaScanResult = require_scan().SchemaScanResult; + module2.exports.scan = require_scan().scan; + module2.exports.validate = function(instance, schema2, options) { + var v = new Validator3(); + return v.validate(instance, schema2, options); + }; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/utils.js +var require_utils8 = __commonJS({ + "node_modules/@actions/tool-cache/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; } - if (key.match(/^\d+$/)) { - return "[" + key + "]"; + return JSON.stringify(input); + } + exports2.toCommandValue = toCommandValue; + function toCommandProperties(annotationProperties) { + if (!Object.keys(annotationProperties).length) { + return {}; } - return "[" + JSON.stringify(key) + "]"; - }; - exports2.deepCompareStrict = function deepCompareStrict(a, b) { - if (typeof a !== typeof b) { - return false; + 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/tool-cache/node_modules/@actions/core/lib/command.js +var require_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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]; + } }; } - 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]); - }); + 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); } - if (typeof a === "object") { - if (!a || !b) { - return a === b; + __setModuleDefault2(result, mod); + return result; + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.issue = exports2.issueCommand = void 0; + var os3 = __importStar2(require("os")); + var utils_1 = require_utils8(); + function issueCommand(command, properties, message) { + const cmd = new Command(command, properties, message); + process.stdout.write(cmd.toString() + os3.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"; } - var aKeys = Object.keys(a); - var bKeys = Object.keys(b); - if (aKeys.length !== bKeys.length) { - return false; + 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)}`; + } + } + } } - return aKeys.every(function(v) { - return deepCompareStrict(a[v], b[v]); - }); + cmdStr += `${CMD_STRING}${escapeData(this.message)}`; + return cmdStr; } - 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 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/tool-cache/node_modules/@actions/core/lib/file-command.js +var require_file_command3 = __commonJS({ + "node_modules/@actions/tool-cache/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 crypto2 = __importStar2(require("crypto")); + var fs13 = __importStar2(require("fs")); + var os3 = __importStar2(require("os")); + var utils_1 = require_utils8(); + 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 (!fs13.existsSync(filePath)) { + throw new Error(`Missing file at path: ${filePath}`); } + fs13.appendFileSync(filePath, `${(0, utils_1.toCommandValue)(message)}${os3.EOL}`, { + encoding: "utf8" + }); } - function copyist(src, dst, key) { - dst[key] = src[key]; + exports2.issueFileCommand = issueFileCommand; + function prepareKeyValueMessage(key, value) { + const delimiter = `ghadelimiter_${crypto2.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}${os3.EOL}${convertedValue}${os3.EOL}${delimiter}`; } - 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]; + exports2.prepareKeyValueMessage = prepareKeyValueMessage; + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js +var require_proxy4 = __commonJS({ + "node_modules/@actions/tool-cache/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 { - dst[key] = deepMerge(target[key], src[key]); + return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + } + })(); + if (proxyVar) { + try { + return new DecodedURL(proxyVar); + } catch (_a) { + if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) + return new DecodedURL(`http://${proxyVar}`); } + } else { + return void 0; } } - function deepMerge(target, src) { - var array = Array.isArray(src); - var dst = array && [] || {}; - if (array) { - 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)); + 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; } - Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); } - return dst; + return false; } - 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.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]"); } - exports2.encodePath = function encodePointer(a) { - return a.map(pathEncoder).join(""); - }; - exports2.getDecimalPlaces = function getDecimalPlaces(number) { - var decimalPlaces = 0; - if (isNaN(number)) return decimalPlaces; - if (typeof number !== "number") { - number = Number(number); + var DecodedURL = class extends URL { + constructor(url2, base) { + super(url2, base); + this._decodedUsername = decodeURIComponent(super.username); + this._decodedPassword = decodeURIComponent(super.password); } - var parts = number.toString().split("e"); - if (parts.length === 2) { - if (parts[1][0] !== "-") { - return decimalPlaces; - } else { - decimalPlaces = Number(parts[1].slice(1)); - } + get username() { + return this._decodedUsername; } - var decimalParts = parts[0].split("."); - if (decimalParts.length === 2) { - decimalPlaces += decimalParts[1].length; + get password() { + return this._decodedPassword; } - return decimalPlaces; - }; - exports2.isSchema = function isSchema(val2) { - return typeof val2 === "object" && val2 || typeof val2 === "boolean"; }; } }); -// node_modules/jsonschema/lib/attribute.js -var require_attribute = __commonJS({ - "node_modules/jsonschema/lib/attribute.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js +var require_lib5 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { "use strict"; - var helpers = require_helpers3(); - 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, schema2, options, ctx) { - if (instance === void 0) { - return null; + 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]; + } }; } - var result = new ValidatorResult(instance, schema2, options, ctx); - var types = Array.isArray(schema2.type) ? schema2.type : [schema2.type]; - if (!types.some(this.testType.bind(this, instance, schema2, options, ctx))) { - var list = types.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 - }); + 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; }; - function testSchemaNoThrow(instance, options, ctx, callback, schema2) { - var throwError2 = options.throwError; - var throwAll = options.throwAll; - options.throwError = false; - options.throwAll = false; - var res = this.validateSchema(instance, schema2, options, ctx); - options.throwError = throwError2; - options.throwAll = throwAll; - if (!res.valid && callback instanceof Function) { - callback(res); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - return res.valid; + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 https2 = __importStar2(require("https")); + var pm = __importStar2(require_proxy4()); + 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 : ""; } - validators.anyOf = function validateAnyOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + 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); } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - if (!Array.isArray(schema2.anyOf)) { - throw new SchemaError("anyOf must be an array"); + }; + exports2.HttpClientError = HttpClientError; + var HttpClientResponse = class { + constructor(message) { + this.message = message; } - if (!schema2.anyOf.some( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - )) { - var list = schema2.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 + "]"; + readBody() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __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", () => { + resolve6(output.toString()); + }); + })); }); - if (options.nestedErrors) { - result.importErrors(inner); - } - result.addError({ - name: "anyOf", - argument: list, - message: "is not any of " + list.join(",") + } + readBodyBuffer() { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => __awaiter2(this, void 0, void 0, function* () { + const chunks = []; + this.message.on("data", (chunk) => { + chunks.push(chunk); + }); + this.message.on("end", () => { + resolve6(Buffer.concat(chunks)); + }); + })); }); } - return result; }; - validators.allOf = function validateAllOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + exports2.HttpClientResponse = HttpClientResponse; + function isHttps(requestUrl) { + const parsedUrl = new URL(requestUrl); + return parsedUrl.protocol === "https:"; + } + exports2.isHttps = isHttps; + var HttpClient2 = class { + constructor(userAgent, 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 = userAgent; + 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; + } + } } - if (!Array.isArray(schema2.allOf)) { - throw new SchemaError("allOf must be an array"); + options(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); + }); } - var result = new ValidatorResult(instance, schema2, options, ctx); - var self2 = this; - schema2.allOf.forEach(function(v, i) { - var valid3 = self2.validateSchema(instance, v, options, ctx); - if (!valid3.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: valid3.errors.length, valid: valid3 }, - message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" - }); - result.importErrors(valid3); - } - }); - return result; - }; - validators.oneOf = function validateOneOf(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + get(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("GET", requestUrl, null, additionalHeaders || {}); + }); } - if (!Array.isArray(schema2.oneOf)) { - throw new SchemaError("oneOf must be an array"); + del(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("DELETE", requestUrl, null, additionalHeaders || {}); + }); } - var result = new ValidatorResult(instance, schema2, options, ctx); - var inner = new ValidatorResult(instance, schema2, options, ctx); - var count = schema2.oneOf.filter( - testSchemaNoThrow.bind( - this, - instance, - options, - ctx, - function(res) { - inner.importErrors(res); - } - ) - ).length; - var list = schema2.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(",") + post(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("POST", requestUrl, data, additionalHeaders || {}); }); } - return result; - }; - validators.if = function validateIf(instance, schema2, options, ctx) { - if (instance === void 0) return null; - if (!helpers.isSchema(schema2.if)) throw new Error('Expected "if" keyword to be a schema'); - var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema2.if); - var result = new ValidatorResult(instance, schema2, options, ctx); - var res; - if (ifValid) { - if (schema2.then === void 0) return; - if (!helpers.isSchema(schema2.then)) throw new Error('Expected "then" keyword to be a schema'); - res = this.validateSchema(instance, schema2.then, options, ctx.makeChild(schema2.then)); - result.importErrors(res); - } else { - if (schema2.else === void 0) return; - if (!helpers.isSchema(schema2.else)) throw new Error('Expected "else" keyword to be a schema'); - res = this.validateSchema(instance, schema2.else, options, ctx.makeChild(schema2.else)); - result.importErrors(res); + patch(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PATCH", requestUrl, data, additionalHeaders || {}); + }); } - return result; - }; - function getEnumerableProperty(object, key) { - if (Object.hasOwnProperty.call(object, key)) return object[key]; - if (!(key in object)) return; - while (object = Object.getPrototypeOf(object)) { - if (Object.propertyIsEnumerable.call(object, key)) return object[key]; + put(requestUrl, data, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("PUT", requestUrl, data, additionalHeaders || {}); + }); } - } - validators.propertyNames = function validatePropertyNames(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var subschema = schema2.propertyNames !== void 0 ? schema2.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); - } + head(requestUrl, additionalHeaders) { + return __awaiter2(this, void 0, void 0, function* () { + return this.request("HEAD", requestUrl, null, additionalHeaders || {}); + }); } - return result; - }; - validators.properties = function validateProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var properties = schema2.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); + 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 info6 = 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(info6, data); + if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { + let authenticationHandler; + for (const handler of this.handlers) { + if (handler.canHandleAuthentication(response)) { + authenticationHandler = handler; + break; + } + } + if (authenticationHandler) { + return authenticationHandler.handleAuthentication(this, info6, 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]; + } + } + } + info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); + response = yield this.requestRaw(info6, 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; + }); } - return result; - }; - function testAdditionalProperty(instance, schema2, options, ctx, property, result) { - if (!this.types.object(instance)) return; - if (schema2.properties && schema2.properties[property] !== void 0) { - return; + /** + * Needs to be called if keepAlive is set to true in request options. + */ + dispose() { + if (this._agent) { + this._agent.destroy(); + } + this._disposed = true; } - if (schema2.additionalProperties === false) { - result.addError({ - name: "additionalProperties", - argument: property, - message: "is not allowed to have the additional property " + JSON.stringify(property) + /** + * Raw request. + * @param info + * @param data + */ + requestRaw(info6, data) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => { + function callbackForResult(err, res) { + if (err) { + reject(err); + } else if (!res) { + reject(new Error("Unknown error")); + } else { + resolve6(res); + } + } + this.requestRawWithCallback(info6, data, callbackForResult); + }); }); - } else { - var additionalProperties = schema2.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, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var patternProperties = schema2.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); + /** + * Raw request with callback. + * @param info + * @param data + * @param onResult + */ + requestRawWithCallback(info6, data, onResult) { + if (typeof data === "string") { + if (!info6.options.headers) { + info6.options.headers = {}; } - if (!regexp.test(property)) { - continue; + info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); + } + let callbackCalled = false; + function handleResult(err, res) { + if (!callbackCalled) { + callbackCalled = true; + onResult(err, res); } - test = false; - if (typeof options.preValidateProperty == "function") { - options.preValidateProperty(instance, property, subschema, options, ctx); + } + const req = info6.httpModule.request(info6.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(); } - 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); + handleResult(new Error(`Request timeout: ${info6.options.path}`)); + }); + req.on("error", function(err) { + handleResult(err); + }); + if (data && typeof data === "string") { + req.write(data, "utf8"); } - if (test) { - testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + if (data && typeof data !== "string") { + data.on("close", function() { + req.end(); + }); + data.pipe(req); + } else { + req.end(); } } - return result; - }; - validators.additionalProperties = function validateAdditionalProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - if (schema2.patternProperties) { - return null; + /** + * 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); } - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in instance) { - testAdditionalProperty.call(this, instance, schema2, options, ctx, property, result); + 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); } - return result; - }; - validators.minProperties = function validateMinProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length >= schema2.minProperties)) { - result.addError({ - name: "minProperties", - argument: schema2.minProperties, - message: "does not meet minimum property length of " + schema2.minProperties - }); + _prepareRequest(method, requestUrl, headers) { + const info6 = {}; + info6.parsedUrl = requestUrl; + const usingSsl = info6.parsedUrl.protocol === "https:"; + info6.httpModule = usingSsl ? https2 : http; + const defaultPort = usingSsl ? 443 : 80; + info6.options = {}; + info6.options.host = info6.parsedUrl.hostname; + info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; + info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); + info6.options.method = method; + info6.options.headers = this._mergeHeaders(headers); + if (this.userAgent != null) { + info6.options.headers["user-agent"] = this.userAgent; + } + info6.options.agent = this._getAgent(info6.parsedUrl); + if (this.handlers) { + for (const handler of this.handlers) { + handler.prepareRequest(info6.options); + } + } + return info6; } - return result; - }; - validators.maxProperties = function validateMaxProperties(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var keys = Object.keys(instance); - if (!(keys.length <= schema2.maxProperties)) { - result.addError({ - name: "maxProperties", - argument: schema2.maxProperties, - message: "does not meet maximum property length of " + schema2.maxProperties - }); + _mergeHeaders(headers) { + if (this.requestOptions && this.requestOptions.headers) { + return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + } + return lowercaseKeys(headers || {}); } - return result; - }; - validators.items = function validateItems(instance, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.items === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - instance.every(function(value, i) { - if (Array.isArray(schema2.items)) { - var items = schema2.items[i] === void 0 ? schema2.additionalItems : schema2.items[i]; - } else { - var items = schema2.items; + _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { + let clientHeader; + if (this.requestOptions && this.requestOptions.headers) { + clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; } - if (items === void 0) { - return true; + return additionalHeaders[header] || clientHeader || _default2; + } + _getAgent(parsedUrl) { + let agent; + const proxyUrl = pm.getProxyUrl(parsedUrl); + const useProxy = proxyUrl && proxyUrl.hostname; + if (this._keepAlive && useProxy) { + agent = this._proxyAgent; } - if (items === false) { - result.addError({ - name: "items", - message: "additionalItems not permitted" - }); - return false; + if (!useProxy) { + agent = this._agent; } - 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, schema2, options, ctx) { - var self2 = this; - if (!this.types.array(instance)) return; - if (schema2.contains === void 0) return; - if (!helpers.isSchema(schema2.contains)) throw new Error('Expected "contains" keyword to be a schema'); - var result = new ValidatorResult(instance, schema2, options, ctx); - var count = instance.some(function(value, i) { - var res = self2.validateSchema(value, schema2.contains, options, ctx.makeChild(schema2.contains, i)); - return res.errors.length === 0; - }); - if (count === false) { - result.addError({ - name: "contains", - argument: schema2.contains, - message: "must contain an item matching given schema" - }); - } - return result; - }; - validators.minimum = function validateMinimum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMinimum && schema2.exclusiveMinimum === true) { - if (!(instance > schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than " + schema2.minimum - }); + if (agent) { + return agent; } - } else { - if (!(instance >= schema2.minimum)) { - result.addError({ - name: "minimum", - argument: schema2.minimum, - message: "must be greater than or equal to " + schema2.minimum + 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 https2.Agent(options) : new http.Agent(options); + this._agent = agent; + } + if (usingSsl && this._ignoreSslError) { + agent.options = Object.assign(agent.options || {}, { + rejectUnauthorized: false }); } + return agent; } - return result; - }; - validators.maximum = function validateMaximum(instance, schema2, options, ctx) { - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (schema2.exclusiveMaximum && schema2.exclusiveMaximum === true) { - if (!(instance < schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than " + schema2.maximum - }); + _getProxyAgentDispatcher(parsedUrl, proxyUrl) { + let proxyAgent; + if (this._keepAlive) { + proxyAgent = this._proxyAgentDispatcher; } - } else { - if (!(instance <= schema2.maximum)) { - result.addError({ - name: "maximum", - argument: schema2.maximum, - message: "must be less than or equal to " + schema2.maximum + 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; } - return result; - }; - validators.exclusiveMinimum = function validateExclusiveMinimum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMinimum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid3 = instance > schema2.exclusiveMinimum; - if (!valid3) { - result.addError({ - name: "exclusiveMinimum", - argument: schema2.exclusiveMinimum, - message: "must be strictly greater than " + schema2.exclusiveMinimum - }); - } - return result; - }; - validators.exclusiveMaximum = function validateExclusiveMaximum(instance, schema2, options, ctx) { - if (typeof schema2.exclusiveMaximum === "boolean") return; - if (!this.types.number(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var valid3 = instance < schema2.exclusiveMaximum; - if (!valid3) { - result.addError({ - name: "exclusiveMaximum", - argument: schema2.exclusiveMaximum, - message: "must be strictly less than " + schema2.exclusiveMaximum - }); - } - return result; - }; - var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy2(instance, schema2, options, ctx, validationType, errorMessage) { - if (!this.types.number(instance)) return; - var validationArgument = schema2[validationType]; - if (validationArgument == 0) { - throw new SchemaError(validationType + " cannot be zero"); - } - var result = new ValidatorResult(instance, schema2, 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, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); - }; - validators.divisibleBy = function validateDivisibleBy(instance, schema2, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema2, options, ctx, "divisibleBy", "is not divisible by (multiple of) "); - }; - validators.required = function validateRequired(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (instance === void 0 && schema2.required === true) { - result.addError({ - name: "required", - message: "is required" - }); - } else if (this.types.object(instance) && Array.isArray(schema2.required)) { - schema2.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, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var pattern = schema2.pattern; - try { - var regexp = new RegExp(pattern, "u"); - } catch (_e) { - regexp = new RegExp(pattern); - } - if (!instance.match(regexp)) { - result.addError({ - name: "pattern", - argument: schema2.pattern, - message: "does not match pattern " + JSON.stringify(schema2.pattern.toString()) - }); - } - return result; - }; - validators.format = function validateFormat(instance, schema2, options, ctx) { - if (instance === void 0) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!result.disableFormat && !helpers.isFormat(instance, schema2.format, this)) { - result.addError({ - name: "format", - argument: schema2.format, - message: "does not conform to the " + JSON.stringify(schema2.format) + " format" - }); - } - return result; - }; - validators.minLength = function validateMinLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length >= schema2.minLength)) { - result.addError({ - name: "minLength", - argument: schema2.minLength, - message: "does not meet minimum length of " + schema2.minLength + _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((resolve6) => setTimeout(() => resolve6(), ms)); }); } - return result; - }; - validators.maxLength = function validateMaxLength(instance, schema2, options, ctx) { - if (!this.types.string(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - var hsp = instance.match(/[\uDC00-\uDFFF]/g); - var length = instance.length - (hsp ? hsp.length : 0); - if (!(length <= schema2.maxLength)) { - result.addError({ - name: "maxLength", - argument: schema2.maxLength, - message: "does not meet maximum length of " + schema2.maxLength + _processResponse(res, options) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6, reject) => __awaiter2(this, void 0, void 0, function* () { + const statusCode = res.message.statusCode || 0; + const response = { + statusCode, + result: null, + headers: {} + }; + if (statusCode === HttpCodes.NotFound) { + resolve6(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 { + resolve6(response); + } + })); }); } - return result; }; - validators.minItems = function validateMinItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length >= schema2.minItems)) { - result.addError({ - name: "minItems", - argument: schema2.minItems, - message: "does not meet minimum length of " + schema2.minItems + exports2.HttpClient = HttpClient2; + var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + } +}); + +// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/auth.js +var require_auth3 = __commonJS({ + "node_modules/@actions/tool-cache/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(resolve6) { + resolve6(value); }); } - return result; + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); }; - validators.maxItems = function validateMaxItems(instance, schema2, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!(instance.length <= schema2.maxItems)) { - result.addError({ - name: "maxItems", - argument: schema2.maxItems, - message: "does not meet maximum length of " + schema2.maxItems - }); + 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; } - 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; + prepareRequest(options) { + if (!options.headers) { + throw Error("The request has no headers"); } + options.headers["Authorization"] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString("base64")}`; } - return true; - } - validators.uniqueItems = function validateUniqueItems(instance, schema2, options, ctx) { - if (schema2.uniqueItems !== true) return; - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!instance.every(testArrays)) { - result.addError({ - name: "uniqueItems", - message: "contains duplicate item" + // This handler cannot handle 401 + canHandleAuthentication() { + return false; + } + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - return result; }; - validators.dependencies = function validateDependencies(instance, schema2, options, ctx) { - if (!this.types.object(instance)) return; - var result = new ValidatorResult(instance, schema2, options, ctx); - for (var property in schema2.dependencies) { - if (instance[property] === void 0) { - continue; - } - var dep = schema2.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); - } - } + exports2.BasicCredentialHandler = BasicCredentialHandler; + var BearerCredentialHandler = class { + constructor(token) { + this.token = token; } - return result; - }; - validators["enum"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + // 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}`; } - if (!Array.isArray(schema2["enum"])) { - throw new SchemaError("enum expects an array", schema2); + // This handler cannot handle 401 + canHandleAuthentication() { + return false; } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!schema2["enum"].some(helpers.deepCompareStrict.bind(null, instance))) { - result.addError({ - name: "enum", - argument: schema2["enum"], - message: "is not one of enum values: " + schema2["enum"].map(String).join(",") + handleAuthentication() { + return __awaiter2(this, void 0, void 0, function* () { + throw new Error("not implemented"); }); } - return result; }; - validators["const"] = function validateEnum(instance, schema2, options, ctx) { - if (instance === void 0) { - return null; + exports2.BearerCredentialHandler = BearerCredentialHandler; + var PersonalAccessTokenCredentialHandler = class { + constructor(token) { + this.token = token; } - var result = new ValidatorResult(instance, schema2, options, ctx); - if (!helpers.deepCompareStrict(schema2["const"], instance)) { - result.addError({ - name: "const", - argument: schema2["const"], - message: "does not exactly match expected constant: " + schema2["const"] + // 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"); }); } - return result; - }; - validators.not = validators.disallow = function validateNot(instance, schema2, options, ctx) { - var self2 = this; - if (instance === void 0) return null; - var result = new ValidatorResult(instance, schema2, options, ctx); - var notTypes = schema2.not || schema2.disallow; - if (!notTypes) return null; - if (!Array.isArray(notTypes)) notTypes = [notTypes]; - notTypes.forEach(function(type2) { - if (self2.testType(instance, schema2, options, ctx, type2)) { - var id = type2 && (type2.$id || type2.id); - var schemaId = id || type2; - result.addError({ - name: "not", - argument: schemaId, - message: "is of prohibited type " + schemaId - }); - } - }); - return result; }; - module2.exports = attribute; + exports2.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler; } }); -// node_modules/jsonschema/lib/scan.js -var require_scan = __commonJS({ - "node_modules/jsonschema/lib/scan.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js +var require_oidc_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/oidc-utils.js"(exports2) { "use strict"; - var urilib = require("url"); - var helpers = require_helpers3(); - module2.exports.SchemaScanResult = SchemaScanResult; - function SchemaScanResult(found, ref) { - this.id = found; - this.ref = ref; - } - module2.exports.scan = function scan(base, schema2) { - function scanSchema(baseuri, schema3) { - if (!schema3 || typeof schema3 != "object") return; - if (schema3.$ref) { - var resolvedUri = urilib.resolve(baseuri, schema3.$ref); - ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri] + 1 : 0; - return; - } - var id = schema3.$id || schema3.id; - var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; - if (ourBase) { - if (ourBase.indexOf("#") < 0) ourBase += "#"; - if (found[ourBase]) { - if (!helpers.deepCompareStrict(found[ourBase], schema3)) { - throw new Error("Schema <" + ourBase + "> already exists with different definition"); - } - return found[ourBase]; + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); } - found[ourBase] = schema3; - if (ourBase[ourBase.length - 1] == "#") { - found[ourBase.substring(0, ourBase.length - 1)] = schema3; + } + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); } } - scanArray(ourBase + "/items", Array.isArray(schema3.items) ? schema3.items : [schema3.items]); - scanArray(ourBase + "/extends", Array.isArray(schema3.extends) ? schema3.extends : [schema3.extends]); - scanSchema(ourBase + "/additionalItems", schema3.additionalItems); - scanObject(ourBase + "/properties", schema3.properties); - scanSchema(ourBase + "/additionalProperties", schema3.additionalProperties); - scanObject(ourBase + "/definitions", schema3.definitions); - scanObject(ourBase + "/patternProperties", schema3.patternProperties); - scanObject(ourBase + "/dependencies", schema3.dependencies); - scanArray(ourBase + "/disallow", schema3.disallow); - scanArray(ourBase + "/allOf", schema3.allOf); - scanArray(ourBase + "/anyOf", schema3.anyOf); - scanArray(ourBase + "/oneOf", schema3.oneOf); - scanSchema(ourBase + "/not", schema3.not); + function step(result) { + result.done ? resolve6(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_auth3(); + 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); } - function scanArray(baseuri, schemas) { - if (!Array.isArray(schemas)) return; - for (var i = 0; i < schemas.length; i++) { - scanSchema(baseuri + "/" + i, schemas[i]); + 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; } - function scanObject(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - scanSchema(baseuri + "/" + p, schemas[p]); + 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 _a; + 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 = (_a = res.result) === null || _a === void 0 ? void 0 : _a.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}`); + } + }); } - var found = {}; - var ref = {}; - scanSchema(base, schema2); - return new SchemaScanResult(found, ref); }; + exports2.OidcClient = OidcClient; } }); -// node_modules/jsonschema/lib/validator.js -var require_validator2 = __commonJS({ - "node_modules/jsonschema/lib/validator.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js +var require_summary3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/summary.js"(exports2) { "use strict"; - var urilib = require("url"); - var attribute = require_attribute(); - var helpers = require_helpers3(); - 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(types); - 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(schema2, base) { - var self2 = this; - if (!schema2) { - return null; - } - var scan = scanSchema(base || anonymousBase, schema2); - var ourUri = base || schema2.$id || schema2.id; - for (var uri in scan.id) { - this.schemas[uri] = scan.id[uri]; - } - for (var uri in scan.ref) { - this.unresolvedRefs.push(uri); + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P ? value : new P(function(resolve6) { + resolve6(value); + }); } - this.unresolvedRefs = this.unresolvedRefs.filter(function(uri2) { - return typeof self2.schemas[uri2] === "undefined"; + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); }); - 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]); + 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 = ""; } - }; - Validator3.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) { - if (!schemas || typeof schemas != "object") return; - for (var p in schemas) { - this.addSubSchema(baseuri, schemas[p]); + /** + * 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 (_a) { + throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`); + } + this._filePath = pathFromEnv; + return this._filePath; + }); } - }; - Validator3.prototype.setSchemas = function setSchemas(schemas) { - this.schemas = schemas; - }; - Validator3.prototype.getSchema = function getSchema(urn) { - return this.schemas[urn]; - }; - Validator3.prototype.validate = function validate(instance, schema2, options, ctx) { - if (typeof schema2 !== "boolean" && typeof schema2 !== "object" || schema2 === null) { - throw new SchemaError("Expected `schema` to be an object or boolean"); + /** + * 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}`; } - if (!options) { - options = {}; + /** + * 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(); + }); } - var id = schema2.$id || schema2.id; - var base = urilib.resolve(options.base || anonymousBase, id || ""); - if (!ctx) { - ctx = new SchemaContext(schema2, options, [], base, Object.create(this.schemas)); - if (!ctx.schemas[base]) { - ctx.schemas[base] = schema2; - } - var found = scanSchema(base, schema2); - for (var n in found.id) { - var sch = found.id[n]; - ctx.schemas[n] = sch; - } + /** + * 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 }); + }); } - if (options.required && instance === void 0) { - var result = new ValidatorResult(instance, schema2, options, ctx); - result.addError("is required, but is undefined"); - return result; + /** + * 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; } - var result = this.validateSchema(instance, schema2, options, ctx); - if (!result) { - throw new Error("Result undefined"); - } else if (options.throwAll && result.errors.length) { - throw new ValidatorResultError(result); + /** + * Resets the summary buffer without writing to summary file + * + * @returns {Summary} summary instance + */ + emptyBuffer() { + this._buffer = ""; + return this; } - return result; - }; - function shouldResolve(schema2) { - var ref = typeof schema2 === "string" ? schema2 : schema2.$ref; - if (typeof ref == "string") return ref; - return false; - } - Validator3.prototype.validateSchema = function validateSchema(instance, schema2, options, ctx) { - var result = new ValidatorResult(instance, schema2, options, ctx); - if (typeof schema2 === "boolean") { - if (schema2 === true) { - schema2 = {}; - } else if (schema2 === false) { - schema2 = { type: [] }; - } - } else if (!schema2) { - throw new Error("schema is undefined"); + /** + * 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; } - if (schema2["extends"]) { - if (Array.isArray(schema2["extends"])) { - var schemaobj = { schema: schema2, ctx }; - schema2["extends"].forEach(this.schemaTraverser.bind(this, schemaobj)); - schema2 = schemaobj.schema; - schemaobj.schema = null; - schemaobj.ctx = null; - schemaobj = null; - } else { - schema2 = helpers.deepMerge(schema2, this.superResolve(schema2["extends"], ctx)); - } + /** + * Adds the operating system-specific end-of-line marker to the buffer + * + * @returns {Summary} summary instance + */ + addEOL() { + return this.addRaw(os_1.EOL); } - var switchSchema = shouldResolve(schema2); - if (switchSchema) { - var resolved = this.resolve(schema2, switchSchema, ctx); - var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas); - return this.validateSchema(instance, resolved.subschema, options, subctx); + /** + * 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(); } - var skipAttributes = options && options.skipAttributes || []; - for (var key in schema2) { - if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) { - var validatorErr = null; - var validator = this.attributes[key]; - if (validator) { - validatorErr = validator.call(this, instance, schema2, options, ctx); - } else if (options.allowUnknownAttributes === false) { - throw new SchemaError("Unsupported attribute: " + key, schema2); - } - if (validatorErr) { - result.importErrors(validatorErr); - } - } + /** + * 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(); } - if (typeof options.rewrite == "function") { - var value = options.rewrite.call(this, instance, schema2, options, ctx); - result.instance = value; + /** + * 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(); } - 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(schema2, ctx) { - var ref = shouldResolve(schema2); - if (ref) { - return this.resolve(schema2, ref, ctx).subschema; + /** + * 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(); } - return schema2; - }; - Validator3.prototype.resolve = function resolve6(schema2, switchSchema, ctx) { - switchSchema = ctx.resolve(switchSchema); - if (ctx.schemas[switchSchema]) { - return { subschema: ctx.schemas[switchSchema], switchSchema }; + /** + * 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(); } - var parsed = urilib.parse(switchSchema); - var fragment = parsed && 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 + ">", schema2); + /** + * 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(); } - var subschema = helpers.objectGetPath(ctx.schemas[document2], fragment.substr(1)); - if (subschema === void 0) { - throw new SchemaError("no such schema " + fragment + " located in <" + document2 + ">", schema2); + /** + * 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(); } - return { subschema, switchSchema }; - }; - Validator3.prototype.testType = function validateType(instance, schema2, options, ctx, type2) { - if (type2 === void 0) { - return; - } else if (type2 === null) { - throw new SchemaError('Unexpected null in "type" keyword'); + /** + * 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(); } - if (typeof this.types[type2] == "function") { - return this.types[type2].call(this, instance); + /** + * 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(); } - if (type2 && typeof type2 == "object") { - var res = this.validateSchema(instance, type2, options, ctx); - return res === void 0 || !(res && res.errors.length); + /** + * 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(); } - return true; - }; - var types = Validator3.prototype.types = {}; - types.string = function testString(instance) { - return typeof instance == "string"; - }; - types.number = function testNumber(instance) { - return typeof instance == "number" && isFinite(instance); - }; - types.integer = function testInteger(instance) { - return typeof instance == "number" && instance % 1 === 0; - }; - types.boolean = function testBoolean(instance) { - return typeof instance == "boolean"; - }; - types.array = function testArray(instance) { - return Array.isArray(instance); - }; - types["null"] = function testNull(instance) { - return instance === null; - }; - types.date = function testDate(instance) { - return instance instanceof Date; - }; - types.any = function testAny(instance) { - return true; - }; - types.object = function testObject(instance) { - return instance && typeof instance === "object" && !Array.isArray(instance) && !(instance instanceof Date); }; - module2.exports = Validator3; + var _summary = new Summary(); + exports2.markdownSummary = _summary; + exports2.summary = _summary; } }); -// node_modules/jsonschema/lib/index.js -var require_lib4 = __commonJS({ - "node_modules/jsonschema/lib/index.js"(exports2, module2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js +var require_path_utils3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/path-utils.js"(exports2) { "use strict"; - var Validator3 = module2.exports.Validator = require_validator2(); - module2.exports.ValidatorResult = require_helpers3().ValidatorResult; - module2.exports.ValidatorResultError = require_helpers3().ValidatorResultError; - module2.exports.ValidationError = require_helpers3().ValidationError; - module2.exports.SchemaError = require_helpers3().SchemaError; - module2.exports.SchemaScanResult = require_scan().SchemaScanResult; - module2.exports.scan = require_scan().scan; - module2.exports.validate = function(instance, schema2, options) { - var v = new Validator3(); - return v.validate(instance, schema2, options); + 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 path12 = __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, path12.sep); + } + exports2.toPlatformPath = toPlatformPath; } }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js -var require_io_util4 = __commonJS({ +var require_io_util3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io-util.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77106,21 +84511,21 @@ var require_io_util4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -77150,14 +84555,14 @@ var require_io_util4 = __commonJS({ var _a; 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 fs13 = __importStar4(require("fs")); - var path12 = __importStar4(require("path")); + var fs13 = __importStar2(require("fs")); + var path12 = __importStar2(require("path")); _a = fs13.promises, exports2.chmod = _a.chmod, exports2.copyFile = _a.copyFile, exports2.lstat = _a.lstat, exports2.mkdir = _a.mkdir, exports2.open = _a.open, exports2.readdir = _a.readdir, exports2.readlink = _a.readlink, exports2.rename = _a.rename, exports2.rm = _a.rm, exports2.rmdir = _a.rmdir, exports2.stat = _a.stat, exports2.symlink = _a.symlink, exports2.unlink = _a.unlink; exports2.IS_WINDOWS = process.platform === "win32"; exports2.UV_FS_O_EXLOCK = 268435456; exports2.READONLY = fs13.constants.O_RDONLY; function exists(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { try { yield exports2.stat(fsPath); } catch (err) { @@ -77171,7 +84576,7 @@ var require_io_util4 = __commonJS({ } exports2.exists = exists; function isDirectory(fsPath, useStat = false) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { const stats = useStat ? yield exports2.stat(fsPath) : yield exports2.lstat(fsPath); return stats.isDirectory(); }); @@ -77189,7 +84594,7 @@ var require_io_util4 = __commonJS({ } exports2.isRooted = isRooted; function tryGetExecutablePath(filePath, extensions) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { let stats = void 0; try { stats = yield exports2.stat(filePath); @@ -77267,10 +84672,10 @@ var require_io_util4 = __commonJS({ }); // node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js -var require_io4 = __commonJS({ +var require_io3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/@actions/io/lib/io.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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]; @@ -77279,21 +84684,21 @@ var require_io4 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -77323,10 +84728,10 @@ var require_io4 = __commonJS({ 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 path12 = __importStar4(require("path")); - var ioUtil = __importStar4(require_io_util4()); + var path12 = __importStar2(require("path")); + var ioUtil = __importStar2(require_io_util3()); function cp(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + 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) { @@ -77353,7 +84758,7 @@ var require_io4 = __commonJS({ } exports2.cp = cp; function mv(source, dest, options = {}) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (yield ioUtil.exists(dest)) { let destExists = true; if (yield ioUtil.isDirectory(dest)) { @@ -77374,7 +84779,7 @@ var require_io4 = __commonJS({ } exports2.mv = mv; function rmRF(inputPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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'); @@ -77394,14 +84799,14 @@ var require_io4 = __commonJS({ } exports2.rmRF = rmRF; function mkdirP(fsPath) { - return __awaiter4(this, void 0, void 0, function* () { + 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 which6(tool, check) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77425,7 +84830,7 @@ var require_io4 = __commonJS({ } exports2.which = which6; function findInPath(tool) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (!tool) { throw new Error("parameter 'tool' is required"); } @@ -77473,7 +84878,7 @@ var require_io4 = __commonJS({ return { force, recursive, copySourceDirectory }; } function cpDirRecursive(sourceDir, destDir, currentDepth, force) { - return __awaiter4(this, void 0, void 0, function* () { + return __awaiter2(this, void 0, void 0, function* () { if (currentDepth >= 255) return; currentDepth++; @@ -77483,290 +84888,65 @@ var require_io4 = __commonJS({ 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 copyFile(srcFile, destFile, force); - } - } - yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); - }); - } - function copyFile(srcFile, destFile, force) { - return __awaiter4(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/tool-cache/lib/manifest.js -var require_manifest = __commonJS({ - "node_modules/@actions/tool-cache/lib/manifest.js"(exports2, module2) { - "use strict"; - var __createBinding4 = 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); - }) : function(o, v) { - o["default"] = v; - }); - var __importStar4 = 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)) __createBinding4(result, mod, k); - } - __setModuleDefault4(result, mod); - return result; - }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P ? value : new P(function(resolve6) { - resolve6(value); - }); - } - return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; - var semver8 = __importStar4(require_semver2()); - var core_1 = require_core(); - var os3 = require("os"); - var cp = require("child_process"); - var fs13 = require("fs"); - function _findMatch(versionSpec, stable, candidates, archFilter) { - return __awaiter4(this, void 0, void 0, function* () { - const platFilter = os3.platform(); - let result; - let match; - let file; - for (const candidate of candidates) { - const version = candidate.version; - (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); - if (semver8.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 = semver8.satisfies(osVersion, item.platform_version); - } - } - return chk; - }); - if (file) { - (0, core_1.debug)(`matched ${candidate.version}`); - match = candidate; - break; - } - } - } - if (match && file) { - result = Object.assign({}, match); - result.files = [file]; - } - return result; - }); - } - exports2._findMatch = _findMatch; - function _getOsVersion() { - const plat = os3.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; - } - exports2._getOsVersion = _getOsVersion; - function _readLinuxVersionFile() { - const lsbReleaseFile = "/etc/lsb-release"; - const osReleaseFile = "/etc/os-release"; - let contents = ""; - if (fs13.existsSync(lsbReleaseFile)) { - contents = fs13.readFileSync(lsbReleaseFile).toString(); - } else if (fs13.existsSync(osReleaseFile)) { - contents = fs13.readFileSync(osReleaseFile).toString(); - } - return contents; - } - exports2._readLinuxVersionFile = _readLinuxVersionFile; - } -}); - -// node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/proxy.js -var require_proxy4 = __commonJS({ - "node_modules/@actions/tool-cache/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 (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + if (srcFileStat.isDirectory()) { + yield cpDirRecursive(srcFile, destFile, currentDepth, force); + } else { + yield copyFile(srcFile, destFile, force); + } } - } else { - return void 0; - } + yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode); + }); } - 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; + function copyFile(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); } - } - 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/tool-cache/node_modules/@actions/http-client/lib/index.js -var require_lib5 = __commonJS({ - "node_modules/@actions/tool-cache/node_modules/@actions/http-client/lib/index.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js +var require_toolrunner3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/toolrunner.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -77794,598 +84974,463 @@ var require_lib5 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy4()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(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", () => { - resolve6(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve6(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(userAgent, 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 = userAgent; - 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; - } + exports2.argStringToArray = exports2.ToolRunner = void 0; + var os3 = __importStar2(require("os")); + var events = __importStar2(require("events")); + var child = __importStar2(require("child_process")); + var path12 = __importStar2(require("path")); + var io6 = __importStar2(require_io3()); + var ioUtil = __importStar2(require_io_util3()); + var timers_1 = require("timers"); + var IS_WINDOWS = process.platform === "win32"; + var ToolRunner6 = 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 || {}; } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); - } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); - }); - } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); - } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); - }); - } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); - } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); - }); - } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); - } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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 __awaiter4(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); - }); + _debug(message) { + if (this.options.listeners && this.options.listeners.debug) { + this.options.listeners.debug(message); + } } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); - } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, data); - redirectsRemaining--; - } - if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) { - return response; + _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}`; } - numTries += 1; - if (numTries < maxTries) { - yield response.readBody(); - yield this._performExponentialBackoff(numTries); + } else if (options.windowsVerbatimArguments) { + cmd += `"${toolPath}"`; + for (const a of args) { + cmd += ` ${a}`; } - } 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(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve6(res); - } + } else { + cmd += this._windowsQuoteCmdArg(toolPath); + for (const a of args) { + cmd += ` ${this._windowsQuoteCmdArg(a)}`; } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; - } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); - } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); - } - } - const req = info6.httpModule.request(info6.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: ${info6.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; + cmd += toolPath; + for (const a of args) { + cmd += ` ${a}`; + } } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); + return cmd; } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; - } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); + _processLineBuffer(data, strBuffer, onLine) { + try { + let s = strBuffer + data.toString(); + let n = s.indexOf(os3.EOL); + while (n > -1) { + const line = s.substring(0, n); + onLine(line); + s = s.substring(n + os3.EOL.length); + n = s.indexOf(os3.EOL); } + return s; + } catch (err) { + this._debug(`error processing line. Failed with error ${err}`); + return ""; } - return info6; } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); + _getSpawnFileName() { + if (IS_WINDOWS) { + if (this._isCmdFile()) { + return process.env["COMSPEC"] || "cmd.exe"; + } } - return lowercaseKeys(headers || {}); + return this.toolPath; } - _getExistingOrDefaultHeader(additionalHeaders, header, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - clientHeader = lowercaseKeys(this.requestOptions.headers)[header]; + _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 additionalHeaders[header] || clientHeader || _default2; + return this.args; } - _getAgent(parsedUrl) { - let agent; - const proxyUrl = pm.getProxyUrl(parsedUrl); - const useProxy = proxyUrl && proxyUrl.hostname; - if (this._keepAlive && useProxy) { - agent = this._proxyAgent; + _endsWith(str2, end) { + return str2.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 (!useProxy) { - agent = this._agent; + if (!arg) { + return '""'; } - if (agent) { - return agent; + const cmdSpecialChars = [ + " ", + " ", + "&", + "(", + ")", + "[", + "]", + "{", + "}", + "^", + "=", + ";", + "!", + "'", + "+", + ",", + "`", + "~", + "|", + "<", + ">", + '"' + ]; + let needsQuotes = false; + for (const char of arg) { + if (cmdSpecialChars.some((x) => x === char)) { + needsQuotes = true; + break; + } } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + if (!needsQuotes) { + return arg; } - 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; + 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 { - tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp; + quoteHit = false; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); - } - return agent; + reverse += '"'; + return reverse.split("").reverse().join(""); } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + _uvQuoteCmdArg(arg) { + if (!arg) { + return '""'; } - if (proxyAgent) { - return proxyAgent; + if (!arg.includes(" ") && !arg.includes(" ") && !arg.includes('"')) { + return arg; } - 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 - }); + if (!arg.includes('"') && !arg.includes("\\")) { + return `"${arg}"`; } - return proxyAgent; + 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(""); } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); - }); + _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; } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve6(response); + _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 = path12.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath); + } + this.toolPath = yield io6.which(this.toolPath, true); + return new Promise((resolve6, 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}`); } - function dateTimeDeserializer(key, value) { - if (typeof value === "string") { - const a = new Date(value); - if (!isNaN(a.valueOf())) { - return a; + const optionsNonNull = this._cloneExecOptions(this.options); + if (!optionsNonNull.silent && optionsNonNull.outStream) { + optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os3.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); } - } - return value; + 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 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); + 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); } - response.result = obj; - } - response.headers = res.message.headers; - } catch (err) { + 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); + } + }); + }); } - if (statusCode > 299) { - let msg; - if (obj && obj.message) { - msg = obj.message; - } else if (contents && contents.length > 0) { - msg = contents; + 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 { - msg = `Failed request: (${statusCode})`; + resolve6(exitCode); } - const err = new HttpClientError(msg, statusCode); - err.result = response.result; - reject(err); - } else { - resolve6(response); + }); + if (this.options.input) { + if (!cp.stdin) { + throw new Error("child process missing stdin"); + } + cp.stdin.end(this.options.input); } })); }); } }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); + exports2.ToolRunner = ToolRunner6; + 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/tool-cache/lib/retry-helper.js -var require_retry_helper = __commonJS({ - "node_modules/@actions/tool-cache/lib/retry-helper.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js +var require_exec3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/exec/lib/exec.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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); + 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 __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -78413,58 +85458,63 @@ var require_retry_helper = __commonJS({ }); }; Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.RetryHelper = void 0; - var core14 = __importStar4(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"); + exports2.getExecOutput = exports2.exec = void 0; + var string_decoder_1 = require("string_decoder"); + var tr = __importStar2(require_toolrunner3()); + function exec(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.`); } - } - execute(action, isRetryable) { - return __awaiter4(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; - } - core14.info(err.message); - } - const seconds = this.getSleepAmount(); - core14.info(`Waiting ${seconds} seconds before trying again`); - yield this.sleep(seconds); - attempt++; + const toolPath = commandArgs[0]; + args = commandArgs.slice(1).concat(args || []); + const runner = new tr.ToolRunner(toolPath, args, options); + return runner.exec(); + }); + } + exports2.exec = exec; + function getExecOutput(commandLine, args, options) { + var _a, _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 = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.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); } - return yield action(); - }); - } - getSleepAmount() { - return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; - } - sleep(seconds) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => setTimeout(resolve6, seconds * 1e3)); - }); - } - }; - exports2.RetryHelper = RetryHelper; + }; + 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 exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners })); + stdout += stdoutDecoder.end(); + stderr += stderrDecoder.end(); + return { + exitCode, + stdout, + stderr + }; + }); + } + exports2.getExecOutput = getExecOutput; } }); -// node_modules/@actions/tool-cache/lib/tool-cache.js -var require_tool_cache = __commonJS({ - "node_modules/@actions/tool-cache/lib/tool-cache.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js +var require_platform3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/platform.js"(exports2) { "use strict"; - var __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -78477,21 +85527,21 @@ var require_tool_cache = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || function(mod) { + 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)) __createBinding4(result, mod, k); + for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding2(result, mod, k); } - __setModuleDefault4(result, mod); + __setModuleDefault2(result, mod); return result; }; - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + var __awaiter2 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function(resolve6) { resolve6(value); @@ -78518,613 +85568,301 @@ var require_tool_cache = __commonJS({ step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; - Object.defineProperty(exports2, "__esModule", { value: true }); - exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; - var core14 = __importStar4(require_core()); - var io6 = __importStar4(require_io4()); - var crypto = __importStar4(require("crypto")); - var fs13 = __importStar4(require("fs")); - var mm = __importStar4(require_manifest()); - var os3 = __importStar4(require("os")); - var path12 = __importStar4(require("path")); - var httpm = __importStar4(require_lib5()); - var semver8 = __importStar4(require_semver2()); - var stream2 = __importStar4(require("stream")); - var util = __importStar4(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); - } + var __importDefault2 = exports2 && exports2.__importDefault || function(mod) { + return mod && mod.__esModule ? mod : { "default": mod }; }; - exports2.HTTPError = HTTPError2; - var IS_WINDOWS = process.platform === "win32"; - var IS_MAC = process.platform === "darwin"; - var userAgent = "actions/tool-cache"; - function downloadTool2(url2, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - dest = dest || path12.join(_getTempDirectory(), crypto.randomUUID()); - yield io6.mkdirP(path12.dirname(dest)); - core14.debug(`Downloading ${url2}`); - core14.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(() => __awaiter4(this, void 0, void 0, function* () { - return yield downloadToolAttempt(url2, dest || "", auth, headers); - }), (err) => { - if (err instanceof HTTPError2 && err.httpStatusCode) { - if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { - return false; - } - } - return true; - }); - }); - } - exports2.downloadTool = downloadTool2; - function downloadToolAttempt(url2, dest, auth, headers) { - return __awaiter4(this, void 0, void 0, function* () { - if (fs13.existsSync(dest)) { - throw new Error(`Destination file path ${dest} already exists`); - } - const http = new httpm.HttpClient(userAgent, [], { - allowRetries: false - }); - if (auth) { - core14.debug("set auth"); - if (headers === void 0) { - headers = {}; - } - headers.authorization = auth; - } - const response = yield http.get(url2, headers); - if (response.message.statusCode !== 200) { - const err = new HTTPError2(response.message.statusCode); - core14.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); - throw err; - } - const pipeline = util.promisify(stream2.pipeline); - const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); - const readStream = responseMessageFactory(); - let succeeded = false; - try { - yield pipeline(readStream, fs13.createWriteStream(dest)); - core14.debug("download complete"); - succeeded = true; - return dest; - } finally { - if (!succeeded) { - core14.debug("download failed"); - try { - yield io6.rmRF(dest); - } catch (err) { - core14.debug(`Failed to delete '${dest}'. ${err.message}`); - } - } - } - }); - } - function extract7z(file, dest, _7zPath) { - return __awaiter4(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 = core14.isDebug() ? "-bb1" : "-bb0"; - const args = [ - "x", - logLevel, - "-bd", - "-sccUTF-8", - file - ]; - const options = { - silent: true - }; - yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } else { - const escapedScript = path12.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 io6.which("powershell", true); - yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); - } finally { - process.chdir(originalCwd); - } - } - return dest; - }); - } - exports2.extract7z = extract7z; - function extractTar2(file, dest, flags = "xz") { - return __awaiter4(this, void 0, void 0, function* () { - if (!file) { - throw new Error("parameter 'file' is required"); - } - dest = yield _createExtractFolder(dest); - core14.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() - } - }); - core14.debug(versionOutput.trim()); - const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); - let args; - if (flags instanceof Array) { - args = flags; - } else { - args = [flags]; - } - if (core14.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; - }); - } - exports2.extractTar = extractTar2; - function extractXar(file, dest, flags = []) { - return __awaiter4(this, void 0, void 0, function* () { - (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 (core14.isDebug()) { - args.push("-v"); - } - const xarPath = yield io6.which("xar", true); - yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); - return dest; - }); - } - exports2.extractXar = extractXar; - function extractZip(file, dest) { - return __awaiter4(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; - }); - } - exports2.extractZip = extractZip; - function extractZipWin(file, dest) { - return __awaiter4(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 io6.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 - ]; - core14.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 io6.which("powershell", true); - core14.debug(`Using powershell at path: ${powershellPath}`); - yield (0, exec_1.exec)(`"${powershellPath}"`, args); - } - }); - } - function extractZipNix(file, dest) { - return __awaiter4(this, void 0, void 0, function* () { - const unzipPath = yield io6.which("unzip", true); - const args = [file]; - if (!core14.isDebug()) { - args.unshift("-q"); - } - args.unshift("-o"); - yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); - }); - } - function cacheDir(sourceDir, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os3.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch2}`); - core14.debug(`source dir: ${sourceDir}`); - if (!fs13.statSync(sourceDir).isDirectory()) { - throw new Error("sourceDir is not a directory"); - } - const destPath = yield _createToolPath(tool, version, arch2); - for (const itemName of fs13.readdirSync(sourceDir)) { - const s = path12.join(sourceDir, itemName); - yield io6.cp(s, destPath, { recursive: true }); - } - _completeToolPath(tool, version, arch2); - return destPath; - }); - } - exports2.cacheDir = cacheDir; - function cacheFile(sourceFile, targetFile, tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - version = semver8.clean(version) || version; - arch2 = arch2 || os3.arch(); - core14.debug(`Caching tool ${tool} ${version} ${arch2}`); - core14.debug(`source file: ${sourceFile}`); - if (!fs13.statSync(sourceFile).isFile()) { - throw new Error("sourceFile is not a file"); - } - const destFolder = yield _createToolPath(tool, version, arch2); - const destPath = path12.join(destFolder, targetFile); - core14.debug(`destination file ${destPath}`); - yield io6.cp(sourceFile, destPath); - _completeToolPath(tool, version, arch2); - return destFolder; - }); - } - exports2.cacheFile = cacheFile; - function find2(toolName, versionSpec, arch2) { - if (!toolName) { - throw new Error("toolName parameter is required"); - } - if (!versionSpec) { - throw new Error("versionSpec parameter is required"); - } - arch2 = arch2 || os3.arch(); - if (!isExplicitVersion(versionSpec)) { - const localVersions = findAllVersions2(toolName, arch2); - const match = evaluateVersions(localVersions, versionSpec); - versionSpec = match; - } - let toolPath = ""; - if (versionSpec) { - versionSpec = semver8.clean(versionSpec) || ""; - const cachePath = path12.join(_getCacheDirectory(), toolName, versionSpec, arch2); - core14.debug(`checking cache: ${cachePath}`); - if (fs13.existsSync(cachePath) && fs13.existsSync(`${cachePath}.complete`)) { - core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); - toolPath = cachePath; - } else { - core14.debug("not found"); - } - } - return toolPath; - } - exports2.find = find2; - function findAllVersions2(toolName, arch2) { - const versions = []; - arch2 = arch2 || os3.arch(); - const toolPath = path12.join(_getCacheDirectory(), toolName); - if (fs13.existsSync(toolPath)) { - const children = fs13.readdirSync(toolPath); - for (const child of children) { - if (isExplicitVersion(child)) { - const fullPath = path12.join(toolPath, child, arch2 || ""); - if (fs13.existsSync(fullPath) && fs13.existsSync(`${fullPath}.complete`)) { - versions.push(child); - } - } - } - } - return versions; - } - exports2.findAllVersions = findAllVersions2; - function getManifestFromRepo(owner, repo, auth, branch = "master") { - return __awaiter4(this, void 0, void 0, function* () { - let releases = []; - const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; - const http = new httpm.HttpClient("tool-cache"); - const headers = {}; - if (auth) { - core14.debug("set auth"); - headers.authorization = auth; - } - 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 (_a) { - core14.debug("Invalid json"); - } - } - return releases; - }); - } - exports2.getManifestFromRepo = getManifestFromRepo; - function findFromManifest(versionSpec, stable, manifest, archFilter = os3.arch()) { - return __awaiter4(this, void 0, void 0, function* () { - const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); - return match; - }); - } - exports2.findFromManifest = findFromManifest; - function _createExtractFolder(dest) { - return __awaiter4(this, void 0, void 0, function* () { - if (!dest) { - dest = path12.join(_getTempDirectory(), crypto.randomUUID()); - } - yield io6.mkdirP(dest); - return dest; + 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 exec = __importStar2(require_exec3()); + var getWindowsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + const { stdout: version } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Version"', void 0, { + silent: true }); - } - function _createToolPath(tool, version, arch2) { - return __awaiter4(this, void 0, void 0, function* () { - const folderPath = path12.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - core14.debug(`destination ${folderPath}`); - const markerPath = `${folderPath}.complete`; - yield io6.rmRF(folderPath); - yield io6.rmRF(markerPath); - yield io6.mkdirP(folderPath); - return folderPath; + const { stdout: name } = yield exec.getExecOutput('powershell -command "(Get-CimInstance -ClassName Win32_OperatingSystem).Caption"', void 0, { + silent: true }); - } - function _completeToolPath(tool, version, arch2) { - const folderPath = path12.join(_getCacheDirectory(), tool, semver8.clean(version) || version, arch2 || ""); - const markerPath = `${folderPath}.complete`; - fs13.writeFileSync(markerPath, ""); - core14.debug("finished caching tool"); - } - function isExplicitVersion(versionSpec) { - const c = semver8.clean(versionSpec) || ""; - core14.debug(`isExplicit: ${c}`); - const valid3 = semver8.valid(c) != null; - core14.debug(`explicit? ${valid3}`); - return valid3; - } - exports2.isExplicitVersion = isExplicitVersion; - function evaluateVersions(versions, versionSpec) { - let version = ""; - core14.debug(`evaluating ${versions.length} versions`); - versions = versions.sort((a, b) => { - if (semver8.gt(a, b)) { - return 1; - } - return -1; + return { + name: name.trim(), + version: version.trim() + }; + }); + var getMacOsInfo = () => __awaiter2(void 0, void 0, void 0, function* () { + var _a, _b, _c, _d; + const { stdout } = yield exec.getExecOutput("sw_vers", void 0, { + silent: true }); - for (let i = versions.length - 1; i >= 0; i--) { - const potential = versions[i]; - const satisfied = semver8.satisfies(potential, versionSpec); - if (satisfied) { - version = potential; - break; - } - } - if (version) { - core14.debug(`matched: ${version}`); - } else { - core14.debug("match not found"); - } - return version; - } - exports2.evaluateVersions = evaluateVersions; - 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; - }; + const version = (_b = (_a = stdout.match(/ProductVersion:\s*(.+)/)) === null || _a === void 0 ? void 0 : _a[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 exec.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/http-client/lib/proxy.js -var require_proxy5 = __commonJS({ - "node_modules/@actions/http-client/lib/proxy.js"(exports2) { +// node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.js +var require_core3 = __commonJS({ + "node_modules/@actions/tool-cache/node_modules/@actions/core/lib/core.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; + 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]; + } }; } - const proxyVar = (() => { - if (usingSsl) { - return process.env["https_proxy"] || process.env["HTTPS_PROXY"]; - } else { - return process.env["http_proxy"] || process.env["HTTP_PROXY"]; + 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(resolve6) { + resolve6(value); + }); + } + return new (P || (P = Promise))(function(resolve6, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } } - })(); - if (proxyVar) { - try { - return new DecodedURL(proxyVar); - } catch (_a) { - if (!proxyVar.startsWith("http://") && !proxyVar.startsWith("https://")) - return new DecodedURL(`http://${proxyVar}`); + function rejected(value) { + try { + step(generator["throw"](value)); + } catch (e) { + reject(e); + } } - } else { - return void 0; + function step(result) { + result.done ? resolve6(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_command3(); + var file_command_1 = require_file_command3(); + var utils_1 = require_utils8(); + var os3 = __importStar2(require("os")); + var path12 = __importStar2(require("path")); + var oidc_utils_1 = require_oidc_utils3(); + var ExitCode; + (function(ExitCode2) { + ExitCode2[ExitCode2["Success"] = 0] = "Success"; + ExitCode2[ExitCode2["Failure"] = 1] = "Failure"; + })(ExitCode || (exports2.ExitCode = ExitCode = {})); + function exportVariable6(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 checkBypass(reqUrl) { - if (!reqUrl.hostname) { - return false; + exports2.exportVariable = exportVariable6; + function setSecret(secret) { + (0, command_1.issueCommand)("add-mask", {}, secret); + } + exports2.setSecret = setSecret; + function addPath(inputPath) { + const filePath = process.env["GITHUB_PATH"] || ""; + if (filePath) { + (0, file_command_1.issueFileCommand)("PATH", inputPath); + } else { + (0, command_1.issueCommand)("add-path", {}, inputPath); } - const reqHost = reqUrl.hostname; - if (isLoopbackAddress(reqHost)) { - return true; + process.env["PATH"] = `${inputPath}${path12.delimiter}${process.env["PATH"]}`; + } + exports2.addPath = addPath; + 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}`); } - const noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || ""; - if (!noProxy) { - return false; + if (options && options.trimWhitespace === false) { + return val; } - let reqPort; - if (reqUrl.port) { - reqPort = Number(reqUrl.port); - } else if (reqUrl.protocol === "http:") { - reqPort = 80; - } else if (reqUrl.protocol === "https:") { - reqPort = 443; + 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; } - const upperReqHosts = [reqUrl.hostname.toUpperCase()]; - if (typeof reqPort === "number") { - upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`); + 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 setOutput2(name, value) { + const filePath = process.env["GITHUB_OUTPUT"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("OUTPUT", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - 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; + process.stdout.write(os3.EOL); + (0, command_1.issueCommand)("set-output", { name }, (0, utils_1.toCommandValue)(value)); + } + exports2.setOutput = setOutput2; + function setCommandEcho(enabled) { + (0, command_1.issue)("echo", enabled ? "on" : "off"); + } + exports2.setCommandEcho = setCommandEcho; + function setFailed2(message) { + process.exitCode = ExitCode.Failure; + error3(message); + } + exports2.setFailed = setFailed2; + function isDebug2() { + return process.env["RUNNER_DEBUG"] === "1"; + } + exports2.isDebug = isDebug2; + 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 warning10(message, properties = {}) { + (0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.warning = warning10; + function notice(message, properties = {}) { + (0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message); + } + exports2.notice = notice; + function info6(message) { + process.stdout.write(message + os3.EOL); + } + exports2.info = info6; + function startGroup3(name) { + (0, command_1.issue)("group", name); + } + exports2.startGroup = startGroup3; + function endGroup3() { + (0, command_1.issue)("endgroup"); + } + exports2.endGroup = endGroup3; + function group(name, fn) { + return __awaiter2(this, void 0, void 0, function* () { + startGroup3(name); + let result; + try { + result = yield fn(); + } finally { + endGroup3(); } + return result; + }); + } + exports2.group = group; + function saveState2(name, value) { + const filePath = process.env["GITHUB_STATE"] || ""; + if (filePath) { + return (0, file_command_1.issueFileCommand)("STATE", (0, file_command_1.prepareKeyValueMessage)(name, value)); } - return false; + (0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value)); } - 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]"); + exports2.saveState = saveState2; + function getState2(name) { + return process.env[`STATE_${name}`] || ""; } - 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; - } - }; + exports2.getState = getState2; + 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_summary3(); + Object.defineProperty(exports2, "summary", { enumerable: true, get: function() { + return summary_1.summary; + } }); + var summary_2 = require_summary3(); + Object.defineProperty(exports2, "markdownSummary", { enumerable: true, get: function() { + return summary_2.markdownSummary; + } }); + var path_utils_1 = require_path_utils3(); + 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_platform3()); } }); -// node_modules/@actions/http-client/lib/index.js -var require_lib6 = __commonJS({ - "node_modules/@actions/http-client/lib/index.js"(exports2) { +// 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 __createBinding4 = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) { + 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)) { @@ -79137,31 +85875,21 @@ var require_lib6 = __commonJS({ if (k2 === void 0) k2 = k; o[k2] = m[k]; })); - var __setModuleDefault4 = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) { + 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 __importStar4 = exports2 && exports2.__importStar || /* @__PURE__ */ (function() { - var 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); - }; - return function(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") __createBinding4(result, mod, k[i]); - } - __setModuleDefault4(result, mod); - return result; - }; - })(); - var __awaiter4 = exports2 && exports2.__awaiter || function(thisArg, _arguments, P, generator) { + 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(resolve6) { resolve6(value); @@ -79189,628 +85917,780 @@ var require_lib6 = __commonJS({ }); }; 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 = __importStar4(require("http")); - var https2 = __importStar4(require("https")); - var pm = __importStar4(require_proxy5()); - var tunnel = __importStar4(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 __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(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", () => { - resolve6(output.toString()); - }); - })); - }); - } - readBodyBuffer() { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6) => __awaiter4(this, void 0, void 0, function* () { - const chunks = []; - this.message.on("data", (chunk) => { - chunks.push(chunk); - }); - this.message.on("end", () => { - resolve6(Buffer.concat(chunks)); + exports2._readLinuxVersionFile = exports2._getOsVersion = exports2._findMatch = void 0; + var semver9 = __importStar2(require_semver2()); + var core_1 = require_core3(); + var os3 = require("os"); + var cp = require("child_process"); + var fs13 = require("fs"); + function _findMatch(versionSpec, stable, candidates, archFilter) { + return __awaiter2(this, void 0, void 0, function* () { + const platFilter = os3.platform(); + let result; + let match; + let file; + for (const candidate of candidates) { + const version = candidate.version; + (0, core_1.debug)(`check ${version} satisfies ${versionSpec}`); + if (semver9.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 = semver9.satisfies(osVersion, item.platform_version); + } + } + return chk; }); - })); - }); - } - }; - exports2.HttpClientResponse = HttpClientResponse; - function isHttps(requestUrl) { - const parsedUrl = new URL(requestUrl); - return parsedUrl.protocol === "https:"; - } - var HttpClient2 = class { - constructor(userAgent, 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 = userAgent; - 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 (file) { + (0, core_1.debug)(`matched ${candidate.version}`); + match = candidate; + break; + } } - if (requestOptions.maxRetries != null) { - this._maxRetries = requestOptions.maxRetries; + } + if (match && file) { + result = Object.assign({}, match); + result.files = [file]; + } + return result; + }); + } + exports2._findMatch = _findMatch; + function _getOsVersion() { + const plat = os3.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; + } } } } - options(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("OPTIONS", requestUrl, null, additionalHeaders || {}); - }); + return version; + } + exports2._getOsVersion = _getOsVersion; + function _readLinuxVersionFile() { + const lsbReleaseFile = "/etc/lsb-release"; + const osReleaseFile = "/etc/os-release"; + let contents = ""; + if (fs13.existsSync(lsbReleaseFile)) { + contents = fs13.readFileSync(lsbReleaseFile).toString(); + } else if (fs13.existsSync(osReleaseFile)) { + contents = fs13.readFileSync(osReleaseFile).toString(); + } + return contents; + } + exports2._readLinuxVersionFile = _readLinuxVersionFile; + } +}); + +// 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 || 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); } - get(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("GET", requestUrl, null, additionalHeaders || {}); + __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(resolve6) { + resolve6(value); }); } - del(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("DELETE", requestUrl, null, additionalHeaders || {}); - }); + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(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 core14 = __importStar2(require_core3()); + 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"); + } } - post(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("POST", requestUrl, data, additionalHeaders || {}); + 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; + } + core14.info(err.message); + } + const seconds = this.getSleepAmount(); + core14.info(`Waiting ${seconds} seconds before trying again`); + yield this.sleep(seconds); + attempt++; + } + return yield action(); }); } - patch(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PATCH", requestUrl, data, additionalHeaders || {}); - }); + getSleepAmount() { + return Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) + this.minSeconds; } - put(requestUrl, data, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("PUT", requestUrl, data, additionalHeaders || {}); + sleep(seconds) { + return __awaiter2(this, void 0, void 0, function* () { + return new Promise((resolve6) => setTimeout(resolve6, seconds * 1e3)); }); } - head(requestUrl, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request("HEAD", requestUrl, null, additionalHeaders || {}); - }); + }; + 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]; + } }; } - sendStream(verb, requestUrl, stream2, additionalHeaders) { - return __awaiter4(this, void 0, void 0, function* () { - return this.request(verb, requestUrl, stream2, additionalHeaders); - }); + 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); } - /** - * 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 __awaiter4(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); + __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(resolve6) { + resolve6(value); }); } - postJson(requestUrl_1, obj_1) { - return __awaiter4(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); - }); + return new (P || (P = Promise))(function(resolve6, 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 ? resolve6(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + Object.defineProperty(exports2, "__esModule", { value: true }); + exports2.evaluateVersions = exports2.isExplicitVersion = exports2.findFromManifest = exports2.getManifestFromRepo = exports2.findAllVersions = exports2.find = exports2.cacheFile = exports2.cacheDir = exports2.extractZip = exports2.extractXar = exports2.extractTar = exports2.extract7z = exports2.downloadTool = exports2.HTTPError = void 0; + var core14 = __importStar2(require_core3()); + var io6 = __importStar2(require_io3()); + var crypto2 = __importStar2(require("crypto")); + var fs13 = __importStar2(require("fs")); + var mm = __importStar2(require_manifest()); + var os3 = __importStar2(require("os")); + var path12 = __importStar2(require("path")); + var httpm = __importStar2(require_lib5()); + var semver9 = __importStar2(require_semver2()); + var stream2 = __importStar2(require("stream")); + var util = __importStar2(require("util")); + var assert_1 = require("assert"); + var exec_1 = require_exec3(); + 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); } - putJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }; + exports2.HTTPError = HTTPError2; + var IS_WINDOWS = process.platform === "win32"; + var IS_MAC = process.platform === "darwin"; + var userAgent = "actions/tool-cache"; + function downloadTool2(url2, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + dest = dest || path12.join(_getTempDirectory(), crypto2.randomUUID()); + yield io6.mkdirP(path12.dirname(dest)); + core14.debug(`Downloading ${url2}`); + core14.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 || "", auth, headers); + }), (err) => { + if (err instanceof HTTPError2 && err.httpStatusCode) { + if (err.httpStatusCode < 500 && err.httpStatusCode !== 408 && err.httpStatusCode !== 429) { + return false; + } + } + return true; }); - } - patchJson(requestUrl_1, obj_1) { - return __awaiter4(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); + }); + } + exports2.downloadTool = downloadTool2; + function downloadToolAttempt(url2, dest, auth, headers) { + return __awaiter2(this, void 0, void 0, function* () { + if (fs13.existsSync(dest)) { + throw new Error(`Destination file path ${dest} already exists`); + } + const http = new httpm.HttpClient(userAgent, [], { + allowRetries: false }); - } - /** - * 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 __awaiter4(this, void 0, void 0, function* () { - if (this._disposed) { - throw new Error("Client has already been disposed."); + if (auth) { + core14.debug("set auth"); + if (headers === void 0) { + headers = {}; } - const parsedUrl = new URL(requestUrl); - let info6 = 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(info6, data); - if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) { - let authenticationHandler; - for (const handler of this.handlers) { - if (handler.canHandleAuthentication(response)) { - authenticationHandler = handler; - break; - } - } - if (authenticationHandler) { - return authenticationHandler.handleAuthentication(this, info6, 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]; - } - } - } - info6 = this._prepareRequest(verb, parsedRedirectUrl, headers); - response = yield this.requestRaw(info6, 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(); + headers.authorization = auth; } - this._disposed = true; - } - /** - * Raw request. - * @param info - * @param data - */ - requestRaw(info6, data) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => { - function callbackForResult(err, res) { - if (err) { - reject(err); - } else if (!res) { - reject(new Error("Unknown error")); - } else { - resolve6(res); - } + const response = yield http.get(url2, headers); + if (response.message.statusCode !== 200) { + const err = new HTTPError2(response.message.statusCode); + core14.debug(`Failed to download from "${url2}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`); + throw err; + } + const pipeline = util.promisify(stream2.pipeline); + const responseMessageFactory = _getGlobal("TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY", () => response.message); + const readStream = responseMessageFactory(); + let succeeded = false; + try { + yield pipeline(readStream, fs13.createWriteStream(dest)); + core14.debug("download complete"); + succeeded = true; + return dest; + } finally { + if (!succeeded) { + core14.debug("download failed"); + try { + yield io6.rmRF(dest); + } catch (err) { + core14.debug(`Failed to delete '${dest}'. ${err.message}`); } - this.requestRawWithCallback(info6, data, callbackForResult); - }); - }); - } - /** - * Raw request with callback. - * @param info - * @param data - * @param onResult - */ - requestRawWithCallback(info6, data, onResult) { - if (typeof data === "string") { - if (!info6.options.headers) { - info6.options.headers = {}; } - info6.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8"); } - let callbackCalled = false; - function handleResult(err, res) { - if (!callbackCalled) { - callbackCalled = true; - onResult(err, res); + }); + } + 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 = core14.isDebug() ? "-bb1" : "-bb0"; + const args = [ + "x", + logLevel, + "-bd", + "-sccUTF-8", + file + ]; + const options = { + silent: true + }; + yield (0, exec_1.exec)(`"${_7zPath}"`, args, options); + } finally { + process.chdir(originalCwd); + } + } else { + const escapedScript = path12.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 io6.which("powershell", true); + yield (0, exec_1.exec)(`"${powershellPath}"`, args, options); + } finally { + process.chdir(originalCwd); } } - const req = info6.httpModule.request(info6.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(); + return dest; + }); + } + exports2.extract7z = extract7z; + function extractTar2(file, dest, flags = "xz") { + return __awaiter2(this, void 0, void 0, function* () { + if (!file) { + throw new Error("parameter 'file' is required"); + } + dest = yield _createExtractFolder(dest); + core14.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() } - handleResult(new Error(`Request timeout: ${info6.options.path}`)); - }); - req.on("error", function(err) { - handleResult(err); }); - if (data && typeof data === "string") { - req.write(data, "utf8"); + core14.debug(versionOutput.trim()); + const isGnuTar = versionOutput.toUpperCase().includes("GNU TAR"); + let args; + if (flags instanceof Array) { + args = flags; + } else { + args = [flags]; + } + if (core14.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; + }); + } + exports2.extractTar = extractTar2; + function extractXar(file, dest, flags = []) { + return __awaiter2(this, void 0, void 0, function* () { + (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 (core14.isDebug()) { + args.push("-v"); + } + const xarPath = yield io6.which("xar", true); + yield (0, exec_1.exec)(`"${xarPath}"`, _unique(args)); + return dest; + }); + } + exports2.extractXar = extractXar; + 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; + }); + } + exports2.extractZip = extractZip; + 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 io6.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 + ]; + core14.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 io6.which("powershell", true); + core14.debug(`Using powershell at path: ${powershellPath}`); + yield (0, exec_1.exec)(`"${powershellPath}"`, args); } - if (data && typeof data !== "string") { - data.on("close", function() { - req.end(); - }); - data.pipe(req); - } else { - req.end(); + }); + } + function extractZipNix(file, dest) { + return __awaiter2(this, void 0, void 0, function* () { + const unzipPath = yield io6.which("unzip", true); + const args = [file]; + if (!core14.isDebug()) { + args.unshift("-q"); } - } - /** - * 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; + args.unshift("-o"); + yield (0, exec_1.exec)(`"${unzipPath}"`, args, { cwd: dest }); + }); + } + function cacheDir(sourceDir, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os3.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch2}`); + core14.debug(`source dir: ${sourceDir}`); + if (!fs13.statSync(sourceDir).isDirectory()) { + throw new Error("sourceDir is not a directory"); } - return this._getProxyAgentDispatcher(parsedUrl, proxyUrl); - } - _prepareRequest(method, requestUrl, headers) { - const info6 = {}; - info6.parsedUrl = requestUrl; - const usingSsl = info6.parsedUrl.protocol === "https:"; - info6.httpModule = usingSsl ? https2 : http; - const defaultPort = usingSsl ? 443 : 80; - info6.options = {}; - info6.options.host = info6.parsedUrl.hostname; - info6.options.port = info6.parsedUrl.port ? parseInt(info6.parsedUrl.port) : defaultPort; - info6.options.path = (info6.parsedUrl.pathname || "") + (info6.parsedUrl.search || ""); - info6.options.method = method; - info6.options.headers = this._mergeHeaders(headers); - if (this.userAgent != null) { - info6.options.headers["user-agent"] = this.userAgent; + const destPath = yield _createToolPath(tool, version, arch2); + for (const itemName of fs13.readdirSync(sourceDir)) { + const s = path12.join(sourceDir, itemName); + yield io6.cp(s, destPath, { recursive: true }); } - info6.options.agent = this._getAgent(info6.parsedUrl); - if (this.handlers) { - for (const handler of this.handlers) { - handler.prepareRequest(info6.options); - } + _completeToolPath(tool, version, arch2); + return destPath; + }); + } + exports2.cacheDir = cacheDir; + function cacheFile(sourceFile, targetFile, tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + version = semver9.clean(version) || version; + arch2 = arch2 || os3.arch(); + core14.debug(`Caching tool ${tool} ${version} ${arch2}`); + core14.debug(`source file: ${sourceFile}`); + if (!fs13.statSync(sourceFile).isFile()) { + throw new Error("sourceFile is not a file"); } - return info6; + const destFolder = yield _createToolPath(tool, version, arch2); + const destPath = path12.join(destFolder, targetFile); + core14.debug(`destination file ${destPath}`); + yield io6.cp(sourceFile, destPath); + _completeToolPath(tool, version, arch2); + return destFolder; + }); + } + exports2.cacheFile = cacheFile; + function find2(toolName, versionSpec, arch2) { + if (!toolName) { + throw new Error("toolName parameter is required"); } - _mergeHeaders(headers) { - if (this.requestOptions && this.requestOptions.headers) { - return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {})); - } - return lowercaseKeys(headers || {}); + if (!versionSpec) { + throw new Error("versionSpec parameter is required"); } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + arch2 = arch2 || os3.arch(); + if (!isExplicitVersion(versionSpec)) { + const localVersions = findAllVersions2(toolName, arch2); + const match = evaluateVersions(localVersions, versionSpec); + versionSpec = match; + } + let toolPath = ""; + if (versionSpec) { + versionSpec = semver9.clean(versionSpec) || ""; + const cachePath = path12.join(_getCacheDirectory(), toolName, versionSpec, arch2); + core14.debug(`checking cache: ${cachePath}`); + if (fs13.existsSync(cachePath) && fs13.existsSync(`${cachePath}.complete`)) { + core14.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch2}`); + toolPath = cachePath; + } else { + core14.debug("not found"); } - return _default2; } - /** - * 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, _default2) { - let clientHeader; - if (this.requestOptions && this.requestOptions.headers) { - const headerValue = lowercaseKeys(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; + return toolPath; + } + exports2.find = find2; + function findAllVersions2(toolName, arch2) { + const versions = []; + arch2 = arch2 || os3.arch(); + const toolPath = path12.join(_getCacheDirectory(), toolName); + if (fs13.existsSync(toolPath)) { + const children = fs13.readdirSync(toolPath); + for (const child of children) { + if (isExplicitVersion(child)) { + const fullPath = path12.join(toolPath, child, arch2 || ""); + if (fs13.existsSync(fullPath) && fs13.existsSync(`${fullPath}.complete`)) { + versions.push(child); } } } - 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 _default2; } - _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; + return versions; + } + exports2.findAllVersions = findAllVersions2; + function getManifestFromRepo(owner, repo, auth, branch = "master") { + return __awaiter2(this, void 0, void 0, function* () { + let releases = []; + const treeUrl = `https://api.github.com/repos/${owner}/${repo}/git/trees/${branch}`; + const http = new httpm.HttpClient("tool-cache"); + const headers = {}; + if (auth) { + core14.debug("set auth"); + headers.authorization = auth; } - const usingSsl = parsedUrl.protocol === "https:"; - let maxSockets = 100; - if (this.requestOptions) { - maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets; + const response = yield http.getJson(treeUrl, headers); + if (!response.result) { + return releases; } - 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; + let manifestUrl = ""; + for (const item of response.result.tree) { + if (item.path === "versions-manifest.json") { + manifestUrl = item.url; + break; } - agent = tunnelAgent(agentOptions); - this._proxyAgent = agent; } - if (!agent) { - const options = { keepAlive: this._keepAlive, maxSockets }; - agent = usingSsl ? new https2.Agent(options) : new http.Agent(options); - this._agent = agent; - } - if (usingSsl && this._ignoreSslError) { - agent.options = Object.assign(agent.options || {}, { - rejectUnauthorized: false - }); + 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 (_a) { + core14.debug("Invalid json"); + } } - return agent; - } - _getProxyAgentDispatcher(parsedUrl, proxyUrl) { - let proxyAgent; - if (this._keepAlive) { - proxyAgent = this._proxyAgentDispatcher; + return releases; + }); + } + exports2.getManifestFromRepo = getManifestFromRepo; + function findFromManifest(versionSpec, stable, manifest, archFilter = os3.arch()) { + return __awaiter2(this, void 0, void 0, function* () { + const match = yield mm._findMatch(versionSpec, stable, manifest, archFilter); + return match; + }); + } + exports2.findFromManifest = findFromManifest; + function _createExtractFolder(dest) { + return __awaiter2(this, void 0, void 0, function* () { + if (!dest) { + dest = path12.join(_getTempDirectory(), crypto2.randomUUID()); } - if (proxyAgent) { - return proxyAgent; + yield io6.mkdirP(dest); + return dest; + }); + } + function _createToolPath(tool, version, arch2) { + return __awaiter2(this, void 0, void 0, function* () { + const folderPath = path12.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + core14.debug(`destination ${folderPath}`); + const markerPath = `${folderPath}.complete`; + yield io6.rmRF(folderPath); + yield io6.rmRF(markerPath); + yield io6.mkdirP(folderPath); + return folderPath; + }); + } + function _completeToolPath(tool, version, arch2) { + const folderPath = path12.join(_getCacheDirectory(), tool, semver9.clean(version) || version, arch2 || ""); + const markerPath = `${folderPath}.complete`; + fs13.writeFileSync(markerPath, ""); + core14.debug("finished caching tool"); + } + function isExplicitVersion(versionSpec) { + const c = semver9.clean(versionSpec) || ""; + core14.debug(`isExplicit: ${c}`); + const valid3 = semver9.valid(c) != null; + core14.debug(`explicit? ${valid3}`); + return valid3; + } + exports2.isExplicitVersion = isExplicitVersion; + function evaluateVersions(versions, versionSpec) { + let version = ""; + core14.debug(`evaluating ${versions.length} versions`); + versions = versions.sort((a, b) => { + if (semver9.gt(a, b)) { + return 1; } - 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 -1; + }); + for (let i = versions.length - 1; i >= 0; i--) { + const potential = versions[i]; + const satisfied = semver9.satisfies(potential, versionSpec); + if (satisfied) { + version = potential; + break; } - return proxyAgent; } - _performExponentialBackoff(retryNumber) { - return __awaiter4(this, void 0, void 0, function* () { - retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber); - const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber); - return new Promise((resolve6) => setTimeout(() => resolve6(), ms)); - }); + if (version) { + core14.debug(`matched: ${version}`); + } else { + core14.debug("match not found"); } - _processResponse(res, options) { - return __awaiter4(this, void 0, void 0, function* () { - return new Promise((resolve6, reject) => __awaiter4(this, void 0, void 0, function* () { - const statusCode = res.message.statusCode || 0; - const response = { - statusCode, - result: null, - headers: {} - }; - if (statusCode === HttpCodes.NotFound) { - resolve6(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 { - resolve6(response); - } - })); - }); + return version; + } + exports2.evaluateVersions = evaluateVersions; + 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; }; - exports2.HttpClient = HttpClient2; - var lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {}); } }); // node_modules/follow-redirects/debug.js -var require_debug2 = __commonJS({ +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 (error4) { + } catch (error3) { } if (typeof debug6 !== "function") { debug6 = function() { @@ -79831,7 +86711,7 @@ var require_follow_redirects = __commonJS({ var https2 = require("https"); var Writable = require("stream").Writable; var assert = require("assert"); - var debug6 = require_debug2(); + var debug6 = require_debug3(); (function detectUnsupportedEnvironment() { var looksLikeNode = typeof process !== "undefined"; var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; @@ -79843,8 +86723,8 @@ var require_follow_redirects = __commonJS({ var useNativeURL = false; try { assert(new URL2("")); - } catch (error4) { - useNativeURL = error4.code === "ERR_INVALID_URL"; + } catch (error3) { + useNativeURL = error3.code === "ERR_INVALID_URL"; } var preservedUrlFields = [ "auth", @@ -79918,9 +86798,9 @@ var require_follow_redirects = __commonJS({ this._currentRequest.abort(); this.emit("abort"); }; - RedirectableRequest.prototype.destroy = function(error4) { - destroyRequest(this._currentRequest, error4); - destroy.call(this, error4); + RedirectableRequest.prototype.destroy = function(error3) { + destroyRequest(this._currentRequest, error3); + destroy.call(this, error3); return this; }; RedirectableRequest.prototype.write = function(data, encoding, callback) { @@ -80087,10 +86967,10 @@ var require_follow_redirects = __commonJS({ var i = 0; var self2 = this; var buffers = this._requestBodyBuffers; - (function writeNext(error4) { + (function writeNext(error3) { if (request === self2._currentRequest) { - if (error4) { - self2.emit("error", error4); + if (error3) { + self2.emit("error", error3); } else if (i < buffers.length) { var buffer = buffers[i++]; if (!request.finished) { @@ -80289,12 +87169,12 @@ var require_follow_redirects = __commonJS({ }); return CustomError; } - function destroyRequest(request, error4) { + function destroyRequest(request, error3) { for (var event of events) { request.removeListener(event, eventHandlers[event]); } request.on("error", noop); - request.destroy(error4); + request.destroy(error3); } function isSubdomain(subdomain, domain) { assert(isString(subdomain) && isString(domain)); @@ -83223,15 +90103,14 @@ var path2 = __toESM(require("path")); var core4 = __toESM(require_core()); var toolrunner = __toESM(require_toolrunner()); var github = __toESM(require_github()); -var io2 = __toESM(require_io2()); +var io2 = __toESM(require_io()); // src/util.ts var fs = __toESM(require("fs")); var fsPromises = __toESM(require("fs/promises")); var path = __toESM(require("path")); var core3 = __toESM(require_core()); -var exec = __toESM(require_exec()); -var io = __toESM(require_io2()); +var io = __toESM(require_io()); // node_modules/get-folder-size/index.js var import_node_path = require("node:path"); @@ -83248,14 +90127,14 @@ async function core(rootItemPath, options = {}, returnType = {}) { await processItem(rootItemPath); async function processItem(itemPath) { if (options.ignore?.test(itemPath)) return; - const stats = returnType.strict ? await fs13.lstat(itemPath, { bigint: true }) : await fs13.lstat(itemPath, { bigint: true }).catch((error4) => errors.push(error4)); + const stats = returnType.strict ? await fs13.lstat(itemPath, { bigint: true }) : await fs13.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 fs13.readdir(itemPath) : await fs13.readdir(itemPath).catch((error4) => errors.push(error4)); + const directoryItems = returnType.strict ? await fs13.readdir(itemPath) : await fs13.readdir(itemPath).catch((error3) => errors.push(error3)); if (typeof directoryItems !== "object") return; await Promise.all( directoryItems.map( @@ -83266,13 +90145,13 @@ async function core(rootItemPath, options = {}, returnType = {}) { } if (!options.bigint) { if (folderSize > BigInt(Number.MAX_SAFE_INTEGER)) { - const error4 = new RangeError( + 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 error4; + throw error3; } - errors.push(error4); + errors.push(error3); folderSize = Number.MAX_SAFE_INTEGER; } else { folderSize = Number(folderSize); @@ -84152,6 +91031,18 @@ function charFromCodepoint(c) { (c - 65536 & 1023) + 56320 ); } +function setProperty(object, key, value) { + if (key === "__proto__") { + Object.defineProperty(object, key, { + configurable: true, + enumerable: true, + writable: true, + value + }); + } else { + object[key] = value; + } +} var simpleEscapeCheck = new Array(256); var simpleEscapeMap = new Array(256); for (i = 0; i < 256; i++) { @@ -84271,7 +91162,7 @@ function mergeMappings(state, destination, source, overridableKeys) { for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { key = sourceKeys[index]; if (!_hasOwnProperty$1.call(destination, key)) { - destination[key] = source[key]; + setProperty(destination, key, source[key]); overridableKeys[key] = true; } } @@ -84311,16 +91202,7 @@ function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valu state.position = startPos || state.position; throwError(state, "duplicated mapping key"); } - if (keyNode === "__proto__") { - Object.defineProperty(_result, keyNode, { - configurable: true, - enumerable: true, - writable: true, - value: valueNode - }); - } else { - _result[keyNode] = valueNode; - } + setProperty(_result, keyNode, valueNode); delete overridableKeys[keyNode]; } return _result; @@ -85885,9 +92767,9 @@ function getExtraOptionsEnvParam() { try { return load(raw); } catch (unwrappedError) { - const error4 = wrapError(unwrappedError); + const error3 = wrapError(unwrappedError); throw new ConfigurationError( - `${varName} environment variable is set, but does not contain valid JSON: ${error4.message}` + `${varName} environment variable is set, but does not contain valid JSON: ${error3.message}` ); } } @@ -86030,11 +92912,11 @@ function parseMatrixInput(matrixInput) { } return JSON.parse(matrixInput); } -function wrapError(error4) { - return error4 instanceof Error ? error4 : new Error(String(error4)); +function wrapError(error3) { + return error3 instanceof Error ? error3 : new Error(String(error3)); } -function getErrorMessage(error4) { - return error4 instanceof Error ? error4.message : String(error4); +function getErrorMessage(error3) { + return error3 instanceof Error ? error3.message : String(error3); } async function checkDiskUsage(logger) { try { @@ -86057,22 +92939,22 @@ async function checkDiskUsage(logger) { numAvailableBytes: diskUsage.bavail * blockSizeInBytes, numTotalBytes: diskUsage.blocks * blockSizeInBytes }; - } catch (error4) { + } catch (error3) { logger.warning( - `Failed to check available disk space: ${getErrorMessage(error4)}` + `Failed to check available disk space: ${getErrorMessage(error3)}` ); return void 0; } } function checkActionVersion(version, githubVersion) { - if (!semver.satisfies(version, ">=3") && // do not log error if the customer is already running v3 + 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 === 0 /* DOTCOM */ || githubVersion.type === 2 /* GHE_DOTCOM */ || githubVersion.type === 1 /* GHES */ && semver.satisfies( + 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.11" + ">=3.20" )) { - core3.error( - "CodeQL Action major versions v1 and v2 have been deprecated. Please update all occurrences of the CodeQL Action in your workflow files to v3. For more information, see https://github.blog/changelog/2025-01-10-code-scanning-codeql-action-v2-is-now-deprecated/" + core3.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/" ); core3.exportVariable("CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */, "true"); } @@ -86116,7 +92998,7 @@ async function asyncSome(array, predicate) { } function unsafeEntriesInvariant(object) { return Object.entries(object).filter( - ([_, val2]) => val2 !== void 0 + ([_, val]) => val !== void 0 ); } @@ -86392,17 +93274,17 @@ function getAuthorizationHeaderFor(logger, apiDetails, url2) { var cachedGitHubVersion = void 0; async function getGitHubVersionFromApi(apiClient, apiDetails) { if (parseGitHubUrl(apiDetails.url) === GITHUB_DOTCOM_URL) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } const response = await apiClient.rest.meta.get(); if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === void 0) { - return { type: 0 /* DOTCOM */ }; + return { type: "GitHub.com" /* DOTCOM */ }; } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: 2 /* GHE_DOTCOM */ }; + return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER]; - return { type: 1 /* GHES */, version }; + return { type: "GitHub Enterprise Server" /* GHES */, version }; } async function getGitHubVersion() { if (cachedGitHubVersion === void 0) { @@ -86500,25 +93382,29 @@ function wrapApiConfigurationError(e) { // src/feature-flags.ts var fs4 = __toESM(require("fs")); var path4 = __toESM(require("path")); -var semver3 = __toESM(require_semver2()); +var semver4 = __toESM(require_semver2()); // src/defaults.json -var bundleVersion = "codeql-bundle-v2.23.3"; -var cliVersion = "2.23.3"; +var bundleVersion = "codeql-bundle-v2.23.8"; +var cliVersion = "2.23.8"; // src/overlay-database-utils.ts var fs3 = __toESM(require("fs")); var path3 = __toESM(require("path")); -var actionsCache = __toESM(require_cache3()); +var actionsCache = __toESM(require_cache4()); -// src/git-utils.ts +// src/caching-utils.ts var core6 = __toESM(require_core()); + +// src/git-utils.ts +var core7 = __toESM(require_core()); var toolrunner2 = __toESM(require_toolrunner()); -var io3 = __toESM(require_io2()); +var io3 = __toESM(require_io()); +var semver2 = __toESM(require_semver2()); var runGitCommand = async function(workingDirectory, args, customErrorMessage) { let stdout = ""; let stderr = ""; - core6.debug(`Running git command: git ${args.join(" ")}`); + core7.debug(`Running git command: git ${args.join(" ")}`); try { await new toolrunner2.ToolRunner(await io3.which("git", true), args, { silent: true, @@ -86533,13 +93419,13 @@ var runGitCommand = async function(workingDirectory, args, customErrorMessage) { cwd: workingDirectory }).exec(); return stdout; - } catch (error4) { + } 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 error4; + core7.info(`git call failed. ${customErrorMessage} Error: ${reason}`); + throw error3; } }; var getCommitOid = async function(checkoutPath, ref = "HEAD") { @@ -86683,7 +93569,7 @@ async function getRef() { ) !== head; if (hasChangedRef) { const newRef = ref.replace(pull_ref_regex, "refs/pull/$1/head"); - core6.debug( + core7.debug( `No longer on merge commit, rewriting ref from ${ref} to ${newRef}.` ); return newRef; @@ -86709,16 +93595,16 @@ async function isAnalyzingDefaultBranch() { } // src/logging.ts -var core7 = __toESM(require_core()); +var core8 = __toESM(require_core()); function getActionsLogger() { return { - debug: core7.debug, - info: core7.info, - warning: core7.warning, - error: core7.error, - isDebug: core7.isDebug, - startGroup: core7.startGroup, - endGroup: core7.endGroup + debug: core8.debug, + info: core8.info, + warning: core8.warning, + error: core8.error, + isDebug: core8.isDebug, + startGroup: core8.startGroup, + endGroup: core8.endGroup }; } function formatDuration(durationMs) { @@ -86734,7 +93620,7 @@ function formatDuration(durationMs) { } // src/overlay-database-utils.ts -var CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +var CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; 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; async function writeBaseDatabaseOidsFile(config, sourceRoot) { @@ -86795,7 +93681,7 @@ function computeChangedFiles(baseFileOids, overlayFileOids) { } // src/tools-features.ts -var semver2 = __toESM(require_semver2()); +var semver3 = __toESM(require_semver2()); function isSupportedToolsFeature(versionInfo, feature) { return !!versionInfo.features && versionInfo.features[feature]; } @@ -86810,11 +93696,6 @@ var featureConfig = { envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: void 0 }, - ["analyze_use_new_upload" /* AnalyzeUseNewUpload */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: void 0 - }, ["cleanup_trap_caches" /* CleanupTrapCaches */]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -86826,6 +93707,16 @@ var featureConfig = { 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", @@ -86854,12 +93745,6 @@ var featureConfig = { legacyApi: true, minimumVersion: void 0 }, - ["resolve_supported_languages_using_cli" /* ResolveSupportedLanguagesUsingCli */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: void 0, - toolsFeature: "builtinExtractorsSpecifyDefaultQueries" /* BuiltinExtractorsSpecifyDefaultQueries */ - }, ["overlay_analysis" /* OverlayAnalysis */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -86960,6 +93845,11 @@ var featureConfig = { envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: void 0 }, + ["overlay_analysis_skip_resource_checks" /* OverlayAnalysisSkipResourceChecks */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: void 0 + }, ["overlay_analysis_swift" /* OverlayAnalysisSwift */]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -86971,21 +93861,22 @@ var featureConfig = { minimumVersion: void 0, toolsFeature: "pythonDefaultIsToNotExtractStdlib" /* PythonDefaultIsToNotExtractStdlib */ }, - ["use_repository_properties" /* UseRepositoryProperties */]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: void 0 - }, ["qa_telemetry_enabled" /* QaTelemetryEnabled */]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: void 0 }, - ["java_minimize_dependency_jars" /* JavaMinimizeDependencyJars */]: { + ["upload_overlay_db_to_api" /* UploadOverlayDbToApi */]: { + defaultValue: false, + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: void 0, + toolsFeature: "bundleSupportsOverlay" /* BundleSupportsOverlay */ + }, + ["use_repository_properties" /* UseRepositoryProperties */]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0" + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: void 0 }, ["validate_db_config" /* ValidateDbConfig */]: { defaultValue: false, @@ -87099,7 +93990,7 @@ var GitHubFeatureFlags = class { DEFAULT_VERSION_FEATURE_FLAG_PREFIX.length, f.length - DEFAULT_VERSION_FEATURE_FLAG_SUFFIX.length ).replace(/_/g, "."); - if (!semver3.valid(version)) { + if (!semver4.valid(version)) { this.logger.warning( `Ignoring feature flag ${f} as it does not specify a valid CodeQL version.` ); @@ -87108,15 +93999,15 @@ var GitHubFeatureFlags = class { return version; } async getDefaultCliVersion(variant) { - if (variant === 0 /* DOTCOM */) { - return await this.getDefaultDotcomCliVersion(); + if (supportsFeatureFlags(variant)) { + return await this.getDefaultCliVersionFromFlags(); } return { cliVersion, tagName: bundleVersion }; } - async getDefaultDotcomCliVersion() { + async getDefaultCliVersionFromFlags() { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response).map( ([f, isEnabled]) => isEnabled ? this.getCliVersionFromFeatureFlag(f) : void 0 @@ -87205,7 +94096,7 @@ var GitHubFeatureFlags = class { } } async loadApiResponse() { - if (this.gitHubVersion.type !== 0 /* DOTCOM */ && this.gitHubVersion.type !== 2 /* GHE_DOTCOM */) { + if (!supportsFeatureFlags(this.gitHubVersion.type)) { this.logger.debug( "Not running against github.com. Disabling all toggleable features." ); @@ -87258,6 +94149,9 @@ var GitHubFeatureFlags = class { } } }; +function supportsFeatureFlags(githubVariant) { + return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */; +} // src/status-report.ts var os = __toESM(require("os")); @@ -87267,12 +94161,9 @@ var core9 = __toESM(require_core()); var fs6 = __toESM(require("fs")); var path6 = __toESM(require("path")); -// src/caching-utils.ts -var core8 = __toESM(require_core()); - // src/config/db-config.ts var jsonschema = __toESM(require_lib4()); -var semver4 = __toESM(require_semver2()); +var semver5 = __toESM(require_semver2()); var PACK_IDENTIFIER_PATTERN = (function() { const alphaNumeric = "[a-z0-9]"; const alphaNumericDash = "[a-z0-9-]"; @@ -87301,9 +94192,12 @@ ${jsonContents}` } // src/trap-caching.ts -var actionsCache2 = __toESM(require_cache3()); +var actionsCache2 = __toESM(require_cache4()); // src/config-utils.ts +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB = 2e4; +var OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES = OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_MB * 1e6; +var OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; var OVERLAY_ANALYSIS_FEATURES = { actions: "overlay_analysis_actions" /* OverlayAnalysisActions */, cpp: "overlay_analysis_cpp" /* OverlayAnalysisCpp */, @@ -87381,9 +94275,9 @@ function isFirstPartyAnalysis(actionName) { function isThirdPartyAnalysis(actionName) { return !isFirstPartyAnalysis(actionName); } -function getActionsStatus(error4, otherFailureCause) { - if (error4 || otherFailureCause) { - return error4 instanceof ConfigurationError ? "user-error" : "failure"; +function getActionsStatus(error3, otherFailureCause) { + if (error3 || otherFailureCause) { + return error3 instanceof ConfigurationError ? "user-error" : "failure"; } else { return "success"; } @@ -87597,19 +94491,19 @@ var CliError = class extends Error { this.stderr = stderr; } }; -function extractFatalErrors(error4) { +function extractFatalErrors(error3) { const fatalErrorRegex = /.*fatal (internal )?error occurr?ed(. Details)?:/gi; let fatalErrors = []; let lastFatalErrorIndex; let match; - while ((match = fatalErrorRegex.exec(error4)) !== null) { + while ((match = fatalErrorRegex.exec(error3)) !== null) { if (lastFatalErrorIndex !== void 0) { - fatalErrors.push(error4.slice(lastFatalErrorIndex, match.index).trim()); + fatalErrors.push(error3.slice(lastFatalErrorIndex, match.index).trim()); } lastFatalErrorIndex = match.index; } if (lastFatalErrorIndex !== void 0) { - const lastError = error4.slice(lastFatalErrorIndex).trim(); + const lastError = error3.slice(lastFatalErrorIndex).trim(); if (fatalErrors.length === 0) { return lastError; } @@ -87625,9 +94519,9 @@ function extractFatalErrors(error4) { } return void 0; } -function extractAutobuildErrors(error4) { +function extractAutobuildErrors(error3) { const pattern = /.*\[autobuild\] \[ERROR\] (.*)/gi; - let errorLines = [...error4.matchAll(pattern)].map((match) => match[1]); + let errorLines = [...error3.matchAll(pattern)].map((match) => match[1]); if (errorLines.length > 10) { errorLines = errorLines.slice(0, 10); errorLines.push("(truncated)"); @@ -87812,7 +94706,7 @@ var fs9 = __toESM(require("fs")); var path8 = __toESM(require("path")); var toolcache3 = __toESM(require_tool_cache()); var import_fast_deep_equal = __toESM(require_fast_deep_equal()); -var semver7 = __toESM(require_semver2()); +var semver8 = __toESM(require_semver2()); // node_modules/uuid/dist-node/stringify.js var byteToHex = []; @@ -87873,9 +94767,9 @@ var import_child_process = require("child_process"); var fs7 = __toESM(require("fs")); var stream = __toESM(require("stream")); var import_toolrunner = __toESM(require_toolrunner()); -var io4 = __toESM(require_io2()); +var io4 = __toESM(require_io()); var toolcache = __toESM(require_tool_cache()); -var semver5 = __toESM(require_semver2()); +var semver6 = __toESM(require_semver2()); var MIN_REQUIRED_BSD_TAR_VERSION = "3.4.3"; var MIN_REQUIRED_GNU_TAR_VERSION = "1.31"; async function getTarVersion() { @@ -87917,9 +94811,9 @@ async function isZstdAvailable(logger) { case "gnu": return { available: foundZstdBinary && // GNU tar only uses major and minor version numbers - semver5.gte( - semver5.coerce(version), - semver5.coerce(MIN_REQUIRED_GNU_TAR_VERSION) + semver6.gte( + semver6.coerce(version), + semver6.coerce(MIN_REQUIRED_GNU_TAR_VERSION) ), foundZstdBinary, version: tarVersion @@ -87928,7 +94822,7 @@ async function isZstdAvailable(logger) { return { available: foundZstdBinary && // Do a loose comparison since these version numbers don't contain // a patch version number. - semver5.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), + semver6.gte(version, MIN_REQUIRED_BSD_TAR_VERSION), foundZstdBinary, version: tarVersion }; @@ -88032,10 +94926,10 @@ var os2 = __toESM(require("os")); var path7 = __toESM(require("path")); var import_perf_hooks = require("perf_hooks"); var core10 = __toESM(require_core()); -var import_http_client = __toESM(require_lib6()); +var import_http_client = __toESM(require_lib()); var toolcache2 = __toESM(require_tool_cache()); var import_follow_redirects = __toESM(require_follow_redirects()); -var semver6 = __toESM(require_semver2()); +var semver7 = __toESM(require_semver2()); var STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; var TOOLCACHE_TOOL_NAME = "CodeQL"; function makeDownloadFirstToolsDownloadDurations(downloadDurationMs, extractionDurationMs) { @@ -88165,7 +95059,7 @@ function getToolcacheDirectory(version) { return path7.join( getRequiredEnvParam("RUNNER_TOOL_CACHE"), TOOLCACHE_TOOL_NAME, - semver6.clean(version) || version, + semver7.clean(version) || version, os2.arch() || "" ); } @@ -88290,13 +95184,13 @@ function tryGetTagNameFromUrl(url2, logger) { return match[1]; } function convertToSemVer(version, logger) { - if (!semver7.valid(version)) { + if (!semver8.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 = semver7.clean(version); + const s = semver8.clean(version); if (!s) { throw new Error(`Bundle version ${version} is not in SemVer format.`); } @@ -88404,7 +95298,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian url2 = toolsInput; if (tagName) { const bundleVersion3 = tryGetBundleVersionFromTagName(tagName, logger); - if (bundleVersion3 && semver7.valid(bundleVersion3)) { + if (bundleVersion3 && semver8.valid(bundleVersion3)) { cliVersion2 = convertToSemVer(bundleVersion3, logger); } } @@ -88487,7 +95381,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian toolsVersion: cliVersion2 ?? humanReadableVersion }; } - if (variant !== 0 /* DOTCOM */ && !forceShippedTools && !toolsInput) { + if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) { const result = await findOverridingToolsInCache( humanReadableVersion, logger @@ -88675,7 +95569,7 @@ async function setupCodeQLBundle(toolsInput, apiDetails, tempDir, variant, defau async function useZstdBundle(cliVersion2, tarSupportsZstd) { return ( // In testing, gzip performs better than zstd on Windows. - process.platform !== "win32" && tarSupportsZstd && semver7.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) + process.platform !== "win32" && tarSupportsZstd && semver8.gte(cliVersion2, CODEQL_VERSION_ZSTD_BUNDLE) ); } function getTempExtractionDir(tempDir) { @@ -88707,7 +95601,7 @@ async function getNightlyToolsUrl(logger) { } } function getLatestToolcacheVersion(logger) { - const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver7.compare(b, a)); + const allVersions = toolcache3.findAllVersions("CodeQL").sort((a, b) => semver8.compare(b, a)); logger.debug( `Found the following versions of the CodeQL tools in the toolcache: ${JSON.stringify( allVersions @@ -89196,6 +96090,23 @@ ${output}` ); } }, + async resolveDatabase(databasePath) { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]) + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + try { + return JSON.parse(output); + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}` + ); + } + }, async mergeResults(sarifFiles, outputFile, { mergeRunsFromEqualCategory = false }) { @@ -89756,13 +96667,13 @@ function fromString(str2, unsigned, radix) { return result; } Long.fromString = fromString; -function fromValue(val2, unsigned) { - if (typeof val2 === "number") return fromNumber(val2, unsigned); - if (typeof val2 === "string") return fromString(val2, unsigned); +function fromValue(val, unsigned) { + if (typeof val === "number") return fromNumber(val, unsigned); + if (typeof val === "string") return fromString(val, unsigned); return fromBits( - val2.low, - val2.high, - typeof unsigned === "boolean" ? unsigned : val2.unsigned + val.low, + val.high, + typeof unsigned === "boolean" ? unsigned : val.unsigned ); } Long.fromValue = fromValue; @@ -89834,8 +96745,8 @@ LongPrototype.getLowBitsUnsigned = function getLowBitsUnsigned() { LongPrototype.getNumBitsAbs = function getNumBitsAbs() { if (this.isNegative()) return this.eq(MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); - var val2 = this.high != 0 ? this.high : this.low; - for (var bit = 31; bit > 0; bit--) if ((val2 & 1 << bit) != 0) break; + 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() { @@ -90455,7 +97366,7 @@ async function addFingerprints(sarif, sourceRoot, logger) { // src/init.ts var toolrunner4 = __toESM(require_toolrunner()); -var io5 = __toESM(require_io2()); +var io5 = __toESM(require_io()); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, features, logger) { logger.startGroup("Setup CodeQL tools"); const { @@ -90541,7 +97452,7 @@ function areAllRunsUnique(sarifObjects) { return true; } async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) { - if (githubVersion.type === 1 /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { + if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) { return false; } return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING; @@ -90556,7 +97467,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) { ); } async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) { - if (githubVersion.type === 1 /* GHES */) { + if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) { if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) { return false; } @@ -90571,7 +97482,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo const sarifObjects = sarifFiles.map((sarifFile) => { return JSON.parse(fs12.readFileSync(sarifFile, "utf8")); }); - const deprecationWarningMessage = gitHubVersion.type === 1 /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025"; + 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); @@ -90803,15 +97714,15 @@ function validateSarifFileSchema(sarif, sarifFilePath, logger) { const warnings = (result.errors ?? []).filter( (err) => err.name === "format" && typeof err.argument === "string" && warningAttributes.includes(err.argument) ); - for (const warning9 of warnings) { + for (const warning10 of warnings) { logger.info( - `Warning: '${warning9.instance}' is not a valid URI in '${warning9.property}'.` + `Warning: '${warning10.instance}' is not a valid URI in '${warning10.property}'.` ); } if (errors.length > 0) { - for (const error4 of errors) { - logger.startGroup(`Error details: ${error4.stack}`); - logger.info(JSON.stringify(error4, null, 2)); + 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}`); @@ -91034,10 +97945,10 @@ function shouldConsiderConfigurationError(processingErrors) { } function shouldConsiderInvalidRequest(processingErrors) { return processingErrors.every( - (error4) => error4.startsWith("rejecting SARIF") || error4.startsWith("an invalid URI was provided as a SARIF location") || error4.startsWith("locationFromSarifResult: expected artifact location") || error4.startsWith( + (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( - error4 + error3 ) ); } @@ -91236,18 +98147,18 @@ async function run() { logger ); } catch (unwrappedError) { - const error4 = isThirdPartyAnalysis("upload-sarif" /* UploadSarif */) && unwrappedError instanceof InvalidSarifUploadError ? new ConfigurationError(unwrappedError.message) : wrapError(unwrappedError); - const message = error4.message; + const error3 = isThirdPartyAnalysis("upload-sarif" /* UploadSarif */) && unwrappedError instanceof InvalidSarifUploadError ? new ConfigurationError(unwrappedError.message) : wrapError(unwrappedError); + const message = error3.message; core13.setFailed(message); const errorStatusReportBase = await createStatusReportBase( "upload-sarif" /* UploadSarif */, - getActionsStatus(error4), + getActionsStatus(error3), startedAt, void 0, await checkDiskUsage(logger), logger, message, - error4.stack + error3.stack ); if (errorStatusReportBase !== void 0) { await sendStatusReport(errorStatusReportBase); @@ -91258,9 +98169,9 @@ async function run() { async function runWrapper() { try { await run(); - } catch (error4) { + } catch (error3) { core13.setFailed( - `codeql/upload-sarif action failed: ${getErrorMessage(error4)}` + `codeql/upload-sarif action failed: ${getErrorMessage(error3)}` ); } } @@ -91274,7 +98185,7 @@ undici/lib/websocket/frame.js: (*! ws. MIT License. Einar Otto Stangvik *) js-yaml/dist/js-yaml.mjs: - (*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *) + (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *) long/index.js: (** diff --git a/package-lock.json b/package-lock.json index 5ce7fe06fa..9c4a53291d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,64 +1,63 @@ { "name": "codeql", - "version": "4.31.3", + "version": "4.31.10", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "codeql", - "version": "4.31.3", + "version": "4.31.10", "license": "MIT", "dependencies": { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", "archiver": "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "jsonschema": "1.4.1", "long": "^5.3.2", - "node-forge": "^1.3.1", - "octokit": "^5.0.5", + "node-forge": "^1.3.3", "semver": "^7.7.3", "uuid": "^13.0.0" }, "devDependencies": { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", "ava": "^6.4.1", - "esbuild": "^0.25.12", + "esbuild": "^0.27.1", "eslint": "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - "glob": "^11.0.3", + "glob": "^11.1.0", "nock": "^14.0.10", "sinon": "^21.0.0", "typescript": "^5.9.3" @@ -73,16 +72,15 @@ } }, "node_modules/@actions/artifact": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-4.0.0.tgz", - "integrity": "sha512-HCc2jMJRAfviGFAh0FsOR/jNfWhirxl7W6z8zDtttt0GltwxBLdEIjLiweOPFl9WbyJRW1VWnPUSAixJqcWUMQ==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@actions/artifact/-/artifact-5.0.1.tgz", + "integrity": "sha512-dHJ5rHduhCKUikKTT9eXeWoUvfKia3IjR1sO/VTAV3DVAL4yMTRnl2iO5mcfiBjySHLwPNezwENAVskKYU5ymw==", "license": "MIT", "dependencies": { - "@actions/core": "^1.10.0", + "@actions/core": "^2.0.0", "@actions/github": "^6.0.1", - "@actions/http-client": "^2.1.0", - "@azure/core-http": "^3.0.5", - "@azure/storage-blob": "^12.15.0", + "@actions/http-client": "^3.0.0", + "@azure/storage-blob": "^12.29.1", "@octokit/core": "^5.2.1", "@octokit/plugin-request-log": "^1.0.4", "@octokit/plugin-retry": "^3.0.9", @@ -106,17 +104,26 @@ "tmp-promise": "^3.0.2" } }, - "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==", + "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": { - "tunnel": "^0.0.6", - "undici": "^5.25.4" + "@actions/exec": "^1.1.1", + "@actions/http-client": "^2.0.1" } }, - "node_modules/@actions/artifact/node_modules/@actions/http-client": { + "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==", @@ -126,6 +133,12 @@ "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/@octokit/endpoint": { "version": "9.0.6", "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-9.0.6.tgz", @@ -206,48 +219,23 @@ "integrity": "sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==" }, "node_modules/@actions/cache": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.1.0.tgz", - "integrity": "sha512-z3Opg+P4Y7baq+g1dODXgdtsvPLSewr3ZKpp3U0HQR1A/vWCoJFS52XSezjdngo4SIOdR5oHtyK3a3Arar+X9A==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-5.0.1.tgz", + "integrity": "sha512-c+oH047Z2zmXLhjMZfEKjxZfv6Ou7T0sn5fhz6yupICXm5OOR47oZn5zxNO8MP7ttkxv5TOg3WsMrffri5Xhfw==", "license": "MIT", "dependencies": { - "@actions/core": "^1.11.1", - "@actions/exec": "^1.0.1", - "@actions/glob": "^0.1.0", - "@actions/http-client": "^2.1.1", - "@actions/io": "^1.0.1", + "@actions/core": "^2.0.0", + "@actions/exec": "^2.0.0", + "@actions/glob": "^0.5.0", + "@actions/http-client": "^3.0.0", + "@actions/io": "^2.0.0", "@azure/abort-controller": "^1.1.0", - "@azure/ms-rest-js": "^2.6.0", - "@azure/storage-blob": "^12.13.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/@actions/glob": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.1.2.tgz", - "integrity": "sha512-SclLR7Ia5sEqjkJTPs7Sd86maMDw43p769YxBOxvPvEWuPEhpAnBsQfENOpXjFYMmhCqd127bmf+YdvJqVqR4A==", - "dependencies": { - "@actions/core": "^1.2.6", - "minimatch": "^3.0.4" - } - }, - "node_modules/@actions/cache/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/cache/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/cache/node_modules/semver": { "version": "6.3.1", "license": "ISC", @@ -256,37 +244,24 @@ } }, "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==", - "dependencies": { - "@actions/exec": "^1.1.1", - "@actions/http-client": "^2.0.1" - } - }, - "node_modules/@actions/core/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==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-2.0.1.tgz", + "integrity": "sha512-oBfqT3GwkvLlo1fjvhQLQxuwZCGTarTE5OuZ2Wg10hvhBj7LRIlF611WT4aZS6fDhO5ZKlY7lCAZTlpmyaHaeg==", "license": "MIT", "dependencies": { - "tunnel": "^0.0.6", - "undici": "^5.25.4" + "@actions/exec": "^2.0.0", + "@actions/http-client": "^3.0.0" } }, "node_modules/@actions/exec": { - "version": "1.1.1", + "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": "^1.0.1" + "@actions/io": "^2.0.0" } }, - "node_modules/@actions/exec/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/github": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/@actions/github/-/github-6.0.1.tgz", @@ -427,6 +402,41 @@ "minimatch": "^3.0.4" } }, + "node_modules/@actions/glob/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/glob/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/glob/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/glob/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/http-client": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-3.0.0.tgz", @@ -456,6 +466,25 @@ "semver": "^6.1.0" } }, + "node_modules/@actions/tool-cache/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/tool-cache/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/tool-cache/node_modules/@actions/http-client": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.2.3.tgz", @@ -498,6 +527,8 @@ }, "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" @@ -506,22 +537,18 @@ "node": ">=12.0.0" } }, - "node_modules/@azure/abort-controller/node_modules/tslib": { - "version": "2.4.0", - "license": "0BSD" - }, "node_modules/@azure/core-auth": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.8.0.tgz", - "integrity": "sha512-YvFMowkXzLbXNM11yZtVLhUCmuG0ex7JKOH366ipjmHBhL3vpDcPAeWF+jf0X+jVXwFqo3UhsWUq4kH0ZPdu/g==", + "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.0.0", - "@azure/core-util": "^1.1.0", + "@azure/abort-controller": "^2.1.2", + "@azure/core-util": "^1.13.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@azure/core-auth/node_modules/@azure/abort-controller": { @@ -536,28 +563,22 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/core-auth/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" - }, "node_modules/@azure/core-client": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.9.2.tgz", - "integrity": "sha512-kRdry/rav3fUKHl/aDLd/pDLcB+4pOFwPPTVEExuMyaI5r+JBbMWqRbCY1pn5BniDaU3lRxO9eaQ1AmSMehl/w==", + "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.0.0", - "@azure/core-auth": "^1.4.0", - "@azure/core-rest-pipeline": "^1.9.1", - "@azure/core-tracing": "^1.0.0", - "@azure/core-util": "^1.6.1", - "@azure/logger": "^1.0.0", + "@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": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@azure/core-client/node_modules/@azure/abort-controller": { @@ -572,50 +593,18 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/core-client/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" - }, - "node_modules/@azure/core-http": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-3.0.5.tgz", - "integrity": "sha512-T8r2q/c3DxNu6mEJfPuJtptUVqwchxzjj32gKcnMi06rdiVONS9rar7kT9T2Am+XvER7uOzpsP79WsqNbdgdWg==", - "deprecated": "This package is no longer supported. Please refer to https://github.com/Azure/azure-sdk-for-js/blob/490ce4dfc5b98ba290dee3b33a6d0876c5f138e2/sdk/core/README.md", - "license": "MIT", - "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.3.0", - "@azure/core-tracing": "1.0.0-preview.13", - "@azure/core-util": "^1.1.1", - "@azure/logger": "^1.0.0", - "@types/node-fetch": "^2.5.0", - "@types/tunnel": "^0.0.3", - "form-data": "^4.0.0", - "node-fetch": "^2.6.7", - "process": "^0.11.10", - "tslib": "^2.2.0", - "tunnel": "^0.0.6", - "uuid": "^8.3.0", - "xml2js": "^0.5.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/@azure/core-http-compat": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/@azure/core-http-compat/-/core-http-compat-2.1.2.tgz", - "integrity": "sha512-5MnV1yqzZwgNLLjlizsU3QqOeQChkIXw781Fwh1xdAqJR5AA32IUaq6xv1BICJvfbHoa+JYcaij2HFkhLbNTJQ==", + "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.0.0", - "@azure/core-client": "^1.3.0", - "@azure/core-rest-pipeline": "^1.3.0" + "@azure/abort-controller": "^2.1.2", + "@azure/core-client": "^1.10.0", + "@azure/core-rest-pipeline": "^1.22.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@azure/core-http-compat/node_modules/@azure/abort-controller": { @@ -630,104 +619,61 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/core-http-compat/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" - }, - "node_modules/@azure/core-http/node_modules/@azure/core-tracing": { - "version": "1.0.0-preview.13", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.13.tgz", - "integrity": "sha512-KxDlhXyMlh2Jhj2ykX6vNEU0Vou4nHr025KoSEiz7cS3BNiHNaZcdECk/DmLkEB0as5T7b/TpRcehJ5yV6NeXQ==", - "license": "MIT", - "dependencies": { - "@opentelemetry/api": "^1.0.1", - "tslib": "^2.2.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@azure/core-http/node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", + "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": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" + "@azure/abort-controller": "^2.0.0", + "@azure/core-util": "^1.2.0", + "@azure/logger": "^1.0.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">= 6" - } - }, - "node_modules/@azure/core-http/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/@azure/core-http/node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "license": "MIT", - "bin": { - "uuid": "dist/bin/uuid" + "node": ">=18.0.0" } }, - "node_modules/@azure/core-lro": { - "version": "2.5.3", + "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": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-util": "^1.2.0", - "@azure/logger": "^1.0.0", - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" } }, - "node_modules/@azure/core-lro/node_modules/tslib": { - "version": "2.6.0", - "license": "0BSD" - }, "node_modules/@azure/core-paging": { - "version": "1.5.0", + "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.2.0" + "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" } }, - "node_modules/@azure/core-paging/node_modules/tslib": { - "version": "2.6.0", - "license": "0BSD" - }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.17.0.tgz", - "integrity": "sha512-62Vv8nC+uPId3j86XJ0WI+sBf0jlqTqPUFCBNrGtlaUeQUIXWV/D8GE5A1d+Qx8H7OQojn2WguC8kChD6v0shA==", + "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.0.0", - "@azure/core-auth": "^1.8.0", - "@azure/core-tracing": "^1.0.1", - "@azure/core-util": "^1.9.0", - "@azure/logger": "^1.0.0", - "http-proxy-agent": "^7.0.0", - "https-proxy-agent": "^7.0.0", + "@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": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller": { @@ -742,41 +688,30 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/core-rest-pipeline/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" - }, "node_modules/@azure/core-tracing": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.1.2.tgz", - "integrity": "sha512-dawW9ifvWAWmUm9/h+/UQ2jrdvjCJ7VJEuCJ6XVNudzcOwm53BFZH4Q845vjfgoUAM8ZxokvVNxNxAITc502YA==", + "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": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@azure/core-tracing/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" - }, "node_modules/@azure/core-util": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.10.0.tgz", - "integrity": "sha512-dqLWQsh9Nro1YQU+405POVtXnwrIVqPyfUzc4zXCbThTg7+vNNaiMkwbX9AMXKyoFYFClxmB3s25ZFr3+jZkww==", + "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.0.0", + "@azure/abort-controller": "^2.1.2", + "@typespec/ts-http-runtime": "^0.3.0", "tslib": "^2.6.2" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, "node_modules/@azure/core-util/node_modules/@azure/abort-controller": { @@ -791,91 +726,90 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/core-util/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" - }, "node_modules/@azure/core-xml": { - "version": "1.4.3", - "resolved": "https://registry.npmjs.org/@azure/core-xml/-/core-xml-1.4.3.tgz", - "integrity": "sha512-D6G7FEmDiTctPKuWegX2WTrS1enKZwqYwdKTO6ZN6JMigcCehlT0/CYl+zWpI9vQ9frwwp7GQT3/owaEXgnOsA==", + "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": "^4.3.2", - "tslib": "^2.6.2" + "fast-xml-parser": "^5.0.7", + "tslib": "^2.8.1" }, "engines": { - "node": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@azure/core-xml/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" - }, "node_modules/@azure/logger": { - "version": "1.0.4", + "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": { - "tslib": "^2.2.0" + "@typespec/ts-http-runtime": "^0.3.0", + "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=20.0.0" } }, - "node_modules/@azure/logger/node_modules/tslib": { - "version": "2.6.0", - "license": "0BSD" - }, - "node_modules/@azure/ms-rest-js": { - "version": "2.7.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/core-auth": "^1.1.4", - "abort-controller": "^3.0.0", - "form-data": "^2.5.0", - "node-fetch": "^2.6.7", - "tslib": "^1.10.0", - "tunnel": "0.0.6", - "uuid": "^8.3.2", - "xml2js": "^0.5.0" + "@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/ms-rest-js/node_modules/uuid": { - "version": "8.3.2", + "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", - "bin": { - "uuid": "dist/bin/uuid" + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, - "node_modules/@azure/storage-blob": { - "version": "12.25.0", - "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.25.0.tgz", - "integrity": "sha512-oodouhA3nCCIh843tMMbxty3WqfNT+Vgzj3Xo5jqR9UPnzq3d7mzLjlHAYz7lW+b4km3SIgz+NAgztvhm7Z6kQ==", + "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.4.0", - "@azure/core-client": "^1.6.2", - "@azure/core-http-compat": "^2.0.0", - "@azure/core-lro": "^2.2.0", - "@azure/core-paging": "^1.1.1", - "@azure/core-rest-pipeline": "^1.10.1", - "@azure/core-tracing": "^1.1.2", - "@azure/core-util": "^1.6.1", - "@azure/core-xml": "^1.4.3", - "@azure/logger": "^1.0.0", - "events": "^3.0.0", - "tslib": "^2.2.0" + "@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": ">=18.0.0" + "node": ">=20.0.0" } }, - "node_modules/@azure/storage-blob/node_modules/@azure/abort-controller": { + "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==", @@ -887,16 +821,64 @@ "node": ">=18.0.0" } }, - "node_modules/@azure/storage-blob/node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", - "license": "0BSD" + "node_modules/@es-joy/jsdoccomment": { + "version": "0.76.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.76.0.tgz", + "integrity": "sha512-g+RihtzFgGTx2WYCuTHbdOXJeAlGnROws0TeALx9ow/ZmOROOZkVg5wp/B44n0WJgI4SQFP1eWM2iRPlU2Y14w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.8", + "@typescript-eslint/types": "^8.46.0", + "comment-parser": "1.4.1", + "esquery": "^1.6.0", + "jsdoc-type-pratt-parser": "~6.10.0" + }, + "engines": { + "node": ">=20.11.0" + } + }, + "node_modules/@es-joy/jsdoccomment/node_modules/@typescript-eslint/types": { + "version": "8.46.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.3.tgz", + "integrity": "sha512-G7Ok9WN/ggW7e/tOf8TQYMaxgID3Iujn231hfi0Pc7ZheztIJVpO44ekY00b7akqc6nZcvregk0Jpah3kep6hA==", + "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/@es-joy/jsdoccomment/node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "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.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", - "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.1.tgz", + "integrity": "sha512-HHB50pdsBX6k47S4u5g/CaLjqS3qwaOVE5ILsq64jyzgMhLuCuZ8rGzM9yhsAjfjkbgUPMzZEPa7DAp7yz6vuA==", "cpu": [ "ppc64" ], @@ -911,9 +893,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", - "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.1.tgz", + "integrity": "sha512-kFqa6/UcaTbGm/NncN9kzVOODjhZW8e+FRdSeypWe6j33gzclHtwlANs26JrupOntlcWmB0u8+8HZo8s7thHvg==", "cpu": [ "arm" ], @@ -928,9 +910,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", - "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.1.tgz", + "integrity": "sha512-45fuKmAJpxnQWixOGCrS+ro4Uvb4Re9+UTieUY2f8AEc+t7d4AaZ6eUJ3Hva7dtrxAAWHtlEFsXFMAgNnGU9uQ==", "cpu": [ "arm64" ], @@ -945,9 +927,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", - "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.1.tgz", + "integrity": "sha512-LBEpOz0BsgMEeHgenf5aqmn/lLNTFXVfoWMUox8CtWWYK9X4jmQzWjoGoNb8lmAYml/tQ/Ysvm8q7szu7BoxRQ==", "cpu": [ "x64" ], @@ -962,9 +944,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", - "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.1.tgz", + "integrity": "sha512-veg7fL8eMSCVKL7IW4pxb54QERtedFDfY/ASrumK/SbFsXnRazxY4YykN/THYqFnFwJ0aVjiUrVG2PwcdAEqQQ==", "cpu": [ "arm64" ], @@ -979,9 +961,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", - "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.1.tgz", + "integrity": "sha512-+3ELd+nTzhfWb07Vol7EZ+5PTbJ/u74nC6iv4/lwIU99Ip5uuY6QoIf0Hn4m2HoV0qcnRivN3KSqc+FyCHjoVQ==", "cpu": [ "x64" ], @@ -996,9 +978,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", - "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.1.tgz", + "integrity": "sha512-/8Rfgns4XD9XOSXlzUDepG8PX+AVWHliYlUkFI3K3GB6tqbdjYqdhcb4BKRd7C0BhZSoaCxhv8kTcBrcZWP+xg==", "cpu": [ "arm64" ], @@ -1013,9 +995,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", - "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.1.tgz", + "integrity": "sha512-GITpD8dK9C+r+5yRT/UKVT36h/DQLOHdwGVwwoHidlnA168oD3uxA878XloXebK4Ul3gDBBIvEdL7go9gCUFzQ==", "cpu": [ "x64" ], @@ -1030,9 +1012,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", - "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.1.tgz", + "integrity": "sha512-ieMID0JRZY/ZeCrsFQ3Y3NlHNCqIhTprJfDgSB3/lv5jJZ8FX3hqPyXWhe+gvS5ARMBJ242PM+VNz/ctNj//eA==", "cpu": [ "arm" ], @@ -1047,9 +1029,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", - "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.1.tgz", + "integrity": "sha512-W9//kCrh/6in9rWIBdKaMtuTTzNj6jSeG/haWBADqLLa9P8O5YSRDzgD5y9QBok4AYlzS6ARHifAb75V6G670Q==", "cpu": [ "arm64" ], @@ -1064,9 +1046,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", - "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.1.tgz", + "integrity": "sha512-VIUV4z8GD8rtSVMfAj1aXFahsi/+tcoXXNYmXgzISL+KB381vbSTNdeZHHHIYqFyXcoEhu9n5cT+05tRv13rlw==", "cpu": [ "ia32" ], @@ -1081,9 +1063,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", - "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.1.tgz", + "integrity": "sha512-l4rfiiJRN7sTNI//ff65zJ9z8U+k6zcCg0LALU5iEWzY+a1mVZ8iWC1k5EsNKThZ7XCQ6YWtsZ8EWYm7r1UEsg==", "cpu": [ "loong64" ], @@ -1098,9 +1080,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", - "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.1.tgz", + "integrity": "sha512-U0bEuAOLvO/DWFdygTHWY8C067FXz+UbzKgxYhXC0fDieFa0kDIra1FAhsAARRJbvEyso8aAqvPdNxzWuStBnA==", "cpu": [ "mips64el" ], @@ -1115,9 +1097,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", - "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.1.tgz", + "integrity": "sha512-NzdQ/Xwu6vPSf/GkdmRNsOfIeSGnh7muundsWItmBsVpMoNPVpM61qNzAVY3pZ1glzzAxLR40UyYM23eaDDbYQ==", "cpu": [ "ppc64" ], @@ -1132,9 +1114,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", - "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.1.tgz", + "integrity": "sha512-7zlw8p3IApcsN7mFw0O1Z1PyEk6PlKMu18roImfl3iQHTnr/yAfYv6s4hXPidbDoI2Q0pW+5xeoM4eTCC0UdrQ==", "cpu": [ "riscv64" ], @@ -1149,9 +1131,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", - "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.1.tgz", + "integrity": "sha512-cGj5wli+G+nkVQdZo3+7FDKC25Uh4ZVwOAK6A06Hsvgr8WqBBuOy/1s+PUEd/6Je+vjfm6stX0kmib5b/O2Ykw==", "cpu": [ "s390x" ], @@ -1166,9 +1148,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", - "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.1.tgz", + "integrity": "sha512-z3H/HYI9MM0HTv3hQZ81f+AKb+yEoCRlUby1F80vbQ5XdzEMyY/9iNlAmhqiBKw4MJXwfgsh7ERGEOhrM1niMA==", "cpu": [ "x64" ], @@ -1183,9 +1165,9 @@ } }, "node_modules/@esbuild/netbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", - "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.1.tgz", + "integrity": "sha512-wzC24DxAvk8Em01YmVXyjl96Mr+ecTPyOuADAvjGg+fyBpGmxmcr2E5ttf7Im8D0sXZihpxzO1isus8MdjMCXQ==", "cpu": [ "arm64" ], @@ -1200,9 +1182,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", - "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.1.tgz", + "integrity": "sha512-1YQ8ybGi2yIXswu6eNzJsrYIGFpnlzEWRl6iR5gMgmsrR0FcNoV1m9k9sc3PuP5rUBLshOZylc9nqSgymI+TYg==", "cpu": [ "x64" ], @@ -1217,9 +1199,9 @@ } }, "node_modules/@esbuild/openbsd-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", - "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.1.tgz", + "integrity": "sha512-5Z+DzLCrq5wmU7RDaMDe2DVXMRm2tTDvX2KU14JJVBN2CT/qov7XVix85QoJqHltpvAOZUAc3ndU56HSMWrv8g==", "cpu": [ "arm64" ], @@ -1234,9 +1216,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", - "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.1.tgz", + "integrity": "sha512-Q73ENzIdPF5jap4wqLtsfh8YbYSZ8Q0wnxplOlZUOyZy7B4ZKW8DXGWgTCZmF8VWD7Tciwv5F4NsRf6vYlZtqg==", "cpu": [ "x64" ], @@ -1251,9 +1233,9 @@ } }, "node_modules/@esbuild/openharmony-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", - "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.1.tgz", + "integrity": "sha512-ajbHrGM/XiK+sXM0JzEbJAen+0E+JMQZ2l4RR4VFwvV9JEERx+oxtgkpoKv1SevhjavK2z2ReHk32pjzktWbGg==", "cpu": [ "arm64" ], @@ -1268,9 +1250,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", - "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.1.tgz", + "integrity": "sha512-IPUW+y4VIjuDVn+OMzHc5FV4GubIwPnsz6ubkvN8cuhEqH81NovB53IUlrlBkPMEPxvNnf79MGBoz8rZ2iW8HA==", "cpu": [ "x64" ], @@ -1285,9 +1267,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", - "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.1.tgz", + "integrity": "sha512-RIVRWiljWA6CdVu8zkWcRmGP7iRRIIwvhDKem8UMBjPql2TXM5PkDVvvrzMtj1V+WFPB4K7zkIGM7VzRtFkjdg==", "cpu": [ "arm64" ], @@ -1302,9 +1284,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", - "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.1.tgz", + "integrity": "sha512-2BR5M8CPbptC1AK5JbJT1fWrHLvejwZidKx3UMSF0ecHMa+smhi16drIrCEggkgviBwLYd5nwrFLSl5Kho96RQ==", "cpu": [ "ia32" ], @@ -1319,9 +1301,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", - "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.1.tgz", + "integrity": "sha512-d5X6RMYv6taIymSk8JBP+nxv8DQAMY6A51GPgusqLdK9wBz5wWIXy1KjTck6HnjE9hqJzJRdk+1p/t5soSbCtw==", "cpu": [ "x64" ], @@ -1362,16 +1344,16 @@ } }, "node_modules/@eslint/compat": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.4.1.tgz", - "integrity": "sha512-cfO82V9zxxGBxcQDr1lfaYB7wykTa0b00mGa36FrJl7iTFd0Z2cHfEYuxcBRP/iNijCsWsEkA+jzT8hGYmv33w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-2.0.0.tgz", + "integrity": "sha512-T9AfE1G1uv4wwq94ozgTGio5EUQBqAVe1X9qsQtSNVEYW6j3hvtZVm8Smr4qL1qDPFg+lOB2cL5RxTRMzq4CTA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.17.0" + "@eslint/core": "^1.0.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": "^20.19.0 || ^22.13.0 || >=24" }, "peerDependencies": { "eslint": "^8.40 || 9" @@ -1383,23 +1365,24 @@ } }, "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==", + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.0.0.tgz", + "integrity": "sha512-PRfWP+8FOldvbApr6xL7mNCw4cJcSTq4GA7tYbgq15mRb0kWKO/wEB2jr+uwjFH3sZvEZneZyCUGTxsv4Sahyw==", "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": "^20.19.0 || ^22.13.0 || >=24" } }, "node_modules/@eslint/eslintrc": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", - "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.3.tgz", + "integrity": "sha512-Kr+LPIUVKz2qkx1HAMH8q1q6azbqBAsXJUxBl/ODDuVPX45Z9DfwB8tPjTi6nNZ8BuM3nbJxC5zCAg5elnBUTQ==", "dev": true, + "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -1407,7 +1390,7 @@ "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" }, @@ -1460,9 +1443,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.39.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.0.tgz", - "integrity": "sha512-BIhe0sW91JGPiaF1mOuPy5v8NflqfjIcDNpC+LbW9f609WVRX1rArrhi6Z2ymvrAry9jw+5POTj4t2t62o8Bmw==", + "version": "9.39.2", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.2.tgz", + "integrity": "sha512-q1mjIoW1VX4IvSocvM/vbTiveKC4k9eLrajNEuSsmjymSDEbpGddtpfOoN7YGAqBK3NG+uqo8ia4PDTt8buCYA==", "dev": true, "license": "MIT", "engines": { @@ -1523,7 +1506,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "dev": true, "license": "MIT", "engines": { "node": "20 || >=22" @@ -1533,7 +1515,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", - "dev": true, "license": "MIT", "dependencies": { "@isaacs/balanced-match": "^4.0.1" @@ -1664,6 +1645,7 @@ "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", @@ -1705,209 +1687,33 @@ } }, "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/@nolyfill/is-core-module": { - "version": "1.0.39", - "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", - "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", - "dev": true, - "engines": { - "node": ">=12.4.0" - } - }, - "node_modules/@octokit/app": { - "version": "16.1.2", - "resolved": "https://registry.npmjs.org/@octokit/app/-/app-16.1.2.tgz", - "integrity": "sha512-8j7sEpUYVj18dxvh0KWj6W/l6uAiVRBl1JBDVRqH1VHKAO/G5eRVl4yEoYACjakWers1DjUkcCHyJNQK47JqyQ==", - "license": "MIT", - "dependencies": { - "@octokit/auth-app": "^8.1.2", - "@octokit/auth-unauthenticated": "^7.0.3", - "@octokit/core": "^7.0.6", - "@octokit/oauth-app": "^8.0.3", - "@octokit/plugin-paginate-rest": "^14.0.0", - "@octokit/types": "^16.0.0", - "@octokit/webhooks": "^14.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/app/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/app/node_modules/@octokit/core": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", - "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", - "license": "MIT", - "dependencies": { - "@octokit/auth-token": "^6.0.0", - "@octokit/graphql": "^9.0.3", - "@octokit/request": "^10.0.6", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "before-after-hook": "^4.0.0", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/app/node_modules/@octokit/graphql": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", - "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", - "license": "MIT", - "dependencies": { - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/app/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/app/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/@octokit/app/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/auth-app": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-app/-/auth-app-8.1.2.tgz", - "integrity": "sha512-db8VO0PqXxfzI6GdjtgEFHY9tzqUql5xMFXYA12juq8TeTgPAuiiP3zid4h50lwlIP457p5+56PnJOgd2GGBuw==", - "license": "MIT", - "dependencies": { - "@octokit/auth-oauth-app": "^9.0.3", - "@octokit/auth-oauth-user": "^6.0.2", - "@octokit/request": "^10.0.6", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "toad-cache": "^3.7.0", - "universal-github-app-jwt": "^2.2.0", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/auth-app/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/auth-oauth-app": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-app/-/auth-oauth-app-9.0.3.tgz", - "integrity": "sha512-+yoFQquaF8OxJSxTb7rnytBIC2ZLbLqA/yb71I4ZXT9+Slw4TziV9j/kyGhUFRRTF2+7WlnIWsePZCWHs+OGjg==", - "license": "MIT", - "dependencies": { - "@octokit/auth-oauth-device": "^8.0.3", - "@octokit/auth-oauth-user": "^6.0.2", - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/auth-oauth-app/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/auth-oauth-device": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-device/-/auth-oauth-device-8.0.3.tgz", - "integrity": "sha512-zh2W0mKKMh/VWZhSqlaCzY7qFyrgd9oTWmTmHaXnHNeQRCZr/CXy2jCgHo4e4dJVTiuxP5dLa0YM5p5QVhJHbw==", + "version": "2.0.5", + "dev": true, "license": "MIT", - "dependencies": { - "@octokit/oauth-methods": "^6.0.2", - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.0" - }, "engines": { - "node": ">= 20" + "node": ">= 8" } }, - "node_modules/@octokit/auth-oauth-device/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/auth-oauth-user": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@octokit/auth-oauth-user/-/auth-oauth-user-6.0.2.tgz", - "integrity": "sha512-qLoPPc6E6GJoz3XeDG/pnDhJpTkODTGG4kY0/Py154i/I003O9NazkrwJwRuzgCalhzyIeWQ+6MDvkUmKXjg/A==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "dev": true, "license": "MIT", "dependencies": { - "@octokit/auth-oauth-device": "^8.0.3", - "@octokit/oauth-methods": "^6.0.2", - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.0" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": ">= 20" + "node": ">= 8" } }, - "node_modules/@octokit/auth-oauth-user/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/@nolyfill/is-core-module": { + "version": "1.0.39", + "resolved": "https://registry.npmjs.org/@nolyfill/is-core-module/-/is-core-module-1.0.39.tgz", + "integrity": "sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==", + "dev": true, + "engines": { + "node": ">=12.4.0" + } }, "node_modules/@octokit/auth-token": { "version": "4.0.0", @@ -1917,24 +1723,12 @@ "node": ">= 18" } }, - "node_modules/@octokit/auth-unauthenticated": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@octokit/auth-unauthenticated/-/auth-unauthenticated-7.0.3.tgz", - "integrity": "sha512-8Jb1mtUdmBHL7lGmop9mU9ArMRUTRhg8vp0T1VtZ4yd9vEm3zcLwmjQkhNEduKawOOORie61xhtYIhTDN+ZQ3g==", - "license": "MIT", - "dependencies": { - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0" - }, - "engines": { - "node": ">= 20" - } - }, "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", + "peer": true, "dependencies": { "@octokit/auth-token": "^4.0.0", "@octokit/graphql": "^7.1.0", @@ -2000,25 +1794,6 @@ "@octokit/openapi-types": "^24.2.0" } }, - "node_modules/@octokit/endpoint": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.2.tgz", - "integrity": "sha512-4zCpzP1fWc7QlqunZ5bSEjxc6yLAlRTnDwKtgXfcI/FxxGoqedDG8V2+xJ60bV2kODqcGB+nATdtap/XYq2NZQ==", - "license": "MIT", - "dependencies": { - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.2" - }, - "engines": { - "node": ">= 20" - } - }, - "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": "7.1.1", "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-7.1.1.tgz", @@ -2084,112 +1859,11 @@ "@octokit/openapi-types": "^24.2.0" } }, - "node_modules/@octokit/oauth-app": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@octokit/oauth-app/-/oauth-app-8.0.3.tgz", - "integrity": "sha512-jnAjvTsPepyUaMu9e69hYBuozEPgYqP4Z3UnpmvoIzHDpf8EXDGvTY1l1jK0RsZ194oRd+k6Hm13oRU8EoDFwg==", - "license": "MIT", - "dependencies": { - "@octokit/auth-oauth-app": "^9.0.2", - "@octokit/auth-oauth-user": "^6.0.1", - "@octokit/auth-unauthenticated": "^7.0.2", - "@octokit/core": "^7.0.5", - "@octokit/oauth-authorization-url": "^8.0.0", - "@octokit/oauth-methods": "^6.0.1", - "@types/aws-lambda": "^8.10.83", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/oauth-app/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/oauth-app/node_modules/@octokit/core": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", - "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", - "license": "MIT", - "dependencies": { - "@octokit/auth-token": "^6.0.0", - "@octokit/graphql": "^9.0.3", - "@octokit/request": "^10.0.6", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "before-after-hook": "^4.0.0", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/oauth-app/node_modules/@octokit/graphql": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", - "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", - "license": "MIT", - "dependencies": { - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/oauth-app/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/@octokit/oauth-app/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/oauth-authorization-url": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@octokit/oauth-authorization-url/-/oauth-authorization-url-8.0.0.tgz", - "integrity": "sha512-7QoLPRh/ssEA/HuHBHdVdSgF8xNLz/Bc5m9fZkArJE5bb6NmVkDm3anKxXPmN1zh6b5WKZPRr3697xKT/yM3qQ==", - "license": "MIT", - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/oauth-methods": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@octokit/oauth-methods/-/oauth-methods-6.0.2.tgz", - "integrity": "sha512-HiNOO3MqLxlt5Da5bZbLV8Zarnphi4y9XehrbaFMkcoJ+FL7sMxH/UlUsCVxpddVu4qvNDrBdaTVE2o4ITK8ng==", - "license": "MIT", - "dependencies": { - "@octokit/oauth-authorization-url": "^8.0.0", - "@octokit/request": "^10.0.6", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0" - }, - "engines": { - "node": ">= 20" - } - }, "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/openapi-webhooks-types": { - "version": "12.0.3", - "resolved": "https://registry.npmjs.org/@octokit/openapi-webhooks-types/-/openapi-webhooks-types-12.0.3.tgz", - "integrity": "sha512-90MF5LVHjBedwoHyJsgmaFhEN1uzXyBDRLEBe7jlTYx/fEhPAk3P3DAJsfZwC54m8hAIryosJOL+UuZHB3K3yA==", + "dev": true, "license": "MIT" }, "node_modules/@octokit/plugin-request-log": { @@ -2243,72 +1917,16 @@ "@octokit/openapi-types": "^24.2.0" } }, - "node_modules/@octokit/request": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.6.tgz", - "integrity": "sha512-FO+UgZCUu+pPnZAR+iKdUt64kPE7QW7ciqpldaMXaNzixz5Jld8dJ31LAUewk0cfSRkNSRKyqG438ba9c/qDlQ==", - "license": "MIT", - "dependencies": { - "@octokit/endpoint": "^11.0.2", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "fast-content-type-parse": "^3.0.0", - "universal-user-agent": "^7.0.2" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/request-error": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.0.2.tgz", - "integrity": "sha512-U8piOROoQQUyExw5c6dTkU3GKxts5/ERRThIauNL7yaRoeXW0q/5bgHWT7JfWBw1UyrbK8ERId2wVkcB32n0uQ==", - "license": "MIT", - "dependencies": { - "@octokit/types": "^16.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "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==", + "dev": true, "license": "MIT", "dependencies": { "@octokit/openapi-types": "^27.0.0" } }, - "node_modules/@octokit/webhooks": { - "version": "14.1.3", - "resolved": "https://registry.npmjs.org/@octokit/webhooks/-/webhooks-14.1.3.tgz", - "integrity": "sha512-gcK4FNaROM9NjA0mvyfXl0KPusk7a1BeA8ITlYEZVQCXF5gcETTd4yhAU0Kjzd8mXwYHppzJBWgdBVpIR9wUcQ==", - "license": "MIT", - "dependencies": { - "@octokit/openapi-webhooks-types": "12.0.3", - "@octokit/request-error": "^7.0.0", - "@octokit/webhooks-methods": "^6.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/@octokit/webhooks-methods": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@octokit/webhooks-methods/-/webhooks-methods-6.0.0.tgz", - "integrity": "sha512-MFlzzoDJVw/GcbfzVC1RLR36QqkTLUf79vLVO3D+xn7r0QgxnFoLZgtrzxiQErAjFUOdH6fas2KeQJ1yr/qaXQ==", - "license": "MIT", - "engines": { - "node": ">= 20" - } - }, "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", @@ -2334,25 +1952,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@opentelemetry/api": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.0.tgz", - "integrity": "sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==", - "license": "Apache-2.0", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=14" - } - }, "node_modules/@pkgr/core": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz", @@ -2494,6 +2093,19 @@ "integrity": "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==", "dev": true }, + "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", @@ -2554,12 +2166,6 @@ "@types/readdir-glob": "*" } }, - "node_modules/@types/aws-lambda": { - "version": "8.10.157", - "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.157.tgz", - "integrity": "sha512-ofjcRCO1N7tMZDSO11u5bFHPDfUFD3Q9YK9g4S4w8UDKuG3CNlw2lNK1sd3Itdo7JORygZmG4h9ZykS8dlXvMA==", - "license": "MIT" - }, "node_modules/@types/color-name": { "version": "1.1.1", "dev": true, @@ -2602,37 +2208,12 @@ "version": "20.19.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.9.tgz", "integrity": "sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw==", + "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.21.0" } }, - "node_modules/@types/node-fetch": { - "version": "2.6.13", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.13.tgz", - "integrity": "sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw==", - "license": "MIT", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.4" - } - }, - "node_modules/@types/node-fetch/node_modules/form-data": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", - "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/@types/node-forge": { "version": "1.3.14", "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.14.tgz", @@ -2661,9 +2242,9 @@ "license": "MIT" }, "node_modules/@types/sinon": { - "version": "17.0.4", - "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-17.0.4.tgz", - "integrity": "sha512-RHnIrhfPO3+tJT0s7cFaXGZvsL4bbR3/k7z3P312qMS4JaS2Tk+KiwiLx1S0rQ56ERj00u1/BtdyVd0FY+Pdew==", + "version": "21.0.0", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-21.0.0.tgz", + "integrity": "sha512-+oHKZ0lTI+WVLxx1IbJDNmReQaIsQJjN2e7UUrJHEeByG7bFeKJYsv1E75JxTQ9QKJDp21bAa/0W2Xo4srsDnw==", "dev": true, "license": "MIT", "dependencies": { @@ -2675,28 +2256,18 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/tunnel": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz", - "integrity": "sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.46.3.tgz", - "integrity": "sha512-sbaQ27XBUopBkRiuY/P9sWGOWUW4rl8fDoHIUmLpZd8uldsTyB4/Zg6bWTegPoTLnKj9Hqgn3QD6cjPNB32Odw==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.49.0.tgz", + "integrity": "sha512-JXij0vzIaTtCwu6SxTh8qBc66kmf1xs7pI4UOiMDFVct6q86G0Zs7KRcEoJgY3Cav3x5Tq0MF5jwgpgLqgKG3A==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.46.3", - "@typescript-eslint/type-utils": "8.46.3", - "@typescript-eslint/utils": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3", - "graphemer": "^1.4.0", + "@typescript-eslint/scope-manager": "8.49.0", + "@typescript-eslint/type-utils": "8.49.0", + "@typescript-eslint/utils": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" @@ -2709,20 +2280,20 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.46.3", + "@typescript-eslint/parser": "^8.49.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.3.tgz", - "integrity": "sha512-FCi7Y1zgrmxp3DfWfr+3m9ansUUFoy8dkEdeQSgA9gbm8DaHYvZCdkFRQrtKiedFf3Ha6VmoqoAaP68+i+22kg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.49.0.tgz", + "integrity": "sha512-npgS3zi+/30KSOkXNs0LQXtsg9ekZ8OISAOLGWA/ZOEn0ZH74Ginfl7foziV8DT+D98WfQ5Kopwqb/PZOaIJGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3" + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2733,9 +2304,9 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.3.tgz", - "integrity": "sha512-G7Ok9WN/ggW7e/tOf8TQYMaxgID3Iujn231hfi0Pc7ZheztIJVpO44ekY00b7akqc6nZcvregk0Jpah3kep6hA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.49.0.tgz", + "integrity": "sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==", "dev": true, "license": "MIT", "engines": { @@ -2747,21 +2318,20 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.3.tgz", - "integrity": "sha512-f/NvtRjOm80BtNM5OQtlaBdM5BRFUv7gf381j9wygDNL+qOYSNOgtQ/DCndiYi80iIOv76QqaTmp4fa9hwI0OA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.49.0.tgz", + "integrity": "sha512-jrLdRuAbPfPIdYNppHJ/D0wN+wwNfJ32YTAm10eJVsFmrVpXQnDWBn8niCSMlWjvml8jsce5E/O+86IQtTbJWA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.46.3", - "@typescript-eslint/tsconfig-utils": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3", + "@typescript-eslint/project-service": "8.49.0", + "@typescript-eslint/tsconfig-utils": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0", "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", + "tinyglobby": "^0.2.15", "ts-api-utils": "^2.1.0" }, "engines": { @@ -2776,16 +2346,16 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.3.tgz", - "integrity": "sha512-VXw7qmdkucEx9WkmR3ld/u6VhRyKeiF1uxWwCy/iuNfokjJ7VhsgLSOTjsol8BunSw190zABzpwdNsze2Kpo4g==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.49.0.tgz", + "integrity": "sha512-N3W7rJw7Rw+z1tRsHZbK395TWSYvufBXumYtEGzypgMUthlg0/hmCImeA8hgO2d2G4pd7ftpxxul2J8OdtdaFA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3" + "@typescript-eslint/scope-manager": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/typescript-estree": "8.49.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2800,13 +2370,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.3.tgz", - "integrity": "sha512-uk574k8IU0rOF/AjniX8qbLSGURJVUCeM5e4MIMKBFFi8weeiLrG1fyQejyLXQpRZbU/1BuQasleV/RfHC3hHg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.49.0.tgz", + "integrity": "sha512-LlKaciDe3GmZFphXIc79THF/YYBugZ7FS1pO581E/edlVVNbZKDy93evqmrfQ9/Y4uN0vVhX4iuchq26mK/iiA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/types": "8.49.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -2879,16 +2449,17 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.46.3.tgz", - "integrity": "sha512-6m1I5RmHBGTnUGS113G04DMu3CpSdxCAU/UvtjNWL4Nuf3MW9tQhiJqRlHzChIkhy6kZSAQmc+I1bcGjE3yNKg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.49.0.tgz", + "integrity": "sha512-N9lBGA9o9aqb1hVMc9hzySbhKibHmB+N3IpoShyV6HyQYRGIhlrO5rQgttypi+yEeKsKI4idxC8Jw6gXKD4THA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { - "@typescript-eslint/scope-manager": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3", + "@typescript-eslint/scope-manager": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/typescript-estree": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0", "debug": "^4.3.4" }, "engines": { @@ -2904,14 +2475,14 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.3.tgz", - "integrity": "sha512-FCi7Y1zgrmxp3DfWfr+3m9ansUUFoy8dkEdeQSgA9gbm8DaHYvZCdkFRQrtKiedFf3Ha6VmoqoAaP68+i+22kg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.49.0.tgz", + "integrity": "sha512-npgS3zi+/30KSOkXNs0LQXtsg9ekZ8OISAOLGWA/ZOEn0ZH74Ginfl7foziV8DT+D98WfQ5Kopwqb/PZOaIJGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3" + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -2922,9 +2493,9 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.3.tgz", - "integrity": "sha512-G7Ok9WN/ggW7e/tOf8TQYMaxgID3Iujn231hfi0Pc7ZheztIJVpO44ekY00b7akqc6nZcvregk0Jpah3kep6hA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.49.0.tgz", + "integrity": "sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==", "dev": true, "license": "MIT", "engines": { @@ -2936,21 +2507,20 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.3.tgz", - "integrity": "sha512-f/NvtRjOm80BtNM5OQtlaBdM5BRFUv7gf381j9wygDNL+qOYSNOgtQ/DCndiYi80iIOv76QqaTmp4fa9hwI0OA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.49.0.tgz", + "integrity": "sha512-jrLdRuAbPfPIdYNppHJ/D0wN+wwNfJ32YTAm10eJVsFmrVpXQnDWBn8niCSMlWjvml8jsce5E/O+86IQtTbJWA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.46.3", - "@typescript-eslint/tsconfig-utils": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3", + "@typescript-eslint/project-service": "8.49.0", + "@typescript-eslint/tsconfig-utils": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0", "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", + "tinyglobby": "^0.2.15", "ts-api-utils": "^2.1.0" }, "engines": { @@ -2965,13 +2535,13 @@ } }, "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.3.tgz", - "integrity": "sha512-uk574k8IU0rOF/AjniX8qbLSGURJVUCeM5e4MIMKBFFi8weeiLrG1fyQejyLXQpRZbU/1BuQasleV/RfHC3hHg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.49.0.tgz", + "integrity": "sha512-LlKaciDe3GmZFphXIc79THF/YYBugZ7FS1pO581E/edlVVNbZKDy93evqmrfQ9/Y4uN0vVhX4iuchq26mK/iiA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/types": "8.49.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -3035,14 +2605,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.46.3.tgz", - "integrity": "sha512-Fz8yFXsp2wDFeUElO88S9n4w1I4CWDTXDqDr9gYvZgUpwXQqmZBr9+NTTql5R3J7+hrJZPdpiWaB9VNhAKYLuQ==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.49.0.tgz", + "integrity": "sha512-/wJN0/DKkmRUMXjZUXYZpD1NEQzQAAn9QWfGwo+Ai8gnzqH7tvqS7oNVdTjKqOcPyVIdZdyCMoqN66Ia789e7g==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.46.3", - "@typescript-eslint/types": "^8.46.3", + "@typescript-eslint/tsconfig-utils": "^8.49.0", + "@typescript-eslint/types": "^8.49.0", "debug": "^4.3.4" }, "engines": { @@ -3057,9 +2627,9 @@ } }, "node_modules/@typescript-eslint/project-service/node_modules/@typescript-eslint/types": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.3.tgz", - "integrity": "sha512-G7Ok9WN/ggW7e/tOf8TQYMaxgID3Iujn231hfi0Pc7ZheztIJVpO44ekY00b7akqc6nZcvregk0Jpah3kep6hA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.49.0.tgz", + "integrity": "sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==", "dev": true, "license": "MIT", "engines": { @@ -3089,9 +2659,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.46.3.tgz", - "integrity": "sha512-GLupljMniHNIROP0zE7nCcybptolcH8QZfXOpCfhQDAdwJ/ZTlcaBOYebSOZotpti/3HrHSw7D3PZm75gYFsOA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.49.0.tgz", + "integrity": "sha512-8prixNi1/6nawsRYxet4YOhnbW+W9FK/bQPxsGB1D3ZrDzbJ5FXw5XmzxZv82X3B+ZccuSxo/X8q9nQ+mFecWA==", "dev": true, "license": "MIT", "engines": { @@ -3106,15 +2676,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.46.3.tgz", - "integrity": "sha512-ZPCADbr+qfz3aiTTYNNkCbUt+cjNwI/5McyANNrFBpVxPt7GqpEYz5ZfdwuFyGUnJ9FdDXbGODUu6iRCI6XRXw==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.49.0.tgz", + "integrity": "sha512-KTExJfQ+svY8I10P4HdxKzWsvtVnsuCifU5MvXrRwoP2KOlNZ9ADNEWWsQTJgMxLzS5VLQKDjkCT/YzgsnqmZg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3", - "@typescript-eslint/utils": "8.46.3", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/typescript-estree": "8.49.0", + "@typescript-eslint/utils": "8.49.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -3131,14 +2701,14 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.46.3.tgz", - "integrity": "sha512-FCi7Y1zgrmxp3DfWfr+3m9ansUUFoy8dkEdeQSgA9gbm8DaHYvZCdkFRQrtKiedFf3Ha6VmoqoAaP68+i+22kg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.49.0.tgz", + "integrity": "sha512-npgS3zi+/30KSOkXNs0LQXtsg9ekZ8OISAOLGWA/ZOEn0ZH74Ginfl7foziV8DT+D98WfQ5Kopwqb/PZOaIJGg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3" + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3149,9 +2719,9 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.46.3.tgz", - "integrity": "sha512-G7Ok9WN/ggW7e/tOf8TQYMaxgID3Iujn231hfi0Pc7ZheztIJVpO44ekY00b7akqc6nZcvregk0Jpah3kep6hA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.49.0.tgz", + "integrity": "sha512-e9k/fneezorUo6WShlQpMxXh8/8wfyc+biu6tnAqA81oWrEic0k21RHzP9uqqpyBBeBKu4T+Bsjy9/b8u7obXQ==", "dev": true, "license": "MIT", "engines": { @@ -3163,21 +2733,20 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.46.3.tgz", - "integrity": "sha512-f/NvtRjOm80BtNM5OQtlaBdM5BRFUv7gf381j9wygDNL+qOYSNOgtQ/DCndiYi80iIOv76QqaTmp4fa9hwI0OA==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.49.0.tgz", + "integrity": "sha512-jrLdRuAbPfPIdYNppHJ/D0wN+wwNfJ32YTAm10eJVsFmrVpXQnDWBn8niCSMlWjvml8jsce5E/O+86IQtTbJWA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.46.3", - "@typescript-eslint/tsconfig-utils": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/visitor-keys": "8.46.3", + "@typescript-eslint/project-service": "8.49.0", + "@typescript-eslint/tsconfig-utils": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/visitor-keys": "8.49.0", "debug": "^4.3.4", - "fast-glob": "^3.3.2", - "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", + "tinyglobby": "^0.2.15", "ts-api-utils": "^2.1.0" }, "engines": { @@ -3192,16 +2761,16 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.46.3.tgz", - "integrity": "sha512-VXw7qmdkucEx9WkmR3ld/u6VhRyKeiF1uxWwCy/iuNfokjJ7VhsgLSOTjsol8BunSw190zABzpwdNsze2Kpo4g==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.49.0.tgz", + "integrity": "sha512-N3W7rJw7Rw+z1tRsHZbK395TWSYvufBXumYtEGzypgMUthlg0/hmCImeA8hgO2d2G4pd7ftpxxul2J8OdtdaFA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.46.3", - "@typescript-eslint/types": "8.46.3", - "@typescript-eslint/typescript-estree": "8.46.3" + "@typescript-eslint/scope-manager": "8.49.0", + "@typescript-eslint/types": "8.49.0", + "@typescript-eslint/typescript-estree": "8.49.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3216,13 +2785,13 @@ } }, "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { - "version": "8.46.3", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.46.3.tgz", - "integrity": "sha512-uk574k8IU0rOF/AjniX8qbLSGURJVUCeM5e4MIMKBFFi8weeiLrG1fyQejyLXQpRZbU/1BuQasleV/RfHC3hHg==", + "version": "8.49.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.49.0.tgz", + "integrity": "sha512-LlKaciDe3GmZFphXIc79THF/YYBugZ7FS1pO581E/edlVVNbZKDy93evqmrfQ9/Y4uN0vVhX4iuchq26mK/iiA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.46.3", + "@typescript-eslint/types": "8.49.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -3404,131 +2973,58 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", - "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/@ungap/structured-clone": { - "version": "1.2.0", - "dev": true, - "license": "ISC" - }, - "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, - "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/@vercel/nft/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@vercel/nft/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dev": true, - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://opencollective.com/eslint" } }, - "node_modules/@vercel/nft/node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dev": true, - "license": "BlueOak-1.0.0", + "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": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.0", + "tslib": "^2.6.2" }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" + "engines": { + "node": ">=20.0.0" } }, - "node_modules/@vercel/nft/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", "dev": true, "license": "ISC" }, - "node_modules/@vercel/nft/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "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": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" + "@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" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@vercel/nft/node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dev": true, - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + "bin": { + "nft": "out/cli.js" }, "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=18" } }, "node_modules/@vercel/nft/node_modules/picomatch": { @@ -3567,6 +3063,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -3679,35 +3176,6 @@ "node": ">= 14" } }, - "node_modules/archiver-utils/node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/archiver-utils/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "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", @@ -3720,56 +3188,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/archiver-utils/node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/archiver-utils/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", - "license": "ISC" - }, - "node_modules/archiver-utils/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/archiver-utils/node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, + "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": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=14" } }, "node_modules/argparse": { @@ -3947,10 +3373,6 @@ "integrity": "sha512-tLRNUXati5MFePdAk8dw7Qt7DpxPB60ofAgn8WRhW6a2rcimZnYBP9oxHiv0OHy+Wz7kPMG+t4LGdt31+4EmGg==", "dev": true }, - "node_modules/asynckit": { - "version": "0.4.0", - "license": "MIT" - }, "node_modules/ava": { "version": "6.4.1", "resolved": "https://registry.npmjs.org/ava/-/ava-6.4.1.tgz", @@ -4213,6 +3635,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "caniuse-lite": "^1.0.30001669", "electron-to-chromium": "^1.5.41", @@ -4290,6 +3713,7 @@ "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" @@ -4504,14 +3928,14 @@ "version": "1.1.4", "license": "MIT" }, - "node_modules/combined-stream": { - "version": "1.0.8", + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, "license": "MIT", - "dependencies": { - "delayed-stream": "~1.0.0" - }, "engines": { - "node": ">= 0.8" + "node": ">= 12.0.0" } }, "node_modules/common-path-prefix": { @@ -4770,13 +4194,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "license": "MIT", - "engines": { - "node": ">=0.4.0" - } - }, "node_modules/deprecation": { "version": "2.3.1", "license": "ISC" @@ -4814,6 +4231,7 @@ "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", @@ -4929,6 +4347,7 @@ "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" } @@ -4937,6 +4356,7 @@ "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" } @@ -4945,6 +4365,7 @@ "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" }, @@ -4956,6 +4377,7 @@ "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", @@ -4992,9 +4414,9 @@ } }, "node_modules/esbuild": { - "version": "0.25.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", - "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "version": "0.27.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.1.tgz", + "integrity": "sha512-yY35KZckJJuVVPXpvjgxiCuVEJT67F6zDeVTv4rizyPrfGBUpZQsvmxnN+C371c2esD/hNMjj4tpBhuueLN7aA==", "dev": true, "hasInstallScript": true, "license": "MIT", @@ -5005,32 +4427,32 @@ "node": ">=18" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.25.12", - "@esbuild/android-arm": "0.25.12", - "@esbuild/android-arm64": "0.25.12", - "@esbuild/android-x64": "0.25.12", - "@esbuild/darwin-arm64": "0.25.12", - "@esbuild/darwin-x64": "0.25.12", - "@esbuild/freebsd-arm64": "0.25.12", - "@esbuild/freebsd-x64": "0.25.12", - "@esbuild/linux-arm": "0.25.12", - "@esbuild/linux-arm64": "0.25.12", - "@esbuild/linux-ia32": "0.25.12", - "@esbuild/linux-loong64": "0.25.12", - "@esbuild/linux-mips64el": "0.25.12", - "@esbuild/linux-ppc64": "0.25.12", - "@esbuild/linux-riscv64": "0.25.12", - "@esbuild/linux-s390x": "0.25.12", - "@esbuild/linux-x64": "0.25.12", - "@esbuild/netbsd-arm64": "0.25.12", - "@esbuild/netbsd-x64": "0.25.12", - "@esbuild/openbsd-arm64": "0.25.12", - "@esbuild/openbsd-x64": "0.25.12", - "@esbuild/openharmony-arm64": "0.25.12", - "@esbuild/sunos-x64": "0.25.12", - "@esbuild/win32-arm64": "0.25.12", - "@esbuild/win32-ia32": "0.25.12", - "@esbuild/win32-x64": "0.25.12" + "@esbuild/aix-ppc64": "0.27.1", + "@esbuild/android-arm": "0.27.1", + "@esbuild/android-arm64": "0.27.1", + "@esbuild/android-x64": "0.27.1", + "@esbuild/darwin-arm64": "0.27.1", + "@esbuild/darwin-x64": "0.27.1", + "@esbuild/freebsd-arm64": "0.27.1", + "@esbuild/freebsd-x64": "0.27.1", + "@esbuild/linux-arm": "0.27.1", + "@esbuild/linux-arm64": "0.27.1", + "@esbuild/linux-ia32": "0.27.1", + "@esbuild/linux-loong64": "0.27.1", + "@esbuild/linux-mips64el": "0.27.1", + "@esbuild/linux-ppc64": "0.27.1", + "@esbuild/linux-riscv64": "0.27.1", + "@esbuild/linux-s390x": "0.27.1", + "@esbuild/linux-x64": "0.27.1", + "@esbuild/netbsd-arm64": "0.27.1", + "@esbuild/netbsd-x64": "0.27.1", + "@esbuild/openbsd-arm64": "0.27.1", + "@esbuild/openbsd-x64": "0.27.1", + "@esbuild/openharmony-arm64": "0.27.1", + "@esbuild/sunos-x64": "0.27.1", + "@esbuild/win32-arm64": "0.27.1", + "@esbuild/win32-ia32": "0.27.1", + "@esbuild/win32-x64": "0.27.1" } }, "node_modules/escalade": { @@ -5056,6 +4478,7 @@ "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "dev": true, + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -5110,6 +4533,7 @@ "version": "8.3.0", "dev": true, "license": "MIT", + "peer": true, "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -5277,6 +4701,40 @@ "eslint": "^8 || ^9" } }, + "node_modules/eslint-plugin-github/node_modules/@eslint/compat": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/compat/-/compat-1.4.1.tgz", + "integrity": "sha512-cfO82V9zxxGBxcQDr1lfaYB7wykTa0b00mGa36FrJl7iTFd0Z2cHfEYuxcBRP/iNijCsWsEkA+jzT8hGYmv33w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": "^8.40 || 9" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-github/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-plugin-github/node_modules/debug": { "version": "3.2.7", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", @@ -5347,6 +4805,7 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", "dev": true, + "peer": true, "dependencies": { "array-includes": "^3.1.7", "array.prototype.findlastindex": "^1.2.3", @@ -5381,6 +4840,110 @@ "ms": "^2.1.1" } }, + "node_modules/eslint-plugin-jsdoc": { + "version": "61.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-61.5.0.tgz", + "integrity": "sha512-PR81eOGq4S7diVnV9xzFSBE4CDENRQGP0Lckkek8AdHtbj+6Bm0cItwlFnxsLFriJHspiE3mpu8U20eODyToIg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@es-joy/jsdoccomment": "~0.76.0", + "@es-joy/resolve.exports": "1.2.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.4.3", + "escape-string-regexp": "^4.0.0", + "espree": "^10.4.0", + "esquery": "^1.6.0", + "html-entities": "^2.6.0", + "object-deep-merge": "^2.0.0", + "parse-imports-exports": "^0.2.4", + "semver": "^7.7.3", + "spdx-expression-parse": "^4.0.0", + "to-valid-identifier": "^1.0.0" + }, + "engines": { + "node": ">=20.11.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.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": "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-plugin-jsdoc/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/eslint-plugin-jsdoc/node_modules/esquery": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", + "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", @@ -5781,26 +5344,10 @@ }, "engines": { "node": "^18.19.0 || >=20.5.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/fast-content-type-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-3.0.0.tgz", - "integrity": "sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", - "url": "https://opencollective.com/fastify" - } - ], - "license": "MIT" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } }, "node_modules/fast-deep-equal": { "version": "3.1.3", @@ -5844,22 +5391,18 @@ "license": "MIT" }, "node_modules/fast-xml-parser": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.5.0.tgz", - "integrity": "sha512-/PlTQCI96+fZMAOLMZK4CWG1ItCbfZ/0jx7UIJFChPNrx7tcEgerUgWbeieCM9MfHInUDyK8DWYZ+YrywDJuTg==", + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-5.3.3.tgz", + "integrity": "sha512-2O3dkPAAC6JavuMm8+4+pgTk+5hoAs+CjZ+sWcQLkX9+/tHRuTkQh/Oaifr8qDmZ8iEHb771Ea6G8CdwkrgvYA==", "funding": [ { "type": "github", "url": "https://github.com/sponsors/NaturalIntelligence" - }, - { - "type": "paypal", - "url": "https://paypal.me/naturalintelligence" } ], "license": "MIT", "dependencies": { - "strnum": "^1.0.5" + "strnum": "^2.1.0" }, "bin": { "fxparser": "src/cli/cli.js" @@ -5989,30 +5532,9 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/form-data": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.5.tgz", - "integrity": "sha512-jqdObeR2rxZZbPSGL+3VckHMYtu+f9//KXBsVny6JSX/pa38Fy+bGjuG8eW/H6USNQWhLi8Num++cU2yOCNz4A==", - "license": "MIT", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "es-set-tostringtag": "^2.1.0", - "hasown": "^2.0.2", - "mime-types": "^2.1.35", - "safe-buffer": "^5.2.1" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "dev": true, - "license": "ISC" - }, "node_modules/function-bind": { "version": "1.1.2", + "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6081,6 +5603,7 @@ "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", @@ -6104,6 +5627,7 @@ "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" @@ -6159,15 +5683,14 @@ } }, "node_modules/glob": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz", - "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==", - "dev": true, - "license": "ISC", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.1.0.tgz", + "integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==", + "license": "BlueOak-1.0.0", "dependencies": { "foreground-child": "^3.3.1", "jackspeak": "^4.1.1", - "minimatch": "^10.0.3", + "minimatch": "^10.1.1", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^2.0.0" @@ -6194,11 +5717,10 @@ } }, "node_modules/glob/node_modules/minimatch": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", - "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", - "dev": true, - "license": "ISC", + "version": "10.1.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.1.1.tgz", + "integrity": "sha512-enIvLvRAFZYXJzkCYG5RKmPfrFArdLv+R+lbQ53BmIMLIry74bjKzX6iHAm8WYamJkhSSEabrWN5D97XnKObjQ==", + "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/brace-expansion": "^5.0.0" }, @@ -6285,6 +5807,7 @@ "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" }, @@ -6347,6 +5870,7 @@ "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" }, @@ -6358,6 +5882,7 @@ "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" }, @@ -6372,6 +5897,7 @@ "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" }, @@ -6379,6 +5905,23 @@ "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", @@ -6493,15 +6036,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/inflight": { - "version": "1.0.6", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, "node_modules/inherits": { "version": "2.0.3", "license": "ISC" @@ -6858,7 +6392,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", - "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -6880,7 +6413,9 @@ } }, "node_modules/js-yaml": { - "version": "4.1.0", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz", + "integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==", "license": "MIT", "dependencies": { "argparse": "^2.0.1" @@ -6890,14 +6425,25 @@ } }, "node_modules/jschardet": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/jschardet/-/jschardet-3.1.3.tgz", - "integrity": "sha512-Q1PKVMK/uu+yjdlobgWIYkUOCR1SqUmW9m/eUJNNj4zI2N12i25v8fYpVf+zCakQeaTdBdhnZTFbVIAVZIVVOg==", + "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": "6.10.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-6.10.0.tgz", + "integrity": "sha512-+LexoTRyYui5iOhJGn13N9ZazL23nAHGkXsa1p/C8yeq79WRfLBag6ZZ0FQG2aRoc9yfo59JT9EYCQonOkHKkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20.0.0" + } + }, "node_modules/json-schema-traverse": { "version": "0.4.1", "dev": true, @@ -7089,7 +6635,6 @@ "version": "11.1.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", - "dev": true, "license": "ISC", "engines": { "node": "20 || >=22" @@ -7126,6 +6671,7 @@ "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" } @@ -7178,23 +6724,6 @@ "node": ">=8.6" } }, - "node_modules/mime-db": { - "version": "1.52.0", - "license": "MIT", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "license": "MIT", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, "node_modules/mimic-function": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", @@ -7285,6 +6814,7 @@ }, "node_modules/node-fetch": { "version": "2.6.7", + "dev": true, "license": "MIT", "dependencies": { "whatwg-url": "^5.0.0" @@ -7302,9 +6832,10 @@ } }, "node_modules/node-forge": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz", - "integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.3.tgz", + "integrity": "sha512-rLvcdSyRCyouf6jcOIPe/BgwG/d7hKjzMKOas33/pHEr6gbq18IK9zV7DiPvzsz0oBJPme6qr6H6kGZuI9/DZg==", + "license": "(BSD-3-Clause OR GPL-2.0)", "engines": { "node": ">= 6.13.0" } @@ -7386,6 +6917,13 @@ "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.2", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", @@ -7473,153 +7011,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/octokit": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/octokit/-/octokit-5.0.5.tgz", - "integrity": "sha512-4+/OFSqOjoyULo7eN7EA97DE0Xydj/PW5aIckxqQIoFjFwqXKuFCvXUJObyJfBF9Khu4RL/jlDRI9FPaMGfPnw==", - "license": "MIT", - "dependencies": { - "@octokit/app": "^16.1.2", - "@octokit/core": "^7.0.6", - "@octokit/oauth-app": "^8.0.3", - "@octokit/plugin-paginate-graphql": "^6.0.0", - "@octokit/plugin-paginate-rest": "^14.0.0", - "@octokit/plugin-rest-endpoint-methods": "^17.0.0", - "@octokit/plugin-retry": "^8.0.3", - "@octokit/plugin-throttling": "^11.0.3", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "@octokit/webhooks": "^14.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/octokit/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==", - "engines": { - "node": ">= 20" - } - }, - "node_modules/octokit/node_modules/@octokit/core": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-7.0.6.tgz", - "integrity": "sha512-DhGl4xMVFGVIyMwswXeyzdL4uXD5OGILGX5N8Y+f6W7LhC1Ze2poSNrkF/fedpVDHEEZ+PHFW0vL14I+mm8K3Q==", - "license": "MIT", - "dependencies": { - "@octokit/auth-token": "^6.0.0", - "@octokit/graphql": "^9.0.3", - "@octokit/request": "^10.0.6", - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "before-after-hook": "^4.0.0", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/octokit/node_modules/@octokit/graphql": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-9.0.3.tgz", - "integrity": "sha512-grAEuupr/C1rALFnXTv6ZQhFuL1D8G5y8CN04RgrO4FIPMrtm+mcZzFG7dcBm+nq+1ppNixu+Jd78aeJOYxlGA==", - "license": "MIT", - "dependencies": { - "@octokit/request": "^10.0.6", - "@octokit/types": "^16.0.0", - "universal-user-agent": "^7.0.0" - }, - "engines": { - "node": ">= 20" - } - }, - "node_modules/octokit/node_modules/@octokit/plugin-paginate-graphql": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-graphql/-/plugin-paginate-graphql-6.0.0.tgz", - "integrity": "sha512-crfpnIoFiBtRkvPqOyLOsw12XsveYuY2ieP6uYDosoUegBJpSVxGwut9sxUgFFcll3VTOTqpUf8yGd8x1OmAkQ==", - "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": ">=6" - } - }, - "node_modules/octokit/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/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/node_modules/@octokit/plugin-retry": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/@octokit/plugin-retry/-/plugin-retry-8.0.3.tgz", - "integrity": "sha512-vKGx1i3MC0za53IzYBSBXcrhmd+daQDzuZfYDd52X5S0M2otf3kVZTVP8bLA3EkU0lTvd1WEC2OlNNa4G+dohA==", - "license": "MIT", - "dependencies": { - "@octokit/request-error": "^7.0.2", - "@octokit/types": "^16.0.0", - "bottleneck": "^2.15.3" - }, - "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": ">=7" - } - }, - "node_modules/octokit/node_modules/@octokit/plugin-throttling": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/@octokit/plugin-throttling/-/plugin-throttling-11.0.3.tgz", - "integrity": "sha512-34eE0RkFCKycLl2D2kq7W+LovheM/ex3AwZCYN8udpi6bxsyjZidb2McXs69hZhLmJlDqTSP8cH+jSRpiaijBg==", - "license": "MIT", - "dependencies": { - "@octokit/types": "^16.0.0", - "bottleneck": "^2.15.3" - }, - "engines": { - "node": ">= 20" - }, - "peerDependencies": { - "@octokit/core": "^7.0.0" - } - }, - "node_modules/octokit/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==" - }, - "node_modules/octokit/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/once": { "version": "1.4.0", "license": "ISC", @@ -7695,6 +7086,16 @@ "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", @@ -7707,13 +7108,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", + "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", - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, "node_modules/path-key": { "version": "3.1.1", @@ -7731,7 +7131,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", - "dev": true, "license": "BlueOak-1.0.0", "dependencies": { "lru-cache": "^11.0.0", @@ -7813,6 +7212,7 @@ "integrity": "sha512-G+YdqtITVZmOJje6QkXQWzl3fSfMxFwm1tjTyo9exhkmWSqC4Yhd1+lug++IlR2mvRVAxEDDWYkQdeSztajqgg==", "dev": true, "license": "MIT", + "peer": true, "bin": { "prettier": "bin/prettier.cjs" }, @@ -7986,6 +7386,19 @@ "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, @@ -8056,25 +7469,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/glob": { - "version": "7.2.0", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "dev": true, @@ -8152,10 +7546,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/sax": { - "version": "1.2.4", - "license": "ISC" - }, "node_modules/semver": { "version": "7.7.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", @@ -8326,6 +7716,31 @@ "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", @@ -8536,9 +7951,15 @@ } }, "node_modules/strnum": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", - "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-2.1.2.tgz", + "integrity": "sha512-l63NF9y/cLROq/yqKXSLtcMeeyOfnSQlfMSlzFt/K73oIaD8DGaQWd7Z34X9GPiKqP5rbSh84Hl4bOlLcjiSrQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + } + ], "license": "MIT" }, "node_modules/supertap": { @@ -8655,13 +8076,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/synckit/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==", - "dev": true, - "license": "0BSD" - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -8747,14 +8161,14 @@ } }, "node_modules/tinyglobby": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", - "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", + "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.4.3", - "picomatch": "^4.0.2" + "fdir": "^6.5.0", + "picomatch": "^4.0.3" }, "engines": { "node": ">=12.0.0" @@ -8764,11 +8178,14 @@ } }, "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", + "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" }, @@ -8779,11 +8196,12 @@ } }, "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=12" }, @@ -8819,17 +8237,26 @@ "node": ">=8.0" } }, - "node_modules/toad-cache": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.0.tgz", - "integrity": "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==", + "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": ">=12" + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/tr46": { "version": "0.0.3", + "dev": true, "license": "MIT" }, "node_modules/traverse": { @@ -8864,7 +8291,9 @@ } }, "node_modules/tslib": { - "version": "1.14.1", + "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/tunnel": { @@ -8984,6 +8413,7 @@ "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, "license": "Apache-2.0", + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -9057,6 +8487,7 @@ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.17.0.tgz", "integrity": "sha512-Drp39TXuUlD49F7ilHHCG7TTg8IkA+hxCuULdmzWYICxGXvDXmDmWEjJYZQYgf6l/TFfYNE167m7isnc3xlIEg==", "dev": true, + "peer": true, "dependencies": { "@typescript-eslint/scope-manager": "8.17.0", "@typescript-eslint/types": "8.17.0", @@ -9136,6 +8567,7 @@ "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": { @@ -9150,12 +8582,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/universal-github-app-jwt": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/universal-github-app-jwt/-/universal-github-app-jwt-2.2.2.tgz", - "integrity": "sha512-dcmbeSrOdTnsjGjUfAlqNDJrhxXizjAz94ija9Qw8YkZ1uu0d+GoZzyH+Jb9tIIqvGsadUfwg+22k5aDqqwzbw==", - "license": "MIT" - }, "node_modules/universal-user-agent": { "version": "6.0.0", "license": "ISC" @@ -9213,7 +8639,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/util-deprecate": { "version": "1.0.2", @@ -9236,6 +8663,7 @@ }, "node_modules/webidl-conversions": { "version": "3.0.1", + "dev": true, "license": "BSD-2-Clause" }, "node_modules/well-known-symbols": { @@ -9249,6 +8677,7 @@ }, "node_modules/whatwg-url": { "version": "5.0.0", + "dev": true, "license": "MIT", "dependencies": { "tr46": "~0.0.3", @@ -9384,24 +8813,6 @@ "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/xml2js": { - "version": "0.5.0", - "license": "MIT", - "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/xmlbuilder": { - "version": "11.0.1", - "license": "MIT", - "engines": { - "node": ">=4.0" - } - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index 7a607760ed..9a47956239 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeql", - "version": "4.31.3", + "version": "4.31.10", "private": true, "description": "CodeQL action", "scripts": { @@ -24,56 +24,55 @@ }, "license": "MIT", "dependencies": { - "@actions/artifact": "^4.0.0", + "@actions/artifact": "^5.0.1", "@actions/artifact-legacy": "npm:@actions/artifact@^1.1.2", - "@actions/cache": "^4.1.0", - "@actions/core": "^1.11.1", - "@actions/exec": "^1.1.1", - "@actions/github": "^6.0.0", + "@actions/cache": "^5.0.1", + "@actions/core": "^2.0.1", + "@actions/exec": "^2.0.0", + "@actions/github": "^6.0.1", "@actions/glob": "^0.5.0", "@actions/http-client": "^3.0.0", "@actions/io": "^2.0.0", "@actions/tool-cache": "^2.0.2", "@octokit/plugin-retry": "^6.0.0", - "@octokit/request-error": "^7.0.2", "@schemastore/package": "0.0.10", "archiver": "^7.0.1", "fast-deep-equal": "^3.1.3", "follow-redirects": "^1.15.11", "get-folder-size": "^5.0.0", - "js-yaml": "^4.1.0", + "js-yaml": "^4.1.1", "jsonschema": "1.4.1", "long": "^5.3.2", - "node-forge": "^1.3.1", - "octokit": "^5.0.5", + "node-forge": "^1.3.3", "semver": "^7.7.3", "uuid": "^13.0.0" }, "devDependencies": { "@ava/typescript": "6.0.0", - "@eslint/compat": "^1.4.1", - "@eslint/eslintrc": "^3.3.1", - "@eslint/js": "^9.39.0", + "@eslint/compat": "^2.0.0", + "@eslint/eslintrc": "^3.3.3", + "@eslint/js": "^9.39.2", "@microsoft/eslint-formatter-sarif": "^3.1.0", "@octokit/types": "^16.0.0", "@types/archiver": "^7.0.0", "@types/follow-redirects": "^1.14.4", "@types/js-yaml": "^4.0.9", - "@types/node": "20.19.9", + "@types/node": "^20.19.9", "@types/node-forge": "^1.3.14", "@types/semver": "^7.7.1", - "@types/sinon": "^17.0.4", - "@typescript-eslint/eslint-plugin": "^8.46.3", - "@typescript-eslint/parser": "^8.41.0", + "@types/sinon": "^21.0.0", + "@typescript-eslint/eslint-plugin": "^8.49.0", + "@typescript-eslint/parser": "^8.48.0", "ava": "^6.4.1", - "esbuild": "^0.25.12", + "esbuild": "^0.27.1", "eslint": "^8.57.1", "eslint-import-resolver-typescript": "^3.8.7", "eslint-plugin-filenames": "^1.3.2", "eslint-plugin-github": "^5.1.8", "eslint-plugin-import": "2.29.1", + "eslint-plugin-jsdoc": "^61.5.0", "eslint-plugin-no-async-foreach": "^0.1.1", - "glob": "^11.0.3", + "glob": "^11.1.0", "nock": "^14.0.10", "sinon": "^21.0.0", "typescript": "^5.9.3" @@ -97,6 +96,7 @@ "eslint-plugin-jsx-a11y": { "semver": ">=6.3.1" }, - "brace-expansion@2.0.1": "2.0.2" + "brace-expansion@2.0.1": "2.0.2", + "glob": "^11.1.0" } } diff --git a/pr-checks/checks/all-platform-bundle.yml b/pr-checks/checks/all-platform-bundle.yml index 3396be22a7..994c91eb97 100644 --- a/pr-checks/checks/all-platform-bundle.yml +++ b/pr-checks/checks/all-platform-bundle.yml @@ -4,6 +4,7 @@ operatingSystems: ["ubuntu", "macos", "windows"] versions: ["nightly-latest"] useAllPlatformBundle: "true" installGo: true +installDotNet: true steps: - id: init uses: ./../action/init diff --git a/pr-checks/checks/analyze-ref-input.yml b/pr-checks/checks/analyze-ref-input.yml index 1dbf9e0c86..e9d2cd1764 100644 --- a/pr-checks/checks/analyze-ref-input.yml +++ b/pr-checks/checks/analyze-ref-input.yml @@ -3,6 +3,7 @@ description: "Checks that specifying 'ref' and 'sha' as inputs works" versions: ["default"] installGo: true installPython: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/autobuild-action.yml b/pr-checks/checks/autobuild-action.yml index 91ae7834cc..b91489cc8c 100644 --- a/pr-checks/checks/autobuild-action.yml +++ b/pr-checks/checks/autobuild-action.yml @@ -2,6 +2,7 @@ name: "autobuild-action" description: "Tests that the C# autobuild action works" operatingSystems: ["ubuntu", "macos", "windows"] versions: ["linked"] +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/build-mode-manual.yml b/pr-checks/checks/build-mode-manual.yml index f1815b7ff0..a8048230c8 100644 --- a/pr-checks/checks/build-mode-manual.yml +++ b/pr-checks/checks/build-mode-manual.yml @@ -2,6 +2,7 @@ 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 diff --git a/pr-checks/checks/bundle-zstd.yml b/pr-checks/checks/bundle-zstd.yml index ac543d8246..371525aab3 100644 --- a/pr-checks/checks/bundle-zstd.yml +++ b/pr-checks/checks/bundle-zstd.yml @@ -27,7 +27,7 @@ steps: output: ${{ runner.temp }}/results upload-database: false - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.os }}-zstd-bundle.sarif path: ${{ runner.temp }}/results/javascript.sarif diff --git a/pr-checks/checks/config-export.yml b/pr-checks/checks/config-export.yml index f7c24f8150..fc4c68ad64 100644 --- a/pr-checks/checks/config-export.yml +++ b/pr-checks/checks/config-export.yml @@ -12,7 +12,7 @@ steps: output: "${{ runner.temp }}/results" upload-database: false - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: config-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json path: "${{ runner.temp }}/results/javascript.sarif" diff --git a/pr-checks/checks/diagnostics-export.yml b/pr-checks/checks/diagnostics-export.yml index b0ea306fbd..ccf5b35015 100644 --- a/pr-checks/checks/diagnostics-export.yml +++ b/pr-checks/checks/diagnostics-export.yml @@ -25,7 +25,7 @@ steps: output: "${{ runner.temp }}/results" upload-database: false - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: diagnostics-export-${{ matrix.os }}-${{ matrix.version }}.sarif.json path: "${{ runner.temp }}/results/javascript.sarif" diff --git a/pr-checks/checks/export-file-baseline-information.yml b/pr-checks/checks/export-file-baseline-information.yml index 1a316d6ec0..fdc352285c 100644 --- a/pr-checks/checks/export-file-baseline-information.yml +++ b/pr-checks/checks/export-file-baseline-information.yml @@ -3,6 +3,7 @@ description: "Tests that file baseline information is exported when the feature operatingSystems: ["ubuntu", "macos", "windows"] versions: ["nightly-latest"] installGo: true +installDotNet: true env: CODEQL_ACTION_SUBLANGUAGE_FILE_COVERAGE: true steps: @@ -17,7 +18,7 @@ steps: with: output: "${{ runner.temp }}/results" - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: with-baseline-information-${{ matrix.os }}-${{ matrix.version }}.sarif.json path: "${{ runner.temp }}/results/javascript.sarif" diff --git a/pr-checks/checks/global-proxy.yml b/pr-checks/checks/global-proxy.yml index 1d64125748..b965eec3b0 100644 --- a/pr-checks/checks/global-proxy.yml +++ b/pr-checks/checks/global-proxy.yml @@ -23,6 +23,7 @@ services: - 3128:3128 env: https_proxy: http://squid-proxy:3128 + CODEQL_ACTION_TOLERATE_MISSING_GIT_VERSION: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/go-custom-queries.yml b/pr-checks/checks/go-custom-queries.yml index ca00fd81a9..867d8dc6cc 100644 --- a/pr-checks/checks/go-custom-queries.yml +++ b/pr-checks/checks/go-custom-queries.yml @@ -7,6 +7,7 @@ versions: - linked - nightly-latest installGo: true +installDotNet: true env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" steps: diff --git a/pr-checks/checks/job-run-uuid-sarif.yml b/pr-checks/checks/job-run-uuid-sarif.yml index 751ac4e1e0..e0610846b1 100644 --- a/pr-checks/checks/job-run-uuid-sarif.yml +++ b/pr-checks/checks/job-run-uuid-sarif.yml @@ -11,7 +11,7 @@ steps: with: output: "${{ runner.temp }}/results" - name: Upload SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: ${{ matrix.os }}-${{ matrix.version }}.sarif.json path: "${{ runner.temp }}/results/javascript.sarif" diff --git a/pr-checks/checks/local-bundle.yml b/pr-checks/checks/local-bundle.yml index 449dcbbb17..c0930772e6 100644 --- a/pr-checks/checks/local-bundle.yml +++ b/pr-checks/checks/local-bundle.yml @@ -3,6 +3,7 @@ description: "Tests using a CodeQL bundle from a local file rather than a URL" versions: ["linked"] installGo: true installPython: true +installDotNet: true steps: - name: Fetch latest CodeQL bundle run: | diff --git a/pr-checks/checks/multi-language-autodetect.yml b/pr-checks/checks/multi-language-autodetect.yml index 84c779dd9a..4892bcc316 100644 --- a/pr-checks/checks/multi-language-autodetect.yml +++ b/pr-checks/checks/multi-language-autodetect.yml @@ -5,6 +5,7 @@ env: CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI: true installGo: true installPython: true +installDotNet: true steps: - name: Use Xcode 16 if: runner.os == 'macOS' && matrix.version != 'nightly-latest' diff --git a/pr-checks/checks/packaging-codescanning-config-inputs-js.yml b/pr-checks/checks/packaging-codescanning-config-inputs-js.yml index 1b72b06b3f..6fd0f7c8a1 100644 --- a/pr-checks/checks/packaging-codescanning-config-inputs-js.yml +++ b/pr-checks/checks/packaging-codescanning-config-inputs-js.yml @@ -4,6 +4,7 @@ versions: ["linked", "default", "nightly-latest"] # This feature is not compatib installGo: true installNode: true installPython: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/packaging-config-inputs-js.yml b/pr-checks/checks/packaging-config-inputs-js.yml index 41275fd15c..8df42f9443 100644 --- a/pr-checks/checks/packaging-config-inputs-js.yml +++ b/pr-checks/checks/packaging-config-inputs-js.yml @@ -3,6 +3,7 @@ description: "Checks that specifying packages using a combination of a config fi versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs installGo: true installNode: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/packaging-config-js.yml b/pr-checks/checks/packaging-config-js.yml index 906a3a7d93..9fa41061ce 100644 --- a/pr-checks/checks/packaging-config-js.yml +++ b/pr-checks/checks/packaging-config-js.yml @@ -3,6 +3,7 @@ description: "Checks that specifying packages using only a config file works" versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs installGo: true installNode: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/packaging-inputs-js.yml b/pr-checks/checks/packaging-inputs-js.yml index 9d9fbe71f8..bb70de7e61 100644 --- a/pr-checks/checks/packaging-inputs-js.yml +++ b/pr-checks/checks/packaging-inputs-js.yml @@ -3,6 +3,7 @@ description: "Checks that specifying packages using the input to the Action work versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs installGo: true installNode: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/quality-queries.yml b/pr-checks/checks/quality-queries.yml index 4fb983745f..353abbb774 100644 --- a/pr-checks/checks/quality-queries.yml +++ b/pr-checks/checks/quality-queries.yml @@ -39,7 +39,7 @@ steps: post-processed-sarif-path: "${{ runner.temp }}/post-processed" - name: Upload security SARIF if: contains(matrix.analysis-kinds, 'code-scanning') - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: | quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json @@ -47,14 +47,14 @@ steps: retention-days: 7 - name: Upload quality SARIF if: contains(matrix.analysis-kinds, 'code-quality') - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: | quality-queries-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.quality.sarif.json path: "${{ runner.temp }}/results/javascript.quality.sarif" retention-days: 7 - name: Upload post-processed SARIF - uses: actions/upload-artifact@v5 + uses: actions/upload-artifact@v6 with: name: | post-processed-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.analysis-kinds }}.sarif.json diff --git a/pr-checks/checks/remote-config.yml b/pr-checks/checks/remote-config.yml index c0a9cf0bb2..24249156ea 100644 --- a/pr-checks/checks/remote-config.yml +++ b/pr-checks/checks/remote-config.yml @@ -7,6 +7,7 @@ versions: - nightly-latest installGo: true installPython: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/rubocop-multi-language.yml b/pr-checks/checks/rubocop-multi-language.yml index 8a1f91444f..b81e743319 100644 --- a/pr-checks/checks/rubocop-multi-language.yml +++ b/pr-checks/checks/rubocop-multi-language.yml @@ -4,7 +4,7 @@ description: "Tests using RuboCop to analyze a multi-language repository and the versions: ["default"] steps: - name: Set up Ruby - uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0 + uses: ruby/setup-ruby@ac793fdd38cc468a4dd57246fa9d0e868aba9085 # v1.270.0 with: ruby-version: 2.6 - name: Install Code Scanning integration diff --git a/pr-checks/checks/split-workflow.yml b/pr-checks/checks/split-workflow.yml index fdcf1d5304..23f82a7a5b 100644 --- a/pr-checks/checks/split-workflow.yml +++ b/pr-checks/checks/split-workflow.yml @@ -3,6 +3,7 @@ description: "Tests a split-up workflow in which we first build a database and l operatingSystems: ["ubuntu", "macos"] versions: ["linked", "default", "nightly-latest"] # This feature is not compatible with old CLIs installGo: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/submit-sarif-failure.yml b/pr-checks/checks/submit-sarif-failure.yml index 97332e4c94..5db63bb813 100644 --- a/pr-checks/checks/submit-sarif-failure.yml +++ b/pr-checks/checks/submit-sarif-failure.yml @@ -18,7 +18,7 @@ permissions: security-events: write # needed to upload the SARIF file steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - uses: ./init with: languages: javascript diff --git a/pr-checks/checks/swift-custom-build.yml b/pr-checks/checks/swift-custom-build.yml index 2ad44ff3b9..1c8f1bf3af 100644 --- a/pr-checks/checks/swift-custom-build.yml +++ b/pr-checks/checks/swift-custom-build.yml @@ -3,6 +3,7 @@ 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: diff --git a/pr-checks/checks/unset-environment.yml b/pr-checks/checks/unset-environment.yml index 614c2006ef..4cc728600a 100644 --- a/pr-checks/checks/unset-environment.yml +++ b/pr-checks/checks/unset-environment.yml @@ -7,6 +7,7 @@ versions: - nightly-latest installGo: true installPython: true +installDotNet: true steps: - uses: ./../action/init id: init diff --git a/pr-checks/checks/upload-ref-sha-input.yml b/pr-checks/checks/upload-ref-sha-input.yml index fe55b5457b..0c8059a515 100644 --- a/pr-checks/checks/upload-ref-sha-input.yml +++ b/pr-checks/checks/upload-ref-sha-input.yml @@ -3,6 +3,7 @@ description: "Checks that specifying 'ref' and 'sha' as inputs works" versions: ["default"] installGo: true installPython: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/upload-sarif.yml b/pr-checks/checks/upload-sarif.yml index 0028e67ed2..cfe66a3f87 100644 --- a/pr-checks/checks/upload-sarif.yml +++ b/pr-checks/checks/upload-sarif.yml @@ -4,6 +4,7 @@ versions: ["default"] analysisKinds: ["code-scanning", "code-quality", "code-scanning,code-quality"] installGo: true installPython: true +installDotNet: true steps: - uses: ./../action/init with: diff --git a/pr-checks/checks/with-checkout-path.yml b/pr-checks/checks/with-checkout-path.yml index b18d191ccd..230e342e30 100644 --- a/pr-checks/checks/with-checkout-path.yml +++ b/pr-checks/checks/with-checkout-path.yml @@ -3,6 +3,7 @@ description: "Checks that a custom `checkout_path` will find the proper commit_o versions: ["linked"] installGo: true installPython: true +installDotNet: true steps: # This ensures we don't accidentally use the original checkout for any part of the test. - name: Delete original checkout @@ -13,7 +14,7 @@ steps: 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@v5 + - uses: actions/checkout@v6 with: ref: 474bbf07f9247ffe1856c6a0f94aeeb10e7afee6 path: x/y/z/some-path diff --git a/pr-checks/sync.py b/pr-checks/sync.py index f247f38245..ebc37b9f85 100755 --- a/pr-checks/sync.py +++ b/pr-checks/sync.py @@ -107,7 +107,7 @@ def writeHeader(checkStream): steps = [ { 'name': 'Check out repository', - 'uses': 'actions/checkout@v5' + 'uses': 'actions/checkout@v6' }, ] @@ -204,6 +204,25 @@ def writeHeader(checkStream): } }) + installDotNet = is_truthy(checkSpecification.get('installDotNet', '')) + + if installDotNet: + baseDotNetVersionExpr = '9.x' + workflowInputs['dotnet-version'] = { + 'type': 'string', + 'description': 'The version of .NET to install', + 'required': False, + 'default': baseDotNetVersionExpr, + } + + steps.append({ + 'name': 'Install .NET', + 'uses': 'actions/setup-dotnet@v5', + 'with': { + 'dotnet-version': '${{ inputs.dotnet-version || \'' + baseDotNetVersionExpr + '\' }}' + } + }) + # If container initialisation steps are present in the check specification, # make sure to execute them first. if 'container' in checkSpecification and 'container-init-steps' in checkSpecification: @@ -337,11 +356,6 @@ def writeHeader(checkStream): 'GO111MODULE': 'auto' }, 'on': { - 'push': { - 'paths': [ - f'.github/workflows/__{collection_name}.yml' - ] - }, 'workflow_dispatch': { 'inputs': combinedInputs }, diff --git a/src/actions-util.ts b/src/actions-util.ts index a2d691b42d..736d35d0f1 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -80,7 +80,7 @@ export function isRunningLocalAction(): boolean { * * This can be used to get the Action's name or tell if we're running a local Action. */ -export function getRelativeScriptPath(): string { +function getRelativeScriptPath(): string { const runnerTemp = getRequiredEnvParam("RUNNER_TEMP"); const actionsDirectory = path.join(path.dirname(runnerTemp), "_actions"); return path.relative(actionsDirectory, __filename); diff --git a/src/analyses.ts b/src/analyses.ts index a8d172e3b6..4f91ab07c0 100644 --- a/src/analyses.ts +++ b/src/analyses.ts @@ -98,7 +98,7 @@ export async function getAnalysisKinds( export const codeQualityQueries: string[] = ["code-quality"]; // Enumerates API endpoints that accept SARIF files. -export enum SARIF_UPLOAD_ENDPOINT { +enum SARIF_UPLOAD_ENDPOINT { CODE_SCANNING = "PUT /repos/:owner/:repo/code-scanning/analysis", CODE_QUALITY = "PUT /repos/:owner/:repo/code-quality/analysis", } diff --git a/src/analyze-action-env.test.ts b/src/analyze-action-env.test.ts index e4960a5803..aecbae4b02 100644 --- a/src/analyze-action-env.test.ts +++ b/src/analyze-action-env.test.ts @@ -74,11 +74,20 @@ test("analyze action with RAM & threads from environment variables", async (t) = // wait for the action promise to complete before starting verification. await analyzeAction.runPromise; - t.assert(runFinalizeStub.calledOnce); - t.deepEqual(runFinalizeStub.firstCall.args[1], "--threads=-1"); - t.deepEqual(runFinalizeStub.firstCall.args[2], "--ram=4992"); - t.assert(runQueriesStub.calledOnce); - t.deepEqual(runQueriesStub.firstCall.args[2], "--threads=-1"); - t.deepEqual(runQueriesStub.firstCall.args[1], "--ram=4992"); + 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", + ), + ); }); }); diff --git a/src/analyze-action-input.test.ts b/src/analyze-action-input.test.ts index 48fa216ebf..74c03923da 100644 --- a/src/analyze-action-input.test.ts +++ b/src/analyze-action-input.test.ts @@ -72,11 +72,20 @@ test("analyze action with RAM & threads from action inputs", async (t) => { // wait for the action promise to complete before starting verification. await analyzeAction.runPromise; - t.assert(runFinalizeStub.calledOnce); - t.deepEqual(runFinalizeStub.firstCall.args[1], "--threads=-1"); - t.deepEqual(runFinalizeStub.firstCall.args[2], "--ram=3012"); - t.assert(runQueriesStub.calledOnce); - t.deepEqual(runQueriesStub.firstCall.args[2], "--threads=-1"); - t.deepEqual(runQueriesStub.firstCall.args[1], "--ram=3012"); + 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-post.ts b/src/analyze-action-post.ts index 1f91b4f0fd..ce8ddd31bb 100644 --- a/src/analyze-action-post.ts +++ b/src/analyze-action-post.ts @@ -12,7 +12,10 @@ import { getGitHubVersion } from "./api-client"; import { getCodeQL } from "./codeql"; import { getConfig } from "./config-utils"; import * as debugArtifacts from "./debug-artifacts"; -import { getJavaTempDependencyDir } from "./dependency-caching"; +import { + getCsharpTempDependencyDir, + getJavaTempDependencyDir, +} from "./dependency-caching"; import { EnvVar } from "./environment"; import { getActionsLogger } from "./logging"; import { checkGitHubVersionInRange, getErrorMessage } from "./util"; @@ -42,17 +45,22 @@ async function runWrapper() { } } - // If we analysed Java in build-mode: none, we may have downloaded dependencies + // 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 javaTempDependencyDir = getJavaTempDependencyDir(); - if (fs.existsSync(javaTempDependencyDir)) { - try { - fs.rmSync(javaTempDependencyDir, { recursive: true }); - } catch (error) { - logger.info( - `Failed to remove temporary Java dependencies directory: ${getErrorMessage(error)}`, - ); + 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) { diff --git a/src/analyze-action.ts b/src/analyze-action.ts index ff24dd4007..6f45ee5f17 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -19,23 +19,21 @@ 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 { - Config, - getConfig, - isCodeQualityEnabled, - isCodeScanningEnabled, -} from "./config-utils"; -import { uploadDatabases } from "./database-upload"; + cleanupAndUploadDatabases, + DatabaseUploadResult, +} from "./database-upload"; import { DependencyCacheUploadStatusReport, uploadDependencyCaches, } from "./dependency-caching"; import { getDiffInformedAnalysisBranches } from "./diff-informed-analysis-utils"; import { EnvVar } from "./environment"; -import { Feature, Features } from "./feature-flags"; +import { Features } from "./feature-flags"; import { KnownLanguage } from "./languages"; import { getActionsLogger, Logger } from "./logging"; -import { uploadOverlayBaseDatabaseToCache } from "./overlay-database-utils"; +import { cleanupAndUploadOverlayBaseDatabaseToCache } from "./overlay-database-utils"; import { getRepositoryNwo } from "./repository"; import * as statusReport from "./status-report"; import { @@ -59,15 +57,13 @@ interface AnalysisStatusReport extends uploadLib.UploadStatusReport, QueriesStatusReport {} -interface DependencyCachingUploadStatusReport { - dependency_caching_upload_results?: DependencyCacheUploadStatusReport; -} - interface FinishStatusReport extends StatusReportBase, DatabaseCreationTimings, - AnalysisStatusReport, - DependencyCachingUploadStatusReport {} + AnalysisStatusReport { + dependency_caching_upload_results?: DependencyCacheUploadStatusReport; + database_upload_results: DatabaseUploadResult[]; +} interface FinishWithTrapUploadStatusReport extends FinishStatusReport { /** Size of TRAP caches that we uploaded, in bytes. */ @@ -86,6 +82,7 @@ async function sendStatusReport( didUploadTrapCaches: boolean, trapCacheCleanup: TrapCacheCleanupStatusReport | undefined, dependencyCacheResults: DependencyCacheUploadStatusReport | undefined, + databaseUploadResults: DatabaseUploadResult[], logger: Logger, ) { const status = getActionsStatus(error, stats?.analyze_failure_language); @@ -106,6 +103,7 @@ async function sendStatusReport( ...(dbCreationTimings || {}), ...(trapCacheCleanup || {}), dependency_caching_upload_results: dependencyCacheResults, + database_upload_results: databaseUploadResults, }; if (config && didUploadTrapCaches) { const trapCacheUploadStatusReport: FinishWithTrapUploadStatusReport = { @@ -223,6 +221,7 @@ async function run() { let dbCreationTimings: DatabaseCreationTimings | undefined = undefined; let didUploadTrapCaches = false; let dependencyCacheResults: DependencyCacheUploadStatusReport | undefined; + let databaseUploadResults: DatabaseUploadResult[] = []; util.initializeEnvironment(actionsUtil.getActionVersion()); // Make inputs accessible in the `post` step, details at @@ -315,6 +314,7 @@ async function run() { await runAutobuildIfLegacyGoWorkflow(config, logger); dbCreationTimings = await runFinalize( + features, outputDir, threads, memory, @@ -357,46 +357,15 @@ async function run() { const checkoutPath = actionsUtil.getRequiredInput("checkout_path"); const category = actionsUtil.getOptionalInput("category"); - if (await features.getValue(Feature.AnalyzeUseNewUpload)) { - uploadResults = await postProcessAndUploadSarif( - logger, - features, - uploadKind, - checkoutPath, - outputDir, - category, - actionsUtil.getOptionalInput("post-processed-sarif-path"), - ); - } else if (uploadKind === "always") { - uploadResults = {}; - - if (isCodeScanningEnabled(config)) { - uploadResults[analyses.AnalysisKind.CodeScanning] = - await uploadLib.uploadFiles( - outputDir, - checkoutPath, - category, - features, - logger, - analyses.CodeScanning, - ); - } - - if (isCodeQualityEnabled(config)) { - uploadResults[analyses.AnalysisKind.CodeQuality] = - await uploadLib.uploadFiles( - outputDir, - checkoutPath, - category, - features, - logger, - analyses.CodeQuality, - ); - } - } else { - uploadResults = {}; - logger.info("Not uploading results"); - } + 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. @@ -417,12 +386,21 @@ async function run() { } // Possibly upload the overlay-base database to actions cache. - // If databases are to be uploaded, they will first be cleaned up at the overlay level. - await uploadOverlayBaseDatabaseToCache(codeql, config, logger); + // 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. - // If databases are to be uploaded, they will first be cleaned up at the clear level. - await uploadDatabases(repositoryNwo, codeql, config, apiDetails, logger); + // 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(); @@ -438,14 +416,11 @@ async function run() { // Store dependency cache(s) if dependency caching is enabled. if (shouldStoreCache(config.dependencyCachingEnabled)) { - const minimizeJavaJars = await features.getValue( - Feature.JavaMinimizeDependencyJars, - codeql, - ); dependencyCacheResults = await uploadDependencyCaches( + codeql, + features, config, logger, - minimizeJavaJars, ); } @@ -490,6 +465,7 @@ async function run() { didUploadTrapCaches, trapCacheCleanupTelemetry, dependencyCacheResults, + databaseUploadResults, logger, ); return; @@ -512,6 +488,7 @@ async function run() { didUploadTrapCaches, trapCacheCleanupTelemetry, dependencyCacheResults, + databaseUploadResults, logger, ); } else if (runStats !== undefined) { @@ -525,6 +502,7 @@ async function run() { didUploadTrapCaches, trapCacheCleanupTelemetry, dependencyCacheResults, + databaseUploadResults, logger, ); } else { @@ -538,6 +516,7 @@ async function run() { didUploadTrapCaches, trapCacheCleanupTelemetry, dependencyCacheResults, + databaseUploadResults, logger, ); } diff --git a/src/analyze.ts b/src/analyze.ts index ec7be074fe..dc631ba98f 100644 --- a/src/analyze.ts +++ b/src/analyze.ts @@ -10,7 +10,10 @@ import * as analyses from "./analyses"; import { setupCppAutobuild } from "./autobuild"; import { type CodeQL } from "./codeql"; import * as configUtils from "./config-utils"; -import { getJavaTempDependencyDir } from "./dependency-caching"; +import { + getCsharpTempDependencyDir, + getJavaTempDependencyDir, +} from "./dependency-caching"; import { addDiagnostic, makeDiagnostic } from "./diagnostics"; import { DiffThunkRange, @@ -38,89 +41,26 @@ export class CodeQLAnalysisError extends Error { } } -export interface QueriesStatusReport { - /** - * Time taken in ms to run queries for actions (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. - */ - analyze_builtin_queries_actions_duration_ms?: number; - /** - * Time taken in ms to run queries for cpp (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. - */ - analyze_builtin_queries_cpp_duration_ms?: number; - /** - * Time taken in ms to run queries for csharp (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. - */ - analyze_builtin_queries_csharp_duration_ms?: number; - /** - * Time taken in ms to run queries for go (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. - */ - analyze_builtin_queries_go_duration_ms?: number; - /** - * Time taken in ms to run queries for java (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. - */ - analyze_builtin_queries_java_duration_ms?: number; - /** - * Time taken in ms to run queries for javascript (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. - */ - analyze_builtin_queries_javascript_duration_ms?: number; - /** - * Time taken in ms to run queries for python (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. - */ - analyze_builtin_queries_python_duration_ms?: number; +type KnownLanguageKey = keyof typeof KnownLanguage; + +type RunQueriesDurationStatusReport = { /** - * Time taken in ms to run queries for ruby (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. - */ - analyze_builtin_queries_ruby_duration_ms?: number; - /** Time taken in ms to run queries for swift (or undefined if this language was not analyzed). + * 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. */ - analyze_builtin_queries_swift_duration_ms?: number; - - /** Time taken in ms to interpret results for actions (or undefined if this language was not analyzed). */ - interpret_results_actions_duration_ms?: number; - /** Time taken in ms to interpret results for cpp (or undefined if this language was not analyzed). */ - interpret_results_cpp_duration_ms?: number; - /** Time taken in ms to interpret results for csharp (or undefined if this language was not analyzed). */ - interpret_results_csharp_duration_ms?: number; - /** Time taken in ms to interpret results for go (or undefined if this language was not analyzed). */ - interpret_results_go_duration_ms?: number; - /** Time taken in ms to interpret results for java (or undefined if this language was not analyzed). */ - interpret_results_java_duration_ms?: number; - /** Time taken in ms to interpret results for javascript (or undefined if this language was not analyzed). */ - interpret_results_javascript_duration_ms?: number; - /** Time taken in ms to interpret results for python (or undefined if this language was not analyzed). */ - interpret_results_python_duration_ms?: number; - /** Time taken in ms to interpret results for ruby (or undefined if this language was not analyzed). */ - interpret_results_ruby_duration_ms?: number; - /** Time taken in ms to interpret results for swift (or undefined if this language was not analyzed). */ - interpret_results_swift_duration_ms?: number; + [L in KnownLanguageKey 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 KnownLanguageKey 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). @@ -161,6 +101,7 @@ async function setupPythonExtractor(logger: Logger) { export async function runExtraction( codeql: CodeQL, + features: FeatureEnablement, config: configUtils.Config, logger: Logger, ) { @@ -185,7 +126,7 @@ export async function runExtraction( await setupCppAutobuild(codeql, logger); } - // The Java `build-mode: none` extractor places dependencies (.jar files) in the + // 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). @@ -196,6 +137,15 @@ export async function runExtraction( process.env["CODEQL_EXTRACTOR_JAVA_OPTION_BUILDLESS_DEPENDENCY_DIR"] = getJavaTempDependencyDir(); } + if ( + language === KnownLanguage.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 { @@ -240,13 +190,14 @@ export function dbIsFinalized( async function finalizeDatabaseCreation( codeql: CodeQL, + features: FeatureEnablement, config: configUtils.Config, threadsFlag: string, memoryFlag: string, logger: Logger, ): Promise { const extractionStart = performance.now(); - await runExtraction(codeql, config, logger); + await runExtraction(codeql, features, config, logger); const extractionTime = performance.now() - extractionStart; const trapImportStart = performance.now(); @@ -660,6 +611,7 @@ export async function runQueries( } export async function runFinalize( + features: FeatureEnablement, outputDir: string, threadsFlag: string, memoryFlag: string, @@ -678,6 +630,7 @@ export async function runFinalize( const timings = await finalizeDatabaseCreation( codeql, + features, config, threadsFlag, memoryFlag, diff --git a/src/api-client.test.ts b/src/api-client.test.ts index d3a5ce2bca..073f68ff1b 100644 --- a/src/api-client.test.ts +++ b/src/api-client.test.ts @@ -95,14 +95,14 @@ test("getGitHubVersion for different domain", async (t) => { t.deepEqual({ type: util.GitHubVariant.DOTCOM }, v3); }); -test("getGitHubVersion for GHE_DOTCOM", async (t) => { +test("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.GHE_DOTCOM }, gheDotcom); + t.deepEqual({ type: util.GitHubVariant.GHEC_DR }, gheDotcom); }); test("wrapApiConfigurationError correctly wraps specific configuration errors", (t) => { diff --git a/src/api-client.ts b/src/api-client.ts index e14048337f..32a6a080b7 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -18,11 +18,6 @@ import { const GITHUB_ENTERPRISE_VERSION_HEADER = "x-github-enterprise-version"; -export enum DisallowedAPIVersionReason { - ACTION_TOO_OLD, - ACTION_TOO_NEW, -} - export type GitHubApiCombinedDetails = GitHubApiDetails & GitHubApiExternalRepoDetails; @@ -130,7 +125,7 @@ export async function getGitHubVersionFromApi( } if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") { - return { type: GitHubVariant.GHE_DOTCOM }; + return { type: GitHubVariant.GHEC_DR }; } const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] as string; diff --git a/src/api-compatibility.json b/src/api-compatibility.json index bf5f9437b4..b61bbd26d3 100644 --- a/src/api-compatibility.json +++ b/src/api-compatibility.json @@ -1 +1 @@ -{"maximumVersion": "3.19", "minimumVersion": "3.14"} +{"maximumVersion": "3.20", "minimumVersion": "3.14"} diff --git a/src/artifact-scanner.test.ts b/src/artifact-scanner.test.ts new file mode 100644 index 0000000000..5678d2cadd --- /dev/null +++ b/src/artifact-scanner.test.ts @@ -0,0 +1,98 @@ +import * as fs from "fs"; +import * as os from "os"; +import * as path from "path"; + +import test from "ava"; + +import { scanArtifactsForTokens } from "./artifact-scanner"; +import { getRunnerLogger } from "./logging"; +import { getRecordingLogger, LoggedMessage } from "./testing-utils"; + +test("scanArtifactsForTokens detects GitHub tokens in files", async (t) => { + const logger = getRunnerLogger(true); + 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 ghp_1234567890123456789012345678901234AB", + ); + + const error = await t.throwsAsync( + async () => await scanArtifactsForTokens([testFile], logger), + ); + + t.regex( + error?.message || "", + /Found 1 potential GitHub token.*Personal Access Token/, + ); + t.regex(error?.message || "", /test\.txt/); + } 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 }); + } +}); + +if (os.platform() !== "win32") { + test("scanArtifactsForTokens finds token in debug artifacts", async (t) => { + t.timeout(15000); // 15 seconds + 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 new file mode 100644 index 0000000000..d04445bf4d --- /dev/null +++ b/src/artifact-scanner.ts @@ -0,0 +1,379 @@ +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"; + +/** + * GitHub token patterns to scan for. + * These patterns match various GitHub token formats. + */ +const GITHUB_TOKEN_PATTERNS = [ + { + name: "Personal Access Token", + pattern: /\bghp_[a-zA-Z0-9]{36}\b/g, + }, + { + name: "OAuth Access Token", + pattern: /\bgho_[a-zA-Z0-9]{36}\b/g, + }, + { + name: "User-to-Server Token", + pattern: /\bghu_[a-zA-Z0-9]{36}\b/g, + }, + { + name: "Server-to-Server Token", + pattern: /\bghs_[a-zA-Z0-9]{36}\b/g, + }, + { + name: "Refresh Token", + pattern: /\bghr_[a-zA-Z0-9]{36}\b/g, + }, + { + name: "App Installation Access Token", + pattern: /\bghs_[a-zA-Z0-9]{255}\b/g, + }, +]; + +interface TokenFinding { + tokenType: string; + filePath: string; +} + +interface ScanResult { + scannedFiles: number; + findings: TokenFinding[]; +} + +/** + * 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 { name, pattern } of GITHUB_TOKEN_PATTERNS) { + const matches = content.match(pattern); + if (matches) { + for (let i = 0; i < matches.length; i++) { + findings.push({ tokenType: name, filePath: relativePath }); + } + logger.debug(`Found ${matches.length} ${name}(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}`, + ); + } + + 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/caching-utils.ts b/src/caching-utils.ts index 9da7978016..33dac7cfb4 100644 --- a/src/caching-utils.ts +++ b/src/caching-utils.ts @@ -1,3 +1,5 @@ +import * as crypto from "crypto"; + import * as core from "@actions/core"; import { getOptionalInput, isDefaultSetup } from "./actions-util"; @@ -71,6 +73,33 @@ export function getCachingKind(input: string | undefined): CachingKind { } } +// 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 diff --git a/src/cli-errors.ts b/src/cli-errors.ts index 0a009f9832..5aba268cab 100644 --- a/src/cli-errors.ts +++ b/src/cli-errors.ts @@ -159,10 +159,7 @@ type CliErrorConfiguration = { * 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. */ -export const cliErrorsConfig: Record< - CliConfigErrorCategory, - CliErrorConfiguration -> = { +const cliErrorsConfig: Record = { [CliConfigErrorCategory.AutobuildError]: { cliErrorMessageCandidates: [ new RegExp("We were unable to automatically build your code"), diff --git a/src/codeql.ts b/src/codeql.ts index 97c3a1fd2f..33dd0db981 100644 --- a/src/codeql.ts +++ b/src/codeql.ts @@ -35,7 +35,7 @@ import { ToolsDownloadStatusReport } from "./tools-download"; import { ToolsFeature, isSupportedToolsFeature } from "./tools-features"; import { shouldEnableIndirectTracing } from "./tracer-config"; import * as util from "./util"; -import { BuildMode, getErrorMessage } from "./util"; +import { BuildMode, CleanupLevel, getErrorMessage } from "./util"; type Options = Array; @@ -141,7 +141,10 @@ export interface CodeQL { /** * Clean up all the databases within a database cluster. */ - databaseCleanupCluster(config: Config, cleanupLevel: string): Promise; + databaseCleanupCluster( + config: Config, + cleanupLevel: CleanupLevel, + ): Promise; /** * Run 'codeql database bundle'. */ @@ -203,6 +206,7 @@ export interface CodeQL { * Run 'codeql resolve queries --format=startingpacks'. */ resolveQueriesStartingPacks(queries: string[]): Promise; + resolveDatabase(databasePath: string): Promise; /** * Run 'codeql github merge-results'. */ @@ -227,6 +231,10 @@ export interface VersionInfo { overlayVersion?: number; } +export interface ResolveDatabaseOutput { + overlayBaseSpecifier?: string; +} + export interface ResolveLanguagesOutput { [language: string]: [string]; } @@ -490,6 +498,7 @@ export function createStubCodeQL(partialCodeql: Partial): CodeQL { partialCodeql, "resolveQueriesStartingPacks", ), + resolveDatabase: resolveFunction(partialCodeql, "resolveDatabase"), mergeResults: resolveFunction(partialCodeql, "mergeResults"), }; } @@ -513,7 +522,7 @@ export async function getCodeQLForTesting( * version requirement. Must be set to true outside tests. * @returns A new CodeQL object */ -export async function getCodeQLForCmd( +async function getCodeQLForCmd( cmd: string, checkVersion: boolean, ): Promise { @@ -878,7 +887,7 @@ export async function getCodeQLForCmd( }, async databaseCleanupCluster( config: Config, - cleanupLevel: string, + cleanupLevel: CleanupLevel, ): Promise { const cacheCleanupFlag = (await util.codeQlVersionAtLeast( this, @@ -1000,6 +1009,26 @@ export async function getCodeQLForCmd( ); } }, + async resolveDatabase( + databasePath: string, + ): Promise { + const codeqlArgs = [ + "resolve", + "database", + databasePath, + "--format=json", + ...getExtraOptionsFromEnv(["resolve", "database"]), + ]; + const output = await runCli(cmd, codeqlArgs, { noStreamStdout: true }); + + try { + return JSON.parse(output) as ResolveDatabaseOutput; + } catch (e) { + throw new Error( + `Unexpected output from codeql resolve database --format=json: ${e}`, + ); + } + }, async mergeResults( sarifFiles: string[], outputFile: string, @@ -1071,8 +1100,11 @@ export async function getCodeQLForCmd( /** * Gets the options for `path` of `options` as an array of extra option strings. * - * @param 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. + * @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[], @@ -1154,8 +1186,9 @@ async function runCli( /** * Writes the code scanning configuration that is to be used by the CLI. * - * @param codeql The CodeQL object to use. - * @param config The CodeQL Action state to use. + * @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( @@ -1218,7 +1251,7 @@ export async function getTrapCachingExtractorConfigArgsForLang( * * This will not exist if the configuration is being parsed in the Action. */ -export function getGeneratedCodeScanningConfigPath(config: Config): string { +function getGeneratedCodeScanningConfigPath(config: Config): string { return path.resolve(config.tempDir, "user-config.yaml"); } diff --git a/src/config-utils.test.ts b/src/config-utils.test.ts index bf60b4902e..337eb85c59 100644 --- a/src/config-utils.test.ts +++ b/src/config-utils.test.ts @@ -15,6 +15,7 @@ import * as configUtils from "./config-utils"; import * as errorMessages from "./error-messages"; import { Feature } from "./feature-flags"; import * as gitUtils from "./git-utils"; +import { GitVersionInfo } from "./git-utils"; import { KnownLanguage, Language } from "./languages"; import { getRunnerLogger } from "./logging"; import { @@ -37,7 +38,9 @@ import { ConfigurationError, withTmpDir, BuildMode, + DiskUsage, } from "./util"; +import * as util from "./util"; setupTests(test); @@ -57,6 +60,7 @@ function createTestInitConfigInputs( dbLocation: undefined, configInput: undefined, buildModeInput: undefined, + ramInput: undefined, trapCachingEnabled: false, dependencyCachingEnabled: CachingKind.None, debugMode: false, @@ -200,12 +204,9 @@ test("load code quality config", async (t) => { ); // And the config we expect it to result in - const expectedConfig: configUtils.Config = { - version: actionsUtil.getActionVersion(), + const expectedConfig = createTestConfig({ analysisKinds: [AnalysisKind.CodeQuality], languages: [KnownLanguage.actions], - buildMode: undefined, - originalUserInput: {}, // This gets set because we only have `AnalysisKind.CodeQuality` computedConfig: { "disable-default-queries": true, @@ -219,14 +220,7 @@ test("load code quality config", async (t) => { debugMode: false, debugArtifactName: "", debugDatabaseName: "", - trapCaches: {}, - trapCacheDownloadTime: 0, - dependencyCachingEnabled: CachingKind.None, - extraQueryExclusions: [], - overlayDatabaseMode: OverlayDatabaseMode.None, - useOverlayDatabaseCaching: false, - repositoryProperties: {}, - }; + }); t.deepEqual(config, expectedConfig); }); @@ -507,9 +501,7 @@ test("load non-empty input", async (t) => { }; // And the config we expect it to parse to - const expectedConfig: configUtils.Config = { - version: actionsUtil.getActionVersion(), - analysisKinds: [AnalysisKind.CodeScanning], + const expectedConfig = createTestConfig({ languages: [KnownLanguage.javascript], buildMode: BuildMode.None, originalUserInput: userConfig, @@ -521,14 +513,7 @@ test("load non-empty input", async (t) => { debugMode: false, debugArtifactName: "my-artifact", debugDatabaseName: "my-db", - trapCaches: {}, - trapCacheDownloadTime: 0, - dependencyCachingEnabled: CachingKind.None, - extraQueryExclusions: [], - overlayDatabaseMode: OverlayDatabaseMode.None, - useOverlayDatabaseCaching: false, - repositoryProperties: {}, - }; + }); const languagesInput = "javascript"; const configFilePath = createConfigFile(inputFileContents, tempDir); @@ -873,71 +858,62 @@ const mockRepositoryNwo = parseRepositoryNwo("owner/repo"); expectedLanguages: ["javascript"], }, ].forEach((args) => { - for (const resolveSupportedLanguagesUsingCli of [true, false]) { - test(`getLanguages${resolveSupportedLanguagesUsingCli ? " (supported languages via CLI)" : ""}: ${args.name}`, async (t) => { - const features = createFeatures( - resolveSupportedLanguagesUsingCli - ? [Feature.ResolveSupportedLanguagesUsingCli] - : [], + test(`getLanguages: ${args.name}`, async (t) => { + const mockRequest = mockLanguagesInRepo(args.languagesInRepository); + const stubExtractorEntry = { + extractor_root: "", + }; + const codeQL = createStubCodeQL({ + betterResolveLanguages: (options) => + Promise.resolve({ + aliases: { + "c#": KnownLanguage.csharp, + c: KnownLanguage.cpp, + kotlin: KnownLanguage.java, + typescript: KnownLanguage.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, ); - const mockRequest = mockLanguagesInRepo(args.languagesInRepository); - const stubExtractorEntry = { - extractor_root: "", - }; - const codeQL = createStubCodeQL({ - betterResolveLanguages: (options) => - Promise.resolve({ - aliases: { - "c#": KnownLanguage.csharp, - c: KnownLanguage.cpp, - kotlin: KnownLanguage.java, - typescript: KnownLanguage.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, - ".", - features, - mockLogger, - ); - t.deepEqual(actualLanguages.sort(), args.expectedLanguages.sort()); - } else { - // there is an error - await t.throwsAsync( - async () => - await configUtils.getLanguages( - codeQL, - args.languagesInput, - mockRepositoryNwo, - ".", - features, - mockLogger, - ), - { message: args.expectedError }, - ); - } - t.deepEqual(mockRequest.called, args.expectedApiCall); - }); - } + 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 [ @@ -999,12 +975,14 @@ interface OverlayDatabaseModeTestSetup { features: Feature[]; isPullRequest: boolean; isDefaultBranch: boolean; - repositoryOwner: string; buildMode: BuildMode | undefined; languages: Language[]; codeqlVersion: string; gitRoot: string | undefined; + gitVersion: GitVersionInfo | undefined; codeScanningConfig: configUtils.UserConfig; + diskUsage: DiskUsage | undefined; + memoryFlagValue: number; } const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = { @@ -1012,12 +990,20 @@ const defaultOverlayDatabaseModeTestSetup: OverlayDatabaseModeTestSetup = { features: [], isPullRequest: false, isDefaultBranch: false, - repositoryOwner: "github", buildMode: BuildMode.None, languages: [KnownLanguage.javascript], codeqlVersion: CODEQL_OVERLAY_MINIMUM_VERSION, gitRoot: "/some/git/root", + gitVersion: new GitVersionInfo( + gitUtils.GIT_MINIMUM_VERSION_FOR_OVERLAY, + gitUtils.GIT_MINIMUM_VERSION_FOR_OVERLAY, + ), codeScanningConfig: {}, + diskUsage: { + numAvailableBytes: 50_000_000_000, + numTotalBytes: 100_000_000_000, + }, + memoryFlagValue: 6920, }; const getOverlayDatabaseModeMacro = test.macro({ @@ -1050,6 +1036,8 @@ const getOverlayDatabaseModeMacro = test.macro({ setup.overlayDatabaseEnvVar; } + sinon.stub(util, "checkDiskUsage").resolves(setup.diskUsage); + // Mock feature flags const features = createFeatures(setup.features); @@ -1058,11 +1046,7 @@ const getOverlayDatabaseModeMacro = test.macro({ .stub(actionsUtil, "isAnalyzingPullRequest") .returns(setup.isPullRequest); - // Mock repository owner - const repository = { - owner: setup.repositoryOwner, - repo: "test-repo", - }; + sinon.stub(util, "getCodeQLMemoryLimit").returns(setup.memoryFlagValue); // Set up CodeQL mock const codeql = mockCodeQLVersion(setup.codeqlVersion); @@ -1086,12 +1070,13 @@ const getOverlayDatabaseModeMacro = test.macro({ const result = await configUtils.getOverlayDatabaseMode( codeql, - repository, features, setup.languages, tempDir, // sourceRoot setup.buildMode, + undefined, setup.codeScanningConfig, + setup.gitVersion, logger, ); @@ -1214,6 +1199,104 @@ test( }, ); +test( + getOverlayDatabaseModeMacro, + "No overlay-base database on default branch if runner disk space is too low", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isDefaultBranch: true, + diskUsage: { + numAvailableBytes: 1_000_000_000, + numTotalBytes: 100_000_000_000, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }, +); + +test( + getOverlayDatabaseModeMacro, + "No overlay-base database on default branch if we can't determine runner disk space", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isDefaultBranch: true, + diskUsage: undefined, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay-base database on default branch if runner disk space is too low and skip resource checks flag is enabled", + { + languages: [KnownLanguage.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, + }, +); + +test( + getOverlayDatabaseModeMacro, + "No overlay-base database on default branch if memory flag is too low", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isDefaultBranch: true, + memoryFlagValue: 3072, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay-base database on default branch if memory flag is too low and skip resource checks flag is enabled", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + Feature.OverlayAnalysisSkipResourceChecks, + ], + isDefaultBranch: true, + memoryFlagValue: 3072, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.OverlayBase, + useOverlayDatabaseCaching: true, + }, +); + test( getOverlayDatabaseModeMacro, "No overlay-base database on default branch when code-scanning feature enabled with disable-default-queries", @@ -1384,6 +1467,104 @@ test( }, ); +test( + getOverlayDatabaseModeMacro, + "No overlay analysis on PR if runner disk space is too low", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isPullRequest: true, + diskUsage: { + numAvailableBytes: 1_000_000_000, + numTotalBytes: 100_000_000_000, + }, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay analysis on PR if runner disk space is too low and skip resource checks flag is enabled", + { + languages: [KnownLanguage.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, + }, +); + +test( + getOverlayDatabaseModeMacro, + "No overlay analysis on PR if we can't determine runner disk space", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isPullRequest: true, + diskUsage: undefined, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }, +); + +test( + getOverlayDatabaseModeMacro, + "No overlay analysis on PR if memory flag is too low", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + ], + isPullRequest: true, + memoryFlagValue: 3072, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Overlay analysis on PR if memory flag is too low and skip resource checks flag is enabled", + { + languages: [KnownLanguage.javascript], + features: [ + Feature.OverlayAnalysis, + Feature.OverlayAnalysisCodeScanningJavascript, + Feature.OverlayAnalysisSkipResourceChecks, + ], + isPullRequest: true, + memoryFlagValue: 3072, + }, + { + overlayDatabaseMode: OverlayDatabaseMode.Overlay, + useOverlayDatabaseCaching: true, + }, +); + test( getOverlayDatabaseModeMacro, "No overlay analysis on PR when code-scanning feature enabled with disable-default-queries", @@ -1508,10 +1689,9 @@ test( test( getOverlayDatabaseModeMacro, - "Overlay PR analysis by env for dsp-testing", + "Overlay PR analysis by env", { overlayDatabaseEnvVar: "overlay", - repositoryOwner: "dsp-testing", }, { overlayDatabaseMode: OverlayDatabaseMode.Overlay, @@ -1521,10 +1701,10 @@ test( test( getOverlayDatabaseModeMacro, - "Overlay PR analysis by env for other-org", + "Overlay PR analysis by env on a runner with low disk space", { overlayDatabaseEnvVar: "overlay", - repositoryOwner: "other-org", + diskUsage: { numAvailableBytes: 0, numTotalBytes: 100_000_000_000 }, }, { overlayDatabaseMode: OverlayDatabaseMode.Overlay, @@ -1534,12 +1714,11 @@ test( test( getOverlayDatabaseModeMacro, - "Overlay PR analysis by feature flag for dsp-testing", + "Overlay PR analysis by feature flag", { languages: [KnownLanguage.javascript], features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], isPullRequest: true, - repositoryOwner: "dsp-testing", }, { overlayDatabaseMode: OverlayDatabaseMode.Overlay, @@ -1549,12 +1728,11 @@ test( test( getOverlayDatabaseModeMacro, - "No overlay PR analysis by feature flag for other-org", + "Fallback due to autobuild with traced language", { - languages: [KnownLanguage.javascript], - features: [Feature.OverlayAnalysis, Feature.OverlayAnalysisJavascript], - isPullRequest: true, - repositoryOwner: "other-org", + overlayDatabaseEnvVar: "overlay", + buildMode: BuildMode.Autobuild, + languages: [KnownLanguage.java], }, { overlayDatabaseMode: OverlayDatabaseMode.None, @@ -1564,10 +1742,10 @@ test( test( getOverlayDatabaseModeMacro, - "Fallback due to autobuild with traced language", + "Fallback due to no build mode with traced language", { overlayDatabaseEnvVar: "overlay", - buildMode: BuildMode.Autobuild, + buildMode: undefined, languages: [KnownLanguage.java], }, { @@ -1578,11 +1756,10 @@ test( test( getOverlayDatabaseModeMacro, - "Fallback due to no build mode with traced language", + "Fallback due to old CodeQL version", { overlayDatabaseEnvVar: "overlay", - buildMode: undefined, - languages: [KnownLanguage.java], + codeqlVersion: "2.14.0", }, { overlayDatabaseMode: OverlayDatabaseMode.None, @@ -1592,10 +1769,10 @@ test( test( getOverlayDatabaseModeMacro, - "Fallback due to old CodeQL version", + "Fallback due to missing git root", { overlayDatabaseEnvVar: "overlay", - codeqlVersion: "2.14.0", + gitRoot: undefined, }, { overlayDatabaseMode: OverlayDatabaseMode.None, @@ -1605,10 +1782,23 @@ test( test( getOverlayDatabaseModeMacro, - "Fallback due to missing git root", + "Fallback due to old git version", { overlayDatabaseEnvVar: "overlay", - gitRoot: undefined, + gitVersion: new GitVersionInfo("2.30.0", "2.30.0"), // Version below required 2.38.0 + }, + { + overlayDatabaseMode: OverlayDatabaseMode.None, + useOverlayDatabaseCaching: false, + }, +); + +test( + getOverlayDatabaseModeMacro, + "Fallback when git version cannot be determined", + { + overlayDatabaseEnvVar: "overlay", + gitVersion: undefined, }, { overlayDatabaseMode: OverlayDatabaseMode.None, diff --git a/src/config-utils.ts b/src/config-utils.ts index 3a1d040db0..5f32406ba1 100644 --- a/src/config-utils.ts +++ b/src/config-utils.ts @@ -22,11 +22,19 @@ import { parseUserConfig, UserConfig, } from "./config/db-config"; +import { addDiagnostic, makeTelemetryDiagnostic } from "./diagnostics"; import { shouldPerformDiffInformedAnalysis } from "./diff-informed-analysis-utils"; +import { EnvVar } from "./environment"; import * as errorMessages from "./error-messages"; import { Feature, FeatureEnablement } from "./feature-flags"; import { RepositoryProperties } from "./feature-flags/properties"; -import { getGitRoot, isAnalyzingDefaultBranch } from "./git-utils"; +import { + getGitRoot, + getGitVersionOrThrow, + GIT_MINIMUM_VERSION_FOR_OVERLAY, + GitVersionInfo, + isAnalyzingDefaultBranch, +} from "./git-utils"; import { KnownLanguage, Language } from "./languages"; import { Logger } from "./logging"; import { @@ -34,6 +42,7 @@ import { OverlayDatabaseMode, } from "./overlay-database-utils"; import { RepositoryNwo } from "./repository"; +import { ToolsFeature } from "./tools-features"; import { downloadTrapCaches } from "./trap-caching"; import { GitHubVersion, @@ -42,10 +51,33 @@ import { codeQlVersionAtLeast, cloneObject, isDefined, + checkDiskUsage, + getCodeQLMemoryLimit, + getErrorMessage, + isInTestMode, } from "./util"; export * from "./config/db-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 = 20000; +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. + */ +const OVERLAY_MINIMUM_MEMORY_MB = 5 * 1024; + export type RegistryConfigWithCredentials = RegistryConfigNoCredentials & { // Token to use when downloading packs from this registry. token: string; @@ -147,6 +179,9 @@ export interface Config { /** 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. */ @@ -175,14 +210,12 @@ export interface Config { repositoryProperties: RepositoryProperties; } -export async function getSupportedLanguageMap( +async function getSupportedLanguageMap( codeql: CodeQL, - features: FeatureEnablement, logger: Logger, ): Promise> { - const resolveSupportedLanguagesUsingCli = await features.getValue( - Feature.ResolveSupportedLanguagesUsingCli, - codeql, + const resolveSupportedLanguagesUsingCli = await codeql.supportsFeature( + ToolsFeature.BuiltinExtractorsSpecifyDefaultQueries, ); const resolveResult = await codeql.betterResolveLanguages({ filterToLanguagesWithQueries: resolveSupportedLanguagesUsingCli, @@ -240,7 +273,7 @@ export function hasActionsWorkflows(sourceRoot: string): boolean { /** * Gets the set of languages in the current repository. */ -export async function getRawLanguagesInRepo( +async function getRawLanguagesInRepo( repository: RepositoryNwo, sourceRoot: string, logger: Logger, @@ -283,7 +316,6 @@ export async function getLanguages( languagesInput: string | undefined, repository: RepositoryNwo, sourceRoot: string, - features: FeatureEnablement, logger: Logger, ): Promise { // Obtain languages without filtering them. @@ -294,7 +326,7 @@ export async function getLanguages( logger, ); - const languageMap = await getSupportedLanguageMap(codeql, features, logger); + const languageMap = await getSupportedLanguageMap(codeql, logger); const languagesSet = new Set(); const unknownLanguages: string[] = []; @@ -350,7 +382,7 @@ export function getRawLanguagesNoAutodetect( * @returns A tuple containing a list of languages in this repository that might be * analyzable and whether or not this list was determined automatically. */ -export async function getRawLanguages( +async function getRawLanguages( languagesInput: string | undefined, repository: RepositoryNwo, sourceRoot: string, @@ -380,6 +412,7 @@ export interface InitConfigInputs { dbLocation: string | undefined; configInput: string | undefined; buildModeInput: string | undefined; + ramInput: string | undefined; trapCachingEnabled: boolean; dependencyCachingEnabled: string | undefined; debugMode: boolean; @@ -431,7 +464,6 @@ export async function initActionState( languagesInput, repository, sourceRoot, - features, logger, ); @@ -499,6 +531,7 @@ export async function initActionState( trapCaches, trapCacheDownloadTime, dependencyCachingEnabled: getCachingKind(dependencyCachingEnabled), + dependencyCachingRestoredKeys: [], extraQueryExclusions: [], overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, @@ -582,17 +615,11 @@ const OVERLAY_ANALYSIS_CODE_SCANNING_FEATURES: Record = { }; async function isOverlayAnalysisFeatureEnabled( - repository: RepositoryNwo, features: FeatureEnablement, codeql: CodeQL, languages: Language[], codeScanningConfig: UserConfig, ): Promise { - // TODO: Remove the repository owner check once support for overlay analysis - // stabilizes, and no more backward-incompatible changes are expected. - if (!["github", "dsp-testing"].includes(repository.owner)) { - return false; - } if (!(await features.getValue(Feature.OverlayAnalysis, codeql))) { return false; } @@ -627,6 +654,42 @@ async function isOverlayAnalysisFeatureEnabled( return true; } +/** + * Checks if the runner supports overlay analysis based on available disk space + * and the maximum memory CodeQL will be allowed to use. + */ +async function runnerSupportsOverlayAnalysis( + ramInput: string | undefined, + logger: Logger, +): Promise { + const diskUsage = await checkDiskUsage(logger); + if ( + diskUsage === undefined || + diskUsage.numAvailableBytes < OVERLAY_MINIMUM_AVAILABLE_DISK_SPACE_BYTES + ) { + const diskSpaceMb = + diskUsage === undefined + ? 0 + : Math.round(diskUsage.numAvailableBytes / 1_000_000); + logger.info( + `Setting overlay database mode to ${OverlayDatabaseMode.None} ` + + `due to insufficient disk space (${diskSpaceMb} MB).`, + ); + return false; + } + + 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).`, + ); + return false; + } + + return true; +} + /** * Calculate and validate the overlay database mode and caching to use. * @@ -650,12 +713,13 @@ async function isOverlayAnalysisFeatureEnabled( */ export async function getOverlayDatabaseMode( codeql: CodeQL, - repository: RepositoryNwo, features: FeatureEnablement, languages: Language[], sourceRoot: string, buildMode: BuildMode | undefined, + ramInput: string | undefined, codeScanningConfig: UserConfig, + gitVersion: GitVersionInfo | undefined, logger: Logger, ): Promise<{ overlayDatabaseMode: OverlayDatabaseMode; @@ -679,14 +743,22 @@ export async function getOverlayDatabaseMode( ); } else if ( await isOverlayAnalysisFeatureEnabled( - repository, features, codeql, languages, codeScanningConfig, ) ) { - if (isAnalyzingPullRequest()) { + const performResourceChecks = !(await features.getValue( + Feature.OverlayAnalysisSkipResourceChecks, + codeql, + )); + if ( + performResourceChecks && + !(await runnerSupportsOverlayAnalysis(ramInput, logger)) + ) { + overlayDatabaseMode = OverlayDatabaseMode.None; + } else if (isAnalyzingPullRequest()) { overlayDatabaseMode = OverlayDatabaseMode.Overlay; useOverlayDatabaseCaching = true; logger.info( @@ -750,6 +822,22 @@ export async function getOverlayDatabaseMode( ); return nonOverlayAnalysis; } + if (gitVersion === undefined) { + logger.warning( + `Cannot build an ${overlayDatabaseMode} database because ` + + "the Git version could not be determined. " + + "Falling back to creating a normal full database instead.", + ); + return nonOverlayAnalysis; + } + if (!gitVersion.isAtLeast(GIT_MINIMUM_VERSION_FOR_OVERLAY)) { + logger.warning( + `Cannot build an ${overlayDatabaseMode} database because ` + + `the installed Git version is older than ${GIT_MINIMUM_VERSION_FOR_OVERLAY}. ` + + "Falling back to creating a normal full database instead.", + ); + return nonOverlayAnalysis; + } return { overlayDatabaseMode, @@ -842,6 +930,24 @@ export async function initConfig( config.computedConfig["query-filters"] = []; } + let gitVersion: GitVersionInfo | undefined = undefined; + try { + gitVersion = await getGitVersionOrThrow(); + logger.info(`Using Git version ${gitVersion.fullVersion}`); + await logGitVersionTelemetry(config, gitVersion); + } 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; + } + } + // 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 @@ -849,12 +955,13 @@ export async function initConfig( const { overlayDatabaseMode, useOverlayDatabaseCaching } = await getOverlayDatabaseMode( inputs.codeql, - inputs.repository, inputs.features, config.languages, inputs.sourceRoot, config.buildMode, + inputs.ramInput, config.computedConfig, + gitVersion, logger, ); logger.info( @@ -1036,7 +1143,6 @@ export async function getConfig( * pack. * * @param registriesInput The value of the `registries` input. - * @param codeQL a codeQL object, used only for checking the version of CodeQL. * @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 @@ -1239,7 +1345,7 @@ export function isCodeQualityEnabled(config: Config): boolean { * @returns Returns `AnalysisKind.CodeScanning` if `AnalysisKind.CodeScanning` is enabled; * otherwise `AnalysisKind.CodeQuality`. */ -export function getPrimaryAnalysisKind(config: Config): AnalysisKind { +function getPrimaryAnalysisKind(config: Config): AnalysisKind { return isCodeScanningEnabled(config) ? AnalysisKind.CodeScanning : AnalysisKind.CodeQuality; @@ -1256,3 +1362,26 @@ export function getPrimaryAnalysisConfig(config: Config): AnalysisConfig { ? CodeScanning : CodeQuality; } + +/** Logs the Git version as a telemetry diagnostic. */ +async function logGitVersionTelemetry( + config: Config, + gitVersion: GitVersionInfo, +): Promise { + if (config.languages.length > 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], + makeTelemetryDiagnostic( + "codeql-action/git-version-telemetry", + "Git version telemetry", + { + fullVersion: gitVersion.fullVersion, + truncatedVersion: gitVersion.truncatedVersion, + }, + ), + ); + } +} diff --git a/src/config/db-config.ts b/src/config/db-config.ts index 3293535f39..a84a20f247 100644 --- a/src/config/db-config.ts +++ b/src/config/db-config.ts @@ -160,7 +160,6 @@ const PACK_IDENTIFIER_PATTERN = (function () { * Version and path are optional. * * @param packStr the package specification to verify. - * @param configFile Config file to use for error reporting */ export function parsePacksSpecification(packStr: string): Pack { if (typeof packStr !== "string") { diff --git a/src/database-upload.test.ts b/src/database-upload.test.ts index 6c986fb7fa..57d07adb28 100644 --- a/src/database-upload.test.ts +++ b/src/database-upload.test.ts @@ -10,11 +10,12 @@ import { GitHubApiDetails } from "./api-client"; import * as apiClient from "./api-client"; import { createStubCodeQL } from "./codeql"; import { Config } from "./config-utils"; -import { uploadDatabases } from "./database-upload"; +import { cleanupAndUploadDatabases } from "./database-upload"; import * as gitUtils from "./git-utils"; import { KnownLanguage } from "./languages"; import { RepositoryNwo } from "./repository"; import { + createFeatures, createTestConfig, getRecordingLogger, LoggedMessage, @@ -91,11 +92,12 @@ test("Abort database upload if 'upload-database' input set to false", async (t) sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(true); const loggedMessages = []; - await uploadDatabases( + await cleanupAndUploadDatabases( testRepoName, getCodeQL(), getTestConfig(tmpDir), testApiDetails, + createFeatures([]), getRecordingLogger(loggedMessages), ); t.assert( @@ -121,7 +123,7 @@ test("Abort database upload if 'analysis-kinds: code-scanning' is not enabled", await mockHttpRequests(201); const loggedMessages = []; - await uploadDatabases( + await cleanupAndUploadDatabases( testRepoName, getCodeQL(), { @@ -129,6 +131,7 @@ test("Abort database upload if 'analysis-kinds: code-scanning' is not enabled", analysisKinds: [AnalysisKind.CodeQuality], }, testApiDetails, + createFeatures([]), getRecordingLogger(loggedMessages), ); t.assert( @@ -155,11 +158,12 @@ test("Abort database upload if running against GHES", async (t) => { config.gitHubVersion = { type: GitHubVariant.GHES, version: "3.0" }; const loggedMessages = []; - await uploadDatabases( + await cleanupAndUploadDatabases( testRepoName, getCodeQL(), config, testApiDetails, + createFeatures([]), getRecordingLogger(loggedMessages), ); t.assert( @@ -183,11 +187,12 @@ test("Abort database upload if not analyzing default branch", async (t) => { sinon.stub(gitUtils, "isAnalyzingDefaultBranch").resolves(false); const loggedMessages = []; - await uploadDatabases( + await cleanupAndUploadDatabases( testRepoName, getCodeQL(), getTestConfig(tmpDir), testApiDetails, + createFeatures([]), getRecordingLogger(loggedMessages), ); t.assert( @@ -212,11 +217,12 @@ test("Don't crash if uploading a database fails", async (t) => { await mockHttpRequests(500); const loggedMessages = [] as LoggedMessage[]; - await uploadDatabases( + await cleanupAndUploadDatabases( testRepoName, getCodeQL(), getTestConfig(tmpDir), testApiDetails, + createFeatures([]), getRecordingLogger(loggedMessages), ); @@ -225,7 +231,7 @@ test("Don't crash if uploading a database fails", async (t) => { (v) => v.type === "warning" && v.message === - "Failed to upload database for javascript: Error: some error message", + "Failed to upload database for javascript: some error message", ) !== undefined, ); }); @@ -243,11 +249,12 @@ test("Successfully uploading a database to github.com", async (t) => { await mockHttpRequests(201); const loggedMessages = [] as LoggedMessage[]; - await uploadDatabases( + await cleanupAndUploadDatabases( testRepoName, getCodeQL(), getTestConfig(tmpDir), testApiDetails, + createFeatures([]), getRecordingLogger(loggedMessages), ); t.assert( @@ -272,7 +279,7 @@ test("Successfully uploading a database to GHEC-DR", async (t) => { const databaseUploadSpy = await mockHttpRequests(201); const loggedMessages = [] as LoggedMessage[]; - await uploadDatabases( + await cleanupAndUploadDatabases( testRepoName, getCodeQL(), getTestConfig(tmpDir), @@ -281,6 +288,7 @@ test("Successfully uploading a database to GHEC-DR", async (t) => { url: "https://tenant.ghe.com", apiURL: undefined, }, + createFeatures([]), getRecordingLogger(loggedMessages), ); t.assert( diff --git a/src/database-upload.ts b/src/database-upload.ts index 69175178c9..d4168295d1 100644 --- a/src/database-upload.ts +++ b/src/database-upload.ts @@ -5,55 +5,80 @@ import { AnalysisKind } from "./analyses"; import { 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-database-utils"; import { RepositoryNwo } from "./repository"; import * as util from "./util"; -import { bundleDb, parseGitHubUrl } from "./util"; +import { bundleDb, CleanupLevel, parseGitHubUrl } from "./util"; -export async function uploadDatabases( +/** 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; + /** 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 { +): Promise { if (actionsUtil.getRequiredInput("upload-database") !== "true") { logger.debug("Database upload disabled in workflow. Skipping upload."); - return; + return []; } if (!config.analysisKinds.includes(AnalysisKind.CodeScanning)) { logger.debug( `Not uploading database because 'analysis-kinds: ${AnalysisKind.CodeScanning}' is not enabled.`, ); - return; + return []; } if (util.isInTestMode()) { logger.debug("In test mode. Skipping database upload."); - return; + return []; } // Do nothing when not running against github.com if ( config.gitHubVersion.type !== util.GitHubVariant.DOTCOM && - config.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM + config.gitHubVersion.type !== util.GitHubVariant.GHEC_DR ) { logger.debug("Not running against github.com or GHEC-DR. Skipping upload."); - return; + 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; + 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)); + 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, "clear"); + await codeql.databaseCleanupCluster(config, cleanupLevel); }); const client = getApiClient(); @@ -68,19 +93,22 @@ export async function uploadDatabases( uploadsBaseUrl = uploadsBaseUrl.slice(0, -1); } + 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); - const bundledDbSize = fs.statSync(bundledDb).size; + bundledDbSize = fs.statSync(bundledDb).size; const bundledDbReadStream = fs.createReadStream(bundledDb); const commitOid = await gitUtils.getCommitOid( actionsUtil.getRequiredInput("checkout_path"), ); try { + const startTime = performance.now(); await client.request( `POST /repos/:owner/:repo/code-scanning/codeql/databases/:language?name=:name&commit_oid=:commit_oid`, { @@ -98,13 +126,30 @@ export async function uploadDatabases( }, }, ); + const endTime = performance.now(); + reports.push({ + language, + zipped_upload_size_bytes: bundledDbSize, + is_overlay_base: shouldUploadOverlayBase, + upload_duration_ms: endTime - startTime, + }); logger.debug(`Successfully uploaded database for ${language}`); } finally { bundledDbReadStream.close(); } } catch (e) { // Log a warning but don't fail the workflow - logger.warning(`Failed to upload database for ${language}: ${e}`); + 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 } + : {}), + }); } } + return reports; } diff --git a/src/debug-artifacts.ts b/src/debug-artifacts.ts index b8197af37e..3534cdc027 100644 --- a/src/debug-artifacts.ts +++ b/src/debug-artifacts.ts @@ -8,6 +8,7 @@ import archiver 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"; @@ -23,6 +24,7 @@ import { getCodeQLDatabasePath, getErrorMessage, GitHubVariant, + isInTestMode, listFolder, } from "./util"; @@ -269,6 +271,14 @@ export async function uploadDebugArtifacts( return "upload-not-supported"; } + // 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"); + } + let suffix = ""; const matrix = getOptionalInput("matrix"); if (matrix) { diff --git a/src/defaults.json b/src/defaults.json index 1fa392f548..6f3dc42bf8 100644 --- a/src/defaults.json +++ b/src/defaults.json @@ -1,6 +1,6 @@ { - "bundleVersion": "codeql-bundle-v2.23.3", - "cliVersion": "2.23.3", - "priorBundleVersion": "codeql-bundle-v2.23.2", - "priorCliVersion": "2.23.2" + "bundleVersion": "codeql-bundle-v2.23.8", + "cliVersion": "2.23.8", + "priorBundleVersion": "codeql-bundle-v2.23.7", + "priorCliVersion": "2.23.7" } diff --git a/src/dependency-caching.test.ts b/src/dependency-caching.test.ts new file mode 100644 index 0000000000..c37d37b43b --- /dev/null +++ b/src/dependency-caching.test.ts @@ -0,0 +1,654 @@ +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 { KnownLanguage } 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("getCsharpDependencyDirs - does not include BMN dir if FF is enabled", 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("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("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("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("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("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, + KnownLanguage.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, + KnownLanguage.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("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]), + KnownLanguage.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([]), + [KnownLanguage.csharp], + logger, + ); + const statusReport = result.statusReport; + t.is(statusReport.length, 1); + t.is(statusReport[0].language, KnownLanguage.csharp); + t.is(statusReport[0].hit_kind, CacheHitKind.Miss); + t.deepEqual(result.restoredKeys, []); + t.assert(restoreCacheStub.calledOnce); +}); + +test("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, + KnownLanguage.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, + [KnownLanguage.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, KnownLanguage.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("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, + KnownLanguage.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, + [KnownLanguage.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, KnownLanguage.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: [KnownLanguage.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("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: [KnownLanguage.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, KnownLanguage.go); + t.is(result[0].result, CacheStoreResult.NoHash); +}); + +test("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, + KnownLanguage.csharp, + CSHARP_BASE_PATTERNS, + ); + + const config = createTestConfig({ + languages: [KnownLanguage.csharp], + dependencyCachingRestoredKeys: [primaryCacheKey], + }); + + const result = await uploadDependencyCaches(codeql, features, config, logger); + t.is(result.length, 1); + t.is(result[0].language, KnownLanguage.csharp); + t.is(result[0].result, CacheStoreResult.Duplicate); +}); + +test("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: [KnownLanguage.csharp], + }); + + const result = await uploadDependencyCaches(codeql, features, config, logger); + t.is(result.length, 1); + t.is(result[0].language, KnownLanguage.csharp); + t.is(result[0].result, CacheStoreResult.Empty); + + checkExpectedLogMessages(t, messages, [ + "Skipping upload of dependency cache", + ]); +}); + +test("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: [KnownLanguage.csharp], + }); + + const result = await uploadDependencyCaches(codeql, features, config, logger); + t.is(result.length, 1); + t.is(result[0].language, KnownLanguage.csharp); + t.is(result[0].result, CacheStoreResult.Stored); + t.is(result[0].upload_size_bytes, 1024); + + checkExpectedLogMessages(t, messages, ["Uploading cache of size"]); +}); + +test("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: [KnownLanguage.csharp], + }); + + await t.notThrowsAsync(async () => { + const result = await uploadDependencyCaches( + codeql, + features, + config, + logger, + ); + t.is(result.length, 1); + t.is(result[0].language, KnownLanguage.csharp); + t.is(result[0].result, CacheStoreResult.Duplicate); + + checkExpectedLogMessages(t, messages, ["Not uploading cache for"]); + }); +}); + +test("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: [KnownLanguage.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(KnownLanguage)) { + 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, KnownLanguage.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(KnownLanguage)) { + // Skip C# since we expect a result for it, which is tested in the previous test. + if (knownLanguage === KnownLanguage.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, KnownLanguage.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(KnownLanguage)) { + // Skip C# since we expect a result for it, which is tested in the previous test. + if (knownLanguage === KnownLanguage.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 index 5c7a4a4e88..dc9a140be4 100644 --- a/src/dependency-caching.ts +++ b/src/dependency-caching.ts @@ -6,9 +6,11 @@ import * as glob from "@actions/glob"; import { getTemporaryDirectory } from "./actions-util"; import { listActionsCaches } from "./api-client"; -import { getTotalCacheSize } from "./caching-utils"; +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 { KnownLanguage, Language } from "./languages"; import { Logger } from "./logging"; import { getErrorMessage, getRequiredEnvParam } from "./util"; @@ -16,15 +18,24 @@ import { getErrorMessage, getRequiredEnvParam } from "./util"; /** * Caching configuration for a particular language. */ -interface CacheConfig { - /** The paths of directories on the runner that should be included in the cache. */ - paths: string[]; +export interface CacheConfig { + /** Gets the paths of directories on the runner that should be included in the cache. */ + getDependencyPaths: ( + codeql: CodeQL, + features: FeatureEnablement, + ) => Promise; /** - * Patterns for the paths of files whose contents affect which dependencies are used - * by a project. We find all files which match these patterns, calculate a hash for - * their contents, and use that hash as part of the cache key. + * 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. */ - hash: string[]; + getHashPatterns: ( + codeql: CodeQL, + features: FeatureEnablement, + ) => Promise; } const CODEQL_DEPENDENCY_CACHE_PREFIX = "codeql-dependencies"; @@ -39,21 +50,137 @@ 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. */ -function getDefaultCacheConfig(): { [language: string]: CacheConfig } { - return { - java: { - paths: [ - // Maven - join(os.homedir(), ".m2", "repository"), - // Gradle - join(os.homedir(), ".gradle", "caches"), - // CodeQL Java build-mode: none - getJavaTempDependencyDir(), - ], - hash: [ +const defaultCacheConfigs: { [language: string]: CacheConfig } = { + java: { + getDependencyPaths: getJavaDependencyDirs, + getHashPatterns: async () => + internal.makePatternCheck([ // Maven "**/pom.xml", // Gradle @@ -63,23 +190,17 @@ function getDefaultCacheConfig(): { [language: string]: CacheConfig } { "buildSrc/**/Dependencies.kt", "gradle/*.versions.toml", "**/versions.properties", - ], - }, - csharp: { - paths: [join(os.homedir(), ".nuget", "packages")], - hash: [ - // NuGet - "**/packages.lock.json", - // Paket - "**/paket.lock", - ], - }, - go: { - paths: [join(os.homedir(), "go", "pkg", "mod")], - hash: ["**/go.sum"], - }, - }; -} + ]), + }, + 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")); @@ -107,23 +228,66 @@ export interface DependencyCacheRestoreStatus { /** 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. - * @param minimizeJavaJars Whether the Java extractor should rewrite downloaded JARs to minimize their size. + * * @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, - minimizeJavaJars: boolean, -): Promise { +): Promise { const status: DependencyCacheRestoreStatusReport = []; + const restoredKeys: string[] = []; for (const language of languages) { - const cacheConfig = getDefaultCacheConfig()[language]; + const cacheConfig = defaultCacheConfigs[language]; if (cacheConfig === undefined) { logger.info( @@ -134,19 +298,22 @@ export async function downloadDependencyCaches( // 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 globber = await makeGlobber(cacheConfig.hash); - - if ((await globber.glob()).length === 0) { + const patterns = await checkHashPatterns( + codeql, + features, + language, + cacheConfig, + "download", + logger, + ); + if (patterns === undefined) { status.push({ language, hit_kind: CacheHitKind.NoHash }); - logger.info( - `Skipping download of dependency cache for ${language} as we cannot calculate a hash for the cache key.`, - ); continue; } - const primaryKey = await cacheKey(language, cacheConfig, minimizeJavaJars); + const primaryKey = await cacheKey(codeql, features, language, patterns); const restoreKeys: string[] = [ - await cachePrefix(language, minimizeJavaJars), + await cachePrefix(codeql, features, language), ]; logger.info( @@ -157,7 +324,7 @@ export async function downloadDependencyCaches( const start = performance.now(); const hitKey = await actionsCache.restoreCache( - cacheConfig.paths, + await cacheConfig.getDependencyPaths(codeql, features), primaryKey, restoreKeys, ); @@ -165,16 +332,27 @@ export async function downloadDependencyCaches( if (hitKey !== undefined) { logger.info(`Cache hit on key ${hitKey} for ${language}.`); - const hit_kind = - hitKey === primaryKey ? CacheHitKind.Exact : CacheHitKind.Partial; - status.push({ language, hit_kind, download_duration_ms }); + + // 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 status; + return { statusReport: status, restoredKeys }; } /** Enumerates possible outcomes for storing caches. */ @@ -203,20 +381,22 @@ 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. - * @param minimizeJavaJars Whether the Java extractor should rewrite downloaded JARs to minimize their size. * * @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, - minimizeJavaJars: boolean, ): Promise { const status: DependencyCacheUploadStatusReport = []; for (const language of config.languages) { - const cacheConfig = getDefaultCacheConfig()[language]; + const cacheConfig = defaultCacheConfigs[language]; if (cacheConfig === undefined) { logger.info( @@ -227,13 +407,28 @@ export async function uploadDependencyCaches( // 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 globber = await makeGlobber(cacheConfig.hash); - - if ((await globber.glob()).length === 0) { + const patterns = await checkHashPatterns( + codeql, + features, + language, + cacheConfig, + "upload", + logger, + ); + if (patterns === undefined) { status.push({ language, result: CacheStoreResult.NoHash }); - logger.info( - `Skipping upload of dependency cache for ${language} as we cannot calculate a hash for the cache key.`, - ); + 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; } @@ -247,7 +442,11 @@ export async function uploadDependencyCaches( // 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(cacheConfig.paths, logger, true); + const size = await getTotalCacheSize( + await cacheConfig.getDependencyPaths(codeql, features), + logger, + true, + ); // Skip uploading an empty cache. if (size === 0) { @@ -258,15 +457,16 @@ export async function uploadDependencyCaches( continue; } - const key = await cacheKey(language, cacheConfig, minimizeJavaJars); - logger.info( `Uploading cache of size ${size} for ${language} with key ${key}...`, ); try { const start = performance.now(); - await actionsCache.saveCache(cacheConfig.paths, key); + await actionsCache.saveCache( + await cacheConfig.getDependencyPaths(codeql, features), + key, + ); const upload_duration_ms = Math.round(performance.now() - start); status.push({ @@ -299,31 +499,76 @@ export async function uploadDependencyCaches( /** * 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 cacheConfig The cache configuration for the language. - * @param minimizeJavaJars Whether the Java extractor should rewrite downloaded JARs to minimize their size. + * @param patterns The file patterns to hash. + * * @returns A cache key capturing information about the project(s) being analyzed in the specified language. */ -async function cacheKey( +export async function cacheKey( + codeql: CodeQL, + features: FeatureEnablement, language: Language, - cacheConfig: CacheConfig, - minimizeJavaJars: boolean = false, + patterns: string[], ): Promise { - const hash = await glob.hashFiles(cacheConfig.hash.join("\n")); - return `${await cachePrefix(language, minimizeJavaJars)}${hash}`; + 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 === KnownLanguage.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. - * @param minimizeJavaJars Whether the Java extractor should rewrite downloaded JARs to minimize their size. * @returns The prefix that identifies what a cache is for. */ async function cachePrefix( + codeql: CodeQL, + features: FeatureEnablement, language: Language, - minimizeJavaJars: boolean, ): Promise { const runnerOs = getRequiredEnvParam("RUNNER_OS"); const customPrefix = process.env[EnvVar.DEPENDENCY_CACHING_PREFIX]; @@ -333,12 +578,12 @@ async function cachePrefix( prefix = `${prefix}-${customPrefix}`; } - // To ensure a safe rollout of JAR minimization, we change the key when the feature is enabled. - if (language === KnownLanguage.java && minimizeJavaJars) { - prefix = `minify-${prefix}`; - } + // 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); - return `${prefix}-${CODEQL_DEPENDENCY_CACHE_VERSION}-${runnerOs}-${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. */ @@ -371,3 +616,7 @@ export async function getDependencyCacheUsage( return undefined; } + +export const internal = { + makePatternCheck, +}; diff --git a/src/diagnostics.ts b/src/diagnostics.ts index b3d18b23cb..493479e64a 100644 --- a/src/diagnostics.ts +++ b/src/diagnostics.ts @@ -185,3 +185,27 @@ export function flushDiagnostics(config: Config) { // Reset the unwritten diagnostics array. unwrittenDiagnostics = []; } + +/** + * 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 }, +): DiagnosticMessage { + return makeDiagnostic(id, name, { + attributes, + visibility: { + cliSummaryTable: false, + statusPage: false, + telemetry: true, + }, + }); +} diff --git a/src/environment.ts b/src/environment.ts index 16a016aaaa..16617c647b 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -20,12 +20,6 @@ export enum EnvVar { /** Whether the CodeQL Action has invoked the Go autobuilder. */ DID_AUTOBUILD_GOLANG = "CODEQL_ACTION_DID_AUTOBUILD_GOLANG", - /** - * Whether to disable the SARIF post-processing in the Action that removes duplicate locations from - * notifications in the `run[].invocations[].toolExecutionNotifications` SARIF property. - */ - DISABLE_DUPLICATE_LOCATION_FIX = "CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX", - /** * Whether the CodeQL Action is using its own deprecated and non-standard way of scanning for * multiple languages. @@ -56,20 +50,12 @@ export enum EnvVar { /** Whether the error for a deprecated version of the CodeQL Action was logged. */ LOG_VERSION_DEPRECATION = "CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION", - /** - * For macOS. Result of `csrutil status` to determine whether System Integrity - * Protection is enabled. - */ - IS_SIP_ENABLED = "CODEQL_ACTION_IS_SIP_ENABLED", - /** UUID representing the current job run. */ JOB_RUN_UUID = "JOB_RUN_UUID", /** Status for the entire job, submitted to the status report in `init-post` */ JOB_STATUS = "CODEQL_ACTION_JOB_STATUS", - ODASA_TRACER_CONFIGURATION = "ODASA_TRACER_CONFIGURATION", - /** The value of the `output` input for the analyze action. */ SARIF_RESULTS_OUTPUT_DIR = "CODEQL_ACTION_SARIF_RESULTS_OUTPUT_DIR", @@ -143,4 +129,10 @@ export enum EnvVar { * 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", } diff --git a/src/feature-flags.test.ts b/src/feature-flags.test.ts index ae9f079cab..11e7ba538f 100644 --- a/src/feature-flags.test.ts +++ b/src/feature-flags.test.ts @@ -62,13 +62,13 @@ test(`All features are disabled if running against GHES`, async (t) => { }); }); -test(`Feature flags are requested in Proxima`, async (t) => { +test(`Feature flags are requested in GHEC-DR`, async (t) => { await withTmpDir(async (tmpDir) => { const loggedMessages = []; const features = setUpFeatureFlagTests( tmpDir, getRecordingLogger(loggedMessages), - { type: GitHubVariant.GHE_DOTCOM }, + { type: GitHubVariant.GHEC_DR }, ); mockFeatureFlagApiEndpoint(200, initializeFeatures(true)); @@ -436,97 +436,79 @@ test(`selects CLI from defaults.json on GHES`, async (t) => { }); }); -test("selects CLI v2.20.1 on Dotcom 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); +for (const variant of [GitHubVariant.DOTCOM, GitHubVariant.GHEC_DR]) { + test(`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.getDefaultCliVersion( - GitHubVariant.DOTCOM, - ); - t.deepEqual(defaultCliVersion, { - cliVersion: "2.20.1", - tagName: "codeql-bundle-v2.20.1", - toolsFeatureFlagsValid: true, + const defaultCliVersion = await features.getDefaultCliVersion(variant); + t.deepEqual(defaultCliVersion, { + cliVersion: "2.20.1", + tagName: "codeql-bundle-v2.20.1", + toolsFeatureFlagsValid: true, + }); }); }); -}); -test("includes tag name", async (t) => { - await withTmpDir(async (tmpDir) => { - const features = setUpFeatureFlagTests(tmpDir); - const expectedFeatureEnablement = initializeFeatures(true); - expectedFeatureEnablement["default_codeql_version_2_20_0_enabled"] = true; - mockFeatureFlagApiEndpoint(200, expectedFeatureEnablement); + test(`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.getDefaultCliVersion( - GitHubVariant.DOTCOM, - ); - t.deepEqual(defaultCliVersion, { - cliVersion: "2.20.0", - tagName: "codeql-bundle-v2.20.0", - toolsFeatureFlagsValid: true, + const defaultCliVersion = await features.getDefaultCliVersion(variant); + t.deepEqual(defaultCliVersion, { + cliVersion: defaults.cliVersion, + tagName: defaults.bundleVersion, + toolsFeatureFlagsValid: false, + }); }); }); -}); - -test(`selects CLI from defaults.json on Dotcom 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.getDefaultCliVersion( - GitHubVariant.DOTCOM, - ); - t.deepEqual(defaultCliVersion, { - cliVersion: defaults.cliVersion, - tagName: defaults.bundleVersion, - toolsFeatureFlagsValid: false, - }); - }); -}); + test(`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); -test("ignores invalid version numbers in default version feature flags", 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.getDefaultCliVersion(variant); + t.deepEqual(defaultCliVersion, { + cliVersion: "2.20.1", + tagName: "codeql-bundle-v2.20.1", + toolsFeatureFlagsValid: true, + }); - const defaultCliVersion = await features.getDefaultCliVersion( - GitHubVariant.DOTCOM, - ); - t.deepEqual(defaultCliVersion, { - cliVersion: "2.20.1", - tagName: "codeql-bundle-v2.20.1", - 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, + ); }); - - 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("legacy feature flags should end with _enabled", async (t) => { for (const [feature, config] of Object.entries(featureConfig)) { diff --git a/src/feature-flags.ts b/src/feature-flags.ts index 068d847273..24e84f7c27 100644 --- a/src/feature-flags.ts +++ b/src/feature-flags.ts @@ -44,15 +44,15 @@ export interface FeatureEnablement { */ export enum Feature { AllowToolcacheInput = "allow_toolcache_input", - AnalyzeUseNewUpload = "analyze_use_new_upload", CleanupTrapCaches = "cleanup_trap_caches", 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", - JavaMinimizeDependencyJars = "java_minimize_dependency_jars", OverlayAnalysis = "overlay_analysis", OverlayAnalysisActions = "overlay_analysis_actions", OverlayAnalysisCodeScanningActions = "overlay_analysis_code_scanning_actions", @@ -73,10 +73,11 @@ export enum Feature { OverlayAnalysisPython = "overlay_analysis_python", OverlayAnalysisRuby = "overlay_analysis_ruby", OverlayAnalysisRust = "overlay_analysis_rust", + OverlayAnalysisSkipResourceChecks = "overlay_analysis_skip_resource_checks", OverlayAnalysisSwift = "overlay_analysis_swift", PythonDefaultIsToNotExtractStdlib = "python_default_is_to_not_extract_stdlib", QaTelemetryEnabled = "qa_telemetry_enabled", - ResolveSupportedLanguagesUsingCli = "resolve_supported_languages_using_cli", + UploadOverlayDbToApi = "upload_overlay_db_to_api", UseRepositoryProperties = "use_repository_properties", ValidateDbConfig = "validate_db_config", } @@ -117,11 +118,6 @@ export const featureConfig: Record< envVar: "CODEQL_ACTION_ALLOW_TOOLCACHE_INPUT", minimumVersion: undefined, }, - [Feature.AnalyzeUseNewUpload]: { - defaultValue: false, - envVar: "CODEQL_ACTION_ANALYZE_USE_NEW_UPLOAD", - minimumVersion: undefined, - }, [Feature.CleanupTrapCaches]: { defaultValue: false, envVar: "CODEQL_ACTION_CLEANUP_TRAP_CACHES", @@ -133,6 +129,16 @@ export const featureConfig: Record< 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", @@ -161,12 +167,6 @@ export const featureConfig: Record< legacyApi: true, minimumVersion: undefined, }, - [Feature.ResolveSupportedLanguagesUsingCli]: { - defaultValue: false, - envVar: "CODEQL_ACTION_RESOLVE_SUPPORTED_LANGUAGES_USING_CLI", - minimumVersion: undefined, - toolsFeature: ToolsFeature.BuiltinExtractorsSpecifyDefaultQueries, - }, [Feature.OverlayAnalysis]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS", @@ -267,6 +267,11 @@ export const featureConfig: Record< envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_RUST", minimumVersion: undefined, }, + [Feature.OverlayAnalysisSkipResourceChecks]: { + defaultValue: false, + envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SKIP_RESOURCE_CHECKS", + minimumVersion: undefined, + }, [Feature.OverlayAnalysisSwift]: { defaultValue: false, envVar: "CODEQL_ACTION_OVERLAY_ANALYSIS_SWIFT", @@ -278,21 +283,22 @@ export const featureConfig: Record< minimumVersion: undefined, toolsFeature: ToolsFeature.PythonDefaultIsToNotExtractStdlib, }, - [Feature.UseRepositoryProperties]: { - defaultValue: false, - envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", - minimumVersion: undefined, - }, [Feature.QaTelemetryEnabled]: { defaultValue: false, envVar: "CODEQL_ACTION_QA_TELEMETRY", legacyApi: true, minimumVersion: undefined, }, - [Feature.JavaMinimizeDependencyJars]: { + [Feature.UploadOverlayDbToApi]: { defaultValue: false, - envVar: "CODEQL_ACTION_JAVA_MINIMIZE_DEPENDENCY_JARS", - minimumVersion: "2.23.0", + envVar: "CODEQL_ACTION_UPLOAD_OVERLAY_DB_TO_API", + minimumVersion: undefined, + toolsFeature: ToolsFeature.BundleSupportsOverlay, + }, + [Feature.UseRepositoryProperties]: { + defaultValue: false, + envVar: "CODEQL_ACTION_USE_REPOSITORY_PROPERTIES", + minimumVersion: undefined, }, [Feature.ValidateDbConfig]: { defaultValue: false, @@ -481,8 +487,8 @@ class GitHubFeatureFlags { async getDefaultCliVersion( variant: util.GitHubVariant, ): Promise { - if (variant === util.GitHubVariant.DOTCOM) { - return await this.getDefaultDotcomCliVersion(); + if (supportsFeatureFlags(variant)) { + return await this.getDefaultCliVersionFromFlags(); } return { cliVersion: defaults.cliVersion, @@ -490,7 +496,7 @@ class GitHubFeatureFlags { }; } - async getDefaultDotcomCliVersion(): Promise { + async getDefaultCliVersionFromFlags(): Promise { const response = await this.getAllFeatures(); const enabledFeatureFlagCliVersions = Object.entries(response) @@ -616,10 +622,7 @@ class GitHubFeatureFlags { private async loadApiResponse(): Promise { // Do nothing when not running against github.com - if ( - this.gitHubVersion.type !== util.GitHubVariant.DOTCOM && - this.gitHubVersion.type !== util.GitHubVariant.GHE_DOTCOM - ) { + if (!supportsFeatureFlags(this.gitHubVersion.type)) { this.logger.debug( "Not running against github.com. Disabling all toggleable features.", ); @@ -685,3 +688,10 @@ class GitHubFeatureFlags { } } } + +function supportsFeatureFlags(githubVariant: util.GitHubVariant): boolean { + return ( + githubVariant === util.GitHubVariant.DOTCOM || + githubVariant === util.GitHubVariant.GHEC_DR + ); +} diff --git a/src/git-utils.test.ts b/src/git-utils.test.ts index 06837e0223..1c96571c27 100644 --- a/src/git-utils.test.ts +++ b/src/git-utils.test.ts @@ -1,4 +1,5 @@ import * as fs from "fs"; +import * as os from "os"; import * as path from "path"; import * as core from "@actions/core"; @@ -315,27 +316,23 @@ test("getFileOidsUnderPath returns correct file mapping", async (t) => { "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96_src/git-utils.ts", ); - try { - 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", - }); - - t.deepEqual(runGitCommandStub.firstCall.args, [ - "/fake/path", - ["ls-files", "--recurse-submodules", "--format=%(objectname)_%(path)"], - "Cannot list Git OIDs of tracked files.", - ]); - } finally { - runGitCommandStub.restore(); - } + 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", + }); + + t.deepEqual(runGitCommandStub.firstCall.args, [ + "/fake/path", + ["ls-files", "--recurse-submodules", "--format=%(objectname)_%(path)"], + "Cannot list Git OIDs of tracked files.", + ]); }); test("getFileOidsUnderPath handles quoted paths", async (t) => { - const runGitCommandStub = sinon + sinon .stub(gitUtils as any, "runGitCommand") .resolves( "30d998ded095371488be3a729eb61d86ed721a18_lib/normal-file.js\n" + @@ -343,34 +340,24 @@ test("getFileOidsUnderPath handles quoted paths", async (t) => { 'a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96_"lib/file\\twith\\ttabs.js"', ); - try { - 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", - }); - } finally { - runGitCommandStub.restore(); - } + 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("getFileOidsUnderPath handles empty output", async (t) => { - const runGitCommandStub = sinon - .stub(gitUtils as any, "runGitCommand") - .resolves(""); - - try { - const result = await gitUtils.getFileOidsUnderPath("/fake/path"); - t.deepEqual(result, {}); - } finally { - runGitCommandStub.restore(); - } + sinon.stub(gitUtils as any, "runGitCommand").resolves(""); + + const result = await gitUtils.getFileOidsUnderPath("/fake/path"); + t.deepEqual(result, {}); }); test("getFileOidsUnderPath throws on unexpected output format", async (t) => { - const runGitCommandStub = sinon + sinon .stub(gitUtils as any, "runGitCommand") .resolves( "30d998ded095371488be3a729eb61d86ed721a18_lib/git-utils.js\n" + @@ -378,17 +365,73 @@ test("getFileOidsUnderPath throws on unexpected output format", async (t) => { "a47c11f5bfdca7661942d2c8f1b7209fb0dfdf96_src/git-utils.ts", ); - try { - await t.throwsAsync( - async () => { - await gitUtils.getFileOidsUnderPath("/fake/path"); - }, - { - instanceOf: Error, - message: 'Unexpected "git ls-files" output: invalid-line-format', - }, - ); - } finally { - runGitCommandStub.restore(); - } + await t.throwsAsync( + async () => { + await gitUtils.getFileOidsUnderPath("/fake/path"); + }, + { + instanceOf: Error, + message: 'Unexpected "git ls-files" output: invalid-line-format', + }, + ); +}); + +test("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("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("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("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("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")); }); diff --git a/src/git-utils.ts b/src/git-utils.ts index 8371240273..eb9d8c695e 100644 --- a/src/git-utils.ts +++ b/src/git-utils.ts @@ -1,6 +1,7 @@ import * as core from "@actions/core"; import * as toolrunner from "@actions/exec/lib/toolrunner"; import * as io from "@actions/io"; +import * as semver from "semver"; import { getOptionalInput, @@ -9,6 +10,52 @@ import { } from "./actions-util"; import { ConfigurationError, getRequiredEnvParam } from "./util"; +/** + * Minimum Git version required for overlay analysis. The `git ls-files --format` + * option, which is used by `getFileOidsUnderPath`, was introduced in Git 2.38.0. + */ +export const GIT_MINIMUM_VERSION_FOR_OVERLAY = "2.38.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[], @@ -122,67 +169,6 @@ export const determineBaseBranchHeadCommitOid = async function ( } }; -/** - * Deepen the git history of HEAD by one level. Errors are logged. - * - * This function uses the `checkout_path` to determine the repository path and - * works only when called from `analyze` or `upload-sarif`. - */ -export const deepenGitHistory = async function () { - try { - await runGitCommand( - getOptionalInput("checkout_path"), - [ - "fetch", - "origin", - "HEAD", - "--no-tags", - "--no-recurse-submodules", - "--deepen=1", - ], - "Cannot deepen the shallow repository.", - ); - } catch { - // Errors are already logged by runGitCommand() - } -}; - -/** - * Fetch the given remote branch. Errors are logged. - * - * This function uses the `checkout_path` to determine the repository path and - * works only when called from `analyze` or `upload-sarif`. - */ -export const gitFetch = async function (branch: string, extraFlags: string[]) { - try { - await runGitCommand( - getOptionalInput("checkout_path"), - ["fetch", "--no-tags", ...extraFlags, "origin", `${branch}:${branch}`], - `Cannot fetch ${branch}.`, - ); - } catch { - // Errors are already logged by runGitCommand() - } -}; - -/** - * Repack the git repository, using with the given flags. Errors are logged. - * - * This function uses the `checkout_path` to determine the repository path and - * works only when called from `analyze` or `upload-sarif`. - */ -export const gitRepack = async function (flags: string[]) { - try { - await runGitCommand( - getOptionalInput("checkout_path"), - ["repack", ...flags], - "Cannot repack the repository.", - ); - } catch { - // Errors are already logged by runGitCommand() - } -}; - /** * Decode, if necessary, a file path produced by Git. See * https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath diff --git a/src/init-action.ts b/src/init-action.ts index 97cb6b784e..c363494566 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -33,6 +33,7 @@ import { flushDiagnostics, logUnwrittenDiagnostics, makeDiagnostic, + makeTelemetryDiagnostic, } from "./diagnostics"; import { EnvVar } from "./environment"; import { Feature, Features } from "./feature-flags"; @@ -75,7 +76,7 @@ import { codeQlVersionAtLeast, DEFAULT_DEBUG_ARTIFACT_NAME, DEFAULT_DEBUG_DATABASE_NAME, - getMemoryFlagValue, + getCodeQLMemoryLimit, getRequiredEnvParam, getThreadsFlagValue, initializeEnvironment, @@ -88,6 +89,13 @@ import { } 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. * @@ -324,6 +332,7 @@ async function run() { queriesInput: getOptionalInput("queries"), packsInput: getOptionalInput("packs"), buildModeInput: getOptionalInput("build-mode"), + ramInput: getOptionalInput("ram"), configFile, dbLocation: getOptionalInput("db-location"), configInput: getOptionalInput("config"), @@ -371,7 +380,7 @@ async function run() { } let overlayBaseDatabaseStats: OverlayBaseDatabaseDownloadStats | undefined; - let dependencyCachingResults: DependencyCacheRestoreStatusReport | undefined; + let dependencyCachingStatus: DependencyCacheRestoreStatusReport | undefined; try { if ( config.overlayDatabaseMode === OverlayDatabaseMode.Overlay && @@ -417,17 +426,10 @@ async function run() { // Arbitrarily choose the first language. We could also choose all languages, but that // increases the risk of misinterpreting the data. config.languages[0], - makeDiagnostic( + makeTelemetryDiagnostic( "codeql-action/bundle-download-telemetry", "CodeQL bundle download telemetry", - { - attributes: toolsDownloadStatusReport, - visibility: { - cliSummaryTable: false, - statusPage: false, - telemetry: true, - }, - }, + toolsDownloadStatusReport, ), ); } @@ -537,7 +539,7 @@ async function run() { core.exportVariable( "CODEQL_RAM", process.env["CODEQL_RAM"] || - getMemoryFlagValue(getOptionalInput("ram"), logger).toString(), + getCodeQLMemoryLimit(getOptionalInput("ram"), logger).toString(), ); core.exportVariable( "CODEQL_THREADS", @@ -578,16 +580,16 @@ async function run() { } // Restore dependency cache(s), if they exist. - const minimizeJavaJars = await features.getValue( - Feature.JavaMinimizeDependencyJars, - codeql, - ); if (shouldRestoreCache(config.dependencyCachingEnabled)) { - dependencyCachingResults = await downloadDependencyCaches( + const dependencyCachingResult = await downloadDependencyCaches( + codeql, + features, config.languages, logger, - minimizeJavaJars, ); + dependencyCachingStatus = dependencyCachingResult.statusReport; + config.dependencyCachingRestoredKeys = + dependencyCachingResult.restoredKeys; } // Suppress warnings about disabled Python library extraction. @@ -637,18 +639,20 @@ async function run() { } } - // If the feature flag to minimize Java dependency jars is enabled, and we are doing a Java - // `build-mode: none` analysis (i.e. the flag is relevant), then set the environment variable - // that enables the corresponding option in the Java extractor. 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. + // 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 ( - minimizeJavaJars && + (await codeQlVersionAtLeast(codeql, CODEQL_VERSION_JAR_MINIMIZATION)) && config.dependencyCachingEnabled && config.buildMode === BuildMode.None && config.languages.includes(KnownLanguage.java) @@ -735,7 +739,7 @@ async function run() { toolsSource, toolsVersion, overlayBaseDatabaseStats, - dependencyCachingResults, + dependencyCachingStatus, logger, error, ); @@ -758,7 +762,7 @@ async function run() { toolsSource, toolsVersion, overlayBaseDatabaseStats, - dependencyCachingResults, + dependencyCachingStatus, logger, ); } @@ -784,17 +788,10 @@ async function recordZstdAvailability( // Arbitrarily choose the first language. We could also choose all languages, but that // increases the risk of misinterpreting the data. config.languages[0], - makeDiagnostic( + makeTelemetryDiagnostic( "codeql-action/zstd-availability", "Zstandard availability", - { - attributes: zstdAvailability, - visibility: { - cliSummaryTable: false, - statusPage: false, - telemetry: true, - }, - }, + zstdAvailability, ), ); } diff --git a/src/overlay-database-utils.test.ts b/src/overlay-database-utils.test.ts index cee0d45f13..db47d4d879 100644 --- a/src/overlay-database-utils.test.ts +++ b/src/overlay-database-utils.test.ts @@ -7,7 +7,9 @@ import * as sinon from "sinon"; import * as actionsUtil from "./actions-util"; import * as apiClient from "./api-client"; +import { ResolveDatabaseOutput } from "./codeql"; import * as gitUtils from "./git-utils"; +import { KnownLanguage } from "./languages"; import { getRunnerLogger } from "./logging"; import { downloadOverlayBaseDatabaseFromCache, @@ -95,6 +97,7 @@ interface DownloadOverlayBaseDatabaseTestCase { hasBaseDatabaseOidsFile: boolean; tryGetFolderBytesSucceeds: boolean; codeQLVersion: string; + resolveDatabaseOutput: ResolveDatabaseOutput | Error; } const defaultDownloadTestCase: DownloadOverlayBaseDatabaseTestCase = { @@ -105,6 +108,7 @@ const defaultDownloadTestCase: DownloadOverlayBaseDatabaseTestCase = { hasBaseDatabaseOidsFile: true, tryGetFolderBytesSucceeds: true, codeQLVersion: "2.20.5", + resolveDatabaseOutput: { overlayBaseSpecifier: "20250626:XXX" }, }; const testDownloadOverlayBaseDatabaseFromCache = test.macro({ @@ -119,9 +123,11 @@ const testDownloadOverlayBaseDatabaseFromCache = test.macro({ await fs.promises.mkdir(dbLocation, { recursive: true }); const logger = getRunnerLogger(true); - const config = createTestConfig({ dbLocation }); - const testCase = { ...defaultDownloadTestCase, ...partialTestCase }; + const config = createTestConfig({ + dbLocation, + languages: [KnownLanguage.java], + }); config.overlayDatabaseMode = testCase.overlayDatabaseMode; config.useOverlayDatabaseCaching = testCase.useOverlayDatabaseCaching; @@ -163,9 +169,23 @@ const testDownloadOverlayBaseDatabaseFromCache = test.macro({ .resolves(testCase.tryGetFolderBytesSucceeds ? 1024 * 1024 : undefined); stubs.push(tryGetFolderBytesStub); + const codeql = mockCodeQLVersion(testCase.codeQLVersion); + + if (testCase.resolveDatabaseOutput instanceof Error) { + const resolveDatabaseStub = sinon + .stub(codeql, "resolveDatabase") + .rejects(testCase.resolveDatabaseOutput); + stubs.push(resolveDatabaseStub); + } else { + const resolveDatabaseStub = sinon + .stub(codeql, "resolveDatabase") + .resolves(testCase.resolveDatabaseOutput); + stubs.push(resolveDatabaseStub); + } + try { const result = await downloadOverlayBaseDatabaseFromCache( - mockCodeQLVersion(testCase.codeQLVersion), + codeql, config, logger, ); @@ -255,6 +275,24 @@ test( false, ); +test( + testDownloadOverlayBaseDatabaseFromCache, + "returns undefined when downloaded database doesn't have an overlayBaseSpecifier", + { + resolveDatabaseOutput: {}, + }, + false, +); + +test( + testDownloadOverlayBaseDatabaseFromCache, + "returns undefined when resolving database metadata fails", + { + resolveDatabaseOutput: new Error("Failed to resolve database metadata"), + }, + false, +); + test( testDownloadOverlayBaseDatabaseFromCache, "returns undefined when filesystem error occurs", diff --git a/src/overlay-database-utils.ts b/src/overlay-database-utils.ts index 50a093a895..921fd0b8eb 100644 --- a/src/overlay-database-utils.ts +++ b/src/overlay-database-utils.ts @@ -1,4 +1,3 @@ -import * as crypto from "crypto"; import * as fs from "fs"; import * as path from "path"; @@ -11,11 +10,14 @@ import { getWorkflowRunID, } from "./actions-util"; import { getAutomationID } from "./api-client"; +import { createCacheKeyHash } from "./caching-utils"; import { type CodeQL } from "./codeql"; import { type Config } from "./config-utils"; import { getCommitOid, getFileOidsUnderPath } from "./git-utils"; import { Logger, withGroupAsync } from "./logging"; import { + CleanupLevel, + getCodeQLDatabasePath, getErrorMessage, isInTestMode, tryGetFolderBytes, @@ -28,7 +30,7 @@ export enum OverlayDatabaseMode { None = "none", } -export const CODEQL_OVERLAY_MINIMUM_VERSION = "2.22.4"; +export const CODEQL_OVERLAY_MINIMUM_VERSION = "2.23.5"; /** * The maximum (uncompressed) size of the overlay base database that we will @@ -175,11 +177,12 @@ const MAX_CACHE_OPERATION_MS = 600_000; * @param warningPrefix Prefix for the check failure warning message * @returns True if the verification succeeded, false otherwise */ -export function checkOverlayBaseDatabase( +async function checkOverlayBaseDatabase( + codeql: CodeQL, config: Config, logger: Logger, warningPrefix: string, -): boolean { +): Promise { // An overlay-base database should contain the base database OIDs file. const baseDatabaseOidsFilePath = getBaseDatabaseOidsFilePath(config); if (!fs.existsSync(baseDatabaseOidsFilePath)) { @@ -188,6 +191,29 @@ export function checkOverlayBaseDatabase( ); 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; } @@ -204,7 +230,7 @@ export function checkOverlayBaseDatabase( * @returns A promise that resolves to true if the upload was performed and * successfully completed, or false otherwise */ -export async function uploadOverlayBaseDatabaseToCache( +export async function cleanupAndUploadOverlayBaseDatabaseToCache( codeql: CodeQL, config: Config, logger: Logger, @@ -231,7 +257,8 @@ export async function uploadOverlayBaseDatabaseToCache( return false; } - const databaseIsValid = checkOverlayBaseDatabase( + const databaseIsValid = await checkOverlayBaseDatabase( + codeql, config, logger, "Abort uploading overlay-base database to cache", @@ -242,7 +269,7 @@ export async function uploadOverlayBaseDatabaseToCache( // Clean up the database using the overlay cleanup level. await withGroupAsync("Cleaning up databases", async () => { - await codeql.databaseCleanupCluster(config, "overlay"); + await codeql.databaseCleanupCluster(config, CleanupLevel.Overlay); }); const dbLocation = config.dbLocation; @@ -414,7 +441,8 @@ export async function downloadOverlayBaseDatabaseFromCache( return undefined; } - const databaseIsValid = checkOverlayBaseDatabase( + const databaseIsValid = await checkOverlayBaseDatabase( + codeql, config, logger, "Downloaded overlay-base database is invalid", @@ -514,27 +542,3 @@ export async function getCacheRestoreKeyPrefix( // easier to debug and understand the cache key structure. return `${CACHE_PREFIX}-${CACHE_VERSION}-${componentsHash}-${languages}-${codeQlVersion}-`; } - -/** - * 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 - */ -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, 16); -} diff --git a/src/setup-codeql.ts b/src/setup-codeql.ts index 9488930229..2a39673d97 100644 --- a/src/setup-codeql.ts +++ b/src/setup-codeql.ts @@ -34,7 +34,7 @@ export enum ToolsSource { Download = "DOWNLOAD", } -export const CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; +const CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; const CODEQL_NIGHTLIES_REPOSITORY_OWNER = "dsp-testing"; const CODEQL_NIGHTLIES_REPOSITORY_NAME = "codeql-cli-nightlies"; @@ -180,17 +180,6 @@ export function tryGetTagNameFromUrl( return match[1]; } -export function tryGetBundleVersionFromUrl( - url: string, - logger: Logger, -): string | undefined { - const tagName = tryGetTagNameFromUrl(url, logger); - if (tagName === undefined) { - return undefined; - } - return tryGetBundleVersionFromTagName(tagName, logger); -} - export function convertToSemVer(version: string, logger: Logger): string { if (!semver.valid(version)) { logger.debug( @@ -522,7 +511,7 @@ export async function getCodeQLSource( // 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.DOTCOM && + variant === util.GitHubVariant.GHES && !forceShippedTools && !toolsInput ) { @@ -580,7 +569,7 @@ export async function getCodeQLSource( * 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. */ -export async function tryGetFallbackToolcacheVersion( +async function tryGetFallbackToolcacheVersion( cliVersion: string | undefined, tagName: string, logger: Logger, @@ -729,7 +718,7 @@ function getCanonicalToolcacheVersion( return cliVersion; } -export interface SetupCodeQLResult { +interface SetupCodeQLResult { codeqlFolder: string; toolsDownloadStatusReport?: ToolsDownloadStatusReport; toolsSource: ToolsSource; @@ -750,7 +739,7 @@ export async function setupCodeQLBundle( defaultCliVersion: CodeQLDefaultVersionInfo, 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.", diff --git a/src/start-proxy.ts b/src/start-proxy.ts index 2888e1a58d..2a082ed628 100644 --- a/src/start-proxy.ts +++ b/src/start-proxy.ts @@ -8,7 +8,7 @@ import { ConfigurationError, getErrorMessage, isDefined } from "./util"; export const UPDATEJOB_PROXY = "update-job-proxy"; export const UPDATEJOB_PROXY_VERSION = "v2.0.20250624110901"; -export const UPDATEJOB_PROXY_URL_PREFIX = +const UPDATEJOB_PROXY_URL_PREFIX = "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.22.0/"; export type Credential = { @@ -202,7 +202,7 @@ export function getFallbackUrl(proxyPackage: string): string { * * @returns The response from the GitHub API. */ -export async function getLinkedRelease() { +async function getLinkedRelease() { return getApiClient().rest.repos.getReleaseByTag({ owner: "github", repo: "codeql-action", diff --git a/src/status-report.ts b/src/status-report.ts index d43d276bfe..c6e747489e 100644 --- a/src/status-report.ts +++ b/src/status-report.ts @@ -54,7 +54,7 @@ export enum ActionName { * 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. */ -export function isFirstPartyAnalysis(actionName: ActionName): boolean { +function isFirstPartyAnalysis(actionName: ActionName): boolean { if (actionName !== ActionName.UploadSarif) { return true; } @@ -252,7 +252,7 @@ export interface EventReport { * * @param actionName The name of the action, e.g. 'init', 'finish', 'upload-sarif' * @param status The status. Must be 'success', 'failure', or 'starting' - * @param startedAt The time this action started executing. + * @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. diff --git a/src/testdata/debug-artifacts-with-fake-token.zip b/src/testdata/debug-artifacts-with-fake-token.zip new file mode 100644 index 0000000000..09a60be415 Binary files /dev/null and b/src/testdata/debug-artifacts-with-fake-token.zip differ diff --git a/src/testing-utils.ts b/src/testing-utils.ts index 12193309bb..897bafcc21 100644 --- a/src/testing-utils.ts +++ b/src/testing-utils.ts @@ -152,27 +152,38 @@ export interface LoggedMessage { message: string | Error; } -export function getRecordingLogger(messages: LoggedMessage[]): Logger { +export function getRecordingLogger( + messages: LoggedMessage[], + { logToConsole }: { logToConsole?: boolean } = { logToConsole: true }, +): Logger { return { debug: (message: string) => { messages.push({ type: "debug", message }); - // eslint-disable-next-line no-console - console.debug(message); + if (logToConsole) { + // eslint-disable-next-line no-console + console.debug(message); + } }, info: (message: string) => { messages.push({ type: "info", message }); - // eslint-disable-next-line no-console - console.info(message); + if (logToConsole) { + // eslint-disable-next-line no-console + console.info(message); + } }, warning: (message: string | Error) => { messages.push({ type: "warning", message }); - // eslint-disable-next-line no-console - console.warn(message); + if (logToConsole) { + // eslint-disable-next-line no-console + console.warn(message); + } }, error: (message: string | Error) => { messages.push({ type: "error", message }); - // eslint-disable-next-line no-console - console.error(message); + if (logToConsole) { + // eslint-disable-next-line no-console + console.error(message); + } }, isDebug: () => true, startGroup: () => undefined, @@ -392,6 +403,7 @@ export function createTestConfig(overrides: Partial): Config { trapCaches: {}, trapCacheDownloadTime: 0, dependencyCachingEnabled: CachingKind.None, + dependencyCachingRestoredKeys: [], extraQueryExclusions: [], overlayDatabaseMode: OverlayDatabaseMode.None, useOverlayDatabaseCaching: false, diff --git a/src/tools-download.ts b/src/tools-download.ts index 4cfba397e9..5d8a4c5fb9 100644 --- a/src/tools-download.ts +++ b/src/tools-download.ts @@ -17,7 +17,7 @@ import { cleanUpPath, getErrorMessage, getRequiredEnvParam } from "./util"; /** * High watermark to use when streaming the download and extraction of the CodeQL tools. */ -export const STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // 4 MiB +const STREAMING_HIGH_WATERMARK_BYTES = 4 * 1024 * 1024; // 4 MiB /** * The name of the tool cache directory for the CodeQL tools. diff --git a/src/tools-features.ts b/src/tools-features.ts index 01f9569c12..8d9258c84c 100644 --- a/src/tools-features.ts +++ b/src/tools-features.ts @@ -4,6 +4,7 @@ import type { VersionInfo } from "./codeql"; export enum ToolsFeature { BuiltinExtractorsSpecifyDefaultQueries = "builtinExtractorsSpecifyDefaultQueries", + BundleSupportsOverlay = "bundleSupportsOverlay", DatabaseInterpretResultsSupportsSarifRunProperty = "databaseInterpretResultsSupportsSarifRunProperty", ForceOverwrite = "forceOverwrite", IndirectTracingSupportsStaticBinaries = "indirectTracingSupportsStaticBinaries", diff --git a/src/tracer-config.ts b/src/tracer-config.ts index 9eea3eecc8..d786d46515 100644 --- a/src/tracer-config.ts +++ b/src/tracer-config.ts @@ -76,7 +76,7 @@ export async function endTracingForCluster( } } -export async function getTracerConfigForCluster( +async function getTracerConfigForCluster( config: Config, ): Promise { const tracingEnvVariables = JSON.parse( diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 30f00b8721..ac02745207 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -412,7 +412,7 @@ export function findSarifFilesInDir( return sarifFiles; } -export function getSarifFilePaths( +function getSarifFilePaths( sarifPath: string, isSarif: (name: string) => boolean, ) { @@ -738,7 +738,7 @@ export async function postProcessSarifFiles( * @param logger The logger to use. * @param pathInput The input provided for `post-processed-sarif-path`. * @param uploadTarget The upload target. - * @param processingResults The results of post-processing SARIF files. + * @param postProcessingResults The results of post-processing SARIF files. */ export async function writePostProcessedFiles( logger: Logger, diff --git a/src/util.test.ts b/src/util.test.ts index 0e3adc8f7e..1376ae7801 100644 --- a/src/util.test.ts +++ b/src/util.test.ts @@ -433,8 +433,8 @@ function formatGitHubVersion(version: util.GitHubVersion): string { switch (version.type) { case util.GitHubVariant.DOTCOM: return "dotcom"; - case util.GitHubVariant.GHE_DOTCOM: - return "GHE dotcom"; + case util.GitHubVariant.GHEC_DR: + return "GHEC-DR"; case util.GitHubVariant.GHES: return `GHES ${version.version}`; default: @@ -445,15 +445,23 @@ function formatGitHubVersion(version: util.GitHubVersion): string { const CHECK_ACTION_VERSION_TESTS: Array<[string, util.GitHubVersion, boolean]> = [ ["2.2.1", { type: util.GitHubVariant.DOTCOM }, true], - ["2.2.1", { type: util.GitHubVariant.GHE_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" }, true], - ["2.2.1", { type: util.GitHubVariant.GHES, version: "3.12" }, true], - ["3.2.1", { type: util.GitHubVariant.DOTCOM }, false], - ["3.2.1", { type: util.GitHubVariant.GHE_DOTCOM }, 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 [ @@ -468,7 +476,7 @@ for (const [ githubVersion, )}`; test(`checkActionVersion ${reportErrorDescription} for ${versionsDescription}`, async (t) => { - const warningSpy = sinon.spy(core, "error"); + const warningSpy = sinon.spy(core, "warning"); const versionStub = sinon .stub(api, "getGitHubVersion") .resolves(githubVersion); @@ -480,9 +488,7 @@ for (const [ if (shouldReportError) { t.true( warningSpy.calledOnceWithExactly( - sinon.match( - "CodeQL Action major versions v1 and v2 have been deprecated.", - ), + sinon.match("CodeQL Action v3 will be deprecated in December 2026."), ), ); } else { diff --git a/src/util.ts b/src/util.ts index 96ea0f9da2..ffaa957fa2 100644 --- a/src/util.ts +++ b/src/util.ts @@ -4,7 +4,6 @@ import * as os from "os"; import * as path from "path"; import * as core from "@actions/core"; -import * as exec from "@actions/exec/lib/exec"; import * as io from "@actions/io"; import getFolderSize from "get-folder-size"; import * as yaml from "js-yaml"; @@ -310,13 +309,13 @@ function getCgroupMemoryLimitBytes( } /** - * 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 + * 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 to use, in megabytes + * @returns {number} the amount of RAM CodeQL is allowed to use, in megabytes */ -export function getMemoryFlagValue( +export function getCodeQLMemoryLimit( userInput: string | undefined, logger: Logger, ): number { @@ -338,7 +337,7 @@ export function getMemoryFlag( userInput: string | undefined, logger: Logger, ): string { - const megabytes = getMemoryFlagValue(userInput, logger); + const megabytes = getCodeQLMemoryLimit(userInput, logger); return `--ram=${megabytes}`; } @@ -557,13 +556,17 @@ const CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = let hasBeenWarnedAboutVersion = false; export enum GitHubVariant { - DOTCOM, - GHES, - GHE_DOTCOM, + /** [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.GHE_DOTCOM } + | { type: GitHubVariant.GHEC_DR } | { type: GitHubVariant.GHES; version: string }; export function checkGitHubVersionInRange( @@ -1026,34 +1029,6 @@ export function fixInvalidNotifications( return newSarif; } -/** - * Removes duplicates from the sarif file. - * - * When `CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX` is set to true, this will - * simply rename the input file to the output file. Otherwise, it will parse the - * input file as JSON, remove duplicate locations from the SARIF notification - * objects, and write the result to the output file. - * - * For context, see documentation of: - * `CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX`. */ -export function fixInvalidNotificationsInFile( - inputPath: string, - outputPath: string, - logger: Logger, -): void { - if (process.env[EnvVar.DISABLE_DUPLICATE_LOCATION_FIX] === "true") { - logger.info( - "SARIF notification object duplicate location fix disabled by the " + - `${EnvVar.DISABLE_DUPLICATE_LOCATION_FIX} environment variable.`, - ); - fs.renameSync(inputPath, outputPath); - } else { - let sarif = JSON.parse(fs.readFileSync(inputPath, "utf8")) as SarifFile; - sarif = fixInvalidNotifications(sarif, logger); - fs.writeFileSync(outputPath, JSON.stringify(sarif)); - } -} - export function wrapError(error: unknown): Error { return error instanceof Error ? error : new Error(String(error)); } @@ -1114,38 +1089,38 @@ export async function checkDiskUsage( } /** - * Prompt the customer to upgrade to CodeQL Action v3, if appropriate. + * Prompt the customer to upgrade to CodeQL Action v4, if appropriate. * - * Check whether a customer is running v1 or v2. If they are, and we can determine that the GitHub - * instance supports v3, then log an error prompting the customer to upgrade to v3. + * 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, ">=3") && // do not log error if the customer is already running v3 + !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 3. + // Only error for versions of GHES that are compatible with CodeQL Action version 4. // - // GHES 3.11 shipped without the v3 tag, but it also shipped without this warning message code. - // Therefore users who are seeing this warning message code have pulled in a new version of the - // Action, and with it the v3 tag. + // 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.GHE_DOTCOM || + githubVersion.type === GitHubVariant.GHEC_DR || (githubVersion.type === GitHubVariant.GHES && semver.satisfies( semver.coerce(githubVersion.version) ?? "0.0.0", - ">=3.11", + ">=3.20", )) ) { - core.error( - "CodeQL Action major versions v1 and v2 have been deprecated. " + - "Please update all occurrences of the CodeQL Action in your workflow files to v3. " + + 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-01-10-code-scanning-codeql-action-v2-is-now-deprecated/", + "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"); @@ -1197,49 +1172,6 @@ export function cloneObject(obj: T): T { return JSON.parse(JSON.stringify(obj)) as T; } -// The first time this function is called, it runs `csrutil status` to determine -// whether System Integrity Protection is enabled; and saves the result in an -// environment variable. Afterwards, simply return the value of the environment -// variable. -export async function checkSipEnablement( - logger: Logger, -): Promise { - if ( - process.env[EnvVar.IS_SIP_ENABLED] !== undefined && - ["true", "false"].includes(process.env[EnvVar.IS_SIP_ENABLED]) - ) { - return process.env[EnvVar.IS_SIP_ENABLED] === "true"; - } - - try { - const sipStatusOutput = await exec.getExecOutput("csrutil status"); - if (sipStatusOutput.exitCode === 0) { - if ( - sipStatusOutput.stdout.includes( - "System Integrity Protection status: enabled.", - ) - ) { - core.exportVariable(EnvVar.IS_SIP_ENABLED, "true"); - return true; - } - if ( - sipStatusOutput.stdout.includes( - "System Integrity Protection status: disabled.", - ) - ) { - core.exportVariable(EnvVar.IS_SIP_ENABLED, "false"); - return false; - } - } - return undefined; - } catch (e) { - logger.warning( - `Failed to determine if System Integrity Protection was enabled: ${e}`, - ); - return undefined; - } -} - export async function cleanUpPath(file: string, name: string, logger: Logger) { logger.debug(`Cleaning up ${name}.`); try { @@ -1291,17 +1223,6 @@ export function isDefined(value: T | null | undefined): value is T { return value !== undefined && value !== null; } -/** Like `Object.keys`, but typed so that the elements of the resulting array 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 unsafeKeysInvariant>( - object: T, -): Array { - return Object.keys(object) as Array; -} - /** 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 @@ -1314,3 +1235,8 @@ export function unsafeEntriesInvariant>( ([_, val]) => val !== undefined, ) as Array<[keyof T, Exclude]>; } + +export enum CleanupLevel { + Clear = "clear", + Overlay = "overlay", +} diff --git a/tests/multi-language-repo/global.json b/tests/multi-language-repo/global.json new file mode 100644 index 0000000000..764fdd82be --- /dev/null +++ b/tests/multi-language-repo/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "9.0.307", + "rollForward": "latestFeature" + } +}